Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Linux CÓïÑÔдµÄ³¬¼¶¼òµ¥¶Ë¿ÚɨÃèÆ÷

 Õâ¸ö±¾À´ÒÔǰҲд¹ýµÄ£¬½ñÌìÎÞÁĸ´Ï°Ï ÔÙдһ±é¡£¼òµ¥µÄÒ»ËúºýÍ¿£¬Ð´µÄ²»Õ¦µØ´ó¼Ò¼ûÁÂŶ£¡ÓпÕÔÙ¼ÓÇ¿ ºÙºÙ£¡
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <time.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <netdb.h>
void msg()
{
printf("EP:scan ip startport endport\nEP:scan ip 127.0.0.1 20 2009\n");
}
int main(int argc,char** argv)
{
char *ip;
int startport,endport,sockfd,i;
struct sockaddr_in to;
float costtime;
clock_t start,end;
if(4!=argc)
{
msg();
return 0;
}
ip=argv[1];
startport=atoi(argv[2]);
endport=atoi(argv[3]);
if(startport<1 || endport>65535 || endport<startport)
{
printf("¶Ë¿Ú·¶Î§³ö´í\n");
return 0;
}
else
printf("IP:%s %d-%d\n",ip,startport,endport);
to.sin_family=AF_INET;
to.sin_addr.s_addr=inet_addr(ip);
start=clock();
for(i=startport;i<=endport;i++)
{
sockfd=socket(AF_INET,SOCK_STREAM,0);
to.sin_port=htons(i);
if(connect(sockfd,(struct sockaddr *)&to,sizeof(struct sockaddr))==0)
{
printf("%s %d\n",ip,i);
close(to);
}
}
end=clock();
costtime=(float)(end-start)/CLOCKS_PER_SEC;
printf("ÓÃʱ:%fÃë\n",costtime);
return 0;
}


Ïà¹ØÎĵµ£º

linux¶àÏß³Ìѧϰ(ËÄ)——ÐźÅÁ¿Ï߳̿ØÖÆ

 ÔÚÉÏһƪÎÄÕÂÖУ¬½²ÊöÁËÏß³ÌÖл¥³âËøµÄʹÓ㬴ﵽ¶Ô¹²Ïí×ÊÔ´»¥³âʹÓᣳýÁËʹÓû¥³âËø£¬ÐźÅÁ¿£¬Ò²¾ÍÊDzÙ×÷ϵͳÖÐËùÌáµ½µÄPVÔ­ÓÄÜ´ïµ½»¥³âºÍͬ²½µÄЧ¹û£¬Õâ¾ÍÊǽñÌìÎÒÃÇËùÒª½²ÊöµÄÐźÅÁ¿Ï߳̿ØÖÆ¡£
PVÔ­ÓïÊǶÔÕûÊý¼ÆÊýÆ÷ÐźÅÁ¿semµÄ²Ù×÷£¬Ò»´ÎP²Ù×÷¿Éʹsem¼õÒ»£¬¶øÒ»´ÎV²Ù×÷¿ÉÊÇsem¼ÓÒ»¡£½ø³Ì£¨»òỊ̈߳©¸ù¾ÝÐźÅÁ ......

LinuxÍøÂç»ù±¾ÍøÂçÅäÖÃ

 ÍøÂçÐÅÏ¢²é¿´
²é¿´Íø·½Ó¿ÚÐÅÏ¢
1£®Á˽âlinuxÖеÄÍøÂç½Ó¿ÚÉ豸
$/sbin/ifconfig                               ²é¿´ËùÓлÍøÂç½Ó¿ÚÐÅÏ¢£¬ÆäÖаüÀ¨Ò»¸ölo»·»Ø¶Ë¿Ú¡£
2£®²é¿´Ö¸¶¨ÍøÂç½Ó¿ÚµÄÐÅÏ¢
$/sbin/ ......

linux¶àÏß³Ìѧϰ£¨Î壩

 1. Ïà¹Øº¯Êý                                               & ......

Linux ´´½¨Îļþϵͳ¼°¹ÒÔØÎļþϵͳÁ÷³ÌÏê½â

 ×÷Õߣº±±ÄÏÄϱ±
À´×Ô£º LinuxSir.Org
ÕªÒª£º±¾ÎĶÔÐÂÔöÓ²ÅÌ£¬ÇиîÓ²ÅÌ£¬´´½¨Ó²ÅÌ·ÖÇø£¬ÎªÓ²ÅÌ·ÖÇø´´½¨Îļþϵͳ£¬ÒÔ¼°¼ÓÔØÎļþϵͳµÄÁ÷³Ì×ö×ܽáÐÔÂÛÊö£»Ö÷ÒªÊÇΪ³õѧÕßŪÇå³þÕâÒ»²Ù×÷¹ý³Ì£»±¾ÎÄ
Éæ¼°fdisk¡¢mkfs¡¢mount ... ... µÈ¹¤¾ß£»¶Ô/etc/fstab ½øÐÐÁ˽â˵£»»¹ÓдÅÅÌɨÃ蹤¾ßfsck µÈ½éÉÜ£»
++++++++++++++++ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