免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: wojiaohesen

共享:linux arp 欺骗程序 [复制链接]

论坛徽章:
0
发表于 2009-09-15 10:37 |显示全部楼层
楼主写个通过MAC地址找IP的程序吧。。

论坛徽章:
0
发表于 2009-09-15 14:31 |显示全部楼层
./darp ip ?
没有作用

论坛徽章:
0
发表于 2009-09-15 17:41 |显示全部楼层
郁闷,我拿LZ的code交叉编译不过,愁死我了.
mipsel-linux-gcc -Wall -o darp darp.c
In file included from darp.c:9:
/opt/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/sys-include/linux/filter.h:21: error: parse error before "__u16"
/opt/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/sys-include/linux/filter.h:23: error: parse error before "jf"
/opt/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/sys-include/linux/filter.h:24: error: parse error before "k"
In file included from darp.c:16:
/opt/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/sys-include/linux/netlink.h:22: error: parse error before "__u32"
/opt/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/sys-include/linux/netlink.h:28: error: parse error before "__u32"
/opt/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/sys-include/linux/netlink.h:30: error: parse error before "nlmsg_flags"
/opt/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/sys-include/linux/netlink.h:31: error: parse error before "nlmsg_seq"
/opt/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/sys-include/linux/netlink.h:32: error: parse error before "nlmsg_pid"
/opt/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/sys-include/linux/netlink.h:83: error: field `msg' has incomplete type
In file included from darp.c:17:
/opt/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/sys-include/linux/rtnetlink.h:253: error: parse error before "__u32"
/opt/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/sys-include/linux/rtnetlink.h:255: error: parse error before "rta_expires"
/opt/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/sys-include/linux/rtnetlink.h:256: error: parse error before "rta_error"
/opt/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/sys-include/linux/rtnetlink.h:257: error: parse error before "rta_used"
/opt/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/sys-include/linux/rtnetlink.h:260: error: parse error before "rta_id"
/opt/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/sys-include/linux/rtnetlink.h:261: error: parse error before "rta_ts"
/opt/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/sys-include/linux/rtnetlink.h:262: error: parse error before "rta_tsage"
/opt/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/sys-include/linux/rtnetlink.h:333: error: parse error before "__s32"
/opt/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/sys-include/linux/rtnetlink.h:359: error: parse error before "__u16"
/opt/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/sys-include/linux/rtnetlink.h:361: error: parse error before "ndm_type"
/opt/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/sys-include/linux/rtnetlink.h:404: error: parse error before "__u32"
/opt/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/sys-include/linux/rtnetlink.h:406: error: parse error before "ndm_updated"
/opt/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/sys-include/linux/rtnetlink.h:407: error: parse error before "ndm_refcnt"
/opt/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/sys-include/linux/rtnetlink.h:519: error: parse error before "__u32"
/opt/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/sys-include/linux/rtnetlink.h:521: error: parse error before "tcm_info"
darp.c:120: error: parse error before "__be16"
darp.c: In function `gateway_on_nic':
darp.c:277: error: invalid application of `sizeof' to incomplete type `nlmsghdr'
darp.c:308: error: invalid application of `sizeof' to incomplete type `nlmsghdr'
darp.c:310: error: invalid application of `sizeof' to incomplete type `nlmsghdr'
darp.c:312: error: dereferencing pointer to incomplete type
darp.c:312: error: invalid application of `sizeof' to incomplete type `nlmsghdr'
darp.c:313: error: dereferencing pointer to incomplete type
darp.c:314: error: dereferencing pointer to incomplete type
darp.c:317: error: invalid application of `sizeof' to incomplete type `nlmsghdr'
darp.c:332: error: invalid application of `sizeof' to incomplete type `nlmsghdr'
darp.c:332: error: dereferencing pointer to incomplete type
darp.c:332: error: invalid application of `sizeof' to incomplete type `nlmsghdr'
darp.c:332: error: dereferencing pointer to incomplete type
darp.c:332: error: dereferencing pointer to incomplete type
darp.c:332: error: dereferencing pointer to incomplete type
darp.c:332: warning: left-hand operand of comma expression has no effect
darp.c:334: error: invalid application of `sizeof' to incomplete type `nlmsghdr'
darp.c:339: error: dereferencing pointer to incomplete type
darp.c:339: error: invalid application of `sizeof' to incomplete type `nlmsghdr'
darp.c:357: error: invalid application of `sizeof' to incomplete type `nlmsghdr'
darp.c:359: error: dereferencing pointer to incomplete type
darp.c:359: error: invalid application of `sizeof' to incomplete type `nlmsghdr'
darp.c: In function `pinghost':
darp.c:402: error: elements of array `sfilter' have incomplete type
darp.c:403: warning: excess elements in struct initializer
darp.c:403: warning: (near initialization for `sfilter[0]')
darp.c:403: warning: excess elements in struct initializer
darp.c:403: warning: (near initialization for `sfilter[0]')
darp.c:403: warning: excess elements in struct initializer
darp.c:403: warning: (near initialization for `sfilter[0]')
darp.c:403: warning: excess elements in struct initializer
darp.c:403: warning: (near initialization for `sfilter[0]')
darp.c:404: warning: excess elements in struct initializer
darp.c:404: warning: (near initialization for `sfilter[1]')
darp.c:404: warning: excess elements in struct initializer
darp.c:404: warning: (near initialization for `sfilter[1]')
darp.c:404: warning: excess elements in struct initializer
darp.c:404: warning: (near initialization for `sfilter[1]')
darp.c:404: warning: excess elements in struct initializer
darp.c:404: warning: (near initialization for `sfilter[1]')
darp.c:405: warning: excess elements in struct initializer
darp.c:405: warning: (near initialization for `sfilter[2]')
darp.c:405: warning: excess elements in struct initializer
darp.c:405: warning: (near initialization for `sfilter[2]')
darp.c:405: warning: excess elements in struct initializer
darp.c:405: warning: (near initialization for `sfilter[2]')
darp.c:405: warning: excess elements in struct initializer
darp.c:405: warning: (near initialization for `sfilter[2]')
darp.c:406: warning: excess elements in struct initializer
darp.c:406: warning: (near initialization for `sfilter[3]')
darp.c:406: warning: excess elements in struct initializer
darp.c:406: warning: (near initialization for `sfilter[3]')
darp.c:406: warning: excess elements in struct initializer
darp.c:406: warning: (near initialization for `sfilter[3]')
darp.c:406: warning: excess elements in struct initializer
darp.c:406: warning: (near initialization for `sfilter[3]')
darp.c:407: warning: excess elements in struct initializer
darp.c:407: warning: (near initialization for `sfilter[4]')
darp.c:407: warning: excess elements in struct initializer
darp.c:407: warning: (near initialization for `sfilter[4]')
darp.c:407: warning: excess elements in struct initializer
darp.c:407: warning: (near initialization for `sfilter[4]')
darp.c:407: warning: excess elements in struct initializer
darp.c:407: warning: (near initialization for `sfilter[4]')
darp.c:410: warning: excess elements in struct initializer
darp.c:410: warning: (near initialization for `sfilter[5]')
darp.c:410: warning: excess elements in struct initializer
darp.c:410: warning: (near initialization for `sfilter[5]')
darp.c:410: warning: excess elements in struct initializer
darp.c:410: warning: (near initialization for `sfilter[5]')
darp.c:410: warning: excess elements in struct initializer
darp.c:410: warning: (near initialization for `sfilter[5]')
darp.c:411: warning: excess elements in struct initializer
darp.c:411: warning: (near initialization for `sfilter[6]')
darp.c:411: warning: excess elements in struct initializer
darp.c:411: warning: (near initialization for `sfilter[6]')
darp.c:411: warning: excess elements in struct initializer
darp.c:411: warning: (near initialization for `sfilter[6]')
darp.c:411: warning: excess elements in struct initializer
darp.c:411: warning: (near initialization for `sfilter[6]')
darp.c:412: warning: excess elements in struct initializer
darp.c:412: warning: (near initialization for `sfilter[7]')
darp.c:412: warning: excess elements in struct initializer
darp.c:412: warning: (near initialization for `sfilter[7]')
darp.c:412: warning: excess elements in struct initializer
darp.c:412: warning: (near initialization for `sfilter[7]')
darp.c:412: warning: excess elements in struct initializer
darp.c:412: warning: (near initialization for `sfilter[7]')
darp.c:402: error: array size missing in 'sfilter'
darp.c:402: error: storage size of 'sfilter' isn't known
darp.c:439: error: invalid application of `sizeof' to incomplete type `sock_filter'
darp.c:439: warning: division by zero
darp.c:402: warning: unused variable `sfilter'
darp.c: At top level:
darp.c:481: error: parse error before "__be16"
darp.c: In function `setup_arpmsg':
darp.c:491: error: `dsthwa' undeclared (first use in this function)
darp.c:491: error: (Each undeclared identifier is reported only once
darp.c:491: error: for each function it appears in.)
darp.c:492: error: `arpmsg' undeclared (first use in this function)
darp.c:496: error: `srchwa' undeclared (first use in this function)
darp.c:500: error: `ha_type' undeclared (first use in this function)
darp.c:504: error: `op' undeclared (first use in this function)
darp.c:506: error: `sha' undeclared (first use in this function)
darp.c:507: error: `spa' undeclared (first use in this function)
darp.c:509: error: `tha' undeclared (first use in this function)
darp.c:514: error: `tpa' undeclared (first use in this function)
make: *** [default] Error 1

论坛徽章:
0
发表于 2009-09-15 18:23 |显示全部楼层
环境不一样?

论坛徽章:
0
发表于 2009-09-16 14:15 |显示全部楼层
支持原创
只是让目标不能上网么?功能做到和windows下zxarp一样就好了

论坛徽章:
0
发表于 2009-09-18 17:01 |显示全部楼层
学习了

论坛徽章:
0
发表于 2009-09-19 21:08 |显示全部楼层

回复 #1 wojiaohesen 的帖子

学习中。。。。
请教一个问题,就是函数int bindnicbyaddr (int sock, in_addr_t addr);是做什么用的,里面的ioctl的参数很少用到 ,查了UNP,也不是很明白
看了看,关键一句是在if (-1 != bind (sock, (struct sockaddr *) &paddr, (socklen_t) len))。
为什么绑定目的IP?
为什么绑定费这么大事?
if (!((dstaddr ^ (*(struct sockaddr_in *) &ifinfo->ifr_addr).sin_addr.s_addr) &
            netmask.sin_addr.s_addr))

论坛徽章:
0
发表于 2009-09-28 15:30 |显示全部楼层
arm_v6_be_uclibc-gcc -o darp darp.c -g2 交叉编译成功
但在我的路由器里面运行效果似乎不明显,我是新手,估计是我不会玩。

论坛徽章:
0
发表于 2009-10-04 15:31 |显示全部楼层
做个记号!!!

下次要用到再找你。。。

论坛徽章:
0
发表于 2009-10-08 00:11 |显示全部楼层
嗯,我也做个记号。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP