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.
This commit is contained in:
Tib3rius 2021-08-02 19:13:09 -04:00
parent 6ce5654d06
commit c92e594f77
19 changed files with 1835 additions and 1837 deletions

View File

@ -201,11 +201,9 @@ class Plugin(object):
self.name = None
self.slug = None
self.description = None
self.type = None
self.tags = ['default']
self.priority = 1
self.patterns = []
self.match = None
self.manual_commands = {}
self.autorecon = None
self.disabled = False
@ -294,13 +292,13 @@ class ServiceScan(Plugin):
super().__init__()
self.ports = {'tcp':[], 'udp':[]}
self.ignore_ports = {'tcp':[], 'udp':[]}
self.services = []
self.ignore_services = []
self.service_names = []
self.ignore_service_names = []
self.run_once_boolean = False
self.require_ssl_boolean = False
@final
def add_port_match(self, protocol, port, negative_match=False):
def match_port(self, protocol, port, negative_match=False):
protocol = protocol.lower()
if protocol not in ['tcp', 'udp']:
print('Invalid protocol.')
@ -317,12 +315,12 @@ class ServiceScan(Plugin):
self.ports[protocol] = list(set(self.ports[protocol] + port))
@final
def add_service_match(self, regex, negative_match=False):
if not isinstance(regex, list):
regex = [regex]
def match_service_name(self, name, negative_match=False):
if not isinstance(name, list):
name = [name]
valid_regex = True
for r in regex:
for r in name:
try:
re.compile(r)
except re.error:
@ -331,9 +329,9 @@ class ServiceScan(Plugin):
if valid_regex:
if negative_match:
self.ignore_services = list(set(self.ignore_services + regex))
self.ignore_service_names = list(set(self.ignore_service_names + name))
else:
self.services = list(set(self.services + regex))
self.service_names = list(set(self.service_names + name))
else:
sys.exit(1)
@ -899,7 +897,7 @@ async def scan_target(target):
for plugin in target.autorecon.plugin_types['service']:
plugin_tag = service.tag() + '/' + plugin.slug
for s in plugin.services:
for s in plugin.service_names:
if re.search(s, service.name):
plugin_tag_set = set(plugin.tags)
@ -942,7 +940,7 @@ async def scan_target(target):
warn('{byellow}[' + plugin_tag + ' against ' + target.address + '{srst}] Plugin can only run on specific ports. Skipping.{rst}')
continue
for i in plugin.ignore_services:
for i in plugin.ignore_service_names:
if re.search(i, service.name):
warn('{byellow}[' + plugin_tag + ' against ' + target.address + '{srst}] Plugin cannot be run against this service. Skipping.{rst}')
continue

View File

