• 11-11-2010, 00:36:31
    #1
    Arkadaşlar sorunumu anlatayım kısaca ;

    Amacım Curl ile vbulletin'e giriş yapıp , konu açmak .

    Fakat yaşadığım problem biraz değişik , curl 'u ilk çalıştırdığımda vbulletine konu açamıyorum hata olarak:

    Your submission could not be processed because you have logged in since the previous page was loaded.

    Please push the back button and reload the previous window.


    Bu gördüğünüz hata mesajını alıyorum , googleda araştırdım vbulletin crsf önlemiymiş.

    Ve curl 'u ikinci defa çalıştırdığımda sorunsuz olarak karşı tarafa konuyu atıyor..

    İlkinde neden atmıyor ve hata mesajı alıyorum çözemedim tam olarak , ama dediğim gibi 2. çalıştırışımda konuları atabiliyorum..

    Ama cookieleri silersem gene ilk çalıştırışımda atamıyorum 2. çalıştırışımda atıyorum , olay cookielerlemi ilgili vbulletinin securitytoken olarak verdiği güvenlik koduylamı ilgili tam anlayamadım , yardımcı olursanız sevinirim..

    Kullandığım kodlarda aşağıda gözüktüğü gibidir , yardımlarınızı bekliyorum ..
    <?php
      $user="x";
      $pass="x";
      $url="http://www.xxxx/";
      $threadf="xxx";
    
      
      $ch = curl_init();
      curl_setopt($ch , CURLOPT_URL , $url);
      curl_setopt($ch , CURLOPT_RETURNTRANSFER , TRUE);
      curl_setopt($ch , CURLOPT_FOLLOWLOCATION , TRUE);
      curl_setopt($ch , CURLOPT_REFERER , "http://www.google.com");
      curl_setopt($ch , CURLOPT_USERAGENT , $_SERVER['HTTP_USERAGENT']);
      curl_setopt($ch , CURLOPT_COOKIEFILE, dirname(__FILE__).'/cookies.txt');
      curl_setopt($ch , CURLOPT_COOKIEJAR, dirname(__FILE__).'/cookies.txt');
      $data=curl_exec($ch);
      
      preg_match('/securitytoken" value="(.*?)"/',$data,$securitytoken);
      curl_setopt($ch , CURLOPT_URL, "".$url."login.php?do=login");
      curl_setopt($ch , CURLOPT_POST , TRUE);
      curl_setopt($ch , CURLOPT_POSTFIELDS, 'cookieuser=1&vb_login_username='.$user.'&vb_login_password='.$pass.'&s=&securitytoken='.$securitytoken[1].'&do=login');
      $data2=curl_exec($ch);  
      
      $subject="selam selam";                
      $message="merhaba merhaba merhaba";
      curl_setopt($ch , CURLOPT_URL , "".$url."newthread.php?do=newthread&f=".$threadf."");
      preg_match('/securitytoken" value="(.*?)"/',$data,$securitytoken);
      curl_setopt($ch , CURLOPT_POST , TRUE);
      curl_setopt($ch , CURLOPT_POSTFIELDS, 'subject='.$subject.'&message='.$message.'&s=&f='.$threadf.'&securitytoken='.$securitytoken[1].'&do=postthread');
      $data3=curl_exec($ch);
      echo $data3;
    
    ?>
  • 11-11-2010, 01:23:29
    #2
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Giriş yaparken sisteme &url=%2Findex.php ekleyin urlye. Böylece giriş yaptıktan sonra sayfaya yönlenmiş olur ve previous page kontolünü geçmiş olursunuz
  • 11-11-2010, 02:07:17
    #3
    <?php
      $user="xxx";
      $pass="xxx";
      $url="xxx";
      $threadf="xxx";
    
      $md5Pass = md5($pass);
        
      $ch = curl_init();
      curl_setopt($ch , CURLOPT_URL , $url);
      curl_setopt($ch , CURLOPT_RETURNTRANSFER , 1);
      curl_setopt($ch , CURLOPT_FOLLOWLOCATION , 1);
      curl_setopt($ch , CURLOPT_REFERER , "http://www.google.com");
      curl_setopt($ch , CURLOPT_USERAGENT , $_SERVER['HTTP_USERAGENT']);
      curl_setopt($ch , CURLOPT_COOKIEFILE, dirname(__FILE__).'/cookies.txt');
      curl_setopt($ch , CURLOPT_COOKIEJAR, dirname(__FILE__).'/cookies.txt');
      $data=curl_exec($ch);    
      
      preg_match('/securitytoken" value="(.*?)"/',$data,$securitytoken);
      curl_setopt($ch , CURLOPT_URL, "".$url."login.php");
      curl_setopt($ch , CURLOPT_POST , TRUE);
      curl_setopt($ch , CURLOPT_POSTFIELDS, 'do=login&url=%2Findex.php&vb_login_md5password='.$md5Pass.'&vb_login_username='.$user.'&cookieuser=1&s=&securitytoken='.$securitytoken[1]);
      $data2=curl_exec($ch);  
      
      $subject="selam selam";                
      $message="merhaba merhaba merhaba";
      curl_setopt($ch , CURLOPT_URL , "".$url."newthread.php?do=newthread&f=".$threadf."");
      preg_match('/securitytoken" value="(.*?)"/',$data,$securitytoken);
      curl_setopt($ch , CURLOPT_POST , TRUE);
      curl_setopt($ch , CURLOPT_POSTFIELDS, 'subject='.$subject.'&message='.$message.'&s=&f='.$threadf.'&securitytoken='.$securitytoken[1].'&do=postthread');
      $data3=curl_exec($ch);
      echo $data3;
    ?>
  • 11-11-2010, 03:34:30
    #4
    İlk bağlantıdan sonra gezilen ilk sayfayı cookie ye atadığımız ( csrf yi aşmak için ) extra 1 bağlantı yapmamız daha gerekiyor

    <?php
      $user="xxx";
      $pass="xxx";
      $url="xxx";
      $threadf="xxx";
    
      $md5Pass = md5($pass);
        
      $ch = curl_init();
      curl_setopt($ch , CURLOPT_URL , $url);
      curl_setopt($ch , CURLOPT_RETURNTRANSFER , 1);
      curl_setopt($ch , CURLOPT_FOLLOWLOCATION , 1);
      curl_setopt($ch,  CURLOPT_MAXREDIRS, 3);
      curl_setopt($ch , CURLOPT_REFERER , "http://www.google.com");
      curl_setopt($ch , CURLOPT_USERAGENT , $_SERVER['HTTP_USERAGENT']);
      curl_setopt($ch , CURLOPT_COOKIEFILE, dirname(__FILE__).'/cookies.txt');
      curl_setopt($ch , CURLOPT_COOKIEJAR, dirname(__FILE__).'/cookies.txt');
      $data=curl_exec($ch);    
      
      preg_match('/securitytoken" value="(.*?)"/',$data,$securitytoken);
      curl_setopt($ch , CURLOPT_URL, "".$url."login.php");
      curl_setopt($ch , CURLOPT_RETURNTRANSFER , 1);
      curl_setopt($ch , CURLOPT_FOLLOWLOCATION , 1);  
      curl_setopt($ch,  CURLOPT_MAXREDIRS, 3);  
      curl_setopt($ch , CURLOPT_POST , TRUE);
      curl_setopt($ch , CURLOPT_POSTFIELDS, 'do=login&url=/forum/serbest-forum/&vb_login_md5password='.$md5Pass.'&vb_login_username='.$user.'&cookieuser=1&s=&securitytoken='.$securitytoken[1]);
      curl_setopt($ch , CURLOPT_COOKIEFILE, dirname(__FILE__).'/cookies.txt');
      curl_setopt($ch , CURLOPT_COOKIEJAR, dirname(__FILE__).'/cookies.txt');  
      $data2=curl_exec($ch);  
      
      $ch = curl_init();
      curl_setopt($ch , CURLOPT_URL , $url);
      curl_setopt($ch , CURLOPT_RETURNTRANSFER , 1);
      curl_setopt($ch , CURLOPT_FOLLOWLOCATION , 1);
      curl_setopt($ch,  CURLOPT_MAXREDIRS, 3);
      curl_setopt($ch , CURLOPT_REFERER , "http://www.google.com");
      curl_setopt($ch , CURLOPT_USERAGENT , $_SERVER['HTTP_USERAGENT']);
      curl_setopt($ch , CURLOPT_COOKIEFILE, dirname(__FILE__).'/cookies.txt');
      curl_setopt($ch , CURLOPT_COOKIEJAR, dirname(__FILE__).'/cookies.txt');
      $data=curl_exec($ch);      
      
      
      $subject="selam selammm";                
      $message="merhaba merhaba merhabaaa";  
      
      curl_setopt($ch , CURLOPT_URL , "".$url."newthread.php?do=newthread&f=".$threadf."");
      preg_match('/securitytoken" value="(.*?)"/',$data,$securitytoken);
      curl_setopt($ch , CURLOPT_POST , TRUE);
      curl_setopt($ch , CURLOPT_POSTFIELDS, 'subject='.$subject.'&message='.$message.'&s=&f='.$threadf.'&securitytoken='.$securitytoken[1].'&do=postthread');
      curl_setopt($ch , CURLOPT_COOKIEFILE, dirname(__FILE__).'/cookies.txt');
      curl_setopt($ch , CURLOPT_COOKIEJAR, dirname(__FILE__).'/cookies.txt');    
      $data3=curl_exec($ch);
      echo $data3;  
    ?>
  • 11-11-2010, 11:52:52
    #5
    Evet hocam son attığın şekilde çalıştırabildim , olayıda anladım yardım için çok teşekkürler , gerçekten çok iyi ilgilendin sağolasın ..

    Arkadaşlar diğer bir sorumda , konuyu postladıktan sonra o konunun linkini alabilirmiyiz ? rapor tutmak için gayet güzel olacak hemde pingletmek açısından vs.. Bu konudada bir yardım veya fikir alabilirsem çok sevinirim...
  • 11-11-2010, 13:56:57
    #6
    AGaRoot adlı üyeden alıntı: mesajı görüntüle
    Evet hocam son attığın şekilde çalıştırabildim , olayıda anladım yardım için çok teşekkürler , gerçekten çok iyi ilgilendin sağolasın ..

    Arkadaşlar diğer bir sorumda , konuyu postladıktan sonra o konunun linkini alabilirmiyiz ? rapor tutmak için gayet güzel olacak hemde pingletmek açısından vs.. Bu konudada bir yardım veya fikir alabilirsem çok sevinirim...
    <?php
      $user="xxx";
      $pass="xxx";
      $url="xxx";
      $threadf="xxx";
    
      $md5Pass = md5($pass);
       
      $ch = curl_init();
      curl_setopt($ch , CURLOPT_URL , $url);
      curl_setopt($ch , CURLOPT_RETURNTRANSFER , 1);
      curl_setopt($ch , CURLOPT_FOLLOWLOCATION , 1);
      curl_setopt($ch,  CURLOPT_MAXREDIRS, 3);
      curl_setopt($ch , CURLOPT_REFERER , "http://www.google.com");
      curl_setopt($ch , CURLOPT_USERAGENT , $_SERVER['HTTP_USERAGENT']);
      curl_setopt($ch , CURLOPT_COOKIEFILE, dirname(__FILE__).'/cookies.txt');
      curl_setopt($ch , CURLOPT_COOKIEJAR, dirname(__FILE__).'/cookies.txt');
      $data=curl_exec($ch);   
     
      preg_match('/securitytoken" value="(.*?)"/',$data,$securitytoken);
      curl_setopt($ch , CURLOPT_URL, "".$url."login.php");
      curl_setopt($ch , CURLOPT_RETURNTRANSFER , 1);
      curl_setopt($ch , CURLOPT_FOLLOWLOCATION , 1); 
      curl_setopt($ch,  CURLOPT_MAXREDIRS, 3); 
      curl_setopt($ch , CURLOPT_POST , TRUE);
      curl_setopt($ch , CURLOPT_POSTFIELDS, 'do=login&url=/forum/serbest-forum/&vb_login_md5password='.$md5Pass.'&vb_login_username='.$user.'&cookieuser=1&s=&securitytoken='.$securitytoken[1]);
      curl_setopt($ch , CURLOPT_COOKIEFILE, dirname(__FILE__).'/cookies.txt');
      curl_setopt($ch , CURLOPT_COOKIEJAR, dirname(__FILE__).'/cookies.txt'); 
      $data2=curl_exec($ch); 
     
      $ch = curl_init();
      curl_setopt($ch , CURLOPT_URL , $url);
      curl_setopt($ch , CURLOPT_RETURNTRANSFER , 1);
      curl_setopt($ch , CURLOPT_FOLLOWLOCATION , 1);
      curl_setopt($ch,  CURLOPT_MAXREDIRS, 3);
      curl_setopt($ch , CURLOPT_REFERER , "http://www.google.com");
      curl_setopt($ch , CURLOPT_USERAGENT , $_SERVER['HTTP_USERAGENT']);
      curl_setopt($ch , CURLOPT_COOKIEFILE, dirname(__FILE__).'/cookies.txt');
      curl_setopt($ch , CURLOPT_COOKIEJAR, dirname(__FILE__).'/cookies.txt');
      $data=curl_exec($ch);     
     
     
      $subject="selam selammmm";               
      $message="merhaba merhaba merhabaaaa"; 
     
      curl_setopt($ch , CURLOPT_URL , "".$url."newthread.php?do=newthread&f=".$threadf."");
      preg_match('/securitytoken" value="(.*?)"/',$data,$securitytoken);
      curl_setopt($ch , CURLOPT_POST , TRUE);
      curl_setopt($ch , CURLOPT_POSTFIELDS, 'subject='.$subject.'&message='.$message.'&s=&f='.$threadf.'&securitytoken='.$securitytoken[1].'&do=postthread');
      curl_setopt($ch , CURLOPT_COOKIEFILE, dirname(__FILE__).'/cookies.txt');
      curl_setopt($ch , CURLOPT_COOKIEJAR, dirname(__FILE__).'/cookies.txt');   
      $data3=curl_exec($ch);
    
      
      $adres=file_get_contents("http://www.xxxxx.com/forum/alt-konu/");
      preg_match_all('@<a href="(.*)" id="(.*)">'.$subject.'</a>@i',$adres,$link);
      echo $link[1][0];  
    ?>
  • 11-11-2010, 15:04:03
    #7
    ScR
    Üyeliği durduruldu
    Curl kapatmayı unutmayın, RAM kullanımınız tavana vurmasın.
    Öyle yapacağınıza ana sayfaya 1 defa uğratın.

    Kodlar bir yerden tanıdık geliyor gibi.
    "&" karakterini göndermek istediğinde mesaj yarıda kesilecek, bilgin olsun.