...:::Mesohu-Ks:::...
Pershendetje vizitor i nderuar...
Me sa duket, ju nuk jeni identifikuar akoma ne faqen tone, ndaj po ju paraqitet ky mesazh per tju kujtuar se ju mund te identifikoheni qe te merrni pjese ne
diskutimet dhe temat e shumta te forumit tone.

- Ne qofte se ende nuk keni nje Llogari personale ne forumin ton, mund ta hapni nje te tille duke u Regjistruar
-Regjistrimi eshte falas dhe ju merr koh maksimumi 1 min...

-Gjithsesi ju falenderojme shume, per kohen qe fute ne dispozicionper te n'a vizituar ne faqen tone.

Me Respekt dhe Kenaqesi:
Staffi i Forumit : Mesohu-ks
...:::Mesohu-Ks:::...
Pershendetje vizitor i nderuar...
Me sa duket, ju nuk jeni identifikuar akoma ne faqen tone, ndaj po ju paraqitet ky mesazh per tju kujtuar se ju mund te identifikoheni qe te merrni pjese ne
diskutimet dhe temat e shumta te forumit tone.

- Ne qofte se ende nuk keni nje Llogari personale ne forumin ton, mund ta hapni nje te tille duke u Regjistruar
-Regjistrimi eshte falas dhe ju merr koh maksimumi 1 min...

-Gjithsesi ju falenderojme shume, per kohen qe fute ne dispozicionper te n'a vizituar ne faqen tone.

Me Respekt dhe Kenaqesi:
Staffi i Forumit : Mesohu-ks
...:::Mesohu-Ks:::...
Would you like to react to this message? Create an account in a few clicks or log in to continue.

...:::Mesohu-Ks:::...

...:::Mesohu-Ks:::...
 
ForumPortalKërkoLatest imagesRegjistrohuidentifikimi

 

 Porti Scanner ne C++

Shko poshtë 
AutoriMesazh
TRo0PiX
Administrator
Administrator
TRo0PiX


Numri i postimeve : 152
Join date : 21/04/2009

Porti Scanner ne C++ Empty
MesazhTitulli: Porti Scanner ne C++   Porti Scanner ne C++ I_icon_minitimeTue May 12, 2009 4:23 pm

Kodi:
#include
#include
#include
#include
#include

int main(int argc,char *argv[])
{
int sock, port;
struct sockaddr_in host;
struct hostent *server;
if(argc != 2){
printf("Keni 0c\''s port scanner\\nUsage: %s [host address]\\n",argv[0]);
return 1;
}
if((sock = socket(AF_INET,SOCK_STREAM,0)) == -1){
perror("Gabim ne krijimin e socket-it");
return 1;
}
if((server=gethostbyname(argv[1])) == NULL){
perror("Gabin ne host");
return 1;
}
for(port = 0; port <= 65535; port++){
host.sin_family = AF_INET;
host.sin_port = htons(port);
host.sin_addr = *((struct in_addr *)server->h_addr);
if(connect(sock,(struct sockaddr *)&host,sizeof(host)) != -1){
printf("Porti %d eshte i hapur ",port);
continue;
}
}
return 0;
}
Mbrapsht në krye Shko poshtë
 
Porti Scanner ne C++
Mbrapsht në krye 
Faqja 1 e 1

Drejtat e ktij Forumit:Ju nuk mund ti përgjigjeni temave të këtij forumi
...:::Mesohu-Ks:::... :: Gjuhet Programuese :: C / C++-
Kërce tek: