{"id":16557195,"url":"https://github.com/mattwright324/jports","last_synced_at":"2026-06-30T04:31:06.238Z","repository":{"id":47567492,"uuid":"200311983","full_name":"mattwright324/jports","owner":"mattwright324","description":"Flexible, fast, multithreaded address and port scanning library for Java.","archived":false,"fork":false,"pushed_at":"2024-09-13T11:29:37.000Z","size":22,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-28T20:41:46.447Z","etag":null,"topics":["java-library","multithreading-library","network-scanning","port-scanner"],"latest_commit_sha":null,"homepage":"","language":"Java","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/mattwright324.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-08-03T00:08:33.000Z","updated_at":"2025-08-10T08:46:17.000Z","dependencies_parsed_at":"2025-02-13T18:45:12.805Z","dependency_job_id":null,"html_url":"https://github.com/mattwright324/jports","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mattwright324/jports","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattwright324%2Fjports","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattwright324%2Fjports/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattwright324%2Fjports/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattwright324%2Fjports/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattwright324","download_url":"https://codeload.github.com/mattwright324/jports/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattwright324%2Fjports/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34952850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-30T02:00:05.919Z","response_time":92,"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":["java-library","multithreading-library","network-scanning","port-scanner"],"created_at":"2024-10-11T20:06:45.539Z","updated_at":"2026-06-30T04:31:06.233Z","avatar_url":"https://github.com/mattwright324.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jports\nFlexible, fast, multithreaded address and port scanning library for Java.\n\n## Features\n- Java 8\n- Flexible inputs to accept a variety of formats\n  - Single address\n  - Multiple addresses\n  - Address range with start and end\n  - Address range with CIDR notation\n- Endless scanning\n  - With a given address, continuously increase or decrease, stopping when you want it to.\n- Check for open port(s)\n- Multithreaded, specify thread count\n\n## Sample(s)\n\n#### Constructors\nExamples of creating addresses and address blocks\n```java\nnew IPv4Address(3232235521L); // 192.168.0.1\nnew IPv4Address(\"192.168.0.1\");\nnew IPv4Address(\"192.168.0.260\"); // 192.168.1.4\nnew IPv4Address(\"999.999.999.999\"); // 234.234.234.231\n\nnew IPv4AddressBlock(\"192.168.0.0\", \"192.168.1.255\");\nnew IPv4AddressBlock(new IPv4Address(\"192.168.0.0\"), new IPv4Address(\"192.168.1.255\"));\nnew IPv4AddressBlock(\"192.168.0.0/24\");\nnew IPv4AddressBlock(\"192.168.0.0\", 24);\nnew IPv4AddressBlock(new IPv4Address(\"192.168.0.0\"), 24);\n\n// Scan through just IP addresses\nnew IPv4BlockScan(new IPv4AddressBlock(\"192.168.0.0/24\"));\nnew IPv4BlockScan(new IPv4Address(\"192.168.0.0\"), ScanMethod.SINGLE_ADDRESS);\nnew IPv4BlockScan(new IPv4Address(\"192.168.0.0\"), ScanMethod.ENDLESS_INCREASE);\nnew IPv4BlockScan(new IPv4Address(\"192.168.0.0\"), ScanMethod.ENDLESS_DECREASE);\nnew IPv4BlockScan(Arrays.asList(new IPv4Address(\"192.168.1.1\"), new IPv4Address(\"192.168.1.145\"))));\n\n// Scan through IP addresses and ports\nnew IPv4BlockPortScan(new IPv4AddressBlock(\"192.168.0.0/24\"));\nnew IPv4BlockPortScan(new IPv4Address(\"192.168.0.0\"), ScanMethod.SINGLE_ADDRESS);\nnew IPv4BlockPortScan(new IPv4Address(\"192.168.0.0\"), ScanMethod.ENDLESS_INCREASE);\nnew IPv4BlockPortScan(new IPv4Address(\"192.168.0.0\"), ScanMethod.ENDLESS_DECREASE);\nnew IPv4BlockPortScan(Arrays.asList(new IPv4Address(\"192.168.1.1\"), new IPv4Address(\"192.168.1.145\"))));\n```\n\n#### Traversing IP blocks\n\nCan manually cycle through a block of addresses.\n```java\nIPv4AddressBlock block = new IPv4AddressBlock(\"192.168.0.0\", \"192.168.1.255\");\nIPv4Address address = block.getFirstAddress();\n\ndo {\n    System.out.println(address.getAddress());\n\n    address = address.nextAddress();\n} while (address.getDecimal() \u003c block.getLastAddress().getDecimal());\n```\n\nOr use the address scanner to do so in a faster, multithreaded context.\n```java\nIPv4AddressBlock addressBlock = new IPv4AddressBlock(\"192.168.0.0\", \"192.168.1.255\");\n\nIPv4BlockScan blockScan = new IPv4BlockScan(addressBlock)\n        .setThreadCount(64)\n        .setConsumingMethod(YourApplication::consumingMethod)\n        .executeAndAwait();\n```\n\n#### Port scanner example\nIn this example, we are creating a range of the most commonly expected local address range\nand have a list of the most common ports used for web pages.\n\nWe initiate the scan and consume the found results, expecting these to be web pages.\nUsing the Jsoup library, we attempt to grab the page and print out the URL and page title.\n\n```java\npublic class LocalScanner {\n    \n    private IPv4AddressBlock localBlock = new IPv4AddressBlock(\"192.168.0.0\", \"192.168.1.255\");\n    private List\u003cInteger\u003e ports = Arrays.asList(80, 81, 443, 8080, 8000);\n\n    public static void main(String[] args) {\n        LocalScanner scanner = new LocalScanner();\n        scanner.startScan();\n    }   \n\n    public void startScan() {\n        IPv4BlockPortScan portScan = new IPv4BlockPortScan(localBlock)\n                .setPorts(ports)\n                .setThreadCount(64)\n                .setCheckPorts(true) // default true, false to consume all address:port combinations\n                .setCheckTimeout(150)\n                .setConsumingMethod(this::consumingMethod)\n                .executeAndAwait();\n    }\n\n    public void consumingMethod(IPv4AddressPort addressPort) {\n        // further process, store in database, display on screen, etc.\n        String expectedWebpage;\n        if(addressPort.getPort() == 80) {\n            expectedWebpage = \"http://\" + addressPort.getAddress().getAddress();\n        } else if(addressPort.getPort() == 443) {\n            expectedWebpage = \"https://\" + addressPort.getAddress().getAddress();\n        } else {\n            expectedWebpage = \"http://\" + addressPort.getFullAddress();\n        }\n\n        try {\n            Document document = Jsoup.connect(expectedWebpage).get();\n\n            System.out.printf(\"%s    size=%s    title=%s\\n\", expectedWebpage, document.html().length(), document.title());\n        } catch (IOException e) {\n            System.err.printf(\"%s    %s\\n\", expectedWebpage, e.getClass().getSimpleName()+\": \"+e.getLocalizedMessage());\n        }\n    }\n\n}\n```\n    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattwright324%2Fjports","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattwright324%2Fjports","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattwright324%2Fjports/lists"}