Skip to content

Commit 5b38fdb

Browse files
committed
Update att open proxy error handling
1 parent 636fdf4 commit 5b38fdb

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

modules/auxiliary/scanner/wproxy/att_open_proxy.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
#!/usr/bin/env python3
22

3-
from metasploit import module, probe_scanner
3+
import sys
4+
from metasploit import module
45

6+
dependencies_missing = False
7+
if sys.version_info >= (3, 8):
8+
from metasploit import probe_scanner
9+
else:
10+
dependencies_missing = True
511

612
metadata = {
713
'name': 'Open WAN-to-LAN proxy on AT&T routers',
@@ -41,7 +47,11 @@ def report_wproxy(target, response):
4147
module.report_vuln(target[0], 'wproxy', port=target[0])
4248

4349

44-
if __name__ == "__main__":
50+
def run():
51+
if dependencies_missing:
52+
module.log('Module dependencies missing, newer Python version 3.8 or above required', level='error')
53+
return
54+
4555
study = probe_scanner.make_scanner(
4656
# Payload and pattern are given and applied straight to the socket, so
4757
# they need to be bytes-like
@@ -50,3 +60,7 @@ def report_wproxy(target, response):
5060
onmatch=report_wproxy
5161
)
5262
module.run(metadata, study)
63+
64+
65+
if __name__ == "__main__":
66+
run()

0 commit comments

Comments
 (0)