mirror of
https://github.com/cisagov/snafflepy
synced 2026-09-24 18:22:23 +00:00
Changed output format to make it more readable
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
|
||||
+6
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user