pentest-wiki icon indicating copy to clipboard operation
pentest-wiki copied to clipboard

[Maintaining Access] How to create a iso with backdoor ?

Open nixawk opened this issue 6 years ago • 0 comments

add a backdoor driver into kernel-source

You can try to use other methods to backdoor the linux. (not driver)

~/Projects/kernelbuild/linux-5.0.3 ➭ zcat /proc/config.gz > .config
~/Projects/kernelbuild/linux-5.0.3 ➭ ll drivers/backdoor
total 12K
-rw-r--r-- 1 debug debug 3.3K Mar 22 16:41 backdoor.c
-rw-r--r-- 1 debug debug   94 Mar 22 16:57 Kconfig
-rw-r--r-- 1 debug debug   37 Mar 22 17:01 Makefile

~/Projects/kernelbuild/linux-5.0.3 ➭ make
...
  AR      drivers/backdoor/built-in.a
...

~/Projects/kernelbuild/linux-5.0.3 ➭ ll drivers/backdoor
total 16K
-rw-r--r-- 1 debug debug 3.3K Mar 22 16:41 backdoor.c
-rw-r--r-- 1 debug debug    8 Mar 22 17:23 built-in.a
-rw-r--r-- 1 debug debug   94 Mar 22 16:57 Kconfig
-rw-r--r-- 1 debug debug   37 Mar 22 17:01 Makefile
-rw-r--r-- 1 debug debug    0 Mar 22 17:23 modules.order
~/Projects/kernelbuild/linux-5.0.3 ➭  cat drivers/backdoor/Makefile
obj-$(CONFIG_BACKDOOR) += backdoor.o

~/Projects/kernelbuild/linux-5.0.3 ➭  cat drivers/backdoor/Kconfig
config BACKDOOR
	tristate "backdoor module"
	# depends on ARM
	help
		this is a backdoor module
~/Projects/kernelbuild/linux-5.0.3 ➭ grep backdoor drivers/Kconfig
source "drivers/backdoor/Kconfig"
~/Projects/kernelbuild/linux-5.0.3 ➭ grep backdoor drivers/Makefile
obj-y                           += backdoor/

create a iso

If you are a archer, archiso is a good choice.

references

  • https://github.com/nixawk/pentest-wiki/issues/28
  • https://wiki.archlinux.org/index.php/Kernel/Traditional_compilation#Copy_System.map
  • https://wiki.archlinux.org/index.php/Archiso
  • https://stackoverflow.com/questions/11710022/adding-new-driver-code-to-linux-source-code
  • https://lwn.net/Articles/57135/

nixawk avatar Mar 22 '19 09:03 nixawk