http://www.hackerschool.org/HS_Boards/zboard.php?id=QNA_linux&no=1847 [º¹»ç]
>sniffit¼³Ä¡ ÇÒ¶§ °è¼Ó ¿À·ù°¡ ¶ß³×¿ä.
>0.3.7º£Å¸ ¹öÀüÀº. confiure¸¦ ¸¶Ä¡°í make¸¦ ½ÇÇà½ÃÅ°¸é
>[root@localhost sniffit.0.3.7.beta]# make
>gcc -w -O2 -c sn_packets.c -I./libpcap -L./libpcap -DHAVE_LIBNCURSES=1 -DHAVE_NCURSES_H=1 -DHAVE_SHMGET=1
>-DHAVE_ATEXIT=1 -DSIZEOF_UNSIGNED_SHORT_INT=2 -DSIZEOF_UNSIGNED_LONG_INT=4 -DUSE_32_LONG_INT=1 -DLINUX=1
>In file included from sn_packets.c:6:
>sn_structs.h:70: error: two or more data types in declaration specifiers
>make: *** [sn_packets.o] ¿À·ù 1
>ÀÌ·¸°Ô ³ª¿À°í..
0.3.7-beta ¹öÀüÀ» ´Ù¿î·Îµå ¹Þ¾Æ¼ ¼Ò½º¸¦ ºÃ½À´Ï´Ù.
sn_structs.h ÆÄÀÏÀÇ 70¹ø° ¶óÀο¡´Â ´ÙÀ½°ú °°ÀÌ µÇ¾î Àִµ¥¿ä..
_32_bit short source_port, destination_port;
sn_defines.h ÆÄÀÏÀÇ 7¹ø ¶óÀκÎÅÍ typedef·Î _32_bit ŸÀÔÀ» Á¤ÀÇÇÏ´Â ºÎºÐÀÌ ÀÖ½À´Ï´Ù.
ÀÌ ºÎºÐÀ» º¸¸é "unsigned long int" ³ª "unsigned int", "unsigned short" ·Î µÇ¾î ÀÖÀ¸¹Ç·Î,
"_32_bit short" ŸÀÔÀ̶õ°Ç, "unsigned long shot" or "unsigned long int short", "unsigned short short" ·Î
ÄÄÆÄÀÏ·¯¿¡¼ ¹ø¿ªµÇ¹Ç·Î À߸øµÈ ŸÀÔÀ̶ó´Â °Ì´Ï´Ù.
±×·¡¼ sn_structs.h ÆÄÀÏÀÇ 70¹ø° ¶óÀο¡¼ "_32_bit" ´ë½Å "unsigned" ¸¦ ³ÖÀ¸¸é ÄÄÆÄÀÏ ÇÏ¸é µÉ °Ì´Ï´Ù.
(port ´Â 2¹ÙÀÌÆ®¸¦ »ç¿ëÇÏ´Â short·Î ÃæºÐÇÏ°í 0ºÎÅÍ ½ÃÀÛÇϹǷΠunsigned :)
>0.3.5 ¹öÀüÀº
>[root@localhost sniffit.0.3.5]# make
>gcc -w -O2 -c sn_packets.c -I./libpcap-0.3 -L./libpcap-0.3 -DHAVE_LIBNCURSES=1 -DHAVE_NCURSES_H=1 -DHAVE_SHMGET=1
>-DHAVE_ATEXIT=1 -DSIZEOF_UNSIGNED_SHORT_INT=2 -DSIZEOF_UNSIGNED_LONG_INT=4 -DLINUX=1
>gcc -w -O2 -c sn_generation.c -I./libpcap-0.3 -L./libpcap-0.3 -DHAVE_LIBNCURSES=1 -DHAVE_NCURSES_H=1 -DHAVE_SHMGET=1
>-DHAVE_ATEXIT=1 -DSIZEOF_UNSIGNED_SHORT_INT=2 -DSIZEOF_UNSIGNED_LONG_INT=4 -DLINUX=1
>gcc -w -O2 -c sn_interface.c -I./libpcap-0.3 -L./libpcap-0.3 -DHAVE_LIBNCURSES=1 -DHAVE_NCURSES_H=1 -DHAVE_SHMGET=1
>-DHAVE_ATEXIT=1 -DSIZEOF_UNSIGNED_SHORT_INT=2 -DSIZEOF_UNSIGNED_LONG_INT=4 -DLINUX=1
>gcc -w -O2 -c sn_cfgfile.c -I./libpcap-0.3 -L./libpcap-0.3 -DHAVE_LIBNCURSES=1 -DHAVE_NCURSES_H=1 -DHAVE_SHMGET=1
>-DHAVE_ATEXIT=1 -DSIZEOF_UNSIGNED_SHORT_INT=2 -DSIZEOF_UNSIGNED_LONG_INT=4 -DLINUX=1
>gcc -w -O2 -c sn_logfile.c -I./libpcap-0.3 -L./libpcap-0.3 -DHAVE_LIBNCURSES=1 -DHAVE_NCURSES_H=1 -DHAVE_SHMGET=1
>-DHAVE_ATEXIT=1 -DSIZEOF_UNSIGNED_SHORT_INT=2 -DSIZEOF_UNSIGNED_LONG_INT=4 -DLINUX=1
>cd libpcap-0.3; make; cd ..
>make[1]: Entering directory `/root/Desktop/sniffit.0.3.5/libpcap-0.3'
>gcc -O2 -I. -Ilinux-include -DHAVE_MALLOC_H=1 -DHAVE_ETHER_HOSTTON=1 -DHAVE_STRERROR=1 -c ./pcap-linux.c
>./pcap-linux.c: In function ¡®pcap_read¡¯:
>./pcap-linux.c:70: warning: pointer targets in assignment differ in signedness
>./pcap-linux.c:81: warning: pointer targets in passing argument 6 of ¡®recvfrom¡¯ differ in signedness
>gcc -O2 -I. -Ilinux-include -DHAVE_MALLOC_H=1 -DHAVE_ETHER_HOSTTON=1 -DHAVE_STRERROR=1 -c ./pcap.c
>gcc -O2 -I. -Ilinux-include -DHAVE_MALLOC_H=1 -DHAVE_ETHER_HOSTTON=1 -DHAVE_STRERROR=1 -c ./inet.c
>gcc -O2 -I. -Ilinux-include -DHAVE_MALLOC_H=1 -DHAVE_ETHER_HOSTTON=1 -DHAVE_STRERROR=1 -c ./gencode.c
>./gencode.c:82: warning: function definition has qualified void return type
>gcc -O2 -I. -Ilinux-include -DHAVE_MALLOC_H=1 -DHAVE_ETHER_HOSTTON=1 -DHAVE_STRERROR=1 -c ./optimize.c
>gcc -O2 -I. -Ilinux-include -DHAVE_MALLOC_H=1 -DHAVE_ETHER_HOSTTON=1 -DHAVE_STRERROR=1 -c ./nametoaddr.c
>gcc -O2 -I. -Ilinux-include -DHAVE_MALLOC_H=1 -DHAVE_ETHER_HOSTTON=1 -DHAVE_STRERROR=1 -c ./etherent.c
>gcc -O2 -I. -Ilinux-include -DHAVE_MALLOC_H=1 -DHAVE_ETHER_HOSTTON=1 -DHAVE_STRERROR=1 -c ./savefile.c
>gcc -O2 -I. -Ilinux-include -DHAVE_MALLOC_H=1 -DHAVE_ETHER_HOSTTON=1 -DHAVE_STRERROR=1 -c ./bpf_filter.c
>gcc -O2 -I. -Ilinux-include -DHAVE_MALLOC_H=1 -DHAVE_ETHER_HOSTTON=1 -DHAVE_STRERROR=1 -c ./bpf_image.c
>flex -Ppcap_ -t scanner.l > $$.scanner.c; mv $$.scanner.c scanner.c
>bison -y -p pcap_ -d grammar.y
>mv y.tab.c grammar.c
>mv y.tab.h tokdefs.h
>gcc -O2 -I. -Ilinux-include -DHAVE_MALLOC_H=1 -DHAVE_ETHER_HOSTTON=1 -DHAVE_STRERROR=1 -c ./scanner.c
>gcc -O2 -I. -Ilinux-include -DHAVE_MALLOC_H=1 -DHAVE_ETHER_HOSTTON=1 -DHAVE_STRERROR=1 -Dyylval=pcap_lval -c
>grammar.c
>ar rc libpcap.a pcap-linux.o pcap.o inet.o gencode.o optimize.o nametoaddr.o etherent.o savefile.o bpf_filter.o
>bpf_image.o scanner.o grammar.o
>ranlib libpcap.a
>make[1]: Leaving directory `/root/Desktop/sniffit.0.3.5/libpcap-0.3'
>gcc -w -O2 -o sniffit sniffit.0.3.5.c sn_packets.o sn_generation.o sn_interface.o sn_cfgfile.o sn_logfile.o
>-I./libpcap-0.3 -L./libpcap-0.3 -lpcap -lncurses -DHAVE_LIBNCURSES=1 -DHAVE_NCURSES_H=1 -DHAVE_SHMGET=1
>-DHAVE_ATEXIT=1 -DSIZEOF_UNSIGNED_SHORT_INT=2 -DSIZEOF_UNSIGNED_LONG_INT=4 -DLINUX=1
>strip sniffit
>[root@localhost sniffit.0.3.5]# make install
>make: *** Ÿ°Ù `install'¸¦ ¸¸µé ±ÔÄ¢ÀÌ ¾øÀ½. ¸ØÃã.
>ÀÌ·¸°Ô ³ª¿É´Ï´Ù.
>µµ´ëü ¾î´ÀºÎºÐ¿¡¼ ¹®Á¦°¡ ÀÖ´ÂÁö Àß ¸ð¸£°Ú½À´Ï´Ù.
>´äº¯ ºÎŹµå¸³´Ï´Ù.
>
>
0.3.7-beta³ª, 0.3.5³ª MakefileÀ» ¿¾îº¸¸é installÀº ¾ø½À´Ï´Ù.
make ´Â Makefile¿¡ Á¤ÀÇµÈ ´ë·Î ÄÄÆÄÀÏ ÇÕ´Ï´Ù.
ÄÄÆÄÀÏÀÌ ¿Ï·áµÇ¸é sniffit À̶ó´Â ÆÄÀÏÀÌ »ý±â´Âµ¥ ÀÌ°É ±×³É ´Ù¸¥µ¥ º¹»çÇؼ »ç¿ëÇÏ½Ã¸é µË´Ï´Ù. |
Hit : 4608 Date : 2006/03/03 12:02
|