Skip to content

Commit c92e594

Browse files
committedAug 2, 2021
Reformatting & API Function Name Updates
Switched spaces to tabs throughout for consistency. Changed add_port_match() to match_port() Changed add_service_match() to match_service_name() Removed un-used variables.
1 parent 6ce5654 commit c92e594

19 files changed

+1972
-1974
lines changed
 

‎LICENSE

+96-96
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
GNU GENERAL PUBLIC LICENSE
2-
Version 3, 29 June 2007
1+
GNU GENERAL PUBLIC LICENSE
2+
Version 3, 29 June 2007
33

44
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
55
Everyone is permitted to copy and distribute verbatim copies
66
of this license document, but changing it is not allowed.
77

8-
Preamble
8+
Preamble
99

1010
The GNU General Public License is a free, copyleft license for
1111
software and other kinds of works.
@@ -68,7 +68,7 @@ patents cannot be used to render the program non-free.
6868
The precise terms and conditions for copying, distribution and
6969
modification follow.
7070

71-
TERMS AND CONDITIONS
71+
TERMS AND CONDITIONS
7272

7373
0. Definitions.
7474

@@ -211,26 +211,26 @@ and you may offer support or warranty protection for a fee.
211211
produce it from the Program, in the form of source code under the
212212
terms of section 4, provided that you also meet all of these conditions:
213213

214-
a) The work must carry prominent notices stating that you modified
215-
it, and giving a relevant date.
214+
a) The work must carry prominent notices stating that you modified
215+
it, and giving a relevant date.
216216

217-
b) The work must carry prominent notices stating that it is
218-
released under this License and any conditions added under section
219-
7. This requirement modifies the requirement in section 4 to
220-
"keep intact all notices".
217+
b) The work must carry prominent notices stating that it is
218+
released under this License and any conditions added under section
219+
7. This requirement modifies the requirement in section 4 to
220+
"keep intact all notices".
221221

222-
c) You must license the entire work, as a whole, under this
223-
License to anyone who comes into possession of a copy. This
224-
License will therefore apply, along with any applicable section 7
225-
additional terms, to the whole of the work, and all its parts,
226-
regardless of how they are packaged. This License gives no
227-
permission to license the work in any other way, but it does not
228-
invalidate such permission if you have separately received it.
222+
c) You must license the entire work, as a whole, under this
223+
License to anyone who comes into possession of a copy. This
224+
License will therefore apply, along with any applicable section 7
225+
additional terms, to the whole of the work, and all its parts,
226+
regardless of how they are packaged. This License gives no
227+
permission to license the work in any other way, but it does not
228+
invalidate such permission if you have separately received it.
229229

230-
d) If the work has interactive user interfaces, each must display
231-
Appropriate Legal Notices; however, if the Program has interactive
232-
interfaces that do not display Appropriate Legal Notices, your
233-
work need not make them do so.
230+
d) If the work has interactive user interfaces, each must display
231+
Appropriate Legal Notices; however, if the Program has interactive
232+
interfaces that do not display Appropriate Legal Notices, your
233+
work need not make them do so.
234234

235235
A compilation of a covered work with other separate and independent
236236
works, which are not by their nature extensions of the covered work,
@@ -249,46 +249,46 @@ of sections 4 and 5, provided that you also convey the
249249
machine-readable Corresponding Source under the terms of this License,
250250
in one of these ways:
251251

252-
a) Convey the object code in, or embodied in, a physical product
253-
(including a physical distribution medium), accompanied by the
254-
Corresponding Source fixed on a durable physical medium
255-
customarily used for software interchange.
256-
257-
b) Convey the object code in, or embodied in, a physical product
258-
(including a physical distribution medium), accompanied by a
259-
written offer, valid for at least three years and valid for as
260-
long as you offer spare parts or customer support for that product
261-
model, to give anyone who possesses the object code either (1) a
262-
copy of the Corresponding Source for all the software in the
263-
product that is covered by this License, on a durable physical
264-
medium customarily used for software interchange, for a price no
265-
more than your reasonable cost of physically performing this
266-
conveying of source, or (2) access to copy the
267-
Corresponding Source from a network server at no charge.
268-
269-
c) Convey individual copies of the object code with a copy of the
270-
written offer to provide the Corresponding Source. This
271-
alternative is allowed only occasionally and noncommercially, and
272-
only if you received the object code with such an offer, in accord
273-
with subsection 6b.
274-
275-
d) Convey the object code by offering access from a designated
276-
place (gratis or for a charge), and offer equivalent access to the
277-
Corresponding Source in the same way through the same place at no
278-
further charge. You need not require recipients to copy the
279-
Corresponding Source along with the object code. If the place to
280-
copy the object code is a network server, the Corresponding Source
281-
may be on a different server (operated by you or a third party)
282-
that supports equivalent copying facilities, provided you maintain
283-
clear directions next to the object code saying where to find the
284-
Corresponding Source. Regardless of what server hosts the
285-
Corresponding Source, you remain obligated to ensure that it is
286-
available for as long as needed to satisfy these requirements.
287-
288-
e) Convey the object code using peer-to-peer transmission, provided
289-
you inform other peers where the object code and Corresponding
290-
Source of the work are being offered to the general public at no
291-
charge under subsection 6d.
252+
a) Convey the object code in, or embodied in, a physical product
253+
(including a physical distribution medium), accompanied by the
254+
Corresponding Source fixed on a durable physical medium
255+
customarily used for software interchange.
256+
257+
b) Convey the object code in, or embodied in, a physical product
258+
(including a physical distribution medium), accompanied by a
259+
written offer, valid for at least three years and valid for as
260+
long as you offer spare parts or customer support for that product
261+
model, to give anyone who possesses the object code either (1) a
262+
copy of the Corresponding Source for all the software in the
263+
product that is covered by this License, on a durable physical
264+
medium customarily used for software interchange, for a price no
265+
more than your reasonable cost of physically performing this
266+
conveying of source, or (2) access to copy the
267+
Corresponding Source from a network server at no charge.
268+
269+
c) Convey individual copies of the object code with a copy of the
270+
written offer to provide the Corresponding Source. This
271+
alternative is allowed only occasionally and noncommercially, and
272+
only if you received the object code with such an offer, in accord
273+
with subsection 6b.
274+
275+
d) Convey the object code by offering access from a designated
276+
place (gratis or for a charge), and offer equivalent access to the
277+
Corresponding Source in the same way through the same place at no
278+
further charge. You need not require recipients to copy the
279+
Corresponding Source along with the object code. If the place to
280+
copy the object code is a network server, the Corresponding Source
281+
may be on a different server (operated by you or a third party)
282+
that supports equivalent copying facilities, provided you maintain
283+
clear directions next to the object code saying where to find the
284+
Corresponding Source. Regardless of what server hosts the
285+
Corresponding Source, you remain obligated to ensure that it is
286+
available for as long as needed to satisfy these requirements.
287+
288+
e) Convey the object code using peer-to-peer transmission, provided
289+
you inform other peers where the object code and Corresponding
290+
Source of the work are being offered to the general public at no
291+
charge under subsection 6d.
292292

293293
A separable portion of the object code, whose source code is excluded
294294
from the Corresponding Source as a System Library, need not be
@@ -362,28 +362,28 @@ for which you have or can give appropriate copyright permission.
362362
add to a covered work, you may (if authorized by the copyright holders of
363363
that material) supplement the terms of this License with terms:
364364

365-
a) Disclaiming warranty or limiting liability differently from the
366-
terms of sections 15 and 16 of this License; or
365+
a) Disclaiming warranty or limiting liability differently from the
366+
terms of sections 15 and 16 of this License; or
367367

368-
b) Requiring preservation of specified reasonable legal notices or
369-
author attributions in that material or in the Appropriate Legal
370-
Notices displayed by works containing it; or
368+
b) Requiring preservation of specified reasonable legal notices or
369+
author attributions in that material or in the Appropriate Legal
370+
Notices displayed by works containing it; or
371371

372-
c) Prohibiting misrepresentation of the origin of that material, or
373-
requiring that modified versions of such material be marked in
374-
reasonable ways as different from the original version; or
372+
c) Prohibiting misrepresentation of the origin of that material, or
373+
requiring that modified versions of such material be marked in
374+
reasonable ways as different from the original version; or
375375

376-
d) Limiting the use for publicity purposes of names of licensors or
377-
authors of the material; or
376+
d) Limiting the use for publicity purposes of names of licensors or
377+
authors of the material; or
378378

379-
e) Declining to grant rights under trademark law for use of some
380-
trade names, trademarks, or service marks; or
379+
e) Declining to grant rights under trademark law for use of some
380+
trade names, trademarks, or service marks; or
381381

