Skip to content

Commit 0f0b116

Browse files
committed
Rename scanner bits to avoid confusion
1 parent c7894f1 commit 0f0b116

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

lib/msf/core/modules/external/python/metasploit/sonar.py renamed to lib/msf/core/modules/external/python/metasploit/probe_scanner.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
from async_timeout import timeout
66

77

8-
def make_study(payload='', pattern='', onmatch=None, connect_timeout=3, read_timeout=10):
9-
return lambda args: start_study(payload, pattern, args, onmatch, connect_timeout=connect_timeout, read_timeout=read_timeout)
8+
def make_scanner(payload='', pattern='', onmatch=None, connect_timeout=3, read_timeout=10):
9+
return lambda args: start_scanner(payload, pattern, args, onmatch, connect_timeout=connect_timeout, read_timeout=read_timeout)
1010

1111

12-
def start_study(payload, pattern, args, onmatch, **timeouts):
12+
def start_scanner(payload, pattern, args, onmatch, **timeouts):
1313
loop = asyncio.get_event_loop()
14-
loop.run_until_complete(run_study(payload, pattern, args, onmatch, **timeouts))
14+
loop.run_until_complete(run_scanner(payload, pattern, args, onmatch, **timeouts))
1515

1616

17-
async def run_study(payload, pattern, args, onmatch, **timeouts):
18-
runs = [study_host(host, int(args['rport']), payload, **timeouts) for host in args['rhosts']]
19-
async for (target, res) in Study(runs):
17+
async def run_scanner(payload, pattern, args, onmatch, **timeouts):
18+
probes = [probe_host(host, int(args['rport']), payload, **timeouts) for host in args['rhosts']]
19+
async for (target, res) in Scan(probes):
2020
if isinstance(res, Exception):
2121
module.log('{}:{} - Error connecting: {}'.format(*target, res), level='error')
2222
elif res and re.search(pattern, res):
@@ -28,7 +28,7 @@ async def run_study(payload, pattern, args, onmatch, **timeouts):
2828
module.log('{}:{} - Does not match with: {}'.format(*target, res), level='debug')
2929

3030

31-
class Study:
31+
class Scan:
3232
def __init__(self, runs):
3333
self.queue = asyncio.queues.Queue()
3434
self.total = len(runs)
@@ -65,7 +65,7 @@ async def __anext__(self):
6565
return res
6666

6767

68-
async def study_host(host, port, payload, connect_timeout, read_timeout):
68+
async def probe_host(host, port, payload, connect_timeout, read_timeout):
6969
r = None
7070
w = None
7171
buf = bytearray()

modules/auxiliary/scanner/wproxy/att_open_proxy.py

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

3-
from metasploit import module, sonar
3+
from metasploit import module, probe_scanner
44

55

66
metadata = {
@@ -38,7 +38,7 @@ def report_wproxy(target, response):
3838

3939

4040
if __name__ == "__main__":
41-
study = sonar.make_study(
41+
study = probe_scanner.make_scanner(
4242
# Payload and pattern are given and applied straight to the socket, so
4343
# they need to be bytes-like
4444
payload = b'\x2a\xce\x00\x00\x00\x00\x00\x00\x00\x00\x00',

0 commit comments

Comments
 (0)