βββ βββββββββββββββββββββ ββββββββββ
βββ ββββββββββββββββββββββ βββββββββββ
βββ ββββββββ βββ ββββββ βββββββββββ
βββ ββββββββ βββ ββββββββββββββββββ
ββββββββββββββββ βββ βββ βββββββββ βββ
ββββββββββββββββ βββ βββ ββββββββ βββ
LSTNR is a command line tool designed to manage multiple reverse shell sessions efficiently. It provides an interactive interface with session handling, and real time command execution.
!! This is only for testing purposes, not intended for anything illegal.!!
I was testing out ways to manage multiple connections while doing OFFSEC, HTB and THM labs.
git clone https://github.com/bwithe/LSNTR
cd lstnr
- Start LSTNR
python3 lstnr.py -p <PORT_TO_LISTEN>
LSTNR> help
Menu commands:
list - List sessions
select <id> - Connect to a session by its ID
payload - Payload generation menu
kill <id> - Terminate specific session
exit - Terminate all sessions and exit LSTNR
Session commands:
<any command> - Execute command on client
background - Return to main menu
die - Terminate current session
Payload Menu Commands:
set name <name> - Custom name for reverse shell
set lhost <ip> - Set the LSTNR IP address
set lport <port> - Set the LSTNR listening port
set payload <type> - Set payload type (EX: py, sh, ps1, exe)
options - Show current payload configuration
generate - Generate the payload with current settings
back - Return to the main menu
help - Show this help menu
- Generate Callbacks
LSTNR> payload
payload> options
βββββββββββ¦ββββββββββββ
β Setting β Value β
β ββββββββββ¬ββββββββββββ£
β name β Default β
β lhost β 127.0.0.1 β
β lport β 80 β
β payload β sh β
βββββββββββ©ββββββββββββ
payload> set name payload
[*] Set name to 'payload'
payload> set lhost 192.168.0.1
[*] Set lhost to '192.168.0.1'
payload> set lport 21
[*] Set lport to '21'
payload> set payload exe
[*] Set payload to 'exe'
payload> options
βββββββββββ¦ββββββββββββββ
β Setting β Value β
β ββββββββββ¬ββββββββββββββ£
β name β payload β
β lhost β 192.168.0.1 β
β lport β 21 β
β payload β exe β
βββββββββββ©ββββββββββββββ
payload> generate
[+] Payload generated: payload.cs
[+] EXE payload compiled successfully as 'payload.exe'
- Execute callbacks on the client to establish a connection to LSTNR
Starting the listener
python3 lstnr.py -p <port>
To get a list of commands, type ? or help
LSTNR> help
Menu commands:
list - List sessions
select <id> - Connect to a session by its ID
payload - Payload generation menu
die - Terminate all sessions
exit - Terminate all sessions and exit LSTNR
Session commands:
<any command> - Execute command on client
background - Return to main menu
die - Terminate current session
Payload Menu Commands:
set lhost <ip> - Set the LSTNR IP address
set lport <port> - Set the LSTNR listening port
set payload <type> - Set payload type (EX: py, sh, ps1)
options - Show current payload configuration
generate - Generate the payload with current settings
back - Return to the main menu
help - Show this help menu
List any active sessions with list
LSTNR> list
ββββββ¦ββββββββββββββββββ¦ββββββββββββββββββ¦ββββββββββ
β ID β IP β HOSTNAME β USER β
β βββββ¬ββββββββββββββββββ¬ββββββββββββββββββ¬ββββββββββ£
β 1 β 192.168.193.131 β ubuntu β clyde β
β 2 β 192.168.193.131 β ubuntu β root β
β 3 β 192.168.193.129 β DESKTOP-P5KACDB β jimothy β
β 4 β 192.168.193.129 β DESKTOP-P5KACDB β SYSTEM β
ββββββ©ββββββββββββββββββ©ββββββββββββββββββ©ββββββββββ
To connect to a session, select <ID>
LSTNR> select 4
[*] Connected to session 4
Background a session with background or CTRL+C
background
[*] Backgrounding session.
LSTNR>
Kill an individual session die
die
[*] Sending 'die' to session 1
To kill individual sessions
LSTNR> kill 1
[*] Client 1 terminated.
LSTNR WILL NOT CLOSE WITH CTRL+C
LSTNR>
[*] Use 'background' to leave a session.
[*] Use 'exit' to shut down the LSTNR cleanly.
To kill LSTNR> and all connections, type exit
LSTNR> exit
- If a session hangs, press 'CTRL+C' then type 'background'. Reconnect to the session.
- If commands stop working all together, reconnect to the session and run
die, then re-run the reverse shell from the client machine.