{"id":13438226,"url":"https://github.com/anestisb/melkor-android","last_synced_at":"2025-10-28T09:51:49.979Z","repository":{"id":19906777,"uuid":"23172185","full_name":"anestisb/melkor-android","owner":"anestisb","description":"  An Android port of the melkor ELF fuzzer","archived":false,"fork":false,"pushed_at":"2014-08-21T03:09:07.000Z","size":198,"stargazers_count":61,"open_issues_count":0,"forks_count":13,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-19T18:40:04.510Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anestisb.png","metadata":{"files":{"readme":"README.txt","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-21T03:03:49.000Z","updated_at":"2025-03-16T10:40:37.000Z","dependencies_parsed_at":"2022-08-26T22:00:47.527Z","dependency_job_id":null,"html_url":"https://github.com/anestisb/melkor-android","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anestisb/melkor-android","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anestisb%2Fmelkor-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anestisb%2Fmelkor-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anestisb%2Fmelkor-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anestisb%2Fmelkor-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anestisb","download_url":"https://codeload.github.com/anestisb/melkor-android/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anestisb%2Fmelkor-android/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281418064,"owners_count":26497723,"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","status":"online","status_checked_at":"2025-10-28T02:00:06.022Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-07-31T03:01:03.815Z","updated_at":"2025-10-28T09:51:49.952Z","avatar_url":"https://github.com/anestisb.png","language":"C","readme":" ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~\r\n|                        -- DESCRIPTION --                        |\r\n ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~\r\n\r\nMelkor - An ELF File Format Fuzzer\r\n\r\nMelkor, a fictional character from J. R. R. Tolkien's Middle-earth \r\nlegendarium, was the first Dark Lord and master of Sauron. He's \r\nmentioned briefly in The Lord of the Rings and is known for:\r\n\r\n\"... Melkor had captured a number of ELVES before the Valar \r\nattacked him, and he tortured and corrupted them, breeding the \r\nfirst Orcs.\" (http://en.wikipedia.org/wiki/Morgoth)\r\n\r\n\"... Melkor was cunning and more filled with malice than ever. \r\nSeeing the bliss of the ELVES and remembering that it was for their \r\nsake that he was overthrown, Melkor desired above all things to \r\ncorrupt them.\" (http://lotr.wikia.com/wiki/Melkor)\r\n\r\n\"Orcs...This has been so from the day they were bred by Melkor from \r\ncorrupted, tortured and mutilated ELVES that may also have been \r\nforced to breed with other unnatural abominations in the dominion \r\nof the Dark Powers.\" (http://lotr.wikia.com/wiki/Orcs)\r\n\r\nTo honor his name, this piece of code takes an ELF, corrupts it and\r\ncreates as much Orcs as you want.\r\n\r\nMelkor is a hybrid fuzzer (mutation-based and generation-based).\r\nIt mutates the existing data in an ELF sample given to create orcs\r\n(malformed ELFs), however, it doesn't change values randomly (dumb \r\nfuzzing), instead, it fuzzes certain metadata with semi-valid values\r\nthrough the use of fuzzing rules (knowledge base). Written in C, \r\nMelkor is a very intuitive and easy-to-use fuzzer to find functional\r\n(and security) bugs in ELF parsers.\r\n\r\nThe fuzzing rules were designed with the following inputs in mind:\r\n- ELF Specification violations\r\n  * TIS ELF Specification 1.2 (May, 1995)\r\n  * ELF-64 Object File Format 1.5 (May 1998)\r\n- Misc ideas \u0026 considerations\r\n- Parsing patterns in ELF software\r\n\r\nYou will find the fuzzing rules in detail and some other schematics\r\nin the docs/ directory.\r\n\r\n\r\n\r\n ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~\r\n|                        -- REQUIREMENTS --                       |\r\n ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~\r\n\r\n- make\r\n- gcc\r\n\r\n\r\n\r\n ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~\r\n|                  -- COMPILATION \u0026 USAGE --                      |\r\n ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~\r\nThe compilation is very straightforward, just type:\r\n$make\r\n\r\nIt will create the file 'melkor', which is the fuzzer itself, and\r\nsome other ELF files inside the templates/ folder, including normal\r\nELF files such as a normal ELF executable, some shared libraries, \r\nan static ELF (standalone executable) and some others.\r\n\r\nBy running melkor, a list of options will be shown and you will\r\nrealize that it's very intuitive and easy-to-use. All you have to\r\nsupply is the name of an ELF to be used as a template, which could\r\nbe any of the ones inside the templates/ dir.\r\n\r\nDepending on what kind of software you want to test, you have to\r\nchoose which metadata you want to fuzz. For example, if you want\r\nto test an OS loader, you probably might want to fuzz only the\r\nProgram Header Table (-P) and/or the Dynamic Section (-D). On the\r\nother hand, perhaps you might want to fuzz the Section Header\r\nTable and the ELF Header to test any antivirus engine or debugger.\r\nFuzzing the Symbols Tables (-s) and/or Relocations Tables (-R) on\r\nrelocatable files (.o) or shared libraries (.so) to test compilers\r\nand/or linkers. The String Tables could be fuzzed as well (-Z).\r\nIt's up to you to decide how badly you want to corrupt an ELF }:-)\r\n\r\nOnce the orcs have been created inside the orcs_*/ dir, it's time\r\nto test them with the help of test_fuzzed.sh, where you can simply\r\nspecify the name of the folder with the orcs to be run (OS loader\r\ntesting) or add an extra parameter to specify which program (and\r\nits parameters) you'd like to test against every malformed ELF \r\nwithin the orcs folder. This script has the option to fuzz some\r\nenvironment variables (defined as fuzzing rules as well).\r\nShowing logs with #dmesg after running the script could be useful\r\nto identify which program/library crashed and where that crash was.\r\nSome examples are shown running the script without parameters.\r\n\r\nIf you want test the malformed ELFs (orcs) automatically on Windows\r\nenvironment, there is included a batch script (win_test_fuzzed.bat)\r\nwith almost the same functionality of the script for *NIX.\r\n\r\nHappy Fuzzing !\r\n\r\n\r\n ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~\r\n|                           -- DIRS --                            |\r\n ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~\r\n\r\n- docs/      Contains related documentation such as the detailed\r\n             list of fuzzing rules as well as the list of ELF\r\n             metadata dependencies.\r\n\r\n- templates/ It has some ELF files compiled at the same time than\r\n             melkor and could be used to feed melkor:\r\n             foo.c    -\u003e foo.o (ELF object)-\u003e foo (ELF executable)\r\n             foo.c    -\u003e foo_static (ELF static executable)\r\n             libfoo.c -\u003e libfoo.so (ELF shared object)\r\n             and some others. Type \"$make templ\" to see in detail\r\n             which other ELF templates are created.\r\n\r\n- orcs_*/    Will contain the malformed ELF files (based on the \r\n             given template file) created after the fuzzing process.\r\n\r\n- src/       Melkor source code.\r\n\r\n\r\n\r\n ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~\r\n|                           -- BUGS --                            |\r\n ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~\r\n\r\nPlease read BUGS.txt\r\n\r\n\r\n\r\n ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~\r\n|                          -- CONTACT --                          |\r\n ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~\r\n\r\nName:      Alejandro Hernandez H. [nitr0us]\r\nTwitter:   http://twitter.com/nitr0usmx\r\nEmail:     nitrousenador [at] gmail [dot] com\r\nWebsite:   http://www.brainoverflow.org\r\nBlog:      http://chatsubo-labs.blogspot.com\r\n\r\n\r\n\r\n ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~\r\n|                        -- IN MEMORIAL --                        |\r\n ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~\r\n\r\nThis project is dedicated to the memory of one of my best friends,\r\nAaron Alba.\r\n\r\n\r\n\r\n ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~\r\n|                          -- LICENSE --                          |\r\n ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~\r\n\r\nMelkor - An ELF File Format Fuzzer\r\nCopyright (C) 2014 Alejandro Hernandez H. (nitr0us)\r\n\r\nThis program is free software: you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful,\r\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r\nGNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License \r\nalong with this program. If not, see \u003chttp://www.gnu.org/licenses/\u003e.\r\n","funding_links":[],"categories":["Android Security","Tools"],"sub_categories":["Fuzz Testing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanestisb%2Fmelkor-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanestisb%2Fmelkor-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanestisb%2Fmelkor-android/lists"}