Skip to content

Commit ee17f62

Browse files
committed
Unify naming
1 parent dfccc39 commit ee17f62

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

enum4linux-ng.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@
277277
113: "no route to host"
278278
}
279279

280-
# This is needed for the ServiceScan class
280+
# This is needed for the ListenersScan class
281281
SERVICE_LDAP = "LDAP"
282282
SERVICE_LDAPS = "LDAPS"
283283
SERVICE_SMB = "SMB"
@@ -300,6 +300,7 @@
300300
ENUM_GROUPS_RPC = "enum_groups_rpc"
301301
ENUM_SHARES = "enum_shares"
302302
ENUM_SERVICES = "enum_services"
303+
ENUM_LISTENERS = "enum_listeners"
303304
ENUM_POLICY = "enum_policy"
304305
ENUM_PRINTERS = "enum_printers"
305306
ENUM_OS_INFO = "enum_os_info"
@@ -743,16 +744,16 @@ def _write_yaml(self):
743744
def as_dict(self):
744745
return self.out_dict
745746

746-
### Service Scans
747+
### Listeners Scans
747748

748-
class ServiceScan():
749+
class ListenersScan():
749750
def __init__(self, target, scan_list):
750751
self.target = target
751752
self.scan_list = scan_list
752753
self.listeners = OrderedDict({})
753754

754755
def run(self):
755-
module_name = ENUM_SERVICES
756+
module_name = ENUM_LISTENERS
756757
output = {}
757758

758759
print_heading(f"Listener Scan on {self.target.host}")
@@ -789,7 +790,7 @@ def check_accessible(self, listener, port):
789790
except Exception:
790791
return Result(False, f"Could not connect to {listener} on {port}/tcp")
791792

792-
def get_accessible_services(self):
793+
def get_accessible_listeners(self):
793794
accessible = []
794795
for listener, entry in self.listeners.items():
795796
if entry["accessible"] is True:
@@ -2789,12 +2790,12 @@ def service_scan(self):
27892790
if self.args.L:
27902791
scan_list += [SERVICE_LDAP, SERVICE_LDAPS]
27912792

2792-
scanner = ServiceScan(self.target, scan_list)
2793+
scanner = ListenersScan(self.target, scan_list)
27932794
result = scanner.run()
27942795
self.output.update(result)
27952796
self.target.smb_ports = scanner.get_accessible_ports_by_pattern("SMB")
27962797
self.target.ldap_ports = scanner.get_accessible_ports_by_pattern("LDAP")
2797-
return scanner.get_accessible_services()
2798+
return scanner.get_accessible_listeners()
27982799

27992800
def get_modules(self, listeners, session=True):
28002801
modules = []

0 commit comments

Comments
 (0)