-
Notifications
You must be signed in to change notification settings - Fork 426
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
23 changed files
with
630 additions
and
518 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
from modules.processing.parsers.CAPE.AgentTesla import extract_config | ||
from modules.processing.parsers.MACO.AgentTesla import convert_to_MACO | ||
|
||
from contextlib import suppress | ||
HAVE_MACO = False | ||
with suppress(ImportError): | ||
from modules.processing.parsers.MACO.AgentTesla import convert_to_MACO | ||
HAVE_MACO = True | ||
|
||
|
||
def test_agenttesla(): | ||
|
@@ -16,26 +21,27 @@ def test_agenttesla(): | |
"ExternalIPCheckServices": ["http://ip-api.com/line/?fields=hosting"], | ||
} | ||
|
||
assert convert_to_MACO(conf).model_dump(exclude_defaults=True, exclude_none=True) == { | ||
"family": "AgentTesla", | ||
"other": { | ||
"Protocol": "SMTP", | ||
"C2": "mail.guestequipment.com.au", | ||
"Username": "[email protected]", | ||
"Password": "Clone89!", | ||
"EmailTo": "[email protected]", | ||
"Persistence_Filename": "newfile.exe", | ||
"ExternalIPCheckServices": ["http://ip-api.com/line/?fields=hosting"], | ||
}, | ||
"smtp": [ | ||
{ | ||
"username": "[email protected]", | ||
"password": "Clone89!", | ||
"hostname": "mail.guestequipment.com.au", | ||
"mail_to": ["[email protected]"], | ||
"usage": "c2", | ||
} | ||
], | ||
"http": [{"uri": "http://ip-api.com/line/?fields=hosting", "usage": "other"}], | ||
"paths": [{"path": "newfile.exe", "usage": "storage"}], | ||
} | ||
if HAVE_MACO: | ||
assert convert_to_MACO(conf).model_dump(exclude_defaults=True, exclude_none=True) == { | ||
"family": "AgentTesla", | ||
"other": { | ||
"Protocol": "SMTP", | ||
"C2": "mail.guestequipment.com.au", | ||
"Username": "[email protected]", | ||
"Password": "Clone89!", | ||
"EmailTo": "[email protected]", | ||
"Persistence_Filename": "newfile.exe", | ||
"ExternalIPCheckServices": ["http://ip-api.com/line/?fields=hosting"], | ||
}, | ||
"smtp": [ | ||
{ | ||
"username": "[email protected]", | ||
"password": "Clone89!", | ||
"hostname": "mail.guestequipment.com.au", | ||
"mail_to": ["[email protected]"], | ||
"usage": "c2", | ||
} | ||
], | ||
"http": [{"uri": "http://ip-api.com/line/?fields=hosting", "usage": "other"}], | ||
"paths": [{"path": "newfile.exe", "usage": "storage"}], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
from modules.processing.parsers.CAPE.Carbanak import extract_config | ||
from modules.processing.parsers.MACO.Carbanak import convert_to_MACO | ||
from contextlib import suppress | ||
HAVE_MACO = False | ||
with suppress(ImportError): | ||
from modules.processing.parsers.MACO.Carbanak import convert_to_MACO | ||
HAVE_MACO = True | ||
|
||
|
||
def test_carbanak(): | ||
with open("tests/data/malware/c9c1b06cb9c9bd6fc4451f5e2847a1f9524bb2870d7bb6f0ee09b9dd4e3e4c84", "rb") as data: | ||
conf = extract_config(data.read()) | ||
assert conf["C2"] == ["5.161.223.210:443", "207.174.30.226:443"] | ||
assert convert_to_MACO(conf).model_dump(exclude_defaults=True, exclude_none=True) == { | ||
"family": "Carbanak", | ||
"other": {"C2": ["5.161.223.210:443", "207.174.30.226:443"]}, | ||
"http": [{"hostname": "5.161.223.210:443", "usage": "c2"}, {"hostname": "207.174.30.226:443", "usage": "c2"}], | ||
} | ||
if HAVE_MACO: | ||
assert convert_to_MACO(conf).model_dump(exclude_defaults=True, exclude_none=True) == { | ||
"family": "Carbanak", | ||
"other": {"C2": ["5.161.223.210:443", "207.174.30.226:443"]}, | ||
"http": [{"hostname": "5.161.223.210:443", "usage": "c2"}, {"hostname": "207.174.30.226:443", "usage": "c2"}], | ||
} |
Oops, something went wrong.