#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define DEF_STR_PORT 1
#define DEF_STP_PORT 1024
#define OXO 1
struct sockaddr_in addr;
struct hostent *rh;
struct servent *rp;
int sock,i;
int str_ptr, stp_ptr;
int Usage(char *ARG);
int CONNECTION(int port);
int main(int argc, char *argv[])
{
if (argc != 4)
Usage(argv[0]);
str_ptr = atoi(argv[2]);
stp_ptr = atoi(argv[3]);
if (strcmp(argv[2],"-")==0 &&
strcmp(argv[3],"-")==0){
str_ptr = DEF_STR_PORT;
stp_ptr = DEF_STP_PORT;
}
if ( str_ptr > stp_ptr){
fprintf(stderr,"DetecT ErroR !!! On PortS,
Can't Be Greater
Than
Usage(argv[0]);
exit(OXO);
}
if ((rh=gethostbyname(argv[1])) == NULL){
fprintf(stderr,"Can't Resolve Host %s
.-\n",argv[1]);
Usage(argv[0]);
exit(OXO);
}
printf("ScanninG Host %s From %d TcP Port To %d
.-\n",argv[1],str_ptr,stp_ptr);
for (i=str_ptr; i <= stp_ptr; i++)
{
if (CONNECTION(i)==0)
{
rp=getservbyport(htons(i),"tcp");
printf("Port %d Is Open !!!
Jangan digunain untuk hal-hal yang merugikan orang lain..!!