View Single Post

 
Old 06-23-2007, 11:46 AM
Chad <b>Offline</b>
[Administrator]
 
Join Date: May 2007
Posts: 383
Quote:
Originally Posted by mads16 View Post
I lied at youtube :P (Mads18)
It didn't work perfectly after all *emberassed*.

I added this: curl_login('http://www.root.no/forum/index.php?act=Login&CODE=01','referer=http%3A%2F%2Fwww.root.no%2Fforum %2Findex.php%3Fact%3DLogin%26CODE%3D00&UserName=test&PassWord=test&CookieDate=1','','off')

And didn't change anything on this:
function curl_login($url,$data,$proxy,$proxystatus){

And I get this error: Parse error: syntax error, unexpected T_FUNCTION in C:\Programfiler\xampp\htdocs\Hacking\Root.no attack - test.php on line 5


PS: I checked the script in the very start without editing anything, and it was all blank; as if everything was working correctly.
you forgot to end your line, and you need to use the curl grab page to get the contents of a blocked page after logging in.
PHP Code:
<?
curl_login
('http://www.root.no/forum/index.php?act=Login&CODE=01','UserName=test&PassWord=test&CookieDate=1','','off');
echo 
curl_grab_page('http://www.root.no/forum/index.php','','off');

function 
curl_login($url,$data,$proxy,$proxystatus){
    
$fp fopen("cookie.txt""w");
    
fclose($fp);
    
$login curl_init();
    
curl_setopt($loginCURLOPT_COOKIEJAR"cookie.txt");
    
curl_setopt($loginCURLOPT_COOKIEFILE"cookie.txt");
    
curl_setopt($loginCURLOPT_USERAGENT"Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
    
curl_setopt($loginCURLOPT_TIMEOUT40);
    
curl_setopt($loginCURLOPT_RETURNTRANSFERTRUE);
    if (
$proxystatus == 'on') {
        
curl_setopt($loginCURLOPT_SSL_VERIFYHOSTFALSE);
        
curl_setopt($loginCURLOPT_HTTPPROXYTUNNELTRUE);
        
curl_setopt($loginCURLOPT_PROXY$proxy);
    }
    
curl_setopt($loginCURLOPT_URL$url);
    
curl_setopt($loginCURLOPT_HEADERTRUE);
    
curl_setopt($loginCURLOPT_USERAGENT$_SERVER['HTTP_USER_AGENT']);
    
curl_setopt($loginCURLOPT_FOLLOWLOCATIONTRUE);
    
curl_setopt($loginCURLOPT_POSTTRUE);
    
curl_setopt($loginCURLOPT_POSTFIELDS$data);
    
ob_start();      // prevent any output
    
return curl_exec ($login); // execute the curl command
    
ob_end_clean();  // stop preventing output
    
curl_close ($login);
    unset(
$login);    
}                   

function 
curl_grab_page($site,$proxy,$proxystatus){
    
$ch curl_init();
    
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
    if (
$proxystatus == 'on') {
        
curl_setopt($chCURLOPT_SSL_VERIFYHOSTFALSE);
        
curl_setopt($chCURLOPT_HTTPPROXYTUNNELTRUE);
        
curl_setopt($chCURLOPT_PROXY$proxy);
    }
    
curl_setopt($chCURLOPT_COOKIEFILE"cookie.txt");
    
curl_setopt($chCURLOPT_USERAGENT"Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
    
curl_setopt($chCURLOPT_URL$site);
    
ob_start();      // prevent any output
    
return curl_exec ($ch); // execute the curl command
    
ob_end_clean();  // stop preventing output
    
curl_close ($ch);

?>
Reply With Quote