Modifier une ip (socket) [PHP]

Résolu
noobiz Messages postés 616 Date d'inscription   Statut Membre Dernière intervention   -  
 Korigan -
Plop ^^
php:
Voila je cherche un moyen d'envoyer une socket à un site, provenant d'une ip "bidon". Est ce possible?

J'ai deja fait un script mais il ne marche pas :s

<?php


function post_v2($host,$query,$referer,$agent,$forward){
$path=explode('/',$host);
$host=$path[0];
unset($path[0]);
$path='/'.(implode('/',$path));
echo "<hr>Envoie d'une requete...<br>";
$post="POST $path HTTP/1.1\r\nHost: $host\r\nUser-Agent: $agent\r\nX-Forwarded-For: $forward\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-length: ".strlen($query)."\r\nConnection: close\r\n\r\n$query";
str_replace('#','',$post);
echo "<br>Post: '".$post."'<br>";
$h=fsockopen($host,80);
fwrite($h,$post);
for($a=0,$r='';!$a;){
$b=fread($h,8192);
$r.=$b;
$a=(($b=='')?1:0);
}
fclose($h);
return $r;
}

$nb=$_GET['nb'];

for($id_shoot=0;$id_shoot<$nb;$id_shoot++){
$rand1=rand(1,254);
$rand2=rand(1,254);
$rand3=rand(1,254);
$rand4=rand(1,254);
$forward=$rand1.".".$rand2.".".$rand3.".".$rand4;
$referer="";
$cookie="";
$agent="Nav ".$id_shoot;
$query="?zz=pp";
$r=post_v2("url",$query,"",$agent,$forward);
}
?>



Pourquoi ne marche il pas? Existe il un script qui puisse me permettre de faire ce que j'ai decris ci dessus?

Merci d'avance,

Ps En aucun cas le script sera utilisé pour du spoofing, trucage de votes, etc

2 réponses

Korigan
 
Ce n'est pas ton script noobiz, et tu le sais ;)

Cordialement,
Korigan
1
kilian Messages postés 8732 Date d'inscription   Statut Modérateur Dernière intervention   1 526
 
Salut,

Voila je cherche un moyen d'envoyer une socket à un site, provenant d'une ip "bidon". Est ce possible?

Non impossible.
0