calebstewart / pwncat

Fancy reverse and bind shell handler
https://pwncat.readthedocs.io
MIT License
2.63k stars 258 forks source link

[BUG] Running scripts immediately after uploading to target system (linux) #117

Closed 3m0W33D closed 3 years ago

3m0W33D commented 3 years ago

Describe the bug I am uploading linpeas.sh to the target system via upload. After successfully uploading, Ctrl+D does not give me my shell but instead hangs or shows the output of linpeas.sh

Describe the target system This https://tryhackme.com/room/wekorra room. Linux system presumably Ubuntu.

To Reproduce Steps to reproduce the behavior:

  1. Getting a reverse shell
  2. Upload linpeas to remote machine upload /home/kali/tools/peas/linPEAS/linpeas.sh
  3. Upload is successful
  4. Ctrl+D either hangs or starts running linpeas.sh immediately
  5. After disconnecting and reconnecting linpeas does not show up in the uploaded directory

Expected behavior Linpeas.sh should have been upload to the current directory.

(remote) www-data@osboxes:/tmp$ 
(local) pwncat$ upload /home/kali/tools/peas/linPEAS/linpeas.sh
./linpeas.sh ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100.0% • 342.9/342.9 KB • ? • 0:00:00
[05:34:44] uploaded 334.83KiB in 1.39 seconds                                                                                                                                                                                     upload.py:87
(local) pwncat$
calebstewart commented 3 years ago

I can confirm something weird is going on. I'm looking into it. When I try, it uploads part of the file, and then hangs (on the same TryHackMe machine). I'll let you know when I find the culprit. Sorry it didn't work for you! :(