1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| <?php
$fp = file("adresse.txt");
foreach($fp as $line)
{
$res = preg_match_all(
"#[0-9]{5,}\.html#i",
$line,
$matches
);
if ($res)
{
foreach(array_unique($matches[0]) as $res)
{
echo "Extraction : ", $res, "\n <br>";
$text = file_get_contents("http://www.xxxxxx.com/load_elite_$res");
// extraction ip
$pattern = preg_match_all(
"#[0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3}</td><td>[0-9]{0,5}#i",
$pattern,
$text,
$match2
);
if ($pattern)
{
foreach($match2[0] as $resultat)
{
include('../dbconnect.php');
list($ip, $port) = split("</td><td>", $resultat);
$insertBase = mysql_query("INSERT IGNORE INTO listeIp (Ipadress, port, InsertDate) VALUES ('$ip', '$port', now())") or die ('Erreur
SQL...veuillez contacter l\'administrateur'.mysql_error());
echo "Extraction : ", $resultat, "\n <br>";
echo "dont l ip est: ", $ip, "\n";
echo "et le port : ", $port, "\n\n <br><br>";
}
}
}
}
}
?> |
Partager