add a stripping tool and a random key experiment

This commit is contained in:
2020-02-28 16:28:13 -05:00
parent 0320e5cea7
commit 662c228b7e
8 changed files with 104 additions and 5 deletions

View File

@@ -5,6 +5,7 @@ set(CMAKE_C_STANDARD 99)
set(CMAKE_C_FLAGS "-g -Wall")
include_directories(include)
add_subdirectory(lib)
add_executable(checkm8_remote main.c src/usb_helpers.c src/exploit.c src/payload.c src/command.c)
target_link_libraries(checkm8_remote usb-1.0 pthread udev m)

View File

@@ -4,6 +4,7 @@
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include "dev/types.h"
#include "util/experiments.h"
@@ -106,12 +107,26 @@ void run_corr_exp(struct pwned_device *dev, char *fname)
unsigned char key[16];
unsigned char key_sched[176];
sprintf(fname, "KEY");
outfile = fopen(fname, "w");
if(outfile == NULL)
{
printf("failed to open key file\n");
return;
}
srand(time(NULL));
for(i = 0; i < 16; i++)
{
msg[i] = 0;
key[i] = 0x0;
key[i] = random();
fprintf(outfile, "%02x", key[i]);
}
fprintf(outfile, "\n");
fflush(outfile);
fclose(outfile);
expand_key(key, key_sched, 11, c);
addr_async_buf = setup_corr_exp(dev, key);