I need to perform MITM attack on a router, which is embedded linux system and its architecture is ARM. The linux kernel is 2.4.24. By MITM attack I mean intercept the packet, reedit it and send it forward. I want to use netfilter. But when I try to cross compile the LKM, I encountered plenty of problems.
As usual, a LKM Makefile is as below:
obj-m+=hello.o
KDIR = /lib/modules/$(shell uname -r)/build
all:
make -C $(KDIR) M=$(shell pwd) modules
clean:
make -C $(KDIR) M=$(shell pwd) clean
I downloaded linux kernel 2.4.24. But when it comes to the cross compile environment, the problems arise.
How to set KDIR
path? The Path where linux_kernel_2.4.24.tar.gz
is extracted? Do I need to cross-compile the kernel first? How?
Firstly, I set KDIR
to the path of linux_kernel_2.4.24
, then make
, the error is "The present kernel configuration has modules disabled". By now I have not successfully make menuconfig
this verion of kernel.
Secondly, I try to cross-compile on CentOS 5.4 32bit, whose kernel is 2.6.18. When I add CC=arm-linux-gcc
to Makefile
and set KDIR as /lib/modules/$(shell uname -r)/build
, the result says "there is no arm...".
Can anyone specify how to compile LKM of the old version kernel on the latest linux? And how to cross-compile ARM version of LKM?