{"id":19755729,"url":"https://github.com/fofapro/fofa-java","last_synced_at":"2025-06-13T11:37:19.383Z","repository":{"id":78800962,"uuid":"190498060","full_name":"fofapro/fofa-java","owner":"fofapro","description":"A Java version of the SDK, based on the FOFA Pro API, makes it easy for Java developers to quickly integrate FOFA Pro into their projects.","archived":false,"fork":false,"pushed_at":"2023-08-27T14:46:16.000Z","size":226,"stargazers_count":29,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-30T11:54:59.763Z","etag":null,"topics":["fofa","java"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fofapro.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,"zenodo":null}},"created_at":"2019-06-06T02:08:28.000Z","updated_at":"2025-04-01T18:20:20.000Z","dependencies_parsed_at":"2025-04-30T12:07:36.691Z","dependency_job_id":null,"html_url":"https://github.com/fofapro/fofa-java","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/fofapro/fofa-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fofapro%2Ffofa-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fofapro%2Ffofa-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fofapro%2Ffofa-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fofapro%2Ffofa-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fofapro","download_url":"https://codeload.github.com/fofapro/fofa-java/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fofapro%2Ffofa-java/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259638560,"owners_count":22888461,"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":["fofa","java"],"created_at":"2024-11-12T03:12:55.608Z","updated_at":"2025-06-13T11:37:19.369Z","avatar_url":"https://github.com/fofapro.png","language":"Java","funding_links":[],"categories":["Java Search Automation Tools"],"sub_categories":[],"readme":"# fofa-java\n\n[![GitHub (pre-)release](https://img.shields.io/github/release/0nise/fofa-java/all.svg)](https://github.com/0nise/fofa-java/releases)\n[![stars](https://img.shields.io/github/stars/0nise/fofa-java.svg)](https://github.com/0nise/fofa-java/stargazers)\n[![license](https://img.shields.io/github/license/0nise/fofa-java.svg)](https://github.com/0nise/fofa-java/blob/master/LICENSE)\n\n[中文文档](https://github.com/0nise/fofa-java/blob/master/README_zh.md)\n\n## FOFA Pro API\n[`FOFA Pro API`](https://fofa.so/api) is an asset search engine [`FOFA Pro`](https://fofa.so) provides a `RESTful API` interface for developers, allowing developers to integrate [`FOFA Pro`](https://fofa.so) functionality into their projects.\n## FOFA SDK\nA `Java` version of the `SDK`, based on the [`FOFA Pro API`](https://fofa.so/api), makes it easy for Java developers to quickly integrate [`FOFA Pro`](https://fofa.so) into their projects.\n## add dependency\n\n### Apache Maven\n\n```java\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.r4v3zn.fofa\u003c/groupId\u003e\n  \u003cartifactId\u003efofa-core\u003c/artifactId\u003e\n  \u003cversion\u003e1.0.6.RELEASE\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Gradle Groovy DSL\n\n```java\nimplementation 'com.r4v3zn.fofa:fofa-core:1.0.6.RELEASE'\n```\n\n### Gradle Kotlin DSL\n\n```java\nimplementation(\"com.r4v3zn.fofa:fofa-core:1.0.6.RELEASE\")\n```\n\n### Scala SBT\n\n```java\nlibraryDependencies += \"com.r4v3zn.fofa\" % \"fofa-core\" % \"1.0.6.RELEASE\"\n```\n\n### Apache Ivy\n\n```java\n\u003cdependency org=\"com.r4v3zn.fofa\" name=\"fofa-core\" rev=\"1.0.6.RELEASE\" /\u003e\n```\n\n### Groovy Grape\n\n```java\n@Grapes(\n  @Grab(group='com.r4v3zn.fofa', module='fofa-core', version='1.0.6.RELEASE')\n)\n```\n\n### Leiningen\n\n```java\n[com.r4v3zn.fofa/fofa-core \"1.0.6.RELEASE\"]\n```\n\n### Apache Buildr\n\n```java\n'com.r4v3zn.fofa:fofa-core:jar:1.0.6.RELEASE'\n```\n\n### Maven Central Badge\n\n```java\n[![Maven Central](https://img.shields.io/maven-central/v/com.r4v3zn.fofa/fofa-core.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.r4v3zn.fofa%22%20AND%20a:%22fofa-core%22)\n```\n\n### PURL\n\n```java\npkg:maven/com.r4v3zn.fofa/fofa-core@1.0.6.RELEASE\n```\n\n### Bazel\n\n```java\nmaven_jar(\n    name = \"fofa-core\",\n    artifact = \"com.r4v3zn.fofa:fofa-core:1.0.6.RELEASE\",\n    sha1 = \"151fc5fe259ccad55c040ed46d40b9bc19dd6b32\",\n)\n```\n\n## USE\n\n|field|description|\n|:---------:|:-----------------:|\n| `email` |User login [`FOFA Pro`](https://fofa.so) mailbox `Email`|\n|`key`| Please go to the [`personal center`](https://fofa.so/user/users/info) to view `API Key`|\n\n### User info\n\n```java\npublic static void main(String[] args) throws Exception {\n    // FOFA Pro email\n    String email = \"\";\n    // FOFA Pro key\n    String key = \"\";\n    FofaClient client = new FofaClient(email, key);\n    System.out.println(client.getUser());\n}\n```\n\n### Search all\n\n#### Code\n\n```java\npublic static void main(String[] args) throws Exception {\n    // FOFA Pro email\n    String email = \"\";\n    // FOFA Pro key\n    String key = \"\";\n    FofaConstants.BASE_URL = \"https://fofa.info\";\n    FofaClient fofaClient = new FofaClient(email, key);\n    FofaSearch fofaSearch = new FofaSearch(fofaClient);\n    String query = \"host=\\\"fofa.info\\\"\";\n    System.out.println(fofaSearch.all(query));\n}\n```\n\n#### Response\n\n```java\nFofaData{mode='extended', page=1, size=74, totalPage=1, query='host=\"fofa.info\"', results=[www.fofa.info, fofa.info, static.fofa.info, https://static.fofa.info, https://fofa.info, api.fofa.info, api.jw.fofa.info:7088, api.g.fofa.info:88, api.jw.fofa.info:88, api.g.fofa.info:8084, api.jw.fofa.info:84, api.jw.fofa.info:81, api.jw.fofa.info:8003, api.g.fofa.info:8083, api.g.fofa.info:7088, api.g.fofa.info:808, https://g.fofa.info, api.jw.fofa.info:8181, https://jw.fofa.info, api.g.fofa.info:8003, api.jw.fofa.info:8083, https://img.gamma.fofa.info, api.g.fofa.info:81, api.g.fofa.info:7070, api.jw.fofa.info:8084, api.jw.fofa.info:808, api.g.fofa.info:8181, api.jw.fofa.info:7070, img.gamma.fofa.info, jw.fofa.info, g.fofa.info, api.g.fofa.info:84, https://35.81.36.22:443, 47.93.92.246:88, https://140.249.61.184:443, 47.93.92.246:808, 47.93.92.246:8003, 47.93.92.246:81, https://106.75.10.35:443, 106.75.10.35:80, 47.93.92.246:7088, 47.93.92.246:84, 140.249.61.184:80, 47.93.92.246:8181, 47.93.92.246:8084, 47.93.92.246:88, 47.93.92.246:7070, 47.93.92.246:81, 47.93.92.246:7070, 47.93.92.246:84, 47.93.92.246:8084, 47.93.92.246:8003, 47.93.92.246:8083, 106.75.10.35:80, 47.93.92.246:808, 47.93.92.246:8083, 47.93.92.246:8181, 47.93.92.246:7088, https://gamma.fofa.info, https://api.gamma.fofa.info, gamma.fofa.info, api.gamma.fofa.info, 1.71.148.8:80, https://1.71.148.8:443, https://79.168.42.251:443, 122.143.5.67:80, https://api.fofa.info, 81.150.11.126:22, www.fofa.info:6443, 117.50.16.112:80, 150.138.167.141:6443, 117.50.16.112:80, https://117.50.16.112:443, https://117.50.16.112:443]}\n```\n\n### Search stats agg\n\n#### Code\n\n```java\npublic static void main(String[] args) throws Exception {\n    // FOFA Pro email\n    String email = \"\";\n    // FOFA Pro key\n    String key = \"\";\n    FofaConstants.BASE_URL = \"https://fofa.info\";\n    FofaClient fofaClient = new FofaClient(email, key);\n    FofaSearch fofaSearch = new FofaSearch(fofaClient);\n    String query = \"host=\\\"fofa.info\\\"\";\n    System.out.println(fofaSearch.stats(query));\n}\n```\n\n#### Response\n\n```java\nStatsData{distinct={ip=16}, aggs={countries=[{code=aG9zdD0iZm9mYS5pbmZvIiAmJiBjb3VudHJ5PSJDTiI=, count=71, name=China, name_code=CN, regions=[{code=aG9zdD0iZm9mYS5pbmZvIiAmJiByZWdpb249IkJlaWppbmci, count=41, name=Beijing}, {code=aG9zdD0iZm9mYS5pbmZvIiAmJiByZWdpb249IiI=, count=27, name=Unknown}, {code=aG9zdD0iZm9mYS5pbmZvIiAmJiByZWdpb249Ikd1YW5nZG9uZyI=, count=2, name=Guangdong}, {code=aG9zdD0iZm9mYS5pbmZvIiAmJiByZWdpb249IkppbGluIg==, count=1, name=Jilin}]}, {code=aG9zdD0iZm9mYS5pbmZvIiAmJiBjb3VudHJ5PSJHQiI=, count=1, name=United Kingdom of Great Britain and Northern Ireland, name_code=GB, regions=[{code=aG9zdD0iZm9mYS5pbmZvIiAmJiByZWdpb249IiI=, count=1, name=Unknown}]}, {code=aG9zdD0iZm9mYS5pbmZvIiAmJiBjb3VudHJ5PSJQVCI=, count=1, name=Portugal, name_code=PT, regions=[{code=aG9zdD0iZm9mYS5pbmZvIiAmJiByZWdpb249Ikxpc2JvbiI=, count=1, name=Lisbon}]}, {code=aG9zdD0iZm9mYS5pbmZvIiAmJiBjb3VudHJ5PSJVUyI=, count=1, name=United States of America, name_code=US, regions=[{code=aG9zdD0iZm9mYS5pbmZvIiAmJiByZWdpb249Ik9yZWdvbiI=, count=1, name=Oregon}]}]}}\n```\n\n### Host Agg\n\n#### Code\n\n```java\npublic static void main(String[] args) throws Exception {\n    // FOFA Pro email\n    String email = \"\";\n    // FOFA Pro key\n    String key = \"\";\n    FofaConstants.BASE_URL = \"https://fofa.info\";\n    FofaClient fofaClient = new FofaClient(email, key);\n    FofaHost fofaHost = new FofaHost(fofaClient);\n    String host = \"fofa.info\";\n    System.out.println(fofaHost.host(host));\n}\n```\n\n#### Response\n\n```\nHostData{host='fofa.info', ip='124.239.250.54', asn=58539, org='null', countryName='China', countryCode='CN', protocol=[http, https, ssh], port=[443, 22, 8080, 9527, 8069, 8089, 80], category=null, product=null}\n```\n\n## Update Log\n\n2022-05-29\n\n```\n- add search stats api\n- add host api\n- add search fields\n- Update jackson version\n- fix bug\n```\n\n2022-01-27\n\n    - update fofa\n\n2021-07-26\n\n    - Update jackson version\n\n2020-04-27\n\n    - Fixing security holes\n\n2020-01-04\n\n    - Fixing security holes\n\n2019-06-12\n\n    - Add Chinese document\n\n2019-06-11\n\n    - change developer\n    - delete hutool\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffofapro%2Ffofa-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffofapro%2Ffofa-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffofapro%2Ffofa-java/lists"}