┌──(root㉿kali)-[/miaosec] └─# nmap -sn 192.168.2.0/24 Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-05 09:55 CST Nmap scan report for 192.168.2.1 Host is up (0.00061s latency). MAC Address: 0A:00:27:00:00:07 (Unknown) Nmap scan report for 192.168.2.2 Host is up (0.00053s latency). MAC Address: 08:00:27:02:7F:AE (Oracle VirtualBox virtual NIC) Nmap scan report for 192.168.2.106 Host is up (0.00085s latency). MAC Address: 08:00:27:C9:A1:AB (Oracle VirtualBox virtual NIC) Nmap scan report for 192.168.2.4 Host is up. Nmap done: 256 IP addresses (4 hosts up) scanned in 2.02 seconds
靶机IP:192.168.2.106
2、端口扫描
1.全端口扫描
1 2 3 4 5 6 7 8 9 10 11 12 13
┌──(root㉿kali)-[/miaosec] └─# nmap --min-rate 10000 -p- 192.168.2.106 Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-05 09:55 CST Nmap scan report for 192.168.2.106 Host is up (0.00044s latency). Not shown: 65532 closed tcp ports (reset) PORT STATE SERVICE 22/tcp open ssh 80/tcp open http 8080/tcp open http-proxy MAC Address: 08:00:27:C9:A1:AB (Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 2.93 seconds
┌──(root㉿kali)-[/miaosec] └─# nmap --min-rate 10000 -sT -sV -sC -O -p22,80,8080 192.168.2.106 Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-05 09:56 CST Nmap scan report for 192.168.2.106 Host is up (0.0011s latency).
PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 8.4p1 Debian 5+deb11u3 (protocol 2.0) | ssh-hostkey: | 3072 f6:a3:b6:78:c4:62:af:44:bb:1a:a0:0c:08:6b:98:f7 (RSA) | 256 bb:e8:a2:31:d4:05:a9:c9:31:ff:62:f6:32:84:21:9d (ECDSA) |_ 256 3b:ae:34:64:4f:a5:75:b9:4a:b9:81:f9:89:76:99:eb (ED25519) 80/tcp open http (PHP 8.2.29) | fingerprint-strings: | GetRequest, HTTPOptions: | HTTP/1.0 200 OK | Date: Wed, 07 Jan 2026 06:59:51 GMT | Connection: close | X-Powered-By: PHP/8.2.29 | Content-type: text/html; charset=UTF-8 | <code><span style="color: #000000"> | <span style="color: #0000BB"><?php | />error_reporting</span><span style="color: #007700">(</span><span style="color: #0000BB">0</span><span style="color: #007700">); | /></span><span style="color: #0000BB">highlight_file</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">); | /></span><span style="color: #FF8000">// | flag | /></span><span style="color: #0000BB">$funtion </span><span style="color: #007700">= </span><span style="color: #0000BB">$_POST</span><span style="color: #007700">[</span><span style="color: #DD0000">'function'</span><span style="color: #007700">]; |_ /></span><span style="color: #0000BB"> |_http-title: Site doesn't have a title (text/html; charset=UTF-8). 8080/tcp open http (PHP 8.2.29) |_http-title: Site doesn't have a title (text/html; charset=UTF-8). | fingerprint-strings: | GetRequest: | HTTP/1.0 200 OK | Date: Wed, 07 Jan 2026 06:59:51 GMT | Connection: close | X-Powered-By: PHP/8.2.29 |_ Content-type: text/html; charset=UTF-8 |_http-open-proxy: Proxy might be redirecting requests 2 services unrecognized despite returning data. If you know the service/version, please submit the following fingerprints at https://nmap.org/cgi-bin/submit.cgi?new-service : ==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)============== SF-Port80-TCP:V=7.94SVN%I=7%D=1/7%Time=695E0468%P=x86_64-pc-linux-gnu%r(Ge SF:tRequest,80E,"HTTP/1\.0\x20200\x20OK\r\nDate:\x20Wed,\x2007\x20Jan\x202 SF:026\x2006:59:51\x20GMT\r\nConnection:\x20close\r\nX-Powered-By:\x20PHP/ SF:8\.2\.29\r\nContent-type:\x20text/html;\x20charset=UTF-8\r\n\r\n<code>< SF:span\x20style=\"color:\x20#000000\">\n<span\x20style=\"color:\x20#0000B SF:B\"><\?php\r<br\x20/>error_reporting</span><span\x20style=\"color:\x SF:20#007700\">\(</span><span\x20style=\"color:\x20#0000BB\">0</span><span SF:\x20style=\"color:\x20#007700\">\);\r<br\x20/></span><span\x20style=\"c SF:olor:\x20#0000BB\">highlight_file</span><span\x20style=\"color:\x20#007 SF:700\">\(</span><span\x20style=\"color:\x20#0000BB\">__FILE__</span><spa SF:n\x20style=\"color:\x20#007700\">\);\r<br\x20/></span><span\x20style=\" SF:color:\x20#FF8000\">// \xe6\xa0\xb9\xe7\x9b\xae\xe5\xbd\x95\xe4\xb SF:8\x8b\xe7\x9a\x84flag\r<br\x20/></span><span\x20style=\"color:\x20#0000 SF:BB\">\$funtion </span><span\x20style=\"color:\x20#007700\">= SF:</span><span\x20style=\"color:\x20#0000BB\">\$_POST</span><span\x20styl SF:e=\"color:\x20#007700\">\[</span><span\x20style=\"color:\x20#DD0000\">' SF:function'</span><span\x20style=\"color:\x20#007700\">\];\r<br\x20/></sp SF:an><span\x20style=\"color:\x20#0000BB\">")%r(HTTPOptions,80E,"HTTP/1\.0 SF:\x20200\x20OK\r\nDate:\x20Wed,\x2007\x20Jan\x202026\x2006:59:51\x20GMT\ SF:r\nConnection:\x20close\r\nX-Powered-By:\x20PHP/8\.2\.29\r\nContent-typ SF:e:\x20text/html;\x20charset=UTF-8\r\n\r\n<code><span\x20style=\"color:\ SF:x20#000000\">\n<span\x20style=\"color:\x20#0000BB\"><\?php\r<br\x20/ SF:>error_reporting</span><span\x20style=\"color:\x20#007700\">\(</span><s SF:pan\x20style=\"color:\x20#0000BB\">0</span><span\x20style=\"color:\x20# SF:007700\">\);\r<br\x20/></span><span\x20style=\"color:\x20#0000BB\">high SF:light_file</span><span\x20style=\"color:\x20#007700\">\(</span><span\x2 SF:0style=\"color:\x20#0000BB\">__FILE__</span><span\x20style=\"color:\x20 SF:#007700\">\);\r<br\x20/></span><span\x20style=\"color:\x20#FF8000\">//& SF:nbsp;\xe6\xa0\xb9\xe7\x9b\xae\xe5\xbd\x95\xe4\xb8\x8b\xe7\x9a\x84flag\r SF:<br\x20/></span><span\x20style=\"color:\x20#0000BB\">\$funtion </s SF:pan><span\x20style=\"color:\x20#007700\">= </span><span\x20style=\ SF:"color:\x20#0000BB\">\$_POST</span><span\x20style=\"color:\x20#007700\" SF:>\[</span><span\x20style=\"color:\x20#DD0000\">'function'</span><span\x SF:20style=\"color:\x20#007700\">\];\r<br\x20/></span><span\x20style=\"col SF:or:\x20#0000BB\">"); ==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)============== SF-Port8080-TCP:V=7.94SVN%I=7%D=1/7%Time=695E0468%P=x86_64-pc-linux-gnu%r( SF:GetRequest,902,"HTTP/1\.0\x20200\x20OK\r\nDate:\x20Wed,\x2007\x20Jan\x2 SF:02026\x2006:59:51\x20GMT\r\nConnection:\x20close\r\nX-Powered-By:\x20PH SF:P/8\.2\.29\r\nContent-type:\x20text/html;\x20charset=UTF-8\r\n\r\n\xe5\ SF:x8f\xaf\xe6\x83\x9c\xe6\xb2\xa1\xe5\xa6\x82\xe6\x9e\x9c\r\n\xe6\x9e\x97 SF:\xe4\xbf\x8a\xe6\x9d\xb0\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8 SF:c\xe2\x80\x8d\xef\xbb\xbf\xe2\x80\xac\xe2\x80\x8c\r\n\xe5\x81\x87\xe5\x SF:a6\x82\xe6\x8a\x8a\xe7\x8a\xaf\xe5\xbe\x97\xe8\xb5\xb7\xe7\x9a\x84\xe9\ SF:x94\x99\r\n\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8d SF:\xe2\x80\xac\xef\xbb\xbf\xe2\x80\x8d\xe8\x83\xbd\xe9\x94\x99\xe7\x9a\x8 SF:4\xe9\x83\xbd\xe9\x94\x99\xe8\xbf\x87\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x SF:8c\xe2\x80\x8c\xe2\x80\x8d\xe2\x80\xac\xe2\x80\x8d\xef\xbb\xbf\r\n\xe5\ SF:xba\x94\xe8\xaf\xa5\xe8\xbf\x98\xe6\x9d\xa5\xe5\xb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80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8d\xef\xbb\xbf\xe2\x80\x SF:ac\xe2\x80\x8d\r\n\xe4\xbd\xa0\xe4\xbc\x9a\xe6\x80\x8e\xe4\xb9\x88\xe5\ SF:x81\x9a\r\n\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8d SF:\xe2\x80\xac\xe2\x80\x8c\xe2\x80\x8d"); MAC Address: 08:00:27:C9:A1:AB (Oracle VirtualBox virtual NIC) Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port Device type: general purpose Running: Linux 4.X|5.X OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5 OS details: Linux 4.15 - 5.8 Network Distance: 1 hop Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
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 21.20 seconds
3.udp扫描
1 2 3 4 5 6 7 8 9 10
┌──(root㉿kali)-[/miaosec] └─# nmap -sU --top-ports 100 192.168.2.106 Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-01-05 09:57 CST Nmap scan report for 192.168.2.106 Host is up (0.0018s latency). All 100 scanned ports on 192.168.2.106 are in ignored states. Not shown: 57 closed udp ports (port-unreach), 43 open|filtered udp ports (no-response) MAC Address: 08:00:27:C9:A1:AB (Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 54.57 seconds
┌──(root㉿kali)-[/miaosec] └─# ssh xmgmxjs@192.168.2.106 xmgmxjs@FCT:~$ id uid=1000(xmgmxjs) gid=1000(xmgmxjs) groups=1000(xmgmxjs)
四、权限提升
查看sudo -l
1 2 3 4 5 6 7 8 9 10
xmgmxjs@FCT:~$ sudo -l Matching Defaults entries for xmgmxjs on FCT: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin
Runas and Command-specific defaults for xmgmxjs: Defaults!/usr/bin/sqlmap, !/usr/bin/sqlmap *--tamper* env_reset
User xmgmxjs may run the following commands on FCT: (root) NOPASSWD: /usr/bin/sqlmap, !/usr/bin/sqlmap *--tamper* (ALL) NOPASSWD: /opt/123.sh
查看/opt/123.sh
1 2 3 4 5 6 7 8
xmgmxjs@FCT:~$ grep . /opt/123.sh #!/bin/bash if [ "${#1}" -eq 2 ]; then evalcat$1.hidden fi if [ "${#1}" -gt 2 ]; then evalecho \${FTC_${1}:-$HOME} fi