Open X1aomu opened 7 years ago
你装个MinGW就有编译工具链了;然后还需要指定一个pcap库,winpcap应该可以使用。不过代码里有没有调windows没有的系统调用我就不清楚了。有的话还需要移植一下。
我去试试,那如何指定 pcap 库的位置呢?我对 automake 还不了解
@Xiaomu0 同学你测试过其他同学的端口能用吗,我这里测试的机会比较少,现有有一个同学不能使用,显示物理mac地址被修改
@Xiaomu0 ./configure的时候可以指定pcap的链接方式,默认情况是dlopen,应该不用特别设置,装上winpcap就行。
@shanzhaozhen 是与我同一个学校的吗?我这里试过两个帐号是可以的,可能还不具有普适性?你可以照这个教程 http://codingstory.com.cn/mo-gai-mentohust-v4ban-ben-de-xin-de/ 试一下。
@Xiaomu0 正是按照这个教程做的,但是物理MAC地址已被修改,我认为包中不仅仅头的部分发送了MAC地址应该还是其他地方存在,我再抓包分析一下
@Xiaomu0 重新抓包后还是找不到MAC认证的位置,看来不好搞
@shanzhaozhen 按照那个教程,主要是找出 6 个位置,并不需要你找 mac 字段呀
@Xiaomu0 是的,现在我只能给自己认证,但是别人都会提示物理mac地址已修改
Maybe this could help figure out what's in the authentication frames: https://github.com/hyrathb/mentohust/issues/282#issuecomment-252603763
@hyrathb 看了一下 ./configure 的结果,现在在我的 msys2 环境缺少 arpa/inet.h, netinet/in.h, sys/ioctl.h, sys/socket.h, libintl.h,make 的时候还有 u_char, u_int32_t 的类型错误。好像都是网络库,不知道 win 下有没有替代品。
$ ./configure
configure: loading site script /mingw64/etc/config.site
checking build system type... x86_64-w64-mingw32
checking host system type... x86_64-w64-mingw32
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking whether byte ordering is bigendian... no
checking for dlsym in -ldl... yes
checking for dlsym in -ldl... (cached) yes
checking for a sed that does not truncate output... /usr/bin/sed
checking whether NLS is requested... yes
checking for msgfmt... /usr/bin/msgfmt
checking for gmsgfmt... /usr/bin/msgfmt
checking for xgettext... /usr/bin/xgettext
checking for msgmerge... /usr/bin/msgmerge
checking for ld used by gcc... D:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe
checking if the linker (D:/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) is GNU ld... yes
checking for shared library run path origin... done
checking for CFPreferencesCopyAppValue... no
checking for CFLocaleCopyCurrent... no
checking for GNU gettext in libc... no
checking for iconv... yes
checking for working iconv... yes
checking how to link with libiconv... -liconv
checking for GNU gettext in libintl... no
checking whether to use NLS... no
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking arpa/inet.h usability... no
checking arpa/inet.h presence... no
checking for arpa/inet.h... no
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking netinet/in.h usability... no
checking netinet/in.h presence... no
checking for netinet/in.h... no
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/ioctl.h usability... no
checking sys/ioctl.h presence... no
checking for sys/ioctl.h... no
checking sys/socket.h usability... no
checking sys/socket.h presence... no
checking for sys/socket.h... no
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking libintl.h usability... no
checking libintl.h presence... no
checking for libintl.h... no
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for size_t... yes
checking for atexit... yes
checking for memmove... yes
checking for memset... yes
checking for socket... no
checking for strrchr... yes
checking for setlocale... yes
config result: host(mingw32) pcap(dyload) notify(yes) encode(yes) arp(yes) nls(yes) getopt_long(yes)
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating po/Makefile.in
config.status: creating mentohust.spec
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing po-directories commands
config.status: creating po/POTFILES
config.status: creating po/Makefile
$ make
make all-recursive
make[1]: 进入目录“/home/Flux/src/mentohust”
Making all in src
make[2]: 进入目录“/home/Flux/src/mentohust/src”
CC mycheck.o
CC dlfunc.o
dlfunc.c: In function 'show_notify':
dlfunc.c:149:2: warning: implicit declaration of function 'seteuid' [-Wimplicit-function-declaration]
seteuid(getuid());
^~~~~~~
dlfunc.c:149:10: warning: implicit declaration of function 'getuid' [-Wimplicit-function-declaration]
seteuid(getuid());
^~~~~~
CC myfunc.o
In file included from myfunc.c:15:0:
myfunc.h:14:16: error: unknown type name 'u_int32_t'
char *formatIP(u_int32_t ip); /* 格式化IP */
^~~~~~~~~
myfunc.h:20:26: error: unknown type name 'u_char'
void fillMd5Packet(const u_char *md5Seed); /* 填充Md5包 */
^~~~~~
myfunc.h:21:21: error: unknown type name 'u_char'
void fillEchoPacket(u_char *buf); /* 填充Echo包 */
^~~~~~
myfunc.h:22:23: error: unknown type name 'u_char'
void getEchoKey(const u_char *capBuf); /* 获取EchoKey */
^~~~~~
myfunc.h:23:1: error: unknown type name 'u_char'
u_char *checkPass(u_char id, const u_char *md5Seed, int seedLen); /* 计算密码的md5 */
^~~~~~
myfunc.h:23:19: error: unknown type name 'u_char'
u_char *checkPass(u_char id, const u_char *md5Seed, int seedLen); /* 计算密码的md5 */
^~~~~~
myfunc.h:23:36: error: unknown type name 'u_char'
u_char *checkPass(u_char id, const u_char *md5Seed, int seedLen); /* 计算密码的md5 */
^~~~~~
myfunc.h:24:21: error: unknown type name 'u_char'
void fillCernetAddr(u_char *buf); /* 填充赛尔网络地址 */
^~~~~~
myfunc.c:22:24: fatal error: netinet/in.h: No such file or directory
#include <netinet/in.h>
^
compilation terminated.
make[2]: *** [Makefile:428:myfunc.o] 错误 1
make[2]: 离开目录“/home/Flux/src/mentohust/src”
make[1]: *** [Makefile:486:all-recursive] 错误 1
make[1]: 离开目录“/home/Flux/src/mentohust”
make: *** [Makefile:361:all] 错误 2
@shanzhaozhen 似乎那个教程的作者也是和你一样的情况,只能认证自己的账号。。。目前我也就验证了我们学校两个账号而已(身边没有足够多的账号),不知道是不是可以对全校通用,也可能我的学校没有 mac 地址的限制。
@Xiaomu0 我不是教程作者啊
下面艾特教程作者帮帮忙
@ShanQincheng 请问你现在修改的代码编译后可以让其他同学也认证成功吗,我跟着你的做法做了一遍,自己成功认证了,但是在其他同学的端口认证失败,提示物理mac地址已被修改。有解决办法或思路吗
费尽周折终于在cygwin的环境下编译通过了,
然后修改源码动态加载winpcap库,
一个比较坑的地方是winpcap和ioctl使用的网卡名不一样,转换后好了
@bnpzsx 同学你好, 我在windows折腾了一下午没弄好. 并且我挺需要这个项目的... 校内的客户端限制诸多, 没有提供接口 无法多拨等等... 请问方便给个联系方式吗? 或者你联系我也可以hpero@foxmail.com
目前我已经针对我们学校修改出了一个可用的版本 mentohust ,想在Windows 下也使用 mentohust。以前也是见过 Windows 版的,但现在难见着了,即使有现成的二进制版本想必也不适合我的学校,所以想问下如何构建 Windows 版本?