Skip to content

Add SSHCommandHunt module for detecting SSH tunneling and pivoting commands#1098

Merged
AndrewRathbun merged 9 commits into
EricZimmerman:masterfrom
cyber20233:patch-1
Mar 10, 2026
Merged

Add SSHCommandHunt module for detecting SSH tunneling and pivoting commands#1098
AndrewRathbun merged 9 commits into
EricZimmerman:masterfrom
cyber20233:patch-1

Conversation

@cyber20233
Copy link
Copy Markdown
Contributor

This PR adds a KAPE module that searches command history and text artifacts for evidence of SSH tunneling and network pivoting commands.

The module detects usage of tools such as:

  • OpenSSH (ssh -L, -R, -D)
  • PuTTY Plink
  • Chisel
  • Netsh portproxy
  • Ngrok
  • Cloudflared
  • Ligolo
  • FRP
  • Socat

It parses artifacts including:

  • ConsoleHost_history.txt
  • .bash_history
  • .zsh_history
  • log and configuration text files

This module helps investigators identify network pivoting and tunneling activity during incident response.

This module searches command history and text artifacts for evidence of SSH tunneling and network pivoting commands.

Tools detected include:
- OpenSSH (ssh -L, -R, -D)
- PuTTY Plink
- Chisel
- Netsh portproxy
- Ngrok
- Cloudflared
- Ligolo
- FRP
- Socat

The module parses command history files such as:
ConsoleHost_history.txt
.bash_history
.zsh_history

This helps investigators identify tunneling and pivoting activity during incident response.
@AndrewRathbun AndrewRathbun self-assigned this Mar 10, 2026
@AndrewRathbun AndrewRathbun added the enhancement New feature or request label Mar 10, 2026
Copy link
Copy Markdown
Collaborator

@AndrewRathbun AndrewRathbun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no Modules\bin folder in this repo, so we're not going to start doing that today. The Modules' BinaryUrl needs to point to the script that you want to be in the Modules\bin folder. Does that make sense?

Comment thread Modules/Apps/SSHTunnelHunt.mkape Outdated
@EricZimmerman
Copy link
Copy Markdown
Owner

As Andrew mentioned the repo cannot contain scripts or executables. You can host it on your own GitHub repo tho.

@cyber20233
Copy link
Copy Markdown
Contributor Author

Thanks Andrew. I’ve made the script public and updated the BinaryUrl to point to the script.

Copy link
Copy Markdown
Collaborator

@AndrewRathbun AndrewRathbun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved this to Apps\GitHub as well, btw. Since the Module is running something that's open source on GitHub, the appropriate subfolder is Apps\GitHub

@AndrewRathbun AndrewRathbun merged commit c7f3522 into EricZimmerman:master Mar 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants