{"id":13508716,"url":"https://github.com/fklement/hades","last_synced_at":"2026-03-05T02:03:15.493Z","repository":{"id":57504076,"uuid":"238936978","full_name":"fklement/hades","owner":"fklement","description":"A wrapper for NMAP written in Elixir.","archived":false,"fork":false,"pushed_at":"2020-03-25T13:14:37.000Z","size":35,"stargazers_count":27,"open_issues_count":3,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-21T15:29:00.799Z","etag":null,"topics":["elixir","nmap","nmap-command","ping-scans","wrapper"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/hades/","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fklement.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-07T14:02:23.000Z","updated_at":"2024-11-08T14:12:46.000Z","dependencies_parsed_at":"2022-08-28T02:01:33.316Z","dependency_job_id":null,"html_url":"https://github.com/fklement/hades","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/fklement/hades","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fklement%2Fhades","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fklement%2Fhades/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fklement%2Fhades/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fklement%2Fhades/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fklement","download_url":"https://codeload.github.com/fklement/hades/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fklement%2Fhades/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30106155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T01:39:18.192Z","status":"online","status_checked_at":"2026-03-05T02:00:06.710Z","response_time":93,"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":["elixir","nmap","nmap-command","ping-scans","wrapper"],"created_at":"2024-08-01T02:00:57.453Z","updated_at":"2026-03-05T02:03:15.453Z","avatar_url":"https://github.com/fklement.png","language":"Elixir","funding_links":[],"categories":["Networking"],"sub_categories":[],"readme":"\u003cp align=center\u003e\u003cimg src=\"logo.png\" width=\"350px\"\u003e\u003c/p\u003e\n\n[![hex.pm version](https://img.shields.io/hexpm/v/hades.svg?style=flat)](https://hex.pm/packages/hades)\n[![Build Status](https://travis-ci.com/fklement/hades.svg?branch=master)](https://travis-ci.com/fklement/hades)\n[![hex.pm downloads](https://img.shields.io/hexpm/dt/hades.svg?style=flat)](https://hex.pm/packages/hades)\n[![hex.pm licence](https://img.shields.io/hexpm/l/hades.svg?style=flat)](https://hex.pm/packages/hades)\n[![Gitter](https://badges.gitter.im/HadesEx/community.svg)](https://gitter.im/HadesEx/community?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n\nA wrapper for `NMAP` written in [Elixir](http://elixir-lang.org/).\n\u003e Used version: Nmap 7.80 \n\nNmap (network mapper), the god of port scanners used for network discovery and the basis for most security enumeration during the initial stages of a penetration test. The tool was written and maintained by Fyodor AKA Gordon Lyon.\n\nNmap displays exposed services on a target machine along with other useful information such as the verion and OS detection.\n\nNmap has made twelve movie appearances, including The Matrix Reloaded, Die Hard 4, Girl With the Dragon Tattoo, and The Bourne Ultimatum.\n\nDocumentation: https://hexdocs.pm/hades   \n    \n\n\u003e **INFO**:   \n\u003e `Hades` is still under development and by far not complete. Feel free to contribute.  \n\u003e See [General Informations](##General-Informations) for more about this project\n\n## Installation\n\nTo use Hades in your Mix projects, first add Hades as a dependency.\n\n```elixir\ndef deps do\n  [\n    {:hades, \"~\u003e 0.0.1\"},\n  ]\nend\n```\n\n\n## Prerequisites\n\n[NMAP](https://nmap.org) must be installed.\n\n### Add nmap command to sudoers\n\nSome of the `NMAP` commands require `sudo` to be executed.\nIn order to process such commands with `Hades` you need to add those commads.  \nThe following shows an example on how to add one to sudoers:\n```sh\nCmnd_Alias NMAP = /usr/bin/nmap -n -oG - -sU -p *\n\n%wheel ALL=(root) NOPASSWD: NMAP\n\nDefaults!NMAP !requiretty\n```\n\nIf you want to know more about `NMAP sudo` behaviour you can find a thread on `SuperUser` here:  \n[different behavior: “sudo nmap” vs just “nmap”?](https://superuser.com/questions/887887/different-behavior-sudo-nmap-vs-just-nmap)\n\n\n## Configuration\n\nYou can optionally specify the `timeout` and the `output_path` in `config.exs`:\n\n```elixir\nconfig :hades, timeout: 20_000\nconfig :hades, output_path: \"/path/to/your/desired/output/folder\"\n```\n\nThe `timeout` is specified in milliseconds. \nIf unspecified, return the default `timeout` which is currently `300_000` (corresponds to 5 minutes).\nThis `timeout` is propagated to the function `Task.await()`.\nIf the specified `timeout` period is exceeded, it is assumed that the process running the NMAP command has timed out.\n\nThe `output_path` is the place where the XML output of the executed `NMAP` command gets stored.\nIf there is nothing specified in the config then the default path (which is located in the `tmp` folder) will be returned.\n\n## Examples\n\n### Simple ping scan\nThe snippet below ping scans the network, and lists the target machine if it responds to ping.\n```elixir\niex\u003e Hades.new_command()\n...\u003e |\u003e Hades.add_argument(Hades.Arguments.ScanTechniques.arg_sP())\n...\u003e |\u003e Hades.add_target(\"192.168.120.42\")\n...\u003e |\u003e Hades.scan()\n12:19:25.739 [info]  NMAP Output: \"Starting Nmap 7.80 ( https://nmap.org ) at 2020-02-07 12:19 CET\\n\"\n\n12:19:25.788 [info]  NMAP Output: \"Nmap scan report for Felix-MACNCHEESEPRO.root.box (192.168.120.42)\\nHost is up (0.00045s latency).\\n\"\n\n12:19:25.788 [info]  NMAP Output: \"Nmap done: 1 IP address (1 host up) scanned in 0.06 seconds\\n\"\n\n12:19:25.789 [info]  Port exit: :exit_status: 0\n\n12:19:25.789 [info]  EXIT\n\n12:19:25.790 [info]  DOWN message from port: #Port\u003c0.14\u003e\n%{\n  hosts: [\n    %{hostname: \"Felix-MACNCHEESEPRO.root.box\", ip: \"192.168.120.42\", ports: []}\n  ],\n  time: %{\n    elapsed: 0.06,\n    endstr: \"Fri Feb  7 12:19:25 2020\",\n    startstr: \"Fri Feb  7 12:19:25 2020\",\n    unix: 1581074365\n  }\n}\n```\n\u003e **INFO**: Currently only standard single IPv4 specified targets are supported. In the future I'll add support for IPv4 ranges specified with a subnetmask.\n\u003e This will enable the functionality to scan targets in a specified IP range.\n\n### Using the script argument\nThe execution of `nmap -sV -version-all -script vulners` in `Hades` looks like the following:\n```elixir\niex\u003e Hades.new_command()\n...\u003e |\u003e Hades.add_argument(arg_sV())\n...\u003e |\u003e Hades.add_argument(arg_version_all())\n...\u003e |\u003e Hades.add_argument(arg_script(\"vulners\"))\n...\u003e |\u003e Hades.add_target(\"192.168.120.87\")\n...\u003e |\u003e Hades.scan()\n12:25:13.092 [info]  NMAP Output: \"Starting Nmap 7.80 ( https://nmap.org ) at 2020-02-07 12:25 CET\\n\"\n\n12:25:47.026 [info]  NMAP Output: \"Nmap scan report for batavis (192.168.120.87)\\n\"\n\n12:25:47.030 [info]  NMAP Output: \"Host is up (0.0076s latency).\\nNot shown: 994 closed ports\\nPORT ... CPE: cpe:/o:linux:linux_kernel\\n\\n\"\n\n12:25:47.031 [info]  NMAP Output: \"Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .\\nNmap done: 1 IP address (1 host up) scanned in 33.97 seconds\\n\"\n\n12:25:47.060 [info]  Port exit: :exit_status: 0\n\n12:25:47.060 [info]  EXIT\n\n12:25:47.060 [info]  DOWN message from port: #Port\u003c0.26\u003e\n%{\n  hosts: [\n    %{\n      hostname: \"batavis\",\n      ip: \"192.168.120.87\",\n      ports: [\n        %{\n          name: \"ssh\",\n          output: [],\n          port: 22,\n          product: \"OpenSSH\",\n          script: [],\n          state: \"open\",\n          version: \"7.4p1 Raspbian 10+deb9u6\"\n        },\n        %{\n          name: \"domain\",\n          output: [],\n          port: 53,\n          product: \"dnsmasq\",\n          script: [],\n          state: \"open\",\n          version: \"pi-hole-2.80\"\n        },\n        %{\n          name: \"http\",\n          output: [],\n          port: 80,\n          product: \"Node.js Express framework\",\n          script: [],\n          state: \"open\",\n          version: \"\"\n        },\n        %{\n          name: \"http\",\n          output: ['Problem with XML parsing of /evox/about'],\n          port: 3000,\n          product: \"Mongoose httpd\",\n          script: [\"http-trane-info\"],\n          state: \"open\",\n          version: \"\"\n        },\n        %{\n          name: \"http\",\n          output: ['lighttpd/1.4.45',\n           '\\ncpe:/a:lighttpd:lighttpd:1.4.45: \\nCVE-2018-19052\\t5.0\\thttps://vulners.com/cve/CVE-2018-19052'],\n          port: 8042,\n          product: \"lighttpd\",\n          script: [\"http-server-header\", \"vulners\"],\n          state: \"open\",\n          version: \"1.4.45\"\n        }\n      ]\n    }\n  ],\n  time: %{\n    elapsed: 33.97,\n    endstr: \"Fri Feb  7 12:25:47 2020\",\n    startstr: \"Fri Feb  7 12:25:13 2020\",\n    unix: 1581074747\n  }\n}\n```\nHere the [nmap-vulners](https://github.com/vulnersCom/nmap-vulners) NSE script is used to provide informations on vulnerabilities of well-known services that are running on the target host.\n\n## General Informations\n\nI started implementing this wrapper because I needed to reliably execute 'NMAP' commands in an 'Elixir/Phoenix' project.\nCurrently not 100% of the `NMAP` functionality is implemented, because the current state is sufficient for the current project. \nBut I will complete the functionality as soon as I find the time. \nIn the meantime, if anyone would like to add anything, feel free to do so.\n\n## Release notes\n\nSee the [changelog](CHANGELOG.md) for changes between versions.\n\n## Disclaimer\n\nHades is not affiliated with nor endorsed by the NMAP project.\n\nNMAP was created and is mainted by [Gordon Lyon](https://insecure.org/fyodor/).\nYou can contact him via fyodor@nmap.org.\n\nSome of the documentation parts were copyed from the linux man pages [nmap(1) - Linux man page](https://linux.die.net/man/1/nmap)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffklement%2Fhades","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffklement%2Fhades","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffklement%2Fhades/lists"}