{ "info": { "author": "Jelle Vergeer / Fox-IT", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# mkYARA\nWriting YARA rules based on executable code within malware can be a tedious task. An analyst cannot simply copy and paste raw executable code into a YARA rule, because this code contains variable values, such as memory addresses and offsets. The analyst has to disassemble the code and wildcard all the pieces in the code that can change between samples. mkYARA aims to automate this part of writing rules by generating executable code signatures that wildcard all these little pieces of executable code that are not static.\n\n## Installation\nInstallation is as easy as installing the pip package.\n``` \npip install mkyara\n```\n\n## Usage\n```python\nimport codecs\nfrom capstone import CS_ARCH_X86, CS_MODE_32\nfrom mkyara import YaraGenerator\n\ngen = YaraGenerator(\"normal\", CS_ARCH_X86, CS_MODE_32)\ngen.add_chunk(b\"\\x90\\x90\\x90\", offset=1000)\ngen.add_chunk(codecs.decode(\"6830800000E896FEFFFFC3\", \"hex\"), offset=0x100)\ngen.add_chunk(b\"\\x90\\x90\\x90\\xFF\\xD7\", is_data=True)\nrule = gen.generate_rule()\nrule_str = rule.get_rule_string()\nprint(rule_str)\n```\n\n## Standalone Tool\nmkYARA comes with a standalone tool that is cross platform, as in, it can create signatures for Windows binaries running under Linux. \n\n```commandline\nusage: mkyara [-h] [-i {x86}] [-a {32,64,x86,x64}] -f FILE_PATH [-n RULENAME]\n -o OFFSET -s SIZE [-m {loose,normal,strict}] [-r RESULT] [-v]\n\nGenerate a Yara rule based on disassembled code\n\noptional arguments:\n -h, --help show this help message and exit\n -i {x86}, --instruction_set {x86}\n Instruction set\n -a {32,64,x86,x64}, --instruction_mode {32,64,x86,x64}\n Instruction mode\n -f FILE_PATH, --file_path FILE_PATH\n Sample file path\n -n RULENAME, --rulename RULENAME\n Generated rule name\n -o OFFSET, --offset OFFSET\n File offset for signature\n -s SIZE, --size SIZE Size of desired signature\n -m {loose,normal,strict}, --mode {loose,normal,strict}\n Wildcard mode for yara rule generation\n loose = wildcard all operands\n normal = wildcard only displacement operands\n strict = wildcard only jmp/call addresses\n -r RESULT, --result RESULT\n Output file\n -v, --verbose Increase verbosity\n\n```\n\n\n## IDA Plugin\nmkYARA comes with a IDA plugin to easily create YARA signatures by selecting a set of instructions and choosing one of the mkYARA -> Generate YARA rule options. Installation is as easy as installing the pip package and copying the mkyara_plugin.py to your IDA plugin directory.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "YARA IDA", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "mkYARA", "package_url": "https://pypi.org/project/mkYARA/", "platform": "", "project_url": "https://pypi.org/project/mkYARA/", "project_urls": null, "release_url": "https://pypi.org/project/mkYARA/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "Generating YARA rules based on binary code", "version": "1.0.0" }, "last_serial": 4997183, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "8134df70e63a8b8eca529f60edd2c627", "sha256": "5fa3fa8dc1342adb4818ab111f23891fcb817caff09941b295593c54207a010e" }, "downloads": -1, "filename": "mkYARA-1.0.0.tar.gz", "has_sig": false, "md5_digest": "8134df70e63a8b8eca529f60edd2c627", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6582, "upload_time": "2019-03-28T11:03:24", "url": "https://files.pythonhosted.org/packages/b0/2e/da30e5e4ae94eaacf88b41ea776b7228df97a7cbd931da2c1e112020f317/mkYARA-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8134df70e63a8b8eca529f60edd2c627", "sha256": "5fa3fa8dc1342adb4818ab111f23891fcb817caff09941b295593c54207a010e" }, "downloads": -1, "filename": "mkYARA-1.0.0.tar.gz", "has_sig": false, "md5_digest": "8134df70e63a8b8eca529f60edd2c627", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6582, "upload_time": "2019-03-28T11:03:24", "url": "https://files.pythonhosted.org/packages/b0/2e/da30e5e4ae94eaacf88b41ea776b7228df97a7cbd931da2c1e112020f317/mkYARA-1.0.0.tar.gz" } ] }