-
Notifications
You must be signed in to change notification settings - Fork 3
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
9 changed files
with
116 additions
and
23 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
File renamed without changes.
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
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
set -e | ||
pushd tool | ||
make | ||
popd | ||
pushd DB_SG_Backup | ||
make | ||
popd | ||
rm -f bin/DB_SG_Backup.bin | ||
cp DB_SG_Backup/DB_SG_Backup.bin bin/DB_SG_Backup.bin | ||
tool/bin2js bin/DB_SG_Backup.bin > html_payload/payload.js | ||
sed "s/###/$(cat html_payload/payload.js)/" exploit.template > html_payload/DB_SG_Backup.html | ||
rm -f DB_SG_Backup/DB_SG_Backup.bin | ||
rm -f html_payload/payload.js |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
pushd tool | ||
make clean | ||
popd | ||
pushd DB_SG_Backup | ||
make clean | ||
popd | ||
rm -f html_payload/DB_SG_Backup.html | ||
rm -f bin/DB_SG_Backup.bin | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
all: bin2js | ||
|
||
bin2js: bin2js.c | ||
gcc -o bin2js bin2js.c | ||
|
||
.PHONY: clean | ||
|
||
clean: | ||
rm bin2js | ||
|
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <stdint.h> | ||
#include <string.h> | ||
#include <assert.h> | ||
|
||
int main(int argc, char** argv) | ||
{ | ||
assert(argc == 2); | ||
char* fn = argv[1]; | ||
FILE* f = fopen(fn, "r"); | ||
fseek(f, 0, SEEK_END); | ||
int l = ftell(f); | ||
int ll = (l + 3) / 4; | ||
fseek(f, 0, SEEK_SET); | ||
char *b = malloc(ll * 4); | ||
memset(b, 0, ll * 4); | ||
fread(b, l, 1, f); | ||
fclose(f); | ||
uint32_t *u = (uint32_t *)b; | ||
printf("var payload=["); | ||
for (int i = 0; i < ll; i++) | ||
{ | ||
printf("%u", *u++); | ||
if (i < (ll - 1)) printf(","); | ||
} | ||
printf("];\n"); | ||
free(b); | ||
} | ||
|