{"id":159455,"url":"https://github.com/stoerchl/yara_zip_module","last_synced_at":"2025-07-27T06:30:39.859Z","repository":{"id":61803587,"uuid":"156281920","full_name":"stoerchl/yara_zip_module","owner":"stoerchl","description":null,"archived":false,"fork":false,"pushed_at":"2022-10-21T12:23:53.000Z","size":85,"stargazers_count":12,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-13T03:32:11.179Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stoerchl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-05T20:56:17.000Z","updated_at":"2023-08-11T06:33:36.000Z","dependencies_parsed_at":"2022-10-21T12:45:26.632Z","dependency_job_id":null,"html_url":"https://github.com/stoerchl/yara_zip_module","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stoerchl%2Fyara_zip_module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stoerchl%2Fyara_zip_module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stoerchl%2Fyara_zip_module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stoerchl%2Fyara_zip_module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stoerchl","download_url":"https://codeload.github.com/stoerchl/yara_zip_module/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227772147,"owners_count":17817641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-06T16:40:38.084Z","updated_at":"2024-12-02T17:30:52.331Z","avatar_url":"https://github.com/stoerchl.png","language":"C","funding_links":[],"categories":["Tools"],"sub_categories":[],"readme":"# yara_zip_module\n\nThis yara module can be used to search for strings inside a zip (.docx word file format) file. The files inside a zip are compressed and therefore not very well searchable for strings. This yara module unzips a requested file in memory and searches for a given string.\n\n## Installation\nThe installation of the module should be pretty simple, but yara has to be built from source..\n1. Clone the yara repository (https://github.com/VirusTotal/yara)\n2. Copy yara_zip_modules files into the libyara folder of the yara clone:\n```\n\tyara_zip_module/miniz.c --\u003e yara/libyara/miniz.c\n\t\n\tyara_zip_module/include/yara/miniz.h --\u003e yara/libyara/include/yara/miniz.h\n\n\tyara_zip_module/modules/zip.c --\u003e yara/libyara/modules/zip.c\n```\n3. Edit the file yara/libyara/Makefile.am and add the module as well as the miniz library:\n```\n\tMODULES += modules/zip.c\n\n\tyarainclude_HEADERS = include/yara/miniz.h\n\t\n\tlibyara_la_SOURCES = miniz.c\n```\t\n4. Add the module to the module_list file in the modules folder:\n```\t\n\tMODULE(zip)\n```\t\n5. Now you can build yara by executing the make command inside the root folder.\n\nMore information can be found here: https://yara.readthedocs.io/en/v3.7.0/writingmodules.html\n\n## Usage\n\nThe yara zip module has at the moment only one function `has_string(\u003cfile_inside_zip\u003e, \u003csearch_string\u003e)`\nFollowing an example of a yara rule using the `has_string(..)` function.\nIf the given string was found, then the return value of the `has_string` function equals the offset inside the requested file.\n\n\timport \"zip\"\n\n\trule embedded_html\n\t{\n\t    meta:\n\t    author = \"@stoerchl\"\n\t    info = \"searches for a given string inside a zip file\"\n      \n\t    condition:\n\t        zip.has_string(\"word/document.xml\", \"wp15:webVideoPr\") \u003e 0\n\t}\n\n\n## Thanks to\nThis module would not be working without this data compression library:\n\nhttps://github.com/richgel999/miniz/\n\nAnd without the yara project there obviously would have been no new yara module ;-)\n\nhttps://github.com/VirusTotal/yara\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstoerchl%2Fyara_zip_module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstoerchl%2Fyara_zip_module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstoerchl%2Fyara_zip_module/lists"}