[web]-代码审计-就这么直接

打开页面就是一个输入框,非sql注入

查看页面源代码,发现有一个hint.php,访问后看到源码,但是有随机种子,根据时间不同随机值是变化的。time()输出时间戳,如果在短时间内访问,就会固定这个种子。

<?php
$key = "********";
srand(time()); 
     
$a = rand(0,100); 
$b = rand(0,100); 
$c = rand(0,100); 
$d = rand(0,100); 
$e = rand(0,100);

$result = ((($a - $b)/$c)+$d) * $e;
$result = md5($key.$result.$key);
show_source(__FILE__);  
?>

回到首页随意输入Md5值,查看源码: b872fba1e81f2fa869ebc536ffbc3a52

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>答案就在这儿</title>
</head>
答案错误</br>emmm我觉得答案是啥呢?<!--94390a7169798b0731d142baddbe6681-->

可以写程序快速提交md5,根据返回的Md5值快速提交

import requests
import re

url='http://ip/flag.php'
data = {'answer':'32c4e35f76a92617d3849dca494bc9a5'}
resp = requests.post(url=url,data=data)
#print(resp.text)
ll = re.findall(r'<!--[a-z0-9]+-->',resp.text)
l0=re.findall(r'[a-z0-9]+',ll[0])
data = {'answer':l0[0]}
resp = requests.post(url=url,data=data)
print(resp.text)

返回结果:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>答案就在这儿</title>
</head>
flag{ef58f0b1e9437b4451248fb3f239622b}

相关推荐

  1. Web应用代码自动化审计浅谈

    2024-07-13 02:56:01       57 阅读
  2. 代码审计web安全-第四章作业

    2024-07-13 02:56:01       36 阅读
  3. 代码审计web安全:第一章作业

    2024-07-13 02:56:01       33 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-13 02:56:01       66 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-13 02:56:01       70 阅读
  3. 在Django里面运行非项目文件

    2024-07-13 02:56:01       57 阅读
  4. Python语言-面向对象

    2024-07-13 02:56:01       68 阅读

热门阅读

  1. 关于QT实现绘图库的技术栈考虑

    2024-07-13 02:56:01       19 阅读
  2. 使用Python绘制百分比堆积条形图

    2024-07-13 02:56:01       23 阅读
  3. How to Use shred to Erase a Drive or File in Fedora

    2024-07-13 02:56:01       22 阅读
  4. Postman接口测试工具详解

    2024-07-13 02:56:01       19 阅读
  5. 【题解】二分 | [USACO 2009 Dec S]Music Notes

    2024-07-13 02:56:01       19 阅读
  6. 如何在工作中"开悟"?

    2024-07-13 02:56:01       25 阅读
  7. 53.处理cpu的异常

    2024-07-13 02:56:01       21 阅读
  8. 如何在Linux系统下安装Anaconda

    2024-07-13 02:56:01       21 阅读
  9. LeetCode 1351, 1, 208

    2024-07-13 02:56:01       22 阅读