|
28 | 28 | config.get("VulnScan Settings", "threshold", fallback=0.6)) # Probability cutoff to consider a file sensitive |
29 | 29 |
|
30 | 30 | # Paths |
31 | | -ROOT_DIR = r"C:/" # Folder to scan |
| 31 | +SENSITIVE_PATHS = [ |
| 32 | + r"C:\Users\%USERNAME%\Documents", |
| 33 | + r"C:\Users\%USERNAME%\Desktop", |
| 34 | + r"C:\Users\%USERNAME%\Downloads", |
| 35 | + r"C:\Users\%USERNAME%\AppData\Roaming", |
| 36 | + r"C:\Users\%USERNAME%\AppData\Local", |
| 37 | + r"C:\Users\%USERNAME%\AppData\Local\Google\Chrome\User Data", |
| 38 | + r"C:\Users\%USERNAME%\AppData\Roaming\Mozilla\Firefox\Profiles", |
| 39 | + r"C:\Users\%USERNAME%\OneDrive", |
| 40 | + r"C:\Users\%USERNAME%\Dropbox", |
| 41 | + r"C:\Users\%USERNAME%\Google Drive", |
| 42 | +] |
32 | 43 | SAVE_DIR = r"VulnScan_Files" # Backup folder |
33 | 44 | MODEL_PATH = r"vulnscan/Model_SenseMacro.4n1.pth" # Your trained model checkpoint |
34 | 45 | REPORT_JSON = "report.json" |
@@ -144,7 +155,7 @@ def scan_directory(root): |
144 | 155 |
|
145 | 156 |
|
146 | 157 | # ================== MAIN ================== |
147 | | -if __name__ == "__main__": |
| 158 | +def main(): |
148 | 159 | log.info(f"Scanning directory: {ROOT_DIR} - This will take some time...") |
149 | 160 | sensitive = scan_directory(ROOT_DIR) |
150 | 161 |
|
@@ -174,3 +185,14 @@ def scan_directory(root): |
174 | 185 | log.debug(f"Files copied into: {SAVE_DIR}") |
175 | 186 | log.debug(f"JSON report saved as: {REPORT_JSON}") |
176 | 187 | log.debug(f"CSV report saved as: {REPORT_CSV}") |
| 188 | + |
| 189 | + |
| 190 | +if __name__ == "__main__": |
| 191 | + log.info(f"Starting VulnScan with {NUM_WORKERS} thread workers and {len(SENSITIVE_PATHS)}...") |
| 192 | + for path in SENSITIVE_PATHS: |
| 193 | + expanded_path = os.path.expandvars(path) |
| 194 | + if os.path.exists(expanded_path): |
| 195 | + ROOT_DIR = expanded_path |
| 196 | + main() |
| 197 | + else: |
| 198 | + log.warning(f"Path does not exist and will be skipped: {expanded_path}") |
0 commit comments