382-
f) Requiring indemnification of licensors and authors of that
383-
material by anyone who conveys the material (or modified versions of
384-
it) with contractual assumptions of liability to the recipient, for
385-
any liability that these contractual assumptions directly impose on
386-
those licensors and authors.
382+
f) Requiring indemnification of licensors and authors of that
383+
material by anyone who conveys the material (or modified versions of
384+
it) with contractual assumptions of liability to the recipient, for
385+
any liability that these contractual assumptions directly impose on
386+
those licensors and authors.
387387

388388
All other non-permissive additional terms are considered "further
389389
restrictions" within the meaning of section 10. If the Program as you
@@ -618,9 +618,9 @@ an absolute waiver of all civil liability in connection with the
618618
Program, unless a warranty or assumption of liability accompanies a
619619
copy of the Program in return for a fee.
620620

621-
END OF TERMS AND CONDITIONS
621+
END OF TERMS AND CONDITIONS
622622

623-
How to Apply These Terms to Your New Programs
623+
How to Apply These Terms to Your New Programs
624624

625625
If you develop a new program, and you want it to be of the greatest
626626
possible use to the public, the best way to achieve this is to make it
@@ -631,31 +631,31 @@ to attach them to the start of each source file to most effectively
631631
state the exclusion of warranty; and each file should have at least
632632
the "copyright" line and a pointer to where the full notice is found.
633633

634-
<one line to give the program's name and a brief idea of what it does.>
635-
Copyright (C) <year> <name of author>
634+
<one line to give the program's name and a brief idea of what it does.>
635+
Copyright (C) <year> <name of author>
636636

637-
This program is free software: you can redistribute it and/or modify
638-
it under the terms of the GNU General Public License as published by
639-
the Free Software Foundation, either version 3 of the License, or
640-
(at your option) any later version.
637+
This program is free software: you can redistribute it and/or modify
638+
it under the terms of the GNU General Public License as published by
639+
the Free Software Foundation, either version 3 of the License, or
640+
(at your option) any later version.
641641

642-
This program is distributed in the hope that it will be useful,
643-
but WITHOUT ANY WARRANTY; without even the implied warranty of
644-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645-
GNU General Public License for more details.
642+
This program is distributed in the hope that it will be useful,
643+
but WITHOUT ANY WARRANTY; without even the implied warranty of
644+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645+
GNU General Public License for more details.
646646

647-
You should have received a copy of the GNU General Public License
648-
along with this program. If not, see <https://www.gnu.org/licenses/>.
647+
You should have received a copy of the GNU General Public License
648+
along with this program. If not, see <https://www.gnu.org/licenses/>.
649649

650650
Also add information on how to contact you by electronic and paper mail.
651651

652652
If the program does terminal interaction, make it output a short
653653
notice like this when it starts in an interactive mode:
654654

655-
<program> Copyright (C) <year> <name of author>
656-
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657-
This is free software, and you are welcome to redistribute it
658-
under certain conditions; type `show c' for details.
655+
<program> Copyright (C) <year> <name of author>
656+
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657+
This is free software, and you are welcome to redistribute it
658+
under certain conditions; type `show c' for details.
659659

660660
The hypothetical commands `show w' and `show c' should show the appropriate
661661
parts of the General Public License. Of course, your program's commands

