+ Auto-Shodanner
+ No scan is running, but this is where statistics will show up!
+
+
+
\ No newline at end of file
diff --git a/modules/main/main.py b/modules/main/main.py
index 61566b9..9c78b43 100755
--- a/modules/main/main.py
+++ b/modules/main/main.py
@@ -204,4 +204,5 @@ def deleteUser(ac, data):
mm.deleteUser(user)
mm.sendPopupSuccess(ac.rawClient, "Success", "User deleted!")
- loadSessionsAdmin(ac)
\ No newline at end of file
+ loadSessionsAdmin(ac)
+
\ No newline at end of file
diff --git a/modules/scan/main.py b/modules/scan/main.py
index f86176d..897b61f 100755
--- a/modules/scan/main.py
+++ b/modules/scan/main.py
@@ -45,21 +45,29 @@ def setSettings(ac, data):
valid = False
if valid:
- print(data)
+ # print(data)
mm.vars['Scanner-Settings'] = data
else:
mm.sendPopupError(ac.rawClient, "Error", "There is an error in the config.")
+def onStats(stats):
+ print(stats)
+ for ac in mm.authServer.clients:
+ if ac.currentPage == "/main/dashboard":
+ ac.send("Scanner-Metrics", stats)
+
+
def startScanner(ac, data):
- scan.start(mm.vars['Scanner-Settings'])
+ mm.sendPopupSuccess(ac.rawClient, "Scanner", "Scanner Started!")
+ scan.start(mm.vars['Scanner-Settings'], onStats)
def stopScanner(ac, data):
+ mm.sendPopupSuccess(ac.rawClient, "Scanner", "Scanner Stopped!")
scan.stop()
-
def init(moduleMaster):
global mm
mm = moduleMaster
@@ -97,9 +105,4 @@ def init(moduleMaster):
mm.addAuthEventListener('Scanner-StopScanner', stopScanner)
def main():
- while True:
- if scan.processStarted():
- print("eee")
- # print(scan.getStdout())
- # print("eee")
- time.sleep(1)
\ No newline at end of file
+ pass
\ No newline at end of file
diff --git a/test.py b/test.py
index 6e93f1c..4cff0d1 100644
--- a/test.py
+++ b/test.py
@@ -1,55 +1,2 @@
import src.utils as utils
-def parse_csv_line(line):
- elements = []
- current_element = ""
- inside_array = False
- array_content = ""
- inside_quotes = False
-
- for char in line:
- if char == ',' and not inside_array and not inside_quotes:
- if array_content:
- elements.append(parse_csv_line(array_content[1:-1]))
- array_content = ""
- else:
- elements.append(current_element.strip())
- current_element = ""
- elif char == '[' and not inside_quotes:
- inside_array = True
- array_content += char
- elif char == ']' and not inside_quotes:
- inside_array = False
- array_content += char
- elif char == "'":
- inside_quotes = not inside_quotes
- current_element += char
- else:
- if inside_array:
- array_content += char
- else:
- current_element += char
-
- if current_element:
- if current_element.startswith("'") and current_element.endswith("'"):
- current_element = current_element[1:-1]
- elements.append(current_element.strip())
- elif array_content:
- elements.append(parse_csv_line(array_content[1:-1]))
-
- return elements
-
-
-def find():
- # print("started!")
- for folder in utils.listSubdirs(utils.getRoot("data/scans/")):
- for file in utils.listSubdirs(utils.getRoot(f"data/scans/{folder}")):
- with open(utils.getRoot(f"data/scans/{folder}/{file}"), "r") as file:
- lines = file.readlines()
- for line in lines:
- data = parse_csv_line(line)
- if data[1] != "1":
- continue
- print(f'{data[0]} ({data[2]}), {data[4]}')
-
- # print("sotopped!!")
\ No newline at end of file