Jump to content
Fórum Script Brasil
  • 0

Gerar Cookie pego de outro site.


Guest --Will --

Question

Guest --Will --

Ola, galera eu fiz um codigo... Ele envia as senhas para o orkut e recebe o cookie de volta...

Bem mas não permanece logado alguém pode ajudar para ele permanecer?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
Guest --Will --
você está querendo fazer o mesmo que o gadget da barra lateral do windows vista em que você digita o usuário e senha e ele loga pra você ?

Acredito que não. vou passar o codigo para que você possa entender melhor.

<?php

header("Content-Type: text/plain");

$error = NULL;
$user = '';
$pass = '';


// PHP4 / PHP5
function sock($host,$port) {
  global $error;
  if (function_exists('stream_socket_client')) { $handle =   @stream_socket_client($host.':'.$port,&$e0,&$e1); }
  elseif (function_exists('fsockopen')) { $handle = @fsockopen($host,$port,&$e0,&$e1); }
  if (!$handle || $e0 || $e1) { $error[0]= $e0; $error[1] = $e1; return false; }
  return $handle;
}

if ( false === ($handle = sock('www.google.com',80)) ) { print 'Error: '.$error[0].'# '.$error[1]."\n"; exit; }



@fwrite($handle, "GET [url=https://www.google.com/accounts/ClientLogin?service=orkut&Email=".urlencode($user)."&Passwd=".urlencode($pass)."]https://www.google.com/accounts/ClientLogin...36;pass)."[/url] HTTP/1.1\r\n\r\n\r\n");

while (!@feof($handle)) {
  if ( @preg_match('/^auth=([^\n\r]+)/i', @fgets($handle), $auth) ) {
    fclose($handle);
    unset($handle);
    break;
 }
}

if (!$auth[1]) { print "Error ao pegar o valor 'auth'\n"; exit; }

if ( false === ($handle = sock('www.orkut.com',80)) ) { print 'Error: '.$error[0].'# '.$error[1]."\n"; exit; }


@fwrite($handle, "GET [url=http://www.orkut.com/RedirLogin.aspx?auth=".$auth]http://www.orkut.com/RedirLogin.aspx?auth=".$auth[/url][1]." HTTP/1.1\r\n\r\n");

while (!@feof($handle)) {
  if ( @preg_match('/^set-cookie:\sorkut_state=([^;]+)/i', @fgets($handle), $cookie) ) {
    fclose($handle);
    unset($handle);
    break;
  }
}
if ($cookie[1])
{
$orkut_coo = $cookie[1];
setcookie("orkut_state",$orkut_coo,$missing_expire_parameter, '/');
}
if ($cookie[1])
{
echo $cookie[1];
}
if (!$cookie[1]) 
{ 
print "Error ao pegar o valor do cookie"; 
exit; 
}

?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.1k
    • Total Posts
      651.8k
×
×
  • Create New...