‎README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ By default, results will be stored in the ./results directory. A new sub directo
129129
│   ├── proof.txt
130130
│   └── screenshots/
131131
└── scans/
132-
├── _commands.log
133-
├── _manual_commands.txt
134-
└── xml/
132+
├── _commands.log
133+
├── _manual_commands.txt
134+
└── xml/
135135
```
136136

137137
The exploit directory is intended to contain any exploit code you download / write for the target.

‎autorecon.py

+1,270-1,272
Large diffs are not rendered by default.

‎plugins/databases.py

+78-78
Original file line numberDiff line numberDiff line change
@@ -2,121 +2,121 @@
22

33
class NmapMongoDB(ServiceScan):
44

5-
def __init__(self):
6-
super().__init__()
7-
self.name = "Nmap MongoDB"
8-
self.tags = ['default', 'databases']
5+
def __init__(self):
6+
super().__init__()
7+
self.name = "Nmap MongoDB"
8+
self.tags = ['default', 'databases']
99

10-
def configure(self):
11-
self.add_service_match('^mongod')
10+
def configure(self):
11+
self.match_service_name('^mongod')
1212

13-
async def run(self, service):
14-
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(mongodb* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_mongodb_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_mongodb_nmap.xml" {address}')
13+
async def run(self, service):
14+
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(mongodb* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_mongodb_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_mongodb_nmap.xml" {address}')
1515

1616
class NmapMSSQL(ServiceScan):
1717

18-
def __init__(self):
19-
super().__init__()
20-
self.name = "Nmap MSSQL"
21-
self.tags = ['default', 'databases']
18+
def __init__(self):
19+
super().__init__()
20+
self.name = "Nmap MSSQL"
21+
self.tags = ['default', 'databases']
2222

23-
def configure(self):
24-
self.add_service_match(['^mssql', '^ms\-sql'])
23+
def configure(self):
24+
self.match_service_name(['^mssql', '^ms\-sql'])
2525

26-
def manual(self):
27-
self.add_manual_command('(sqsh) interactive database shell:', 'sqsh -U <username> -P <password> -S {address}:{port}')
26+
def manual(self):
27+
self.add_manual_command('(sqsh) interactive database shell:', 'sqsh -U <username> -P <password> -S {address}:{port}')
2828

29-
async def run(self, service):
30-
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(ms-sql* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" --script-args="mssql.instance-port={port},mssql.username=sa,mssql.password=sa" -oN "{scandir}/{protocol}_{port}_mssql_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_mssql_nmap.xml" {address}')
29+
async def run(self, service):
30+
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(ms-sql* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" --script-args="mssql.instance-port={port},mssql.username=sa,mssql.password=sa" -oN "{scandir}/{protocol}_{port}_mssql_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_mssql_nmap.xml" {address}')
3131

3232
class NmapMYSQL(ServiceScan):
3333

34-
def __init__(self):
35-
super().__init__()
36-
self.name = "Nmap MYSQL"
37-
self.tags = ['default', 'databases']
34+
def __init__(self):
35+
super().__init__()
36+
self.name = "Nmap MYSQL"
37+
self.tags = ['default', 'databases']
3838

39-
def configure(self):
40-
self.add_service_match('^mysql')
39+
def configure(self):
40+
self.match_service_name('^mysql')
4141

42-
def manual(self):
43-
self.add_manual_command('(sqsh) interactive database shell:', 'sqsh -U <username> -P <password> -S {address}:{port}')
42+
def manual(self):
43+
self.add_manual_command('(sqsh) interactive database shell:', 'sqsh -U <username> -P <password> -S {address}:{port}')
4444

45-
async def run(self, service):
46-
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(mysql* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_mysql_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_mysql_nmap.xml" {address}')
45+
async def run(self, service):
46+
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(mysql* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_mysql_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_mysql_nmap.xml" {address}')
4747

4848
class NmapOracle(ServiceScan):
4949

50-
def __init__(self):
51-
super().__init__()
52-
self.name = "Nmap Oracle"
53-
self.tags = ['default', 'databases']
50+
def __init__(self):
51+
super().__init__()
52+
self.name = "Nmap Oracle"
53+
self.tags = ['default', 'databases']
5454

55-
def configure(self):
56-
self.add_service_match('^oracle')
55+
def configure(self):
56+
self.match_service_name('^oracle')
5757

58-
def manual(self):
59-
self.add_manual_command('Brute-force SIDs using Nmap:', 'nmap {nmap_extra} -sV -p {port} --script="banner,oracle-sid-brute" -oN "{scandir}/{protocol}_{port}_oracle_sid-brute_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_oracle_sid-brute_nmap.xml" {address}')
58+
def manual(self):
59+
self.add_manual_command('Brute-force SIDs using Nmap:', 'nmap {nmap_extra} -sV -p {port} --script="banner,oracle-sid-brute" -oN "{scandir}/{protocol}_{port}_oracle_sid-brute_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_oracle_sid-brute_nmap.xml" {address}')
6060

61-
async def run(self, service):
62-
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(oracle* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_oracle_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_oracle_nmap.xml" {address}')
61+
async def run(self, service):
62+
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(oracle* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_oracle_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_oracle_nmap.xml" {address}')
6363

6464
class OracleTNScmd(ServiceScan):
6565

66-
def __init__(self):
67-
super().__init__()
68-
self.name = "Oracle TNScmd"
69-
self.tags = ['default', 'databases']
66+
def __init__(self):
67+
super().__init__()
68+
self.name = "Oracle TNScmd"
69+
self.tags = ['default', 'databases']
7070

71-
def configure(self):
72-
self.add_service_match('^oracle')
71+
def configure(self):
72+
self.match_service_name('^oracle')
7373

74-
async def run(self, service):
75-
await service.execute('tnscmd10g ping -h {address} -p {port} 2>&1', outfile='{protocol}_{port}_oracle_tnscmd_ping.txt')
76-
await service.execute('tnscmd10g version -h {address} -p {port} 2>&1', outfile='{protocol}_{port}_oracle_tnscmd_version.txt')
74+
async def run(self, service):
75+
await service.execute('tnscmd10g ping -h {address} -p {port} 2>&1', outfile='{protocol}_{port}_oracle_tnscmd_ping.txt')
76+
await service.execute('tnscmd10g version -h {address} -p {port} 2>&1', outfile='{protocol}_{port}_oracle_tnscmd_version.txt')
7777

7878
class OracleScanner(ServiceScan):
7979

80-
def __init__(self):
81-
super().__init__()
82-
self.name = "Oracle Scanner"
83-
self.tags = ['default', 'databases']
80+
def __init__(self):
81+
super().__init__()
82+
self.name = "Oracle Scanner"
83+
self.tags = ['default', 'databases']
8484

85-
def configure(self):
86-
self.add_service_match('^oracle')
85+
def configure(self):
86+
self.match_service_name('^oracle')
8787

88-
async def run(self, service):
89-
await service.execute('oscanner -v -s {address} -P {port} 2>&1', outfile='{protocol}_{port}_oracle_scanner.txt')
88+
async def run(self, service):
89+
await service.execute('oscanner -v -s {address} -P {port} 2>&1', outfile='{protocol}_{port}_oracle_scanner.txt')
9090

9191
class OracleODAT(ServiceScan):
9292

93-
def __init__(self):
94-
super().__init__()
95-
self.name = "Oracle ODAT"
96-
self.tags = ['default', 'databases']
93+
def __init__(self):
94+
super().__init__()
95+
self.name = "Oracle ODAT"
96+
self.tags = ['default', 'databases']
9797

98-
def configure(self):
99-
self.add_service_match('^oracle')
98+
def configure(self):
99+
self.match_service_name('^oracle')
100100

101-
def manual(self):
102-
self.add_manual_commands('Install ODAT (https://github.com/quentinhardy/odat) and run the following commands:', [
103-
'python odat.py tnscmd -s {address} -p {port} --ping',
104-
'python odat.py tnscmd -s {address} -p {port} --version',
105-
'python odat.py tnscmd -s {address} -p {port} --status',
106-
'python odat.py sidguesser -s {address} -p {port}',
107-
'python odat.py passwordguesser -s {address} -p {port} -d <sid> --accounts-file accounts/accounts_multiple.txt',
108-
'python odat.py tnspoison -s {address} -p {port} -d <sid> --test-module'
109-
])
101+
def manual(self):
102+
self.add_manual_commands('Install ODAT (https://github.com/quentinhardy/odat) and run the following commands:', [
103+
'python odat.py tnscmd -s {address} -p {port} --ping',
104+
'python odat.py tnscmd -s {address} -p {port} --version',
105+
'python odat.py tnscmd -s {address} -p {port} --status',
106+
'python odat.py sidguesser -s {address} -p {port}',
107+
'python odat.py passwordguesser -s {address} -p {port} -d <sid> --accounts-file accounts/accounts_multiple.txt',
108+
'python odat.py tnspoison -s {address} -p {port} -d <sid> --test-module'
109+
])
110110

111111
class OraclePatator(ServiceScan):
112112

113-
def __init__(self):
114-
super().__init__()
115-
self.name = "Oracle Patator"
116-
self.tags = ['default', 'databases']
113+
def __init__(self):
114+
super().__init__()
115+
self.name = "Oracle Patator"
116+
self.tags = ['default', 'databases']
117117

118-
def configure(self):
119-
self.add_service_match('^oracle')
118+
def configure(self):
119+
self.match_service_name('^oracle')
120120

121-
def manual(self):
122-
self.add_manual_command('Install Oracle Instant Client (https://github.com/rapid7/metasploit-framework/wiki/How-to-get-Oracle-Support-working-with-Kali-Linux) and then bruteforce with patator:', 'patator oracle_login host={address} port={port} user=COMBO00 password=COMBO01 0=/usr/share/seclists/Passwords/Default-Credentials/oracle-betterdefaultpasslist.txt -x ignore:code=ORA-01017 -x ignore:code=ORA-28000')
121+
def manual(self):
122+
self.add_manual_command('Install Oracle Instant Client (https://github.com/rapid7/metasploit-framework/wiki/How-to-get-Oracle-Support-working-with-Kali-Linux) and then bruteforce with patator:', 'patator oracle_login host={address} port={port} user=COMBO00 password=COMBO01 0=/usr/share/seclists/Passwords/Default-Credentials/oracle-betterdefaultpasslist.txt -x ignore:code=ORA-01017 -x ignore:code=ORA-28000')

‎plugins/default-port-scan.py

+34-34
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,44 @@
33

44
class QuickTCPPortScan(PortScan):
55

6-
def __init__(self):
7-
super().__init__()
8-
self.name = "Top TCP Ports"
9-
self.tags = ["default", "default-port-scan"]
10-
self.priority = 0
11-
12-
async def run(self, target):
13-
process, stdout, stderr = await target.execute('nmap {nmap_extra} -sV -sC --version-all -oN "{scandir}/_quick_tcp_nmap.txt" -oX "{scandir}/xml/_quick_tcp_nmap.xml" {address}', blocking=False)
14-
services = await target.extract_services(stdout)
15-
await process.wait()
16-
return services
6+
def __init__(self):
7+
super().__init__()
8+
self.name = "Top TCP Ports"
9+
self.tags = ["default", "default-port-scan"]
10+
self.priority = 0
11+
12+
async def run(self, target):
13+
process, stdout, stderr = await target.execute('nmap {nmap_extra} -sV -sC --version-all -oN "{scandir}/_quick_tcp_nmap.txt" -oX "{scandir}/xml/_quick_tcp_nmap.xml" {address}', blocking=False)
14+
services = await target.extract_services(stdout)
15+
await process.wait()
16+
return services
1717

1818
class AllTCPPortScan(PortScan):
1919

20-
def __init__(self):
21-
super().__init__()
22-
self.name = "All TCP Ports"
23-
self.tags = ["default", "default-port-scan", "long"]
20+
def __init__(self):
21+
super().__init__()
22+
self.name = "All TCP Ports"
23+
self.tags = ["default", "default-port-scan", "long"]
2424

25-
async def run(self, target):
26-
process, stdout, stderr = await target.execute('nmap {nmap_extra} -A --osscan-guess --version-all -p- -oN "{scandir}/_full_tcp_nmap.txt" -oX "{scandir}/xml/_full_tcp_nmap.xml" {address}', blocking=False)
27-
services = await target.extract_services(stdout)
28-
await process.wait()
29-
return services
25+
async def run(self, target):
26+
process, stdout, stderr = await target.execute('nmap {nmap_extra} -A --osscan-guess --version-all -p- -oN "{scandir}/_full_tcp_nmap.txt" -oX "{scandir}/xml/_full_tcp_nmap.xml" {address}', blocking=False)
27+
services = await target.extract_services(stdout)
28+
await process.wait()
29+
return services
3030

3131
class Top20UDPPortScan(PortScan):
3232

33-
def __init__(self):
34-
super().__init__()
35-
self.name = "Top 100 UDP Ports"
36-
self.tags = ["default", "default-port-scan"]
37-
38-
async def run(self, target):
39-
# Only run UDP scan if user is root.
40-
if os.getuid() == 0:
41-
process, stdout, stderr = await target.execute('nmap {nmap_extra} -sU -A --version-all --top-ports 100 -oN "{scandir}/_top_20_udp_nmap.txt" -oX "{scandir}/xml/_top_20_udp_nmap.xml" {address}', blocking=False)
42-
services = await target.extract_services(stdout)
43-
await process.wait()
44-
return services
45-
else:
46-
error('UDP scan requires AutoRecon be run with root privileges.')
33+
def __init__(self):
34+
super().__init__()
35+
self.name = "Top 100 UDP Ports"
36+
self.tags = ["default", "default-port-scan"]
37+
38+
async def run(self, target):
39+
# Only run UDP scan if user is root.
40+
if os.getuid() == 0:
41+
process, stdout, stderr = await target.execute('nmap {nmap_extra} -sU -A --version-all --top-ports 100 -oN "{scandir}/_top_20_udp_nmap.txt" -oX "{scandir}/xml/_top_20_udp_nmap.xml" {address}', blocking=False)
42+
services = await target.extract_services(stdout)
43+
await process.wait()
44+
return services
45+
else:
46+
error('UDP scan requires AutoRecon be run with root privileges.')

‎plugins/dns.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
class DNS(ServiceScan):
44

5-
def __init__(self):
6-
super().__init__()
7-
self.name = "DNS"
8-
self.tags = ['default', 'dns']
5+
def __init__(self):
6+
super().__init__()
7+
self.name = "DNS"
8+
self.tags = ['default', 'dns']
99

10-
def configure(self):
11-
self.add_service_match('^domain')
10+
def configure(self):
11+
self.match_service_name('^domain')
1212

13-
async def run(self, service):
14-
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(dns* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_dns_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_dns_nmap.xml" {address}')
13+
async def run(self, service):
14+
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(dns* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_dns_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_dns_nmap.xml" {address}')

‎plugins/ftp.py

+19-19
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,29 @@
22

33
class NmapFTP(ServiceScan):
44

5-
def __init__(self):
6-
super().__init__()
7-
self.name = 'Nmap FTP'
8-
self.tags = ['default', 'ftp']
5+
def __init__(self):
6+
super().__init__()
7+
self.name = 'Nmap FTP'
8+
self.tags = ['default', 'ftp']
99

10-
def configure(self):
11-
self.add_service_match(['^ftp', '^ftp\-data'])
10+
def configure(self):
11+
self.match_service_name(['^ftp', '^ftp\-data'])
1212

13-
async def run(self, service):
14-
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(ftp* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_ftp_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_ftp_nmap.xml" {address}')
13+
async def run(self, service):
14+
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(ftp* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_ftp_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_ftp_nmap.xml" {address}')
1515

1616
class BruteforceFTP(ServiceScan):
1717

18-
def __init__(self):
19-
super().__init__()
20-
self.name = "Bruteforce FTP"
21-
self.tags = ['default', 'ftp']
18+
def __init__(self):
19+
super().__init__()
20+
self.name = "Bruteforce FTP"
21+
self.tags = ['default', 'ftp']
2222

23-
def configure(self):
24-
self.add_service_match(['^ftp', '^ftp\-data'])
23+
def configure(self):
24+
self.match_service_name(['^ftp', '^ftp\-data'])
2525

26-
def manual(self):
27-
self.add_manual_commands('Bruteforce logins:', [
28-
'hydra -L "' + self.get_global('username_wordlist') + '" -P "' + self.get_global('password_wordlist') + '" -e nsr -s {port} -o "{scandir}/{protocol}_{port}_ftp_hydra.txt" ftp://{address}',
29-
'medusa -U "' + self.get_global('username_wordlist') + '" -P "' + self.get_global('password_wordlist') + '" -e ns -n {port} -O "{scandir}/{protocol}_{port}_ftp_medusa.txt" -M ftp -h {address}'
30-
])
26+
def manual(self):
27+
self.add_manual_commands('Bruteforce logins:', [
28+
'hydra -L "' + self.get_global('username_wordlist') + '" -P "' + self.get_global('password_wordlist') + '" -e nsr -s {port} -o "{scandir}/{protocol}_{port}_ftp_hydra.txt" ftp://{address}',
29+
'medusa -U "' + self.get_global('username_wordlist') + '" -P "' + self.get_global('password_wordlist') + '" -e ns -n {port} -O "{scandir}/{protocol}_{port}_ftp_medusa.txt" -M ftp -h {address}'
30+
])

‎plugins/http.py

+140-140
Large diffs are not rendered by default.

‎plugins/kerberos.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
class NmapKerberos(ServiceScan):
44

5-
def __init__(self):
6-
super().__init__()
7-
self.name = "Nmap Kerberos"
8-
self.tags = ['default', 'kerberos', 'active-directory']
5+
def __init__(self):
6+
super().__init__()
7+
self.name = "Nmap Kerberos"
8+
self.tags = ['default', 'kerberos', 'active-directory']
99

10-
def configure(self):
11-
self.add_service_match(['^kerberos', '^kpasswd'])
10+
def configure(self):
11+
self.match_service_name(['^kerberos', '^kpasswd'])
1212

13-
async def run(self, service):
14-
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,krb5-enum-users" -oN "{scandir}/{protocol}_{port}_kerberos_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_kerberos_nmap.xml" {address}')
13+
async def run(self, service):
14+
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,krb5-enum-users" -oN "{scandir}/{protocol}_{port}_kerberos_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_kerberos_nmap.xml" {address}')

‎plugins/ldap.py

+18-18
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,28 @@
22

33
class NmapLDAP(ServiceScan):
44

5-
def __init__(self):
6-
super().__init__()
7-
self.name = "Nmap LDAP"
8-
self.tags = ['default', 'ldap', 'active-directory']
5+
def __init__(self):
6+
super().__init__()
7+
self.name = "Nmap LDAP"
8+
self.tags = ['default', 'ldap', 'active-directory']
99

10-
def configure(self):
11-
self.add_service_match('^ldap')
10+
def configure(self):
11+
self.match_service_name('^ldap')
1212

13-
async def run(self, service):
14-
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(ldap* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_ldap_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_ldap_nmap.xml" {address}')
13+
async def run(self, service):
14+
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(ldap* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_ldap_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_ldap_nmap.xml" {address}')
1515

1616
class LDAPSearch(ServiceScan):
1717

18-
def __init__(self):
19-
super().__init__()
20-
self.name = 'LDAP Search'
21-
self.tags = ['default', 'ldap', 'active-directory']
18+
def __init__(self):
19+
super().__init__()
20+
self.name = 'LDAP Search'
21+
self.tags = ['default', 'ldap', 'active-directory']
2222

23-
def configure(self):
24-
self.add_service_match('^ldap')
23+
def configure(self):
24+
self.match_service_name('^ldap')
2525

26-
def manual(self):
27-
self.add_manual_command('ldapsearch command (modify before running):', [
28-
'ldapsearch -x -D "<username>" -w "<password>"" -p {port} -h {address} -b "dc=example,dc=com" -s sub "(objectclass=*) 2>&1 | tee > "{scandir}/{protocol}_{port}_ldap_all-entries.txt"'
29-
])
26+
def manual(self):
27+
self.add_manual_command('ldapsearch command (modify before running):', [
28+
'ldapsearch -x -D "<username>" -w "<password>"" -p {port} -h {address} -b "dc=example,dc=com" -s sub "(objectclass=*) 2>&1 | tee > "{scandir}/{protocol}_{port}_ldap_all-entries.txt"'
29+
])

‎plugins/misc.py

+104-104
Original file line numberDiff line numberDiff line change
@@ -2,169 +2,169 @@
22

33
class NmapCassandra(ServiceScan):
44

5-
def __init__(self):
6-
super().__init__()
7-
self.name = "Nmap Cassandra"
8-
self.tags = ['default', 'cassandra']
5+
def __init__(self):
6+
super().__init__()
7+
self.name = "Nmap Cassandra"
8+
self.tags = ['default', 'cassandra']
99

10-
def configure(self):
11-
self.add_service_match('^apani1')
10+
def configure(self):
11+
self.match_service_name('^apani1')
1212

13-
async def run(self, service):
14-
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(cassandra* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_cassandra_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_cassandra_nmap.xml" {address}')
13+
async def run(self, service):
14+
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(cassandra* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_cassandra_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_cassandra_nmap.xml" {address}')
1515

1616
class NmapCUPS(ServiceScan):
1717

18-
def __init__(self):
19-
super().__init__()
20-
self.name = "Nmap CUPS"
21-
self.tags = ['default', 'cups']
18+
def __init__(self):
19+
super().__init__()
20+
self.name = "Nmap CUPS"
21+
self.tags = ['default', 'cups']
2222

23-
def configure(self):
24-
self.add_service_match('^ipp')
23+
def configure(self):
24+
self.match_service_name('^ipp')
2525

26-
async def run(self, service):
27-
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(cups* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_cups_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_cups_nmap.xml" {address}')
26+
async def run(self, service):
27+
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(cups* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_cups_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_cups_nmap.xml" {address}')
2828

2929
class NmapDistccd(ServiceScan):
3030

31-
def __init__(self):
32-
super().__init__()
33-
self.name = "Nmap distccd"
34-
self.tags = ['default', 'distccd']
31+
def __init__(self):
32+
super().__init__()
33+
self.name = "Nmap distccd"
34+
self.tags = ['default', 'distccd']
3535

36-
def configure(self):
37-
self.add_service_match('^distccd')
36+
def configure(self):
37+
self.match_service_name('^distccd')
3838

39-
async def run(self, service):
40-
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,distcc-cve2004-2687" --script-args="distcc-cve2004-2687.cmd=id" -oN "{scandir}/{protocol}_{port}_distcc_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_distcc_nmap.xml" {address}')
39+
async def run(self, service):
40+
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,distcc-cve2004-2687" --script-args="distcc-cve2004-2687.cmd=id" -oN "{scandir}/{protocol}_{port}_distcc_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_distcc_nmap.xml" {address}')
4141

4242
class NmapFinger(ServiceScan):
4343

44-
def __init__(self):
45-
super().__init__()
46-
self.name = "Nmap finger"
47-
self.tags = ['default', 'finger']
44+
def __init__(self):
45+
super().__init__()
46+
self.name = "Nmap finger"
47+
self.tags = ['default', 'finger']
4848

49-
def configure(self):
50-
self.add_service_match('^finger')
49+
def configure(self):
50+
self.match_service_name('^finger')
5151

52-
async def run(self, service):
53-
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,finger" -oN "{scandir}/{protocol}_{port}_finger_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_finger_nmap.xml" {address}')
52+
async def run(self, service):
53+
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,finger" -oN "{scandir}/{protocol}_{port}_finger_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_finger_nmap.xml" {address}')
5454

5555
class NmapIMAP(ServiceScan):
5656

57-
def __init__(self):
58-
super().__init__()
59-
self.name = "Nmap IMAP"
60-
self.tags = ['default', 'imap', 'email']
57+
def __init__(self):
58+
super().__init__()
59+
self.name = "Nmap IMAP"
60+
self.tags = ['default', 'imap', 'email']
6161

62-
def configure(self):
63-
self.add_service_match('^imap')
62+
def configure(self):
63+
self.match_service_name('^imap')
6464

65-
async def run(self, service):
66-
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(imap* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_imap_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_imap_nmap.xml" {address}')
65+
async def run(self, service):
66+
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(imap* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_imap_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_imap_nmap.xml" {address}')
6767

6868
class NmapNNTP(ServiceScan):
6969

70-
def __init__(self):
71-
super().__init__()
72-
self.name = "Nmap NNTP"
73-
self.tags = ['default', 'nntp']
70+
def __init__(self):
71+
super().__init__()
72+
self.name = "Nmap NNTP"
73+
self.tags = ['default', 'nntp']
7474

75-
def configure(self):
76-
self.add_service_match('^nntp')
75+
def configure(self):
76+
self.match_service_name('^nntp')
7777

78-
async def run(self, service):
79-
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,nntp-ntlm-info" -oN "{scandir}/{protocol}_{port}_nntp_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_nntp_nmap.xml" {address}')
78+
async def run(self, service):
79+
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,nntp-ntlm-info" -oN "{scandir}/{protocol}_{port}_nntp_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_nntp_nmap.xml" {address}')
8080

8181
class NmapPOP3(ServiceScan):
8282

83-
def __init__(self):
84-
super().__init__()
85-
self.name = "Nmap POP3"
86-
self.tags = ['default', 'pop3', 'email']
83+
def __init__(self):
84+
super().__init__()
85+
self.name = "Nmap POP3"
86+
self.tags = ['default', 'pop3', 'email']
8787

88-
def configure(self):
89-
self.add_service_match('^pop3')
88+
def configure(self):
89+
self.match_service_name('^pop3')
9090

91-
async def run(self, service):
92-
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(pop3* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_pop3_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_pop3_nmap.xml" {address}')
91+
async def run(self, service):
92+
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(pop3* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_pop3_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_pop3_nmap.xml" {address}')
9393

9494
class NmapRMI(ServiceScan):
9595

96-
def __init__(self):
97-
super().__init__()
98-
self.name = "Nmap RMI"
99-
self.tags = ['default', 'rmi']
96+
def __init__(self):
97+
super().__init__()
98+
self.name = "Nmap RMI"
99+
self.tags = ['default', 'rmi']
100100

101-
def configure(self):
102-
self.add_service_match(['^java\-rmi', '^rmiregistry'])
101+
def configure(self):
102+
self.match_service_name(['^java\-rmi', '^rmiregistry'])
103103

104-
async def run(self, service):
105-
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,rmi-vuln-classloader,rmi-dumpregistry" -oN "{scandir}/{protocol}_{port}_rmi_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_rmi_nmap.xml" {address}')
104+
async def run(self, service):
105+
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,rmi-vuln-classloader,rmi-dumpregistry" -oN "{scandir}/{protocol}_{port}_rmi_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_rmi_nmap.xml" {address}')
106106

107107
class NmapSMTP(ServiceScan):
108108

109-
def __init__(self):
110-
super().__init__()
111-
self.name = "Nmap SMTP"
112-
self.tags = ['default', 'smtp', 'email']
109+
def __init__(self):
110+
super().__init__()
111+
self.name = "Nmap SMTP"
112+
self.tags = ['default', 'smtp', 'email']
113113

114-
def configure(self):
115-
self.add_service_match('^smtp')
114+
def configure(self):
115+
self.match_service_name('^smtp')
116116

117-
async def run(self, service):
118-
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(smtp* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_smtp_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_smtp_nmap.xml" {address}')
117+
async def run(self, service):
118+
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(smtp* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_smtp_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_smtp_nmap.xml" {address}')
119119

120120
class SMTPUserEnum(ServiceScan):
121121

122-
def __init__(self):
123-
super().__init__()
124-
self.name = 'SMTP-User-Enum'
125-
self.tags = ['default', 'smtp', 'email']
122+
def __init__(self):
123+
super().__init__()
124+
self.name = 'SMTP-User-Enum'
125+
self.tags = ['default', 'smtp', 'email']
126126

127-
def configure(self):
128-
self.add_service_match('^smtp')
127+
def configure(self):
128+
self.match_service_name('^smtp')
129129

130-
async def run(self, service):
131-
await service.execute('smtp-user-enum -M VRFY -U "' + self.get_global('username_wordlist') + '" -t {address} -p {port} 2>&1', outfile='{protocol}_{port}_smtp_user-enum.txt')
130+
async def run(self, service):
131+
await service.execute('smtp-user-enum -M VRFY -U "' + self.get_global('username_wordlist') + '" -t {address} -p {port} 2>&1', outfile='{protocol}_{port}_smtp_user-enum.txt')
132132

133133
class NmapTelnet(ServiceScan):
134134

135-
def __init__(self):
136-
super().__init__()
137-
self.name = 'Nmap Telnet'
138-
self.tags = ['default', 'telnet']
135+
def __init__(self):
136+
super().__init__()
137+
self.name = 'Nmap Telnet'
138+
self.tags = ['default', 'telnet']
139139

140-
def configure(self):
141-
self.add_service_match('^telnet')
140+
def configure(self):
141+
self.match_service_name('^telnet')
142142

143-
async def run(self, service):
144-
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,telnet-encryption,telnet-ntlm-info" -oN "{scandir}/{protocol}_{port}_telnet-nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_telnet_nmap.xml" {address}')
143+
async def run(self, service):
144+
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,telnet-encryption,telnet-ntlm-info" -oN "{scandir}/{protocol}_{port}_telnet-nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_telnet_nmap.xml" {address}')
145145

146146
class NmapTFTP(ServiceScan):
147147

148-
def __init__(self):
149-
super().__init__()
150-
self.name = 'Nmap TFTP'
151-
self.tags = ['default', 'tftp']
148+
def __init__(self):
149+
super().__init__()
150+
self.name = 'Nmap TFTP'
151+
self.tags = ['default', 'tftp']
152152

153-
def configure(self):
154-
self.add_service_match('^tftp')
153+
def configure(self):
154+
self.match_service_name('^tftp')
155155

156-
async def run(self, service):
157-
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,tftp-enum" -oN "{scandir}/{protocol}_{port}_tftp-nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_tftp_nmap.xml" {address}')
156+
async def run(self, service):
157+
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,tftp-enum" -oN "{scandir}/{protocol}_{port}_tftp-nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_tftp_nmap.xml" {address}')
158158

159159
class NmapVNC(ServiceScan):
160160

161-
def __init__(self):
162-
super().__init__()
163-
self.name = 'Nmap VNC'
164-
self.tags = ['default', 'vnc']
161+
def __init__(self):
162+
super().__init__()
163+
self.name = 'Nmap VNC'
164+
self.tags = ['default', 'vnc']
165165

166-
def configure(self):
167-
self.add_service_match('^vnc')
166+
def configure(self):
167+
self.match_service_name('^vnc')
168168

169-
async def run(self, service):
170-
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(vnc* or realvnc* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" --script-args="unsafe=1" -oN "{scandir}/{protocol}_{port}_vnc_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_vnc_nmap.xml" {address}')
169+
async def run(self, service):
170+
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(vnc* or realvnc* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" --script-args="unsafe=1" -oN "{scandir}/{protocol}_{port}_vnc_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_vnc_nmap.xml" {address}')

‎plugins/nfs.py

+16-16
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@
22

33
class NmapNFS(ServiceScan):
44

5-
def __init__(self):
6-
super().__init__()
7-
self.name = "Nmap NFS"
8-
self.tags = ['default', 'nfs']
5+
def __init__(self):
6+
super().__init__()
7+
self.name = "Nmap NFS"
8+
self.tags = ['default', 'nfs']
99

10-
def configure(self):
11-
self.add_service_match(['^nfs', '^rpcbind'])
10+
def configure(self):
11+
self.match_service_name(['^nfs', '^rpcbind'])
1212

13-
async def run(self, service):
14-
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(rpcinfo or nfs*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_nfs_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_nfs_nmap.xml" {address}')
13+
async def run(self, service):
14+
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(rpcinfo or nfs*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_nfs_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_nfs_nmap.xml" {address}')
1515

1616
class Showmount(ServiceScan):
1717

18-
def __init__(self):
19-
super().__init__()
20-
self.name = "showmount"
21-
self.tags = ['default', 'nfs']
18+
def __init__(self):
19+
super().__init__()
20+
self.name = "showmount"
21+
self.tags = ['default', 'nfs']
2222

23-
def configure(self):
24-
self.add_service_match(['^nfs', '^rpcbind'])
23+
def configure(self):
24+
self.match_service_name(['^nfs', '^rpcbind'])
2525

26-
async def run(self, service):
27-
await service.execute('showmount -e {address} 2>&1', outfile='{protocol}_{port}_showmount.txt')
26+
async def run(self, service):
27+
await service.execute('showmount -e {address} 2>&1', outfile='{protocol}_{port}_showmount.txt')

‎plugins/rdp.py

+19-19
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,29 @@
22

33
class NmapRDP(ServiceScan):
44

5-
def __init__(self):
6-
super().__init__()
7-
self.name = "Nmap RDP"
8-
self.tags = ['default', 'rdp']
5+
def __init__(self):
6+
super().__init__()
7+
self.name = "Nmap RDP"
8+
self.tags = ['default', 'rdp']
99

10-
def configure(self):
11-
self.add_service_match(['^rdp', '^ms\-wbt\-server', '^ms\-term\-serv'])
10+
def configure(self):
11+
self.match_service_name(['^rdp', '^ms\-wbt\-server', '^ms\-term\-serv'])
1212

13-
async def run(self, service):
14-
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(rdp* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_rdp_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_rdp_nmap.xml" {address}')
13+
async def run(self, service):
14+
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(rdp* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_rdp_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_rdp_nmap.xml" {address}')
1515

1616
class BruteforceRDP(ServiceScan):
1717

18-
def __init__(self):
19-
super().__init__()
20-
self.name = "Bruteforce RDP"
21-
self.tags = ['default', 'rdp']
18+
def __init__(self):
19+
super().__init__()
20+
self.name = "Bruteforce RDP"
21+
self.tags = ['default', 'rdp']
2222

23-
def configure(self):
24-
self.add_service_match(['^rdp', '^ms\-wbt\-server', '^ms\-term\-serv'])
23+
def configure(self):
24+
self.match_service_name(['^rdp', '^ms\-wbt\-server', '^ms\-term\-serv'])
2525

26-
def manual(self):
27-
self.add_manual_commands('Bruteforce logins:', [
28-
'hydra -L "' + self.get_global('username_wordlist') + '" -P "' + self.get_global('password_wordlist') + '" -e nsr -s {port} -o "{scandir}/{protocol}_{port}_rdp_hydra.txt" rdp://{address}',
29-
'medusa -U "' + self.get_global('username_wordlist') + '" -P "' + self.get_global('password_wordlist') + '" -e ns -n {port} -O "{scandir}/{protocol}_{port}_rdp_medusa.txt" -M rdp -h {address}'
30-
])
26+
def manual(self):
27+
self.add_manual_commands('Bruteforce logins:', [
28+
'hydra -L "' + self.get_global('username_wordlist') + '" -P "' + self.get_global('password_wordlist') + '" -e nsr -s {port} -o "{scandir}/{protocol}_{port}_rdp_hydra.txt" rdp://{address}',
29+
'medusa -U "' + self.get_global('username_wordlist') + '" -P "' + self.get_global('password_wordlist') + '" -e ns -n {port} -O "{scandir}/{protocol}_{port}_rdp_medusa.txt" -M rdp -h {address}'
30+
])

‎plugins/rpc.py

+16-16
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@
22

33
class NmapMSRPC(ServiceScan):
44

5-
def __init__(self):
6-
super().__init__()
7-
self.name = "Nmap MSRPC"
8-
self.tags = ['default', 'rpc']
5+
def __init__(self):
6+
super().__init__()
7+
self.name = "Nmap MSRPC"
8+
self.tags = ['default', 'rpc']
99

10-
def configure(self):
11-
self.add_service_match(['^msrpc', '^rpcbind', '^erpc'])
10+
def configure(self):
11+
self.match_service_name(['^msrpc', '^rpcbind', '^erpc'])
1212

13-
async def run(self, service):
14-
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,msrpc-enum,rpc-grind,rpcinfo" -oN "{scandir}/{protocol}_{port}_rpc_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_rpc_nmap.xml" {address}')
13+
async def run(self, service):
14+
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,msrpc-enum,rpc-grind,rpcinfo" -oN "{scandir}/{protocol}_{port}_rpc_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_rpc_nmap.xml" {address}')
1515

1616
class RPCClient(ServiceScan):
1717

18-
def __init__(self):
19-
super().__init__()
20-
self.name = "rpcclient"
21-
self.tags = ['default', 'rpc']
18+
def __init__(self):
19+
super().__init__()
20+
self.name = "rpcclient"
21+
self.tags = ['default', 'rpc']
2222

23-
def configure(self):
24-
self.add_service_match(['^msrpc', '^rpcbind', '^erpc'])
23+
def configure(self):
24+
self.match_service_name(['^msrpc', '^rpcbind', '^erpc'])
2525

26-
def manual(self):
27-
self.add_manual_command('RPC Client:', 'rpcclient -p {port} -U "" {address}')
26+
def manual(self):
27+
self.add_manual_command('RPC Client:', 'rpcclient -p {port} -U "" {address}')

‎plugins/sip.py

+16-16
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@
22

33
class NmapSIP(ServiceScan):
44

5-
def __init__(self):
6-
super().__init__()
7-
self.name = "Nmap SIP"
8-
self.tags = ['default', 'sip']
5+
def __init__(self):
6+
super().__init__()
7+
self.name = "Nmap SIP"
8+
self.tags = ['default', 'sip']
99

10-
def configure(self):
11-
self.add_service_match('^asterisk')
10+
def configure(self):
11+
self.match_service_name('^asterisk')
1212

13-
async def run(self, service):
14-
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,sip-enum-users,sip-methods" -oN "{scandir}/{protocol}_{port}_sip_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_sip_nmap.xml" {address}')
13+
async def run(self, service):
14+
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,sip-enum-users,sip-methods" -oN "{scandir}/{protocol}_{port}_sip_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_sip_nmap.xml" {address}')
1515

1616
class SIPVicious(ServiceScan):
1717

18-
def __init__(self):
19-
super().__init__()
20-
self.name = "SIPVicious"
21-
self.tags = ['default', 'sip']
18+
def __init__(self):
19+
super().__init__()
20+
self.name = "SIPVicious"
21+
self.tags = ['default', 'sip']
2222

23-
def configure(self):
24-
self.add_service_match('^asterisk')
23+
def configure(self):
24+
self.match_service_name('^asterisk')
2525

26-
def manual(self):
27-
self.add_manual_command('svwar:', 'svwar -D -m INVITE -p {port} {address}')
26+
def manual(self):
27+
self.add_manual_command('svwar:', 'svwar -D -m INVITE -p {port} {address}')

‎plugins/smb.py

+60-60
Original file line numberDiff line numberDiff line change
@@ -2,84 +2,84 @@
22

33
class NmapSMB(ServiceScan):
44

5-
def __init__(self):
6-
super().__init__()
7-
self.name = "Nmap SMB"
8-
self.tags = ['default', 'smb', 'active-directory']
5+
def __init__(self):
6+
super().__init__()
7+
self.name = "Nmap SMB"
8+
self.tags = ['default', 'smb', 'active-directory']
99

10-
def configure(self):
11-
self.add_service_match(['^smb', '^microsoft\-ds', '^netbios'])
10+
def configure(self):
11+
self.match_service_name(['^smb', '^microsoft\-ds', '^netbios'])
1212

13-
def manual(self):
14-
self.add_manual_commands('Nmap scans for SMB vulnerabilities that could potentially cause a DoS if scanned (according to Nmap). Be careful:', [
15-
'nmap {nmap_extra} -sV -p {port} --script="smb-vuln-ms06-025" --script-args="unsafe=1" -oN "{scandir}/{protocol}_{port}_smb_ms06-025.txt" -oX "{scandir}/xml/{protocol}_{port}_smb_ms06-025.xml" {address}',
16-
'nmap {nmap_extra} -sV -p {port} --script="smb-vuln-ms07-029" --script-args="unsafe=1" -oN "{scandir}/{protocol}_{port}_smb_ms07-029.txt" -oX "{scandir}/xml/{protocol}_{port}_smb_ms07-029.xml" {address}',
17-
'nmap {nmap_extra} -sV -p {port} --script="smb-vuln-ms08-067" --script-args="unsafe=1" -oN "{scandir}/{protocol}_{port}_smb_ms08-067.txt" -oX "{scandir}/xml/{protocol}_{port}_smb_ms08-067.xml" {address}'
18-
])
13+
def manual(self):
14+
self.add_manual_commands('Nmap scans for SMB vulnerabilities that could potentially cause a DoS if scanned (according to Nmap). Be careful:', [
15+
'nmap {nmap_extra} -sV -p {port} --script="smb-vuln-ms06-025" --script-args="unsafe=1" -oN "{scandir}/{protocol}_{port}_smb_ms06-025.txt" -oX "{scandir}/xml/{protocol}_{port}_smb_ms06-025.xml" {address}',
16+
'nmap {nmap_extra} -sV -p {port} --script="smb-vuln-ms07-029" --script-args="unsafe=1" -oN "{scandir}/{protocol}_{port}_smb_ms07-029.txt" -oX "{scandir}/xml/{protocol}_{port}_smb_ms07-029.xml" {address}',
17+
'nmap {nmap_extra} -sV -p {port} --script="smb-vuln-ms08-067" --script-args="unsafe=1" -oN "{scandir}/{protocol}_{port}_smb_ms08-067.txt" -oX "{scandir}/xml/{protocol}_{port}_smb_ms08-067.xml" {address}'
18+
])
1919

20-
async def run(self, service):
21-
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(nbstat or smb* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_smb_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_smb_nmap.xml" {address}')
20+
async def run(self, service):
21+
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(nbstat or smb* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_smb_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_smb_nmap.xml" {address}')
2222

2323
class Enum4Linux(ServiceScan):
2424

25-
def __init__(self):
26-
super().__init__()
27-
self.name = "Enum4Linux"
28-
self.tags = ['default', 'enum4linux', 'active-directory']
25+
def __init__(self):
26+
super().__init__()
27+
self.name = "Enum4Linux"
28+
self.tags = ['default', 'enum4linux', 'active-directory']
2929

30-
def configure(self):
31-
self.add_service_match(['^ldap', '^smb', '^microsoft\-ds', '^netbios'])
32-
self.add_port_match('tcp', [139, 389, 445])
33-
self.add_port_match('udp', 137)
34-
self.run_once(True)
30+
def configure(self):
31+
self.match_service_name(['^ldap', '^smb', '^microsoft\-ds', '^netbios'])
32+
self.match_port('tcp', [139, 389, 445])
33+
self.match_port('udp', 137)
34+
self.run_once(True)
3535

36-
async def run(self, service):
37-
await service.execute('enum4linux -a -M -l -d {address} 2>&1', outfile='enum4linux.txt')
36+
async def run(self, service):
37+
await service.execute('enum4linux -a -M -l -d {address} 2>&1', outfile='enum4linux.txt')
3838

3939
class NBTScan(ServiceScan):
4040

41-
def __init__(self):
42-
super().__init__()
43-
self.name = "nbtscan"
44-
self.tags = ['default', 'netbios', 'active-directory']
41+
def __init__(self):
42+
super().__init__()
43+
self.name = "nbtscan"
44+
self.tags = ['default', 'netbios', 'active-directory']
4545

46-
def configure(self):
47-
self.add_service_match(['^smb', '^microsoft\-ds', '^netbios'])
48-
self.add_port_match('udp', 137)
49-
self.run_once(True)
46+
def configure(self):
47+
self.match_service_name(['^smb', '^microsoft\-ds', '^netbios'])
48+
self.match_port('udp', 137)
49+
self.run_once(True)
5050

51-
async def run(self, service):
52-
await service.execute('nbtscan -rvh {address} 2>&1', outfile='nbtscan.txt')
51+
async def run(self, service):
52+
await service.execute('nbtscan -rvh {address} 2>&1', outfile='nbtscan.txt')
5353

5454
class SMBClient(ServiceScan):
5555

56-
def __init__(self):
57-
super().__init__()
58-
self.name = "SMBClient"
59-
self.tags = ['default', 'smb', 'active-directory']
56+
def __init__(self):
57+
super().__init__()
58+
self.name = "SMBClient"
59+
self.tags = ['default', 'smb', 'active-directory']
6060

61-
def configure(self):
62-
self.add_service_match(['^smb', '^microsoft\-ds', '^netbios'])
63-
self.add_port_match('tcp', [139, 445])
64-
self.run_once(True)
61+
def configure(self):
62+
self.match_service_name(['^smb', '^microsoft\-ds', '^netbios'])
63+
self.match_port('tcp', [139, 445])
64+
self.run_once(True)
6565

66-
async def run(self, service):
67-
await service.execute('smbclient -L\\\\ -N -I {address} 2>&1', outfile='smbclient.txt')
66+
async def run(self, service):
67+
await service.execute('smbclient -L\\\\ -N -I {address} 2>&1', outfile='smbclient.txt')
6868

6969
class SMBMap(ServiceScan):
7070

71-
def __init__(self):
72-
super().__init__()
73-
self.name = "SMBMap"
74-
self.tags = ['default', 'smb', 'active-directory']
75-
76-
def configure(self):
77-
self.add_service_match(['^smb', '^microsoft\-ds', '^netbios'])
78-
79-
async def run(self, service):
80-
await service.execute('smbmap -H {address} -P {port} 2>&1', outfile='smbmap-share-permissions.txt')
81-
await service.execute('smbmap -u null -p "" -H {address} -P {port} 2>&1', outfile='smbmap-share-permissions.txt')
82-
await service.execute('smbmap -H {address} -P {port} -R 2>&1', outfile='smbmap-list-contents.txt')
83-
await service.execute('smbmap -u null -p "" -H {address} -P {port} -R 2>&1', outfile='smbmap-list-contents.txt')
84-
await service.execute('smbmap -H {address} -P {port} -x "ipconfig /all" 2>&1', outfile='smbmap-execute-command.txt')
85-
await service.execute('smbmap -u null -p "" -H {address} -P {port} -x "ipconfig /all" 2>&1', outfile='smbmap-execute-command.txt')
71+
def __init__(self):
72+
super().__init__()
73+
self.name = "SMBMap"
74+
self.tags = ['default', 'smb', 'active-directory']
75+
76+
def configure(self):
77+
self.match_service_name(['^smb', '^microsoft\-ds', '^netbios'])
78+
79+
async def run(self, service):
80+
await service.execute('smbmap -H {address} -P {port} 2>&1', outfile='smbmap-share-permissions.txt')
81+
await service.execute('smbmap -u null -p "" -H {address} -P {port} 2>&1', outfile='smbmap-share-permissions.txt')
82+
await service.execute('smbmap -H {address} -P {port} -R 2>&1', outfile='smbmap-list-contents.txt')
83+
await service.execute('smbmap -u null -p "" -H {address} -P {port} -R 2>&1', outfile='smbmap-list-contents.txt')
84+
await service.execute('smbmap -H {address} -P {port} -x "ipconfig /all" 2>&1', outfile='smbmap-execute-command.txt')
85+
await service.execute('smbmap -u null -p "" -H {address} -P {port} -x "ipconfig /all" 2>&1', outfile='smbmap-execute-command.txt')

‎plugins/snmp.py

+38-38
Original file line numberDiff line numberDiff line change
@@ -2,51 +2,51 @@
22

33
class NmapSNMP(ServiceScan):
44

5-
def __init__(self):
6-
super().__init__()
7-
self.name = "Nmap SNMP"
8-
self.tags = ['default', 'snmp']
5+
def __init__(self):
6+
super().__init__()
7+
self.name = "Nmap SNMP"
8+
self.tags = ['default', 'snmp']
99

10-
def configure(self):
11-
self.add_service_match('^snmp')
10+
def configure(self):
11+
self.match_service_name('^snmp')
1212

13-
async def run(self, service):
14-
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(snmp* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_snmp-nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_snmp_nmap.xml" {address}')
13+
async def run(self, service):
14+
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(snmp* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_snmp-nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_snmp_nmap.xml" {address}')
1515

1616
class OneSixtyOne(ServiceScan):
1717

18-
def __init__(self):
19-
super().__init__()
20-
self.name = "OneSixtyOne"
21-
self.tags = ['default', 'snmp']
18+
def __init__(self):
19+
super().__init__()
20+
self.name = "OneSixtyOne"
21+
self.tags = ['default', 'snmp']
2222

23-
def configure(self):
24-
self.add_service_match('^snmp')
25-
self.add_port_match('udp', 161)
26-
self.run_once(True)
27-
self.add_option('community-strings', default='/usr/share/seclists/Discovery/SNMP/common-snmp-community-strings-onesixtyone.txt', help='The file containing a list of community strings to try. Default: %(default)s')
23+
def configure(self):
24+
self.match_service_name('^snmp')
25+
self.match_port('udp', 161)
26+
self.run_once(True)
27+
self.add_option('community-strings', default='/usr/share/seclists/Discovery/SNMP/common-snmp-community-strings-onesixtyone.txt', help='The file containing a list of community strings to try. Default: %(default)s')
2828

29-
async def run(self, service):
30-
await service.execute('onesixtyone -c ' + service.get_option('community-strings') + ' -dd {address} 2>&1', outfile='{protocol}_{port}_snmp_onesixtyone.txt')
29+
async def run(self, service):
30+
await service.execute('onesixtyone -c ' + service.get_option('community-strings') + ' -dd {address} 2>&1', outfile='{protocol}_{port}_snmp_onesixtyone.txt')
3131

3232
class SNMPWalk(ServiceScan):
3333

34-
def __init__(self):
35-
super().__init__()
36-
self.name = "SNMPWalk"
37-
self.tags = ['default', 'snmp']
38-
39-
def configure(self):
40-
self.add_service_match('^snmp')
41-
self.add_port_match('udp', 161)
42-
self.run_once(True)
43-
44-
async def run(self, service):
45-
await service.execute('snmpwalk -c public -v 1 {address} 2>&1', outfile='{protocol}_{port}_snmp_snmpwalk.txt')
46-
await service.execute('snmpwalk -c public -v 1 {address} 1.3.6.1.2.1.25.1.6.0 2>&1', outfile='{protocol}_{port}_snmp_snmpwalk_system_processes.txt')
47-
await service.execute('snmpwalk -c public -v 1 {address} 1.3.6.1.2.1.25.4.2.1.2 2>&1', outfile='{scandir}/{protocol}_{port}_snmp_snmpwalk_running_processes.txt')
48-
await service.execute('snmpwalk -c public -v 1 {address} 1.3.6.1.2.1.25.4.2.1.4 2>&1', outfile='{protocol}_{port}_snmp_snmpwalk_process_paths.txt')
49-
await service.execute('snmpwalk -c public -v 1 {address} 1.3.6.1.2.1.25.2.3.1.4 2>&1', outfile='{protocol}_{port}_snmp_snmpwalk_storage_units.txt')
50-
await service.execute('snmpwalk -c public -v 1 {address} 1.3.6.1.2.1.25.2.3.1.4 2>&1', outfile='{protocol}_{port}_snmp_snmpwalk_software_names.txt')
51-
await service.execute('snmpwalk -c public -v 1 {address} 1.3.6.1.4.1.77.1.2.25 2>&1', outfile='{protocol}_{port}_snmp_snmpwalk_user_accounts.txt')
52-
await service.execute('snmpwalk -c public -v 1 {address} 1.3.6.1.2.1.6.13.1.3 2>&1', outfile='{protocol}_{port}_snmp_snmpwalk_tcp_ports.txt')
34+
def __init__(self):
35+
super().__init__()
36+
self.name = "SNMPWalk"
37+
self.tags = ['default', 'snmp']
38+
39+
def configure(self):
40+
self.match_service_name('^snmp')
41+
self.match_port('udp', 161)
42+
self.run_once(True)
43+
44+
async def run(self, service):
45+
await service.execute('snmpwalk -c public -v 1 {address} 2>&1', outfile='{protocol}_{port}_snmp_snmpwalk.txt')
46+
await service.execute('snmpwalk -c public -v 1 {address} 1.3.6.1.2.1.25.1.6.0 2>&1', outfile='{protocol}_{port}_snmp_snmpwalk_system_processes.txt')
47+
await service.execute('snmpwalk -c public -v 1 {address} 1.3.6.1.2.1.25.4.2.1.2 2>&1', outfile='{scandir}/{protocol}_{port}_snmp_snmpwalk_running_processes.txt')
48+
await service.execute('snmpwalk -c public -v 1 {address} 1.3.6.1.2.1.25.4.2.1.4 2>&1', outfile='{protocol}_{port}_snmp_snmpwalk_process_paths.txt')
49+
await service.execute('snmpwalk -c public -v 1 {address} 1.3.6.1.2.1.25.2.3.1.4 2>&1', outfile='{protocol}_{port}_snmp_snmpwalk_storage_units.txt')
50+
await service.execute('snmpwalk -c public -v 1 {address} 1.3.6.1.2.1.25.2.3.1.4 2>&1', outfile='{protocol}_{port}_snmp_snmpwalk_software_names.txt')
51+
await service.execute('snmpwalk -c public -v 1 {address} 1.3.6.1.4.1.77.1.2.25 2>&1', outfile='{protocol}_{port}_snmp_snmpwalk_user_accounts.txt')
52+
await service.execute('snmpwalk -c public -v 1 {address} 1.3.6.1.2.1.6.13.1.3 2>&1', outfile='{protocol}_{port}_snmp_snmpwalk_tcp_ports.txt')

‎plugins/ssh.py

+19-19
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,29 @@
22

33
class NmapSSH(ServiceScan):
44

5-
def __init__(self):
6-
super().__init__()
7-
self.name = "Nmap SSH"
8-
self.tags = ['default', 'ssh']
5+
def __init__(self):
6+
super().__init__()
7+
self.name = "Nmap SSH"
8+
self.tags = ['default', 'ssh']
99

10-
def configure(self):
11-
self.add_service_match('^ssh')
10+
def configure(self):
11+
self.match_service_name('^ssh')
1212

13-
async def run(self, service):
14-
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,ssh2-enum-algos,ssh-hostkey,ssh-auth-methods" -oN "{scandir}/{protocol}_{port}_ssh_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_ssh_nmap.xml" {address}')
13+
async def run(self, service):
14+
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,ssh2-enum-algos,ssh-hostkey,ssh-auth-methods" -oN "{scandir}/{protocol}_{port}_ssh_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_ssh_nmap.xml" {address}')
1515

1616
class BruteforceSSH(ServiceScan):
1717

18-
def __init__(self):
19-
super().__init__()
20-
self.name = "Bruteforce SSH"
21-
self.tags = ['default', 'ssh']
18+
def __init__(self):
19+
super().__init__()
20+
self.name = "Bruteforce SSH"
21+
self.tags = ['default', 'ssh']
2222

23-
def configure(self):
24-
self.add_service_match('ssh')
23+
def configure(self):
24+
self.match_service_name('ssh')
2525

26-
def manual(self):
27-
self.add_manual_command('Bruteforce logins:', [
28-
'hydra -L "' + self.get_global('username_wordlist') + '" -P "' + self.get_global('password_wordlist') + '" -e nsr -s {port} -o "{scandir}/{protocol}_{port}_ssh_hydra.txt" ssh://{address}',
29-
'medusa -U "' + self.get_global('username_wordlist') + '" -P "' + self.get_global('password_wordlist') + '" -e ns -n {port} -O "{scandir}/{protocol}_{port}_ssh_medusa.txt" -M ssh -h {address}'
30-
])
26+
def manual(self):
27+
self.add_manual_command('Bruteforce logins:', [
28+
'hydra -L "' + self.get_global('username_wordlist') + '" -P "' + self.get_global('password_wordlist') + '" -e nsr -s {port} -o "{scandir}/{protocol}_{port}_ssh_hydra.txt" ssh://{address}',
29+
'medusa -U "' + self.get_global('username_wordlist') + '" -P "' + self.get_global('password_wordlist') + '" -e ns -n {port} -O "{scandir}/{protocol}_{port}_ssh_medusa.txt" -M ssh -h {address}'
30+
])

‎plugins/sslscan.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
class SSLScan(ServiceScan):
44

5-
def __init__(self):
6-
super().__init__()
7-
self.name = "SSL Scan"
8-
self.tags = ['default', 'ssl', 'tls']
5+
def __init__(self):
6+
super().__init__()
7+
self.name = "SSL Scan"
8+
self.tags = ['default', 'ssl', 'tls']
99

10-
def configure(self):
11-
self.add_service_match('.+')
12-
self.require_ssl(True)
10+
def configure(self):
11+
self.match_service_name('.+')
12+
self.require_ssl(True)
1313

14-
async def run(self, service):
15-
if service.protocol == 'tcp' and service.secure:
16-
await service.execute('sslscan --show-certificate --no-colour {address}:{port} 2>&1', outfile='{protocol}_{port}_sslscan.html')
14+
async def run(self, service):
15+
if service.protocol == 'tcp' and service.secure:
16+
await service.execute('sslscan --show-certificate --no-colour {address}:{port} 2>&1', outfile='{protocol}_{port}_sslscan.html')

0 commit comments

Comments
 (0)
Please sign in to comment.