@ -8,7 +8,7 @@ class NmapMongoDB(ServiceScan):
self.tags = ['default', 'databases']
def configure(self):
self.add_service_match('^mongod')
self.match_service_name('^mongod')
async def run(self, service):
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}')
@ -21,7 +21,7 @@ class NmapMSSQL(ServiceScan):
self.tags = ['default', 'databases']
def configure(self):
self.add_service_match(['^mssql', '^ms\-sql'])
self.match_service_name(['^mssql', '^ms\-sql'])
def manual(self):
self.add_manual_command('(sqsh) interactive database shell:', 'sqsh -U <username> -P <password> -S {address}:{port}')
@ -37,7 +37,7 @@ class NmapMYSQL(ServiceScan):
self.tags = ['default', 'databases']
def configure(self):
self.add_service_match('^mysql')
self.match_service_name('^mysql')
def manual(self):
self.add_manual_command('(sqsh) interactive database shell:', 'sqsh -U <username> -P <password> -S {address}:{port}')
@ -53,7 +53,7 @@ class NmapOracle(ServiceScan):
self.tags = ['default', 'databases']
def configure(self):
self.add_service_match('^oracle')
self.match_service_name('^oracle')
def manual(self):
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}')
@ -69,7 +69,7 @@ class OracleTNScmd(ServiceScan):
self.tags = ['default', 'databases']
def configure(self):
self.add_service_match('^oracle')
self.match_service_name('^oracle')
async def run(self, service):
await service.execute('tnscmd10g ping -h {address} -p {port} 2>&1', outfile='{protocol}_{port}_oracle_tnscmd_ping.txt')
@ -83,7 +83,7 @@ class OracleScanner(ServiceScan):
self.tags = ['default', 'databases']
def configure(self):
self.add_service_match('^oracle')
self.match_service_name('^oracle')
async def run(self, service):
await service.execute('oscanner -v -s {address} -P {port} 2>&1', outfile='{protocol}_{port}_oracle_scanner.txt')
@ -96,7 +96,7 @@ class OracleODAT(ServiceScan):
self.tags = ['default', 'databases']
def configure(self):
self.add_service_match('^oracle')
self.match_service_name('^oracle')
def manual(self):
self.add_manual_commands('Install ODAT (https://github.com/quentinhardy/odat) and run the following commands:', [
@ -116,7 +116,7 @@ class OraclePatator(ServiceScan):
self.tags = ['default', 'databases']
def configure(self):
self.add_service_match('^oracle')
self.match_service_name('^oracle')
def manual(self):
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')

View File

@ -8,7 +8,7 @@ class DNS(ServiceScan):
self.tags = ['default', 'dns']
def configure(self):
self.add_service_match('^domain')
self.match_service_name('^domain')
async def run(self, service):
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}')

View File

@ -8,7 +8,7 @@ class NmapFTP(ServiceScan):
self.tags = ['default', 'ftp']
def configure(self):
self.add_service_match(['^ftp', '^ftp\-data'])
self.match_service_name(['^ftp', '^ftp\-data'])
async def run(self, service):
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}')
@ -21,7 +21,7 @@ class BruteforceFTP(ServiceScan):
self.tags = ['default', 'ftp']
def configure(self):
self.add_service_match(['^ftp', '^ftp\-data'])
self.match_service_name(['^ftp', '^ftp\-data'])
def manual(self):
self.add_manual_commands('Bruteforce logins:', [

View File

@ -10,8 +10,8 @@ class NmapHTTP(ServiceScan):
self.tags = ['default', 'http']
def configure(self):
self.add_service_match('^http')
self.add_service_match('^nacn_http$', negative_match=True)
self.match_service_name('^http')
self.match_service_name('^nacn_http$', negative_match=True)
self.add_pattern('Server: ([^\n]+)', description='Identified HTTP Server: {match}')
self.add_pattern('WebDAV is ENABLED', description='WebDAV is enabled')
@ -26,8 +26,8 @@ class BruteforceHTTP(ServiceScan):
self.tags = ['default', 'http']
def configure(self):
self.add_service_match('^http')
self.add_service_match('^nacn_http$', negative_match=True)
self.match_service_name('^http')
self.match_service_name('^nacn_http$', negative_match=True)
def manual(self):
self.add_manual_commands('Credential bruteforcing commands (don\'t run these without modifying them):', [
@ -46,8 +46,8 @@ class Curl(ServiceScan):
def configure(self):
self.add_option("path", default="/", help="The path on the web server to curl. Default: %(default)s")
self.add_service_match('^http')
self.add_service_match('^nacn_http$', negative_match=True)
self.match_service_name('^http')
self.match_service_name('^nacn_http$', negative_match=True)
self.add_pattern('(?i)Powered by [^\n]+')
async def run(self, service):
@ -62,8 +62,8 @@ class CurlRobots(ServiceScan):
self.tags = ['default', 'http']
def configure(self):
self.add_service_match('^http')
self.add_service_match('^nacn_http$', negative_match=True)
self.match_service_name('^http')
self.match_service_name('^nacn_http$', negative_match=True)
async def run(self, service):
if service.protocol == 'tcp':
@ -82,8 +82,8 @@ class DirBuster(ServiceScan):
self.add_choice_option('tool', default='feroxbuster', choices=['feroxbuster', 'gobuster', 'dirsearch', 'ffuf', 'dirb'], help='The tool to use for directory busting. Default: %(default)s')
self.add_list_option('wordlist', default=['/usr/share/seclists/Discovery/Web-Content/common.txt'], help='The wordlist to use when directory busting. Specify the option multiple times to use multiple wordlists. Default: %(default)s')
self.add_option('threads', default=10, help='The number of threads to use when directory busting. Default: %(default)s')
self.add_service_match('^http')
self.add_service_match('^nacn_http$', negative_match=True)
self.match_service_name('^http')
self.match_service_name('^nacn_http$', negative_match=True)
def manual(self):
self.add_manual_command('(feroxbuster) Multi-threaded recursive directory/file enumeration for web servers using various wordlists:', [
@ -133,8 +133,8 @@ class Nikto(ServiceScan):
self.tags = ['default', 'http', 'long']
def configure(self):
self.add_service_match('^http')
self.add_service_match('^nacn_http$', negative_match=True)
self.match_service_name('^http')
self.match_service_name('^nacn_http$', negative_match=True)
def manual(self):
self.add_manual_command('(nikto) old but generally reliable web server enumeration tool:', 'nikto -ask=no -h {http_scheme}://{address}:{port} 2>&1 | tee "{scandir}/{protocol}_{port}_{http_scheme}_nikto.txt"')
@ -147,8 +147,8 @@ class WhatWeb(ServiceScan):
self.tags = ['default', 'http']
def configure(self):
self.add_service_match('^http')
self.add_service_match('^nacn_http$', negative_match=True)
self.match_service_name('^http')
self.match_service_name('^nacn_http$', negative_match=True)
async def run(self, service):
if service.protocol == 'tcp':
@ -162,8 +162,8 @@ class WkHTMLToImage(ServiceScan):
self.tags = ['default', 'http']
def configure(self):
self.add_service_match('^http')
self.add_service_match('^nacn_http$', negative_match=True)
self.match_service_name('^http')
self.match_service_name('^nacn_http$', negative_match=True)
async def run(self, service):
if which('wkhtmltoimage') is not None and service.protocol == 'tcp':
@ -179,8 +179,8 @@ class WPScan(ServiceScan):
self.tags = ['default', 'http']
def configure(self):
self.add_service_match('^http')
self.add_service_match('^nacn_http$', negative_match=True)
self.match_service_name('^http')
self.match_service_name('^nacn_http$', negative_match=True)
def manual(self):
self.add_manual_command('(wpscan) WordPress Security Scanner (useful if WordPress is found):', 'wpscan --url {http_scheme}://{address}:{port}/ --no-update -e vp,vt,tt,cb,dbe,u,m --plugins-detection aggressive --plugins-version-detection aggressive -f cli-no-color 2>&1 | tee "{scandir}/{protocol}_{port}_{http_scheme}_wpscan.txt"')

View File

@ -8,7 +8,7 @@ class NmapKerberos(ServiceScan):
self.tags = ['default', 'kerberos', 'active-directory']
def configure(self):
self.add_service_match(['^kerberos', '^kpasswd'])
self.match_service_name(['^kerberos', '^kpasswd'])
async def run(self, service):
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}')

View File

@ -8,7 +8,7 @@ class NmapLDAP(ServiceScan):
self.tags = ['default', 'ldap', 'active-directory']
def configure(self):
self.add_service_match('^ldap')
self.match_service_name('^ldap')
async def run(self, service):
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}')
@ -21,7 +21,7 @@ class LDAPSearch(ServiceScan):
self.tags = ['default', 'ldap', 'active-directory']
def configure(self):
self.add_service_match('^ldap')
self.match_service_name('^ldap')
def manual(self):
self.add_manual_command('ldapsearch command (modify before running):', [

View File

@ -8,7 +8,7 @@ class NmapCassandra(ServiceScan):
self.tags = ['default', 'cassandra']
def configure(self):
self.add_service_match('^apani1')
self.match_service_name('^apani1')
async def run(self, service):
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}')
@ -21,7 +21,7 @@ class NmapCUPS(ServiceScan):
self.tags = ['default', 'cups']
def configure(self):
self.add_service_match('^ipp')
self.match_service_name('^ipp')
async def run(self, service):
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}')
@ -34,7 +34,7 @@ class NmapDistccd(ServiceScan):
self.tags = ['default', 'distccd']
def configure(self):
self.add_service_match('^distccd')
self.match_service_name('^distccd')
async def run(self, service):
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}')
@ -47,7 +47,7 @@ class NmapFinger(ServiceScan):
self.tags = ['default', 'finger']
def configure(self):
self.add_service_match('^finger')
self.match_service_name('^finger')
async def run(self, service):
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}')
@ -60,7 +60,7 @@ class NmapIMAP(ServiceScan):
self.tags = ['default', 'imap', 'email']
def configure(self):
self.add_service_match('^imap')
self.match_service_name('^imap')
async def run(self, service):
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}')
@ -73,7 +73,7 @@ class NmapNNTP(ServiceScan):
self.tags = ['default', 'nntp']
def configure(self):
self.add_service_match('^nntp')
self.match_service_name('^nntp')
async def run(self, service):
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}')
@ -86,7 +86,7 @@ class NmapPOP3(ServiceScan):
self.tags = ['default', 'pop3', 'email']
def configure(self):
self.add_service_match('^pop3')
self.match_service_name('^pop3')
async def run(self, service):
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}')
@ -99,7 +99,7 @@ class NmapRMI(ServiceScan):
self.tags = ['default', 'rmi']
def configure(self):
self.add_service_match(['^java\-rmi', '^rmiregistry'])
self.match_service_name(['^java\-rmi', '^rmiregistry'])
async def run(self, service):
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}')
@ -112,7 +112,7 @@ class NmapSMTP(ServiceScan):
self.tags = ['default', 'smtp', 'email']
def configure(self):
self.add_service_match('^smtp')
self.match_service_name('^smtp')
async def run(self, service):
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}')
@ -125,7 +125,7 @@ class SMTPUserEnum(ServiceScan):
self.tags = ['default', 'smtp', 'email']
def configure(self):
self.add_service_match('^smtp')
self.match_service_name('^smtp')
async def run(self, service):
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')
@ -138,7 +138,7 @@ class NmapTelnet(ServiceScan):
self.tags = ['default', 'telnet']
def configure(self):
self.add_service_match('^telnet')
self.match_service_name('^telnet')
async def run(self, service):
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}')
@ -151,7 +151,7 @@ class NmapTFTP(ServiceScan):
self.tags = ['default', 'tftp']
def configure(self):
self.add_service_match('^tftp')
self.match_service_name('^tftp')
async def run(self, service):
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}')
@ -164,7 +164,7 @@ class NmapVNC(ServiceScan):
self.tags = ['default', 'vnc']
def configure(self):
self.add_service_match('^vnc')
self.match_service_name('^vnc')
async def run(self, service):
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}')

