{"id":16271106,"url":"https://github.com/morpheuslord/nmap-api","last_synced_at":"2025-04-06T18:17:10.837Z","repository":{"id":143402550,"uuid":"532720773","full_name":"morpheuslord/Nmap-API","owner":"morpheuslord","description":"Uses python3.10, Debian, python-Nmap, OpenaAI, and flask framework to create a Nmap API that can do scans with a good speed online and is easy to deploy.  This is a implementation for our college PCL project which is still under development and constantly updating.","archived":false,"fork":false,"pushed_at":"2025-01-22T19:08:53.000Z","size":234,"stargazers_count":78,"open_issues_count":0,"forks_count":18,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-30T17:09:26.658Z","etag":null,"topics":["chatgpt","flask","flask-restful","flask-sqlalchemy","hacking","hacking-tool","nmap","nmap-api","nmap-scanner-api","nmap-scripts","nmap-vulnerability","openai-api","poc","python","python-flask-api","python-nmap-api","reasearch-papers"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/morpheuslord.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-05T02:47:49.000Z","updated_at":"2025-02-27T00:11:37.000Z","dependencies_parsed_at":"2023-11-09T12:42:22.415Z","dependency_job_id":"86e7d193-4069-4830-ac29-4124c40f095a","html_url":"https://github.com/morpheuslord/Nmap-API","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/morpheuslord%2FNmap-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpheuslord%2FNmap-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpheuslord%2FNmap-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morpheuslord%2FNmap-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/morpheuslord","download_url":"https://codeload.github.com/morpheuslord/Nmap-API/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247526768,"owners_count":20953143,"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":["chatgpt","flask","flask-restful","flask-sqlalchemy","hacking","hacking-tool","nmap","nmap-api","nmap-scanner-api","nmap-scripts","nmap-vulnerability","openai-api","poc","python","python-flask-api","python-nmap-api","reasearch-papers"],"created_at":"2024-10-10T18:12:30.290Z","updated_at":"2025-04-06T18:17:10.819Z","avatar_url":"https://github.com/morpheuslord.png","language":"HTML","readme":"# Nmap API\r\n\r\nUses python3.10, Debian, python-Nmap, and flask framework to create an Nmap API that can do scans with a good speed online and is easy to deploy.\r\n\r\nThis is an implementation for our college PCL project which is still under development and constantly updating.\r\n\r\n## API Reference\r\n\r\n#### Get all items\r\n\r\n```\r\n  GET /api/p1/{auth_key}/{target}\r\n  GET /api/p2/{auth_key}/{target}\r\n  GET /api/p3/{auth_key}/{target}\r\n  GET /api/p4/{auth_key}/{target}\r\n  GET /api/p5/{auth_key}/{target}\r\n```\r\n\r\n| Parameter  | Type     | Description                              |\r\n| :--------- | :------- | :--------------------------------------- |\r\n| `auth_key` | `string` | **Required**. The API auth key gebe      |\r\n| `target`   | `string` | **Required**. The target Hostname and IP |\r\n\r\n#### Get item\r\n\r\n```\r\n  GET /api/p1/\r\n  GET /api/p2/\r\n  GET /api/p3/\r\n  GET /api/p4/\r\n  GET /api/p5/\r\n  GET /api/p6/\r\n  GET /api/p7/\r\n  GET /api/p8/\r\n  GET /api/p9/\r\n  GET /api/p10/\r\n  GET /api/p11/\r\n  GET /api/p12/\r\n  GET /api/p13/\r\n```\r\n\r\n| Parameter | Return data | Description                                          | Nmap Command                                          |\r\n| :-------- | :---------- | :--------------------------------------------------- | :---------------------------------------------------- |\r\n| `p1`      | `json`      | Effective Scan                                       | `-Pn -sV -T4 -O -F`                                   |\r\n| `p2`      | `json`      | Simple Scan                                          | `-Pn -T4 -A -v`                                       |\r\n| `p3`      | `json`      | Low Power Scan                                       | `-Pn -sS -sU -T4 -A -v`                               |\r\n| `p4`      | `json`      | Partial Intense Scan                                 | `-Pn -p- -T4 -A -v`                                   |\r\n| `p5`      | `json`      | Complete Intense Scan                                | `-Pn -sS -sU -T4 -A -PE -PP  -PY -g 53 --script=vuln` |\r\n| `p6`      | `json`      | Comprehensive Service Version Detection              | `-Pn -sV -p- -A`                                      |\r\n| `p7`      | `json`      | Aggressive Scan with OS Detection                    | `-Pn -sS -sV -O -T4 -A`                               |\r\n| `p8`      | `json`      | Script Scan for Common Vulnerabilities               | `-Pn -sC`                                             |\r\n| `p9`      | `json`      | Intense Scan, All TCP Ports                          | `-Pn -p 1-65535 -T4 -A -v`                            |\r\n| `p10`     | `json`      | UDP Scan                                             | `-Pn -sU -T4`                                         |\r\n| `p11`     | `json`      | Service and Version Detection for Top Ports          | `-Pn -sV --top-ports 100`                             |\r\n| `p12`     | `json`      | Aggressive Scan with NSE Scripts for Vulnerabilities | `-Pn -sS -sV -T4 --script=default,discovery,vuln`     |\r\n| `p13`     | `json`      | Fast Scan for Common Ports                           | `-Pn -F`                                              |\r\n\r\n#### Auth and User management\r\n\r\n```\r\n  GET /register/\u003cint:user_id\u003e/\u003cstring:password\u003e\r\n```\r\n\r\n| Parameter | Type     | Description |\r\n| :-------- | :------- | :---------- |\r\n| `ID`      | `Int`    | user ID     |\r\n| `Passwd`  | `String` | User Passwd |\r\n\r\n## Improvements\r\n\r\nAdded GPT functionality with chunking module.\r\nThe methodology is based on how `Langchain GPT embeddings` operate. Basically the operation goes like this:\r\n\r\n```text\r\nData -\u003e Chunks_generator ─┐            ┌─\u003e AI_Loop -\u003e Data_Extraction -\u003e Return_Data\r\n                          ├─\u003e Chunk1  ─┤\r\n                          ├─\u003e Chunk2  ─┤\r\n                          ├─\u003e Chunk3  ─┤\r\n                          └─\u003e Chunk N ─┘\r\n```\r\n\r\nAI code:\r\n\r\n```python\r\ndef AI(analize: str) -\u003e dict[str, any]:\r\n    prompt = f\"\"\"\r\n        Do a NMAP scan analysis on the provided NMAP scan information\r\n        The NMAP output must return in a JSON format accorging to the provided\r\n        output format. The data must be accurate in regards towards a pentest report.\r\n        The data must follow the following rules:\r\n        1) The NMAP scans must be done from a pentester point of view\r\n        2) The final output must be minimal according to the format given.\r\n        3) The final output must be kept to a minimal.\r\n        4) If a value not found in the scan just mention an empty string.\r\n        5) Analyze everything even the smallest of data.\r\n        6) Completely analyze the data provided and give a confirm answer using the output format.\r\n\r\n        The output format:\r\n        {{\r\n            \"critical score\": [\"\"],\r\n            \"os information\": [\"\"],\r\n            \"open ports\": [\"\"],\r\n            \"open services\": [\"\"],\r\n            \"vulnerable service\": [\"\"],\r\n            \"found cve\": [\"\"]\r\n        }}\r\n\r\n        NMAP Data to be analyzed: {analize}\r\n    \"\"\"\r\n    messages = [{\"content\": prompt, \"role\": \"assistant\"}]\r\n    response = openai.ChatCompletion.create(\r\n        model=model_engine,\r\n        messages=messages,\r\n        max_tokens=2500,\r\n        n=1,\r\n        stop=None,\r\n    )\r\n    response = response['choices'][0]['message']['content']\r\n    ai_output = {\r\n        \"markdown\": response\r\n    }\r\n\r\n    return ai_output\r\n```\r\n\r\n**Default_Key**: **e43d4**\r\n`newer updates are still in progress`\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorpheuslord%2Fnmap-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorpheuslord%2Fnmap-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorpheuslord%2Fnmap-api/lists"}