|
|
|
|
|
|
|
|
|
|
|
|
|
3206, 5/161 |
|
hipro | |||||||
ÀÌ ÇÁ·Î±×·¥À» ½ÇÇàÇؼ ³ª¿À´Â ±ÛÀ» ÅؽºÆ®·Î ÀúÀåÇÏ°í ½Í½À´Ï´Ù. | |||||||
http://www.hackerschool.org/HS_Boards/zboard.php?id=QNA_programming&no=3390 [º¹»ç]
Hit : 2756 Date : 2012/04/11 12:07
|
|||||||
ralehgus123 | #include<stdio.h> #include<Windows.h> int main() { char cmd[40]; int x; FILE * fp=fopen("test.txt","w"); // test.txt¶ó´Â ÆÄÀÏ »ý¼º for(x=1;x<=255;x++) { sprintf(cmd,"ping -c 1 192.168.1.%d | grep ttl ",x); fwrite(cmd,sizeof(char),1,fp); // cmdÀÇ ³»¿ëÀ» ÆÄÀÏ¿¡ ÀÔ·Â system(cmd); } } |
2012/04/11 | |
cd80 | [root@leaveret /tmp]$ cat d.c #include<stdio.h> int main() { char cmd[40]; int x; for(x=1;x<=255;x++) { sprintf(cmd,"ping 192.168.1.%d -c 1 | grep ttl",x); system(cmd); } } [root@leaveret /tmp]$ gcc -o d d.c [root@leaveret /tmp]$ ./d 1>result.txt |
2012/04/11 | |
cd80 | [root@leaveret /tmp]$ cat result.txt 64 bytes from 192.168.1.1: icmp_seq=0 ttl=128 time=4.9 ms 64 bytes from 192.168.1.101: icmp_seq=0 ttl=128 time=0.6 ms 64 bytes from 192.168.1.109: icmp_seq=0 ttl=128 time=4.9 ms [root@leaveret /tmp]$ |
2012/04/11 | |
|
|