Added sys_openat for the injection module, fully working!

This commit is contained in:
h3xduck
2022-05-16 08:02:38 -04:00
parent abc501d4be
commit 4044d7994c
16 changed files with 24017 additions and 12699 deletions

View File

@@ -1,72 +1,3 @@
q
disass main
b *(main+446)
r
ssi
si
ni
1
q
b *(main+446)
r
si
ni
q
b *(main+446)
r
si
ni
q
b *(main+446)
r
si
ni
q
b *(main+446)
r
si
ni
q
b *(main+446)
r
si
ni
q
b *(main+446)
r
si
ni
si
ni
si
q
b *(main+446)
r
si
ni
si
si
si
fin
q
b *(main+446)
r
si
ni
si
ni
q
b *(main+446)
r
si
si
ni
si
ni
si
si
s
q
b *(main+446)
r
ni
@@ -254,3 +185,72 @@ si
ni
si
q
l main
b 15
r
si
si
q
l main
b 14
r
si
si
si
siq
q
b 15
r
si
si
Q
q
b 15
r
si
q
b 15
r
si
sqi
q
b 15
r
si
si
q
l main
b 15
r
si
q
b 14
r
si
si
q
b 15
r
si
si
si
q
b 15
r
si
q
b 15
t
r
si
q
b 14
r
si
ni
si
ni
stepi
fin
fin
q

View File

@@ -3,7 +3,7 @@ HEADERS = lib/RawTCP.h
EXTRA_CFLAGS= -I$(PWD)/lib
default:
make execve_hijack injection_lib simple_timer
make execve_hijack injection_lib simple_timer simple_open
injection_lib: injection_lib.o
gcc -Wall -shared -fPIC -o injection_lib.so injection_lib.c -ldl
@@ -14,6 +14,12 @@ simple_timer.o: simple_timer.c $(HEADERS)
simple_timer: simple_timer.o
gcc -g -o simple_timer simple_timer.o
simple_open.o: simple_open.c $(HEADERS)
gcc -g -c simple_open.c
simple_open: simple_open.o
gcc -g -o simple_open simple_open.o
execve_hijack.o: execve_hijack.c $(HEADERS)
gcc -g -c execve_hijack.c
@@ -26,4 +32,6 @@ clean:
-rm -f injection_lib.o
-rm -f injection_lib.so
-rm -f simple_timer.o
-rm -f simple_timer
-rm -f simple_timer
-rm -f simple_open.o
-rm -f simple_open

View File

@@ -0,0 +1,2 @@
break /home/osboxes/TFG/src/helpers/simple_open.c:14

BIN
src/helpers/simple_open Executable file

Binary file not shown.

22
src/helpers/simple_open.c Normal file
View File

@@ -0,0 +1,22 @@
/**
* Modified version of Linux man page timer using timerfd.
* Counts to 3, 1 second at a time, then sets another time up to 3, one second at a time.
*/
#include <time.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <unistd.h>
#include <fcntl.h>
int main(int argc, char *argv[]) {
int fd;
char* path = "/home/osboxes/TFG/src/helpers/Makefile";
openat(fd, path, O_RDONLY);
//Second call
openat(fd, path, O_RDONLY);
return 0;
}

BIN
src/helpers/simple_open.o Normal file

Binary file not shown.