".htmlspecialchars($res).""); } write("[+] There. All done."); display_form(); _exit(); # --------------------------------------------------------- } // main() function getTargets($sourceURI) { $src = http_req($sourceURI); preg_match_all("/]+href=.(http:\/\/[^'\"]+)/i", $src, $matches); return array_unique($matches[1]); } function http_req($uri, $method = "GET", $add_header = '', $payload = '') { preg_match("/^http:\/\/([^\/]+)(.*)$/", $uri, $matches); $hostname = $matches[1]; $script = $matches[2]; if(empty($hostname)) { write("[!] Parsing of URL $uri failed."); return; } $fp = fsockopen($hostname, 80, $errno, $errstr, 30); if(!$fp) { write("[!] Connection to ".htmlspecialchars($hostname)." failed: $errstr ($errno)"); return; } fwrite($fp, "$method $script HTTP/1.1 Host: $hostname User-Agent: kapsobor pingor $add_header $payload "); stream_set_timeout($fp, 1); $res = stream_get_contents($fp); fclose($fp); return $res; } function ping($pingbackserver, $sourceURI, $targetURI) { $payload = <<
Source URL has to be in the form of http://host.name/path/to/blog/post.html. It is the URL to your blog posting. _All_ absolute links
therein will tried to be pinged.