skorov/ridrelay: Enumerate usernames on a domain where you have no creds by using SMB Relay with low priv.
2019-04-07 11:28:02 Author: github.com(查看原文) 阅读量:164 收藏

Join GitHub today

GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.

Sign up

Enumerate usernames on a domain where you have no creds by using SMB Relay with low priv.

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
submodules Updated to use latest (python3) version of impacket Apr 5, 2019
.gitignore
.gitmodules
LICENSE
Pipfile
README.md Update README.md Apr 6, 2019
ridrelay.py

Quick and easy way to get domain usernames while on an internal network.

Hit me up: @skorov8

How it works

RidRelay combines the NTLM Relay attack, common lsarpc based queries and RID cycling to get a list of domain usernames. It takes these steps:

  1. Spins up an SMB and HTTP servers and waits for an incoming connection
  2. The incoming credentials are relayed to a specified target, creating a connection with the context of the relayed user
  3. Queries are made down the SMB connection to the lsarpc pipe to get the list of domain usernames. This is done by cycling up to 50000 RIDs
  4. The password policy is extracted through the samr pipe

(For best results, use with Responder)

Dependencies

  • Python 3.6
  • Impacket v0.9.20-dev or above

Installation

pipenv install
pipenv shell

# Optional: Run if installing impacket
git submodule update --init --recursive
cd submodules/impacket
pip install .
cd ../..

Usage

First, find a target host to relay to. The target must be a member of the domain and MUST have SMB Signing off. CrackMapExec can get this info for you very quick!

Start RidRelay pointing to the target:

python ridrelay.py -t 10.0.0.50

OR

Also output usernames to file

python ridrelay.py -t 10.0.0.50 -o path_to_output.txt

Highly Recommended: Start Responder to trick users to connecting to RidRelay

Shout out

Mad props go to:

  • Ronnie Flathers (@ropnop) - Original idea on low priv smb relaying

TODO:

  • Add password policy enumeration - DONE
  • Dynamic relaying based on where incoming creds have admin rights
  • Getting active sessions???
  • Connect with Bloodhound???
  • Decided to keep this tool simple. Above functionality will come in a new tool at some stage

文章来源: https://github.com/skorov/ridrelay
如有侵权请联系:admin#unsafe.sh