PHP port sniffer-you can specify the website and Port
Source: Internet
Author: User
<?
// PHP port sniffer-you can specify the website and Port
// Returns the sniffing result
Function http_request ($ server, $ port ){
$ DATA = "";
$ Query = "head/HTTP/1.0 ";
$ Fp = fsockopen ($ server, $ port );
If ($ FP ){
Fputs ($ FP, $ query. "rnn ");
While (! Feof ($ FP )){
$ Data. = fread ($ FP, 1000 );
}
Fclose ($ FP );
}
Return $ data;
}
?>
<Form>
<Input type = hidden name = action value = query>
Site: <input type = text name = server value = "<? Echo $ server?> "> <Small> (ie: www.wackowoh.com) </small> <br>
Port: <input type = text name = port value = "80" size = "5" maxlength = "5"> <br>
<Input type = submit value = "OK">
</Form>
<?
If ($ action = "query "){
$ DATA = http_request ($ server, $ port );
Echo "connected to $ server on port $ port. <p> ";
Echo "output: <p> <PRE> $ data </PRE> <p> ";
}
?>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.