{"id":23138284,"url":"https://github.com/jim3/network-packet-analyzer","last_synced_at":"2026-02-11T05:04:07.302Z","repository":{"id":176410352,"uuid":"655883351","full_name":"jim3/Network-Packet-Analyzer","owner":"jim3","description":"A web application with API capabilities that analyzes Wireshark packets","archived":false,"fork":false,"pushed_at":"2025-02-22T01:42:04.000Z","size":224,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-22T02:30:19.237Z","etag":null,"topics":["api-endpoints","expressjs","javascript","mongodb-atlas","mongoose","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/jim3.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-19T20:11:19.000Z","updated_at":"2025-02-22T01:42:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"b8162ba7-626f-42da-8aaa-8a798a5b302f","html_url":"https://github.com/jim3/Network-Packet-Analyzer","commit_stats":null,"previous_names":["jim3/network-packet-analyzer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jim3%2FNetwork-Packet-Analyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jim3%2FNetwork-Packet-Analyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jim3%2FNetwork-Packet-Analyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jim3%2FNetwork-Packet-Analyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jim3","download_url":"https://codeload.github.com/jim3/Network-Packet-Analyzer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247157133,"owners_count":20893210,"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":["api-endpoints","expressjs","javascript","mongodb-atlas","mongoose","nodejs"],"created_at":"2024-12-17T13:10:24.500Z","updated_at":"2025-04-04T09:44:03.704Z","avatar_url":"https://github.com/jim3.png","language":"JavaScript","readme":"### Network Packet Analyzer (Wireshark)\r\n\r\nThe application analyzes exported Wireshark packets in JSON format. [see here](https://www.wireshark.org/docs/wsug_html_chunked/ChIOExportSection.html) Currently, it displays the following:\r\n\r\n1. IP location details (city, state, country, etc...)\r\n2. List of unique IP addresses\r\n3. List of unique MAC addresses\r\n4. List of unique TCP \u0026 UDP port numbers\r\n5. DNS queries / answers\r\n6. HTTP request methods, user agent, etc..\r\n\r\nThere is an HTML front-end for the app at the root endpoint `/`. This allows you upload your exported json file for parsing. The server code extracts the data and responds back to the client with JSON. I created an endpoint located at `/api/packet/data` that displays the results in HTML/EJS table format, `http://127.0.0.1/api/packet/data`. If you need customized output all you have to do is edit the functions inside `packetAnalyzer.js` file.\r\n\r\nI included [MongoDB Atlas](https://www.mongodb.com/atlas) into the full-stack app. It reads from the last packet in the collection and Express renders it to the `/api/packet/data` endpoint. See examples of it at the bottom of the README.md\r\n\r\n## Getting Started\r\n\r\nIdeally, it should be as easy as issuing `npm install`, filling in your `.env` file and `nodemon index.js` It's been tested on Linux (Debian based) and Windows 10.\r\n\r\n-   To get the IP address location details I used the [ip2location.io](https://www.ip2location.io) API.\r\n-   For MongoDB Atlas, Place your connection string info inside the `.env` file. There is an `env.example`.\r\n\r\n### Installation\r\n\r\nClone the repo\r\n\r\n```bash\r\ngit clone https://github.com/jim3/Network-Packet-Analyzer.git\r\n```\r\n\r\nInstall dependencies\r\n\r\n```bash\r\nnpm install\r\n```\r\n\r\n### Usage\r\n\r\nCapture some Wireshark packets, use a capture filter for better results:\r\n\r\n- Wireshark `host \u003cYourIP\u003e and not broadcast and not multicast and ip` then `File \u003e Export Packet Dissections \u003e As JSON`\r\n\r\n- TShark: `./tshark -i \u003cinterface\u003e -T json -c 100 \u003e \u003cpath to json file\u003e`\r\n\r\n\r\nRun the script\r\n\r\n```bash\r\nnodemon index.js\r\n```\r\n\r\nOpen your browser and go to:\r\n\r\n1. `http://localhost:3000/` and upload your exported wireshark file, the server will respond with the details in JSON.\r\n\r\nVist `http://localhost:3000/api/packet/data` to view the results of the last file written to your MongoDB Atlas database/collection.\r\n\r\n## Technology Used\r\n\r\n-   [Node.js](https://nodejs.org/en/) - JavaScript runtime\r\n-   [npm](https://www.npmjs.com/) - Package manager\r\n-   [MongoDB Atlas](https://www.mongodb.com/atlas)\r\n-   [Mongoose](https://mongoosejs.com)\r\n-   [WireShark](https://www.wireshark.org/) - Network protocol analyzer\r\n-   [JSON](https://www.json.org/) - Data format\r\n-   [JavaScript](https://learnjavascript.online/) - Programming language\r\n-   [Visual Studio Code](https://code.visualstudio.com/) - Code editor\r\n\r\n---\r\n\r\n### HTML Table Output Example\r\n\r\n![01-table](https://github.com/jim3/Network-Packet-Analyzer/assets/11630112/2261c091-bb09-4692-823d-9a366483d168)\r\n\r\n\r\n\r\n\r\n### JSON Output Example\r\n\r\n```json\r\n{\r\n  \"ipAddr\": [\r\n    \"192.168.0.205\",\r\n    \"108.166.149.2\",\r\n    \"209.197.3.8\",\r\n    \"17.253.7.203\",\r\n    \"54.174.225.91\",\r\n    \"185.199.111.153\",\r\n    \"52.39.121.148\",\r\n    \"172.253.124.188\"\r\n  ],\r\n  \"dnsArray\": [\r\n    \"ctldl.windowsupdate.com\",\r\n    \"wu-bg-shim.trafficmanager.net\",\r\n    \"cds.d2s7q6s2.hwcdn.net\",\r\n    \"crl.apple.com\",\r\n    \"crl-lb.apple.com.akadns.net\",\r\n    \"crl.g.aaplimg.com\"\r\n  ],\r\n  \"httpArray\": [\r\n    \"ctldl.windowsupdate.com\",\r\n    \"http://ctldl.windowsupdate.com/msdownload/update/v3/static/trustedr/en/authrootstl.cab\",\r\n    \"Microsoft-CryptoAPI/10.0\",\r\n    \"crl.apple.com\",\r\n    \"http://crl.apple.com/appleserverauthca1.crl\",\r\n    \"http://crl.apple.com/root.crl\"\r\n  ],\r\n  \"macArray\": [\r\n    \"02:10:18:84:63:f3\",\r\n    \"34:17:eb:dc:d2:f9\"\r\n  ],\r\n  \"udpArray\": [\r\n    \"53\",\r\n    \"49788\",\r\n    \"61820\"\r\n  ],\r\n  \"tcpArray\": [\r\n    \"80\",\r\n    \"25633\",\r\n    \"25634\",\r\n    \"443\",\r\n    \"25539\",\r\n    \"25567\",\r\n    \"25283\",\r\n    \"5228\",\r\n    \"25272\"\r\n  ],\r\n  \"ipDetails\": {\r\n    \"ipDetailsSource\": [\r\n      {\r\n        \"ip\": \"192.168.0.205\",\r\n        \"country_code\": \"-\",\r\n        \"country_name\": \"-\",\r\n        \"region_name\": \"-\",\r\n        \"city_name\": \"-\",\r\n        \"latitude\": null,\r\n        \"longitude\": null,\r\n        \"zip_code\": \"-\",\r\n        \"time_zone\": \"-\",\r\n        \"asn\": \"-\",\r\n        \"as\": \"-\",\r\n        \"is_proxy\": false\r\n      },\r\n      {\r\n        \"ip\": \"108.166.149.2\",\r\n        \"country_code\": \"US\",\r\n        \"country_name\": \"United States of America\",\r\n        \"region_name\": \"New York\",\r\n        \"city_name\": \"New York City\",\r\n        \"latitude\": 41.353013,\r\n        \"longitude\": -74.2637,\r\n        \"zip_code\": \"10918\",\r\n        \"time_zone\": \"-04:00\",\r\n        \"asn\": \"30036\",\r\n        \"as\": \"Mediacom Communications Corp\",\r\n        \"is_proxy\": false\r\n      },\r\n\r\n```\r\n\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjim3%2Fnetwork-packet-analyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjim3%2Fnetwork-packet-analyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjim3%2Fnetwork-packet-analyzer/lists"}