Skip to content

Commit

Permalink
Release 1.5.1: Added setup.py installer
Browse files Browse the repository at this point in the history
  • Loading branch information
p0dalirius committed Jul 17, 2022
1 parent 05f7c4d commit c1c1396
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ clean:
@rm -rf `find ./ -type d -name "*__pycache__"`
@rm -rf ./build/ ./dist/ ./coercer.egg-info/

install:
install: build
python3 setup.py install

build:
python3 setup.py sdist bdist_wheel

upload:
python3 setup.py sdist upload
upload: build
twine upload dist/*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ $ ./coercer.py -h
______
/ ____/___ ___ _____________ _____
/ / / __ \/ _ \/ ___/ ___/ _ \/ ___/
/ /___/ /_/ / __/ / / /__/ __/ / v1.4
/ /___/ /_/ / __/ / / /__/ __/ / v1.5.1
\____/\____/\___/_/ \___/\___/_/ by @podalirius_
usage: coercer.py [-h] [-u USERNAME] [-p PASSWORD] [-d DOMAIN] [--hashes [LMHASH]:NTHASH] [--no-pass] [-v] [-a] [-k] [--dc-ip ip address] [-l LISTENER] [-wh WEBDAV_HOST] [-wp WEBDAV_PORT]
Expand Down
2 changes: 1 addition & 1 deletion coercer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
# File name : coercer.py
# Author : Podalirius (@podalirius_)
# Date created : 6 Jul 2022
# Date created : 17 Jul 2022


from coercer.__main__ import main
Expand Down
2 changes: 1 addition & 1 deletion coercer/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from coercer.utils.smb import connect_to_pipe, can_bind_to_protocol, get_available_pipes_and_protocols


VERSION = "1.5"
VERSION = "1.5.1"

banner = """
______
Expand Down
103 changes: 101 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,113 @@

import setuptools

long_description = ""
long_description = """
<p align="center">
A python script to automatically coerce a Windows server to authenticate on an arbitrary machine through 9 methods.
<br>
<img alt="GitHub release (latest by date)" src="https://img.shields.io/github/v/release/p0dalirius/Coercer">
<a href="https://twitter.com/intent/follow?screen_name=podalirius_" title="Follow"><img src="https://img.shields.io/twitter/follow/podalirius_?label=Podalirius&style=social"></a>
<a href="https://www.youtube.com/c/Podalirius_?sub_confirmation=1" title="Subscribe"><img alt="YouTube Channel Subscribers" src="https://img.shields.io/youtube/channel/subscribers/UCF_x5O7CSfr82AfNVTKOv_A?style=social"></a>
<br>
</p>
## Features
- [x] Automatically detects open SMB pipes on the remote machine.
- [x] Calls one by one all the vulnerable RPC functions to coerce the server to authenticate on an arbitrary machine.
- [x] Analyze mode with `--analyze`, which only lists the vulnerable protocols and functions listening, without performing a coerced authentication.
- [x] Perform coerce attack on a list of targets from a file with `--targets-file`
- [x] Coerce to a WebDAV target with `--webdav-host` and `--webdav-port`
## Usage
```
$ ./coercer.py -h
______
/ ____/___ ___ _____________ _____
/ / / __ \/ _ \/ ___/ ___/ _ \/ ___/
/ /___/ /_/ / __/ / / /__/ __/ / v1.5.1
\____/\____/\___/_/ \___/\___/_/ by @podalirius_
usage: coercer.py [-h] [-u USERNAME] [-p PASSWORD] [-d DOMAIN] [--hashes [LMHASH]:NTHASH] [--no-pass] [-v] [-a] [-k] [--dc-ip ip address] [-l LISTENER] [-wh WEBDAV_HOST] [-wp WEBDAV_PORT]
(-t TARGET | -f TARGETS_FILE) [--target-ip ip address]
Automatic windows authentication coercer over various RPC calls.
options:
-h, --help show this help message and exit
-u USERNAME, --username USERNAME
Username to authenticate to the endpoint.
-p PASSWORD, --password PASSWORD
Password to authenticate to the endpoint. (if omitted, it will be asked unless -no-pass is specified)
-d DOMAIN, --domain DOMAIN
Windows domain name to authenticate to the endpoint.
--hashes [LMHASH]:NTHASH
NT/LM hashes (LM hash can be empty)
--no-pass Don't ask for password (useful for -k)
-v, --verbose Verbose mode (default: False)
-a, --analyze Analyze mode (default: Attack mode)
-k, --kerberos Use Kerberos authentication. Grabs credentials from ccache file (KRB5CCNAME) based on target parameters. If valid credentials cannot be found, it will use the ones specified in the
command line
--dc-ip ip address IP Address of the domain controller. If omitted it will use the domain part (FQDN) specified in the target parameter
-t TARGET, --target TARGET
IP address or hostname of the target machine
-f TARGETS_FILE, --targets-file TARGETS_FILE
IP address or hostname of the target machine
--target-ip ip address
IP Address of the target machine. If omitted it will use whatever was specified as target. This is useful when target is the NetBIOS name or Kerberos name and you cannot resolve it
-l LISTENER, --listener LISTENER
IP address or hostname of the listener machine
-wh WEBDAV_HOST, --webdav-host WEBDAV_HOST
WebDAV IP of the server to authenticate to.
-wp WEBDAV_PORT, --webdav-port WEBDAV_PORT
WebDAV port of the server to authenticate to.
```
## Coerced SMB authentication demonstration
Here is a video demonstration of the attack mode against a target:
https://user-images.githubusercontent.com/79218792/177647814-bb04f728-96bb-4048-a3ad-f83b250c05bf.mp4
## Coerced WebDAV authentication demonstration
If you want to trigger an HTTP authentication, you can use WebDAV with `--webdav-host` and the netdbios name of your attacking machine! Here is an example:
https://user-images.githubusercontent.com/79218792/178027554-a0b084d8-10af-401a-b54c-f33bec011fe2.mp4
## Example output
In attack mode (without `--analyze` option) you get the following output:
![](./.github/example.png)
After all the RPC calls, you get plenty of authentications in Responder:
![](./.github/hashes.png)
## Contributing
Pull requests are welcome. Feel free to open an issue if you want to add other features.
## Credits
- [@topotam77](https://twitter.com/topotam77) for **PetitPotam** on [MS-EFSR](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-efsr/08796ba8-01c8-4872-9221-1000ec2eff31)
- [@topotam77](https://twitter.com/topotam77) and [@_nwodtuhs](https://twitter.com/_nwodtuhs) for **ShadowCoerce** on [MS-FSRVP](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-fsrvp/dae107ec-8198-4778-a950-faa7edad125b)
- [@filip_dragovic](https://twitter.com/filip_dragovic) for **DFSCoerce** on [MS-DFSNM](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dfsnm/95a506a8-cae6-4c42-b19d-9c1ed1223979)
"""

with open('requirements.txt', 'r', encoding='utf-8') as f:
requirements = [x.strip() for x in f.readlines()]

setuptools.setup(
name="coercer",
version="1.5",
version="1.5.1",
description="",
url="https://github.com/p0dalirius/Coercer",
author="Podalirius",
Expand Down

0 comments on commit c1c1396

Please sign in to comment.