CTF-35解题思路

Track-子羽   ·   发表于 2021-11-22 17:34:26   ·   CTF&WP专版

源码分析

  1. <h3>挑战VIP会员的第三天<h3/>
  2. <?php
  3. error_reporting(0);
  4. include('flag.php');
  5. if(isset($_GET['token'])){
  6. $token = md5($_GET['token']);
  7. if(substr($token, 1,1)===substr($token, 14,1) && substr($token, 14,1) ===substr($token, 17,1)){
  8. if((intval(substr($token, 1,1))+intval(substr($token, 14,1))+substr($token, 17,1))/substr($token, 1,1)===intval(substr($token, 31,1))){
  9. echo $flag;
  10. }
  11. }
  12. }else{
  13. echo 'you no VIP !'
  14. highlight_file(__FILE__);
  15. }
  16. ?>

爆破,可以知道,第2位,第15位,第18位是一样的,并且为数字,第32位为3,

脚本:

  1. import hashlib
  2. for i in range(1, 1000000000000000):
  3. s = hashlib.md5(str(i).encode()).hexdigest()
  4. if s[1]==s[14] and s[14]==s[17] and s[31].isdigit() and s[31]=='3':
  5. print(i,s)
  6. break
  7. //运行结果
  8. 422 f85454e8279be180185cac7d243c5eb3

payload:

  1. ?token=422

打赏我,让我更有动力~

0 Reply   |  Until 17天前 | 37 View
LoginCan Publish Content
返回顶部 投诉反馈

© 2016 - 2021 掌控者 All Rights Reserved.