Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hash algorithm for unknown Mythic agent #45

Merged
merged 1 commit into from
Aug 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions algorithms/mythic_unknown.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env python

DESCRIPTION = "API hash find in an unknown Mythic agent, need a XOR key"
# Type can be either 'unsigned_int' (32bit) or 'unsigned_long' (64bit)
TYPE = "unsigned_int"
# Test must match the exact has of the string 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
TEST_1 = 3762100525


def hash(data):
crc = 0xffffffff
for val in data:
for _ in range(8):
tmp = crc
crc = crc >> 1 & 0xffffffff
if (val ^ tmp) & 1 != 0:
crc ^= 0xedb88320
val = val >> 1 & 0xffffffff
return crc
Loading