Drako píše:
vl4kn0=> ako moze odosielat cez post, ak nema form?
velmi jednoducho
staci keby odchytil http hlavicku odosielanu na server pomocou nejakeho sniffera a potom by zostavil parametre odosielane funkciou fsockopen
priklad takuto http hlavicku dostanes sniffovanim nejakeho webu pri odosielani formu napr.
Kód:
POST /login.php HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; sk; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.6
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: sk,cs;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://example.com/login.php?sid=blablabla
Cookie: bla bla bla;example_data=bla bla bla;
example_sid=dkashdôklasds5a4d4as64ddas456
Content-Type: application/x-www-form-urlencoded
Content-Length: 78
a ty z toho spravis fciu
Kód:
<?php
$sock = fsockopen("example.com", 80);
fputs($sock,"POST /login.php HTTP/1.1\n");
fputs($sock,"Host: example.com\n");
fputs($sock,"User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; sk; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.6\n");
fputs($sock,"Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\n");
fputs($sock,"Accept-Language: sk,cs;q=0.8,en-us;q=0.5,en;q=0.3\n");
fputs($sock,"Accept-Encoding: gzip,deflate\n");
fputs($sock,"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\n");
fputs($sock,"Keep-Alive: 300\n");
fputs($sock,"Connection: keep-alive\n");
fputs($sock,"Referer: http://example.com/login.php?sid=blablabla\n");
fputs($sock,"Cookie: bla bla bla;example_data=bla bla bla;\n");
example_sid=dkashdôklasds5a4d4as64ddas456\n");
fputs($sock,"Content-Type: application/x-www-form-urlencoded\n");
fputs($sock,"Content-Length: 78\n\n");
fclose($sock);
?>
btw. teraz nehovorim ze je to moc prakticke riesenie. tym som chcel povedat ze sa to da
ale niekedy je to naramne uzitocne a bez toho sa nezaobides