-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
84 lines (67 loc) · 2.47 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import autoreco.State
autoreco.State.State().set_working_dir("/tmp/autoreco")
from autoreco.TestRunner import TestRunner
from autoreco.HostTestEvaluator import HostTestEvaluator
from autoreco.WorkThreader import WorkThreader
from autoreco.utils import print_summary
from autoreco.logger import logger
import os
import sys
import autoreco.config
import logging
from datetime import datetime
import json
autoreco.config.STDOUT_LOGLEVEL = logging.DEBUG
autoreco.config.WATCHDOG_INTERVAL = 30
autoreco.config.NMAP_DEFAULT_TCP_PORT_OPTION = "--top-ports 10"
from autoreco.TestHost import TestHost
# Importing here to make sure we have set config / state properly
# autoreco.State.State().set_working_dir("/home/babadmin/offsec/challenges/challenge3_skylark/10.10_scan/autoreco_2024_03_14__19_10_59", resume=True)
# autoreco.State.State().load_state()
# h = TestHost("10.10.137.250")
# eval = HostTestEvaluator(h)
# print(eval.get_known_domains(True))
#
# eval.get_ad_dc_ips()
runner = TestRunner()
# runner.move_empty_log_files()
WorkThreader.start_threads(None)
# runner = TestRunner("192.168.230.0/24")
# runner.run()
# job = {
# "module_name": "discovery.NmapSubnetDiscovery",
# "job_id": "discovery.NmapSubnetDiscoveryQuickScan_192.168.188.0_24",
# "target": "192.168.188.189 192.168.188.18",
# "priority": 100,
# "args": {
# "ports": "--top-ports 50"
# }
# }
# WorkThreader.add_job(job)
w = "/usr/share/seclists/Discovery/Web-Content/big.txt"
job = {
"module_name": "bruteforce.Medusa",
"job_id": "TestMedusa",
"target": "192.168.1.250",
"target_port": 445,
"priority": 250,
"args": {
"protocol": "smbnt",
"user_wordlist": "/usr/share/seclists/Usernames/top-usernames-shortlist.txt",
"passw_wordlist": "/usr/share/seclists/Passwords/500-worst-passwords.txt",
"domain": "baba"
},
}
WorkThreader.add_job(job)
# WorkThreader.start_threads(None)
# job = {
# "module_name": "hostscan.NmapHostScan",
# "job_id": "hostscan.NmapHostScantcp",
# "target": "192.168.1.252",
# "args": {"protocol": "tcp"}
# }
print_summary()
# logger.debug("State: %s", json.dumps(autoreco.State.State().TEST_STATE, indent=4))
# logger.info("="*50)
# with open(os.path.join(autoreco.State.State().TEST_WORKING_DIR, "state.json"), "w") as f:
# f.write(json.dumps(autoreco.State.State().TEST_STATE, indent=4))