From 827dd4b6afde721554c28f4b0046c7d932a0ce4c Mon Sep 17 00:00:00 2001 From: robert-todora Date: Tue, 25 Jul 2023 15:10:48 -0400 Subject: [PATCH] Changed output format to make it more readable --- .../DefaultRules/ShareRules/Keep/KeepDollarShares.toml | 2 +- snaffcore/classifier.py | 1 + snaffcore/go_snaffle.py | 2 +- snaffcore/smb.py | 9 ++++++--- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/snaffcore/DefaultRules/ShareRules/Keep/KeepDollarShares.toml b/snaffcore/DefaultRules/ShareRules/Keep/KeepDollarShares.toml index 18bcfd7..d476500 100644 --- a/snaffcore/DefaultRules/ShareRules/Keep/KeepDollarShares.toml +++ b/snaffcore/DefaultRules/ShareRules/Keep/KeepDollarShares.toml @@ -2,7 +2,7 @@ EnumerationScope = "ShareEnumeration" RuleName = "KeepDollarShares" MatchAction = "Snaffle" -Description = "Notifies the user that C$ or ADMIN$ is visible on file share, but doesn't actually scan inside it." +Description = "Notifies the user that C$ or ADMIN$ is visible, but doesn't actually scan inside the share." MatchLocation = "ShareName" WordListType = "Exact" MatchLength = 0 diff --git a/snaffcore/classifier.py b/snaffcore/classifier.py index b1cceb0..d8631e5 100644 --- a/snaffcore/classifier.py +++ b/snaffcore/classifier.py @@ -65,6 +65,7 @@ def is_interest_share(share, rules: Rules): for rule in rules.share_classifiers: regex_rules = [] share_text = termcolor.colored("[Share]", 'yellow') + default_triage = termcolor.colored(f"{share}", 'green') if rule['WordListType'] == "Regex": regex_rules = rule['WordList'] for pattern in regex_rules: diff --git a/snaffcore/go_snaffle.py b/snaffcore/go_snaffle.py index b8e15c3..4060707 100644 --- a/snaffcore/go_snaffle.py +++ b/snaffcore/go_snaffle.py @@ -126,7 +126,7 @@ def begin_snaffle(options): def access_ldap_server(ip, username, password): - log.info("Accessing LDAP Server") + # log.info("Accessing LDAP Server") server = Server(ip, get_info=DSA) try: conn = Connection(server, username, password) diff --git a/snaffcore/smb.py b/snaffcore/smb.py index 7db0557..aa3bc47 100644 --- a/snaffcore/smb.py +++ b/snaffcore/smb.py @@ -1,6 +1,7 @@ import ntpath import struct import logging +import termcolor from .errors import * from impacket.nmb import NetBIOSError, NetBIOSTimeout @@ -42,9 +43,11 @@ class SMBClient: for i in range(len(resp)): sharename = resp[i]['shi1_netname'][:-1] remarkname = resp[i]['shi1_remark'][:-1] - # fullname = resp[i] - # print(fullname) - log.info(f'Found share {sharename} on {self.server}, remark {remarkname}') + # log.info(f'Found share {sharename} on {self.server}, remark {remarkname}') + + share_text = termcolor.colored("[Share]", 'yellow') + + print(share_text, termcolor.colored(f"{{Green}} \\\\{self.server}\\{sharename} ({remarkname})", 'green', 'on_white')) # log.info(f'{self.server}: Share: {sharename}') yield sharename