mirror of
https://github.com/cuckoosandbox/cuckoo.git
synced 2026-10-12 02:12:40 +00:00
Instead of having special .lnk parsing in our Office analyzer it's much easier to separate this logic using Yara rules & Extractor plugins. This way we support other file formats such as, apparently, PE files, too.
17 lines
561 B
Python
17 lines
561 B
Python
# Copyright (C) 2017 Cuckoo Foundation.
|
|
# This file is part of Cuckoo Sandbox - https://cuckoosandbox.org
|
|
# See the file 'docs/LICENSE' for copying permission.
|
|
|
|
import os.path
|
|
import sys
|
|
|
|
if __name__ == "__main__":
|
|
if len(sys.argv) != 2:
|
|
print "Usage: python %s <filepath>" % sys.argv[0]
|
|
exit(1)
|
|
|
|
# Takes the file, reverses its contents, and writes it to tests/files/.
|
|
content = open(sys.argv[1], "rb").read()
|
|
filepath = os.path.join("tests", "files", os.path.basename(sys.argv[1]))
|
|
open(filepath, "wb").write(content[::-1])
|