View File

@ -8,7 +8,7 @@ class NmapNFS(ServiceScan):
self.tags = ['default', 'nfs']
def configure(self):
self.add_service_match(['^nfs', '^rpcbind'])
self.match_service_name(['^nfs', '^rpcbind'])
async def run(self, service):
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}')
@ -21,7 +21,7 @@ class Showmount(ServiceScan):
self.tags = ['default', 'nfs']
def configure(self):
self.add_service_match(['^nfs', '^rpcbind'])
self.match_service_name(['^nfs', '^rpcbind'])
async def run(self, service):
await service.execute('showmount -e {address} 2>&1', outfile='{protocol}_{port}_showmount.txt')

View File

@ -8,7 +8,7 @@ class NmapRDP(ServiceScan):
self.tags = ['default', 'rdp']
def configure(self):
self.add_service_match(['^rdp', '^ms\-wbt\-server', '^ms\-term\-serv'])
self.match_service_name(['^rdp', '^ms\-wbt\-server', '^ms\-term\-serv'])
async def run(self, service):
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}')
@ -21,7 +21,7 @@ class BruteforceRDP(ServiceScan):
self.tags = ['default', 'rdp']
def configure(self):
self.add_service_match(['^rdp', '^ms\-wbt\-server', '^ms\-term\-serv'])
self.match_service_name(['^rdp', '^ms\-wbt\-server', '^ms\-term\-serv'])
def manual(self):
self.add_manual_commands('Bruteforce logins:', [

View File

@ -8,7 +8,7 @@ class NmapMSRPC(ServiceScan):
self.tags = ['default', 'rpc']
def configure(self):
self.add_service_match(['^msrpc', '^rpcbind', '^erpc'])
self.match_service_name(['^msrpc', '^rpcbind', '^erpc'])
async def run(self, service):
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}')
@ -21,7 +21,7 @@ class RPCClient(ServiceScan):
self.tags = ['default', 'rpc']
def configure(self):
self.add_service_match(['^msrpc', '^rpcbind', '^erpc'])
self.match_service_name(['^msrpc', '^rpcbind', '^erpc'])
def manual(self):
self.add_manual_command('RPC Client:', 'rpcclient -p {port} -U "" {address}')

View File

@ -8,7 +8,7 @@ class NmapSIP(ServiceScan):
self.tags = ['default', 'sip']
def configure(self):
self.add_service_match('^asterisk')
self.match_service_name('^asterisk')
async def run(self, service):
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}')
@ -21,7 +21,7 @@ class SIPVicious(ServiceScan):
self.tags = ['default', 'sip']
def configure(self):
self.add_service_match('^asterisk')
self.match_service_name('^asterisk')
def manual(self):
self.add_manual_command('svwar:', 'svwar -D -m INVITE -p {port} {address}')

