From 45b0714fdc24683b6dd621f622bd49b68004cb55 Mon Sep 17 00:00:00 2001 From: Roxas77 <63656689+roxas-tan@users.noreply.github.com> Date: Sat, 7 Nov 2020 03:34:47 +0800 Subject: [PATCH] Update threadscanner.py Fixed error http.client.InvalidURL: URL can't contain control characters --- cmsmap/lib/threadscanner.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmsmap/lib/threadscanner.py b/cmsmap/lib/threadscanner.py index 5863c98..4a953f8 100644 --- a/cmsmap/lib/threadscanner.py +++ b/cmsmap/lib/threadscanner.py @@ -1,5 +1,5 @@ #! /usr/bin/env python3 -import urllib, http.client, threading, time, socket +import urllib, http.client, threading, time, socket, urllib.parse # Import Object from .initialize import initializer @@ -17,7 +17,7 @@ def __init__(self, url, pluginPath, pluginPathEnd, pluginsFound, notExistingCode threading.Thread.__init__(self) self.url = url self.q = q - self.pluginPath = pluginPath + self.pluginPath = urllib.parse.quote(pluginPath) self.pluginsFound = pluginsFound self.pluginPathEnd = pluginPathEnd self.notExistingCode = notExistingCode @@ -26,7 +26,7 @@ def __init__(self, url, pluginPath, pluginPathEnd, pluginsFound, notExistingCode def run(self): while True: # Get plugin from plugin queue - plugin = self.q.get() + plugin = urllib.parse.quote(self.q.get()) requester.request(self.url + self.pluginPath + plugin + self.pluginPathEnd, data=None) if requester.status_code == 200 and len(requester.htmltext) not in self.notValidLen: self.pluginsFound.append(plugin)