Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discover Common On-Prem Microsoft Stuff (RDP, ADFS, OWA, etc.) #790

Merged
merged 4 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions bbot/modules/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from contextlib import suppress

from ..core.helpers.misc import get_size # noqa
from ..core.errors import ValidationError
from ..core.helpers.async_helpers import TaskCounter
from ..core.errors import ValidationError, WordlistError


class BaseModule:
Expand Down Expand Up @@ -527,9 +527,6 @@ async def _setup(self):
self.debug(f"Finished setting up module {self.name}")
except Exception as e:
self.set_error_state()
# soft-fail if it's only a wordlist error
if isinstance(e, WordlistError):
status = None
msg = f"{e}"
self.trace()
return self.name, status, str(msg)
Expand Down
8 changes: 7 additions & 1 deletion bbot/modules/massdns.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ async def setup(self):
self.mutations_tried = set()
self.source_events = self.helpers.make_target()
self.subdomain_file = await self.helpers.wordlist(self.config.get("wordlist"))
self.subdomain_list = set(self.helpers.read_file(self.subdomain_file))

ms_on_prem_string_file = self.helpers.wordlist_dir / "ms_on_prem_subdomains.txt"
ms_on_prem_strings = set(self.helpers.read_file(ms_on_prem_string_file))
self.subdomain_list.update(ms_on_prem_strings)

self.max_resolvers = self.config.get("max_resolvers", 1000)
self.max_mutations = self.config.get("max_mutations", 500)
nameservers_url = (
Expand Down Expand Up @@ -104,7 +110,7 @@ async def handle_event(self, event):
self.source_events.add_target(event)

self.info(f"Brute-forcing subdomains for {query} (source: {event.data})")
for hostname in await self.massdns(query, self.helpers.read_file(self.subdomain_file)):
for hostname in await self.massdns(query, self.subdomain_list):
self.emit_result(hostname, event, query)

def abort_if(self, event):
Expand Down
4 changes: 3 additions & 1 deletion bbot/test/test_step_1/test_modules_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ async def test_modules_basic(scan, helpers, events, bbot_config, bbot_scanner, h
modules=list(set(available_modules + available_internal_modules)),
output_modules=list(available_output_modules),
config=bbot_config,
force_start=True,
)
scan2.helpers.dns.fallback_nameservers_file = fallback_nameservers
await scan2.load_modules()
Expand Down Expand Up @@ -174,9 +175,9 @@ async def test_modules_basic_perhostonly(scan, helpers, events, bbot_config, bbo
"evilcorp.com",
modules=list(set(available_modules + available_internal_modules)),
config=bbot_config,
force_start=True,
)

await per_host_scan.load_modules()
await per_host_scan.setup_modules()
per_host_scan.status = "RUNNING"

Expand Down Expand Up @@ -214,6 +215,7 @@ async def test_modules_basic_perdomainonly(scan, helpers, events, bbot_config, b
"evilcorp.com",
modules=list(set(available_modules + available_internal_modules)),
config=bbot_config,
force_start=True,
)

await per_domain_scan.load_modules()
Expand Down
101 changes: 101 additions & 0 deletions bbot/wordlists/ms_on_prem_subdomains.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
adfs
adfs01
adfs02
adfs1
adfs2
adfs3
adfsproxy
adfstest
auth
fed
federate
federated
federation
federationfs
fs
fs1
fs2
fs3
fs4
gateway
login
portal
saml
sso
sts
wap
webmail
owa
hybrid
hybrid-cloud
email
outlook
exchange
mail2
webmail2
mail1
mailbox
mail01
mailman
mailgate
mailbackup
mail3
webmail1
webmail3
mailing
mailserver
mailhost
mailer
mailadmin
imap
pop3
post
post1
post2
mail
remote
desktop
desktop1
desktop2
desktops
extranet
mydesktop
ra
rdesktop
rdgate
rdp
rdpweb
rds
rdsh
rdweb
remote01
remote02
remote1
remote2
remote3
remote4
remoteapp
remoteapps
remotedesktop
remotegateway
tsweb
vdesktop
vdi
dialin
meet
lync
lyncweb
sip
skype
sfbweb
scheduler
lyncext
lyncdiscoverinternal
access
lyncaccess01
lyncaccess
lync10
wac
_sipinternaltls
uc
lyncdiscover