Snake & Apple: Antivirus
MAJOR
-
Repaired bug in
checkDyldInsertLibraries
that was missing the case for0x10000
+ insecure entitlements -
I repaired all the bugs I missed after the latest updates to the
lief
library. -
All tests were successful, so it should work for the latest
lief
version. -
Added
testDyldSLC
andprinttestDyldSLC
to support--test_dyld_SLC
option to test for code injection usingDYLD_SHARED_CACHE_DIR
. -
New Snake VII. Antivirus class with bunch of new functionalities.
-
Added
AMFI_test.sh
script.
MINOR
- Patched Type-error because of changes in
lief
library:
if arm64_bin == None:
^^^^^^^^^^^^^^^^^
TypeError: __eq__(): incompatible function arguments. The following argument types are supported:
1. __eq__(self, arg: lief._lief.Object, /) -> bool
Invoked with types: lief._lief.MachO.Binary, NoneType
Now it cannot use ==
as the operator arm64_bin is None
.
- Patched the
getEndianess
function because of changes in thelief
library.
File "/Users/karmaz/.local/bin/CrimsonUroboros", line 261, in getEndianess
magic = self.binary.header.magic.name
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'lief._lief.MachO.MACHO_TYPES' object has no attribute 'name
Now we must use __name__
property.
__name__
patch ingetDylibID
File "/Users/karmaz/.local/bin/CrimsonUroboros", line 1365, in getDylibID
if cmd.command.name == 'ID_DYLIB':
^^^^^^^^^^^^^^^^
AttributeError: 'lief._lief.MachO.LOAD_COMMAND_TYPES' object has no attribute 'name'
__name__
patch ingetDylibLoadCommands
File "/Users/karmaz/.local/bin/CrimsonUroboros", line 1176, in getDylibLoadCommands
cmd_name = cmd.command.name
^^^^^^^^^^^^^^^^
AttributeError: 'lief._lief.MachO.LOAD_COMMAND_TYPES' object has no attribute 'name'
__name__
patch ingetUnresolvedRunPathLoadCommandsPaths
File "/Users/karmaz/.local/bin/CrimsonUroboros", line 1188, in getUnresolvedRunPathLoadCommandsPaths
return [cmd.path for cmd in self.load_commands if cmd.command.name == 'RPATH']
^^^^^^^^^^^^^^^^
AttributeError: 'lief._lief.MachO.LOAD_COMMAND_TYPES' object has no attribute 'name'
- ... and other places where
__name__
should be used instead of.name
as from lief verion 14.0 - Minor bug patch with
getSections
where byte string was returned instead of decoded utf. - Added information about success in
dumpPrelink_info
anddumpPrelink_text
- Patched
getSectionRange
bug withif section_name == section.fullname
- lack od.decode()
after changes inlief
.
def getSectionRange(self, segment_name, section_name):
'''
Return section start and end file offset.
If there is no such section return False, False.
'''
for section in self.binary.sections:
if segment_name == section.segment_name:
if section_name == section.fullname.decode():
-
Modified some tests.
-
Added some RE to Dyld according to DYLD VII.
-
Fix the name in Arg parser for amfi_group.
-
Added X. NU directory for storing materials related to macOS kernel.
-
Added some presentations and decompiled code to the
mac
directory ofAntivirus