当前位置:网站首页>[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
![]()


边栏推荐
- Visual Studio编辑器 2019:scanf函数返回值被忽略(C4996)报错及解决办法
- gvim命令记录
- 你是这样的volatile,出乎意料
- DTSE Tech Talk丨第2期:1小时深度解读SaaS应用系统设计
- No qualifying bean of type问题解决
- 如何写一份高可读性的软件工程设计文档
- 华为云数据治理生产线DataArts,让“数据'慧'说话”
- 游戏多开检测的几种实现方法及破解方法参考
- [MRCTF2020]Ezaudit
- Paper reading (63): Get To The Point: Summarization with Pointer-Generator Networks
猜你喜欢

How does the new retail saas applet explore the way to break the digital store?

数据库的三大范式

Goland opens file saving and automatically formats

huato hot update environment construction (DLL method hot update C# code)

@Bean注解详解

Minio 入门
![[HarekazeCTF2019]Avatar Uploader 1](/img/2c/6dde7b8d34ba0deb334b4283e1e30e.png)
[HarekazeCTF2019]Avatar Uploader 1

全职做自媒体靠谱吗?

字符串复制、拼接、比较以及分割函数总结(一)

华为云数据治理生产线DataArts,让“数据'慧'说话”
随机推荐
云厂商做生态需要“真连接、真赋能”,用“技术+真金实银”发展伙伴
Login Module Debugging - Getting Started with Software Debugging
23. 请你谈谈关于IO同步、异步、阻塞、非阻塞的区别
vivo announced to extend the product warranty period, the system launched a variety of functional services
onenote use
微信小程序picker滚动选择器使用详解
SwiftUI SQLite教程之带有历史的搜索栏List App (教程含完整代码)
Visual Studio 集成Qt开发环境的一些注意事项
MySQL超详细安装教程 手把手教你安装MySQL到使用MySQL 最简单的MySQL安装方式,这种方式装,卸载也简单
字符串复制、拼接、比较以及分割函数总结(一)
实现web实时消息推送的7种方案
LeetCode167:有序数组两数之和
基于STM32F407使用ADC采集电压实验
深度学习区分不同种类的图片
获得抖音商品详情 API
武汉星起航跨境电商有前景吗?亚马逊的未来趋势如何发展?
data storage
Mirror stand to collect
2022-07-30 Androd 进入深度休眠后把WIFI给关掉,唤醒之后重新打开WIFI
[TypeScript] Introduction, Development Environment Construction, Basic Types