CTFHUB 2021-第五空间 yet_another_mysql_injection 源码如下: <?phpinclude_once("lib.php");function alertMes($mes,$url){die("<script>alert('{$mes}');location.href='{$url}';</script>");}function checkSql($s) {if(preg_match
[第五空间 2021]yet_another_mysql_injectionF12查看源代码发现 ?source提示,<?php include_once("lib.php"); function alertMes($mes,$url){ die("alert('{$mes}');location.href='{$url}';"); }function checkSql($s) {if(preg_match("/...
实质上就是返回的值和输入值相同,对于这种输出自己的源代码的程序有一个名称,Qunie 看一个典型的Qunie的构造过程 首先看mysql的replace函数 REPLACE(str,old_string,new_string); 就是对字符串进行搜索替换 尝试构造字符串S REPLACE('A',B,'A') 而其中的A为原字符串: REPLACE("B",B,"B") S即为 REPLACE...
PHP mysqli_query() 函数 :执行某个针对数据库的查询。语法:mysqli_query( connection(必需。规定要使用的 MySQL 连接。),query(必需,规定查询字符串,即查询语句。),resultmode); 这里则是用$sql作为条件去查询数据库内容, 然后: 如果你输入的password与数据库中的匹配,则输出flag。
[第五空间2021]yet_another_mysql_injection <!-- /?source --> 根据提⽰访问/?source得到后端代码 <?php include_once("lib.php");function alertMes($mes,$url){ die("alert('{$mes}');location.href='{$url}';");} function checkSql($s) { if(preg_match("/regexp|between|...
PHP mysqli_query() 函数 :执行某个针对数据库的查询。语法:mysqli_query( connection(必需。规定要使用的 MySQL 连接。),query(必需,规定查询字符串,即查询语句。),resultmode); 这里则是用$sql作为条件去查询数据库内容, 然后: 如果你输入的password与数据库中的匹配,则输出flag。
(left + right) // 2 if (mid == 32) : break res += chr(mid) print(res) if __name__ == "__main__" : # data = {"username":"admin","password":"'/**/or/**/1#"} # print(data) # resp = requests.post(url = url, data = data) # print(resp.text) SQL_injection(...
[第五空间 2021]yet_another_mysql_injection 随便输入进去,发现只有账号是admin可以进入 使用弱密码admin admin,报错为hacker 就没啥办法了,想着F12看一下源码 发现有一个source,打开看看 可以发现username是固定的admin,password需要直接手动输入 这时就不知道咋整了,上网搜了一下...
$row= mysqli_fetch_array($user_result); if(!$row) { alertMes("something wrong",'index.php'); } if($row['password'] ===$password) {//这个是关键 die($FLAG); }else{ alertMes("wrong password",'index.php'); } } if(isset($_GET['source'])){ ...