View File

@ -8,7 +8,7 @@ class NmapSMB(ServiceScan):
self.tags = ['default', 'smb', 'active-directory']
def configure(self):
self.add_service_match(['^smb', '^microsoft\-ds', '^netbios'])
self.match_service_name(['^smb', '^microsoft\-ds', '^netbios'])
def manual(self):
self.add_manual_commands('Nmap scans for SMB vulnerabilities that could potentially cause a DoS if scanned (according to Nmap). Be careful:', [
@ -28,9 +28,9 @@ class Enum4Linux(ServiceScan):
self.tags = ['default', 'enum4linux', 'active-directory']
def configure(self):
self.add_service_match(['^ldap', '^smb', '^microsoft\-ds', '^netbios'])
self.add_port_match('tcp', [139, 389, 445])
self.add_port_match('udp', 137)
self.match_service_name(['^ldap', '^smb', '^microsoft\-ds', '^netbios'])
self.match_port('tcp', [139, 389, 445])
self.match_port('udp', 137)
self.run_once(True)
async def run(self, service):
@ -44,8 +44,8 @@ class NBTScan(ServiceScan):
self.tags = ['default', 'netbios', 'active-directory']
def configure(self):
self.add_service_match(['^smb', '^microsoft\-ds', '^netbios'])
self.add_port_match('udp', 137)
self.match_service_name(['^smb', '^microsoft\-ds', '^netbios'])
self.match_port('udp', 137)
self.run_once(True)
async def run(self, service):
@ -59,8 +59,8 @@ class SMBClient(ServiceScan):
self.tags = ['default', 'smb', 'active-directory']
def configure(self):
self.add_service_match(['^smb', '^microsoft\-ds', '^netbios'])
self.add_port_match('tcp', [139, 445])
self.match_service_name(['^smb', '^microsoft\-ds', '^netbios'])
self.match_port('tcp', [139, 445])
self.run_once(True)
async def run(self, service):
@ -74,7 +74,7 @@ class SMBMap(ServiceScan):
self.tags = ['default', 'smb', 'active-directory']
def configure(self):
self.add_service_match(['^smb', '^microsoft\-ds', '^netbios'])
self.match_service_name(['^smb', '^microsoft\-ds', '^netbios'])
async def run(self, service):
await service.execute('smbmap -H {address} -P {port} 2>&1', outfile='smbmap-share-permissions.txt')

View File

@ -8,7 +8,7 @@ class NmapSNMP(ServiceScan):
self.tags = ['default', 'snmp']
def configure(self):
self.add_service_match('^snmp')
self.match_service_name('^snmp')
async def run(self, service):
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}')
@ -21,8 +21,8 @@ class OneSixtyOne(ServiceScan):
self.tags = ['default', 'snmp']
def configure(self):
self.add_service_match('^snmp')
self.add_port_match('udp', 161)
self.match_service_name('^snmp')
self.match_port('udp', 161)
self.run_once(True)
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')
@ -37,8 +37,8 @@ class SNMPWalk(ServiceScan):
self.tags = ['default', 'snmp']
def configure(self):
self.add_service_match('^snmp')
self.add_port_match('udp', 161)
self.match_service_name('^snmp')
self.match_port('udp', 161)
self.run_once(True)
async def run(self, service):

View File

@ -8,7 +8,7 @@ class NmapSSH(ServiceScan):
self.tags = ['default', 'ssh']
def configure(self):
self.add_service_match('^ssh')
self.match_service_name('^ssh')
async def run(self, service):
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}')
@ -21,7 +21,7 @@ class BruteforceSSH(ServiceScan):
self.tags = ['default', 'ssh']
def configure(self):
self.add_service_match('ssh')
self.match_service_name('ssh')
def manual(self):
self.add_manual_command('Bruteforce logins:', [

View File

@ -8,7 +8,7 @@ class SSLScan(ServiceScan):
self.tags = ['default', 'ssl', 'tls']
def configure(self):
self.add_service_match('.+')
self.match_service_name('.+')
self.require_ssl(True)
async def run(self, service):