
BOF and Python3 implementation of technique to unbind 445/tcp on Windows via SCM interactions
A technique to unbind and rebind 445/tcp on Windows without loading a driver, loading a module into LSASS, or rebooting the target machine. Implemented to ease the burden of SMB-based NTLM relays while operating over C2. Technical analysis of the technique is dicussed in more detail during the Relay Your Heart Away: An OPSEC Concious Approach to 445 Takeover presentation at x33fcon.
PoCs written in both Python and BOF format. Both utilize RPC over TCP (ncacn_ip_tcp) as transport when targeting remote machines.
Please see Operations Usage section of the associated blog post for an overview of considerations. The highlights include:
srvnet and see if there are additional dependents to consider.ncacn_ip_tcp or ncacn_np as transport for RPC. If it uses the latter (named pipes) then you won't be able to communicate remotely with the target to re-enable.Create a Python virtual environment and pip install impacket.
git clone https://github.com/zyn3rgy/smbtakeover.gitcd smbtakeoverpython3 -m virtualenv venvsource venv/bin/activatepython3 -m pip install impacketpython3 smbtakeover.py -hpython3 smbtakeover.py atlas.lab/josh:[email protected] checkpython3 smbtakeover.py atlas.lab/josh:[email protected] stoppython3 smbtakeover.py atlas.lab/josh:[email protected] startbof_smbtakeover localhost checkbof_smbtakeover 10.0.0.21 stopbof_smbtakeover localhost start