Showing
10 changed files
with
19 additions
and
16 deletions
1 | -cmd_/root/hooking/dhooker/hooker.ko := arm-linux-gnueabihf-ld -EL -r -T ./scripts/module-common.lds --build-id -o /root/hooking/dhooker/hooker.ko /root/hooking/dhooker/hooker.o /root/hooking/dhooker/hooker.mod.o | 1 | +cmd_/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.ko := arm-linux-gnueabihf-ld -EL -r -T ./scripts/module-common.lds --build-id -o /root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.ko /root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.o /root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.mod.o | ... | ... |
1 | -cmd_/root/hooking/dhooker/hooker.mod.o := arm-linux-gnueabihf-gcc -Wp,-MD,/root/hooking/dhooker/.hooker.mod.o.d -nostdinc -isystem /usr/lib/gcc-cross/arm-linux-gnueabihf/5/include -I./arch/arm/include -Iarch/arm/include/generated/uapi -Iarch/arm/include/generated -Iinclude -I./arch/arm/include/uapi -Iarch/arm/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-bcm2709/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -fno-dwarf2-cfi-asm -fno-omit-frame-pointer -mapcs -mno-sched-prolog -fno-ipa-sra -mabi=aapcs-linux -mno-thumb-interwork -mfpu=vfp -funwind-tables -marm -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -fno-delete-null-pointer-checks -Wno-maybe-uninitialized -O2 --param=allow-store-data-races=0 -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -DCC_HAVE_ASM_GOTO -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(hooker.mod)" -D"KBUILD_MODNAME=KBUILD_STR(hooker)" -DMODULE -c -o /root/hooking/dhooker/hooker.mod.o /root/hooking/dhooker/hooker.mod.c | 1 | +cmd_/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.mod.o := arm-linux-gnueabihf-gcc -Wp,-MD,/root/OSSPractice/lab5-2/hooking_prac/dhooker/.hooker.mod.o.d -nostdinc -isystem /usr/lib/gcc-cross/arm-linux-gnueabihf/5/include -I./arch/arm/include -Iarch/arm/include/generated/uapi -Iarch/arm/include/generated -Iinclude -I./arch/arm/include/uapi -Iarch/arm/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-bcm2709/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -fno-dwarf2-cfi-asm -fno-omit-frame-pointer -mapcs -mno-sched-prolog -fno-ipa-sra -mabi=aapcs-linux -mno-thumb-interwork -mfpu=vfp -funwind-tables -marm -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -fno-delete-null-pointer-checks -Wno-maybe-uninitialized -O2 --param=allow-store-data-races=0 -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -DCC_HAVE_ASM_GOTO -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(hooker.mod)" -D"KBUILD_MODNAME=KBUILD_STR(hooker)" -DMODULE -c -o /root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.mod.o /root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.mod.c |
2 | 2 | ||
3 | -source_/root/hooking/dhooker/hooker.mod.o := /root/hooking/dhooker/hooker.mod.c | 3 | +source_/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.mod.o := /root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.mod.c |
4 | 4 | ||
5 | -deps_/root/hooking/dhooker/hooker.mod.o := \ | 5 | +deps_/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.mod.o := \ |
6 | $(wildcard include/config/module/unload.h) \ | 6 | $(wildcard include/config/module/unload.h) \ |
7 | include/linux/module.h \ | 7 | include/linux/module.h \ |
8 | $(wildcard include/config/modules.h) \ | 8 | $(wildcard include/config/modules.h) \ |
... | @@ -438,6 +438,6 @@ deps_/root/hooking/dhooker/hooker.mod.o := \ | ... | @@ -438,6 +438,6 @@ deps_/root/hooking/dhooker/hooker.mod.o := \ |
438 | include/linux/vermagic.h \ | 438 | include/linux/vermagic.h \ |
439 | include/generated/utsrelease.h \ | 439 | include/generated/utsrelease.h \ |
440 | 440 | ||
441 | -/root/hooking/dhooker/hooker.mod.o: $(deps_/root/hooking/dhooker/hooker.mod.o) | 441 | +/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.mod.o: $(deps_/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.mod.o) |
442 | 442 | ||
443 | -$(deps_/root/hooking/dhooker/hooker.mod.o): | 443 | +$(deps_/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.mod.o): | ... | ... |
1 | -cmd_/root/hooking/dhooker/hooker.o := arm-linux-gnueabihf-gcc -Wp,-MD,/root/hooking/dhooker/.hooker.o.d -nostdinc -isystem /usr/lib/gcc-cross/arm-linux-gnueabihf/5/include -I./arch/arm/include -Iarch/arm/include/generated/uapi -Iarch/arm/include/generated -Iinclude -I./arch/arm/include/uapi -Iarch/arm/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-bcm2709/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -fno-dwarf2-cfi-asm -fno-omit-frame-pointer -mapcs -mno-sched-prolog -fno-ipa-sra -mabi=aapcs-linux -mno-thumb-interwork -mfpu=vfp -funwind-tables -marm -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -fno-delete-null-pointer-checks -Wno-maybe-uninitialized -O2 --param=allow-store-data-races=0 -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -DCC_HAVE_ASM_GOTO -DMODULE -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(hooker)" -D"KBUILD_MODNAME=KBUILD_STR(hooker)" -c -o /root/hooking/dhooker/.tmp_hooker.o /root/hooking/dhooker/hooker.c | 1 | +cmd_/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.o := arm-linux-gnueabihf-gcc -Wp,-MD,/root/OSSPractice/lab5-2/hooking_prac/dhooker/.hooker.o.d -nostdinc -isystem /usr/lib/gcc-cross/arm-linux-gnueabihf/5/include -I./arch/arm/include -Iarch/arm/include/generated/uapi -Iarch/arm/include/generated -Iinclude -I./arch/arm/include/uapi -Iarch/arm/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-bcm2709/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -fno-dwarf2-cfi-asm -fno-omit-frame-pointer -mapcs -mno-sched-prolog -fno-ipa-sra -mabi=aapcs-linux -mno-thumb-interwork -mfpu=vfp -funwind-tables -marm -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -fno-delete-null-pointer-checks -Wno-maybe-uninitialized -O2 --param=allow-store-data-races=0 -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -DCC_HAVE_ASM_GOTO -DMODULE -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(hooker)" -D"KBUILD_MODNAME=KBUILD_STR(hooker)" -c -o /root/OSSPractice/lab5-2/hooking_prac/dhooker/.tmp_hooker.o /root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.c |
2 | 2 | ||
3 | -source_/root/hooking/dhooker/hooker.o := /root/hooking/dhooker/hooker.c | 3 | +source_/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.o := /root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.c |
4 | 4 | ||
5 | -deps_/root/hooking/dhooker/hooker.o := \ | 5 | +deps_/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.o := \ |
6 | include/linux/kernel.h \ | 6 | include/linux/kernel.h \ |
7 | $(wildcard include/config/lbdaf.h) \ | 7 | $(wildcard include/config/lbdaf.h) \ |
8 | $(wildcard include/config/preempt/voluntary.h) \ | 8 | $(wildcard include/config/preempt/voluntary.h) \ |
... | @@ -824,6 +824,6 @@ deps_/root/hooking/dhooker/hooker.o := \ | ... | @@ -824,6 +824,6 @@ deps_/root/hooking/dhooker/hooker.o := \ |
824 | arch/arm/include/generated/asm/local.h \ | 824 | arch/arm/include/generated/asm/local.h \ |
825 | include/asm-generic/local.h \ | 825 | include/asm-generic/local.h \ |
826 | 826 | ||
827 | -/root/hooking/dhooker/hooker.o: $(deps_/root/hooking/dhooker/hooker.o) | 827 | +/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.o: $(deps_/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.o) |
828 | 828 | ||
829 | -$(deps_/root/hooking/dhooker/hooker.o): | 829 | +$(deps_/root/OSSPractice/lab5-2/hooking_prac/dhooker/hooker.o): | ... | ... |
... | @@ -13,7 +13,7 @@ unsigned int (* sys_write_orig)(int fd, char *byf, size_t count); | ... | @@ -13,7 +13,7 @@ unsigned int (* sys_write_orig)(int fd, char *byf, size_t count); |
13 | 13 | ||
14 | //sys_write_orig() 호출 전 pBuF의 내용 수정 | 14 | //sys_write_orig() 호출 전 pBuF의 내용 수정 |
15 | unsigned int sys_write_hooked(int nFD, char *pBuf, size_t nCnt){ | 15 | unsigned int sys_write_hooked(int nFD, char *pBuf, size_t nCnt){ |
16 | - | 16 | + printk("current process: %s", current->comm); |
17 | if(current->comm == "hello_world" && nFD == 1){ | 17 | if(current->comm == "hello_world" && nFD == 1){ |
18 | memset(pBuf, 0, nCnt); | 18 | memset(pBuf, 0, nCnt); |
19 | strcpy(pBuf, "Hacked!!!\n"); | 19 | strcpy(pBuf, "Hacked!!!\n"); |
... | @@ -26,6 +26,8 @@ unsigned int sys_write_hooked(int nFD, char *pBuf, size_t nCnt){ | ... | @@ -26,6 +26,8 @@ unsigned int sys_write_hooked(int nFD, char *pBuf, size_t nCnt){ |
26 | } | 26 | } |
27 | 27 | ||
28 | int __init Hook_Init(void){ | 28 | int __init Hook_Init(void){ |
29 | + | ||
30 | + printk("외않되\n"); | ||
29 | sys_write_orig = (void *)g_puSysTableAddr[__NR_write]; | 31 | sys_write_orig = (void *)g_puSysTableAddr[__NR_write]; |
30 | 32 | ||
31 | __asm__ __volatile__("mrc p15, 0, %0, c3, c0" : "=r"(g_uPrevAP)); | 33 | __asm__ __volatile__("mrc p15, 0, %0, c3, c0" : "=r"(g_uPrevAP)); | ... | ... |
... | @@ -20,6 +20,7 @@ __attribute__((section("__versions"))) = { | ... | @@ -20,6 +20,7 @@ __attribute__((section("__versions"))) = { |
20 | { 0xb344870e, __VMLINUX_SYMBOL_STR(module_layout) }, | 20 | { 0xb344870e, __VMLINUX_SYMBOL_STR(module_layout) }, |
21 | { 0x2e5810c6, __VMLINUX_SYMBOL_STR(__aeabi_unwind_cpp_pr1) }, | 21 | { 0x2e5810c6, __VMLINUX_SYMBOL_STR(__aeabi_unwind_cpp_pr1) }, |
22 | { 0xfa2a45e, __VMLINUX_SYMBOL_STR(__memzero) }, | 22 | { 0xfa2a45e, __VMLINUX_SYMBOL_STR(__memzero) }, |
23 | + { 0x27e1a049, __VMLINUX_SYMBOL_STR(printk) }, | ||
23 | { 0xb1ad28e0, __VMLINUX_SYMBOL_STR(__gnu_mcount_nc) }, | 24 | { 0xb1ad28e0, __VMLINUX_SYMBOL_STR(__gnu_mcount_nc) }, |
24 | }; | 25 | }; |
25 | 26 | ||
... | @@ -29,4 +30,4 @@ __attribute__((section(".modinfo"))) = | ... | @@ -29,4 +30,4 @@ __attribute__((section(".modinfo"))) = |
29 | "depends="; | 30 | "depends="; |
30 | 31 | ||
31 | 32 | ||
32 | -MODULE_INFO(srcversion, "D2F3FA25DCB0D285CB3AE41"); | 33 | +MODULE_INFO(srcversion, "2A131E5614C253504393ED6"); | ... | ... |
No preview for this file type
No preview for this file type
No preview for this file type
-
Please register or login to post a comment