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

SMB, Exchange (OWA/EWS), SMTP (NTLM) support #28

Open
3 of 4 tasks
jeffmcjunkin opened this issue Dec 4, 2023 · 6 comments
Open
3 of 4 tasks

SMB, Exchange (OWA/EWS), SMTP (NTLM) support #28

jeffmcjunkin opened this issue Dec 4, 2023 · 6 comments
Assignees

Comments

@jeffmcjunkin
Copy link
Sponsor Contributor

jeffmcjunkin commented Dec 4, 2023

Hello!

I'm loving this project, but given how often I encounter the above protocols, is there a consideration or timeline for authentication via the following protocols?

Sorry to make an issue for a wish list, but I think the above protocols could get this project even more traction as well.

Cheers!

@evilsocket
Copy link
Owner

Hey! So for the consideration:

SMB - i have a semi finished prototype for SMB, but it's relying on libsmbclient and i'm trying to keep the C/unsafe dependencies to the minimum. I'm not super happy with the current implementation as it makes cross compilation challenging, but i'll probably end up releasing it as it is if I can't find alternative solutions.

Exchange - the main challenge here is creating docker containers or VMs that i can use for testing while I develop the module, as I have almost no experience with MS things. Do you have any suggestion for this? Ideally I'd need a one-command solution that'd bring up an already configured env I can test with.

BTW issues are also for features request, so no problem here! Thanks for the feedback actually

@evilsocket evilsocket self-assigned this Dec 10, 2023
@evilsocket evilsocket added the enhancement New feature or request label Dec 10, 2023
evilsocket added a commit that referenced this issue Dec 18, 2023
@evilsocket
Copy link
Owner

SMB pushed!

@jeffmcjunkin
Copy link
Sponsor Contributor Author

Hmm, there's a few ways to build out Exchange in an automated fashion. I can help you build out your own if you like, or provide a working set of VMs, or point you at resources like https://automatedlab.org/en/latest/ if that's an option for you. Exchange is a bit tricky.

Great to hear about SMB! Thank you :D

@evilsocket
Copy link
Owner

@jeffmcjunkin it's not super clear to me if I can use automatedlab tool to create and run VMs on bare metal ... ? Do you have specific quick&dirty guides on how to setup an exchange VM on virtualbox/vmware/qemu? thank you so much for your help, has I said I have very little experience on microsoft envs and was leaving out a lot of protocols due to how difficult it is to bring up a test env :D

@evilsocket evilsocket added new feature and removed enhancement New feature or request labels Dec 20, 2023
@evilsocket
Copy link
Owner

evilsocket commented Jan 11, 2024

@jeffmcjunkin it turns out that the http module can already be used for the OWA endpoint. Here's the command line i used for the VM you provided:

legba http \
    -T "https://bahamut.local/owa/auth.owa" \
    -U "LEGBA\jeff" \
    -P data/wordlist.txt \
    --http-method POST \
    --http-payload 'destination=https://bahamut.local/&flags=4&username={USERNAME}&password={PASSWORD}' \
    --http-success-codes 302 \
    --http-success-string 'set-cookie'

Notice that the "destination" POST variable has to be a valid URL containing the Exchange server host. On successful login, the server will respond with a 302 redirect and a Set-Cookie header.

@evilsocket
Copy link
Owner

The EWS endpoint is using NTLMv2 negotiation via http basic auth. This is already supported by the HTTP module:

legba http.ntlm2 \
    --http-ntlm-domain LEGBA \
    -U jeff \
    -P data/wordlist.txt \
    -T "https://bahamut.local/ews" \
    --http-success-codes "200, 500"

Notice how in my setup I had to include a 500 response as success since I get this after logging in:

Screenshot 2024-01-11 alle 12 52 28

NOTE: The EWS endpoint, at least in my setup, seems to be a bit unreliable for bruteforcing. I don't know if it's related to the 500 error or there's some rate limiting going on there, but sometimes I get an "401 Unauthorized" response for valid credentials. So I think using OWA is the way to go against MS Exchange :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants