{"id":20706697,"url":"https://github.com/censys-workshop/threatfox-censys","last_synced_at":"2025-05-10T20:30:51.514Z","repository":{"id":199797124,"uuid":"703776515","full_name":"censys-workshop/threatfox-censys","owner":"censys-workshop","description":"Threatfox Censys is a tool to query Censys Search for IP addresses and domains and then parses the JSON and submits the results to Threatfox.","archived":false,"fork":false,"pushed_at":"2024-12-16T14:20:17.000Z","size":199,"stargazers_count":32,"open_issues_count":4,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-16T15:34:08.374Z","etag":null,"topics":["c2","censys","censys-search","iocs","threatfox"],"latest_commit_sha":null,"homepage":"http://workshop.censys.io/threatfox-censys/","language":"Python","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/censys-workshop.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":"2023-10-11T22:35:29.000Z","updated_at":"2024-12-16T14:18:36.000Z","dependencies_parsed_at":"2023-10-30T13:38:45.447Z","dependency_job_id":"f40d830c-1a7f-4e13-a328-6df428da91be","html_url":"https://github.com/censys-workshop/threatfox-censys","commit_stats":null,"previous_names":["censys-workshop/threatfox-censys"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/censys-workshop%2Fthreatfox-censys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/censys-workshop%2Fthreatfox-censys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/censys-workshop%2Fthreatfox-censys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/censys-workshop%2Fthreatfox-censys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/censys-workshop","download_url":"https://codeload.github.com/censys-workshop/threatfox-censys/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253480269,"owners_count":21915245,"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":["c2","censys","censys-search","iocs","threatfox"],"created_at":"2024-11-17T01:23:52.224Z","updated_at":"2025-05-10T20:30:51.509Z","avatar_url":"https://github.com/censys-workshop.png","language":"Python","funding_links":[],"categories":["Integrations and plugins"],"sub_categories":[],"readme":"# Threatfox Censys\n\nThreatfox Censys is a tool to query [Censys Search](https://search.censys.io/) for IP addresses and domains and then parses the JSON and submits the results to Threatfox.\n\n## Features\n\n- Create dynamic fingerprints for various IoCs\n  - Create a fingerprint using the `create-fingerprint` command\n  - Fingerprint file: [`fingerprints.yaml`](fingerprints.yaml)\n- Uses the Censys Search API\n- Submit IoCs to ThreatFox\n  - Submit IoCs using the `scan` command\n  - Links Censys Search in ThreatFox IoC reference\n  - Tags IoCs with `censys` and the autonomous system name\n- Uses a PostgreSQL database to store the IoCs submitted to ThreatFox\n\n## Installation\n\n### Prerequisites\n\n- [Python 3.10](https://www.python.org/downloads/release/python-3100/)\n- [A PostgreSQL 15+ Instance](https://www.postgresql.org/)\n\nYou will need to install [poetry](https://python-poetry.org/) on Python 3.10.\n\n```bash\ncurl -sSL https://install.python-poetry.org | python3 -\n```\n\nClone the repository.\n\n```bash\ngit clone https://github.com/censys-workshop/threatfox-censys.git\n```\n\nThen install the dependencies.\n\n```bash\npoetry install\n```\n\nThen you will need to copy the `.env.example` file to `.env` and add your Censys API ID and Secret as well as your Threatfox API key (from \u003chttps://auth.abuse.ch/\u003e). Also make sure to set the `DATABASE_URL` to your database.\n\n```bash\ncp .env.example .env\n```\n\nThen you will need to run the database migrations.\n\n```bash\npoetry run threatfox-censys database-migrations\n```\n\n## Usage\n\n### Scan\n\nScan Censys Search for IoCs and submit them to ThreatFox.\n\n```bash\npoetry run threatfox-censys scan\n```\n\n#### Mastodon Posts\n\nYou can also post the results to Mastodon. Make sure to set the `MASTODON_API_URL` and `MASTODON_ACCESS_TOKEN` environment variables. It will post a toot for each IoC found. Simply create a Mastodon app and get the access token.\n\n### Create Fingerprint\n\nPrompt the user to create a fingerprint for an IoC.\n\n```bash\npoetry run threatfox-censys create-fingerprint\n```\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\n### Testing\n\n```bash\npoetry run pytest\n```\n\n### Linting\n\n```bash\npoetry run flake8\n```\n\n### Formatting\n\n```bash\npoetry run black .\npoetry run isort .\npoetry run pyupgrade --py310-plus threatfox_censys/*.py scripts/*.py\n```\n\n## License\n\nThreatfox Censys is licensed under the [MIT](https://choosealicense.com/licenses/mit/) license.\n\n## Author\n\n- [Aidan Holland](mailto:aidan@censys.com)\n\n## Acknowledgements\n\n- [Censys](https://censys.io/)\n- [Threatfox](https://threatfox.abuse.ch/)\n\n## TODO\n\n- [ ] Add more fingerprint.\n- [ ] Add more documentation.\n\u003c!-- Add your idea here --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcensys-workshop%2Fthreatfox-censys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcensys-workshop%2Fthreatfox-censys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcensys-workshop%2Fthreatfox-censys/lists"}