{"id":22109213,"url":"https://github.com/kyagara/hagelslag","last_synced_at":"2026-05-16T17:32:18.956Z","repository":{"id":242274449,"uuid":"807179513","full_name":"Kyagara/hagelslag","owner":"Kyagara","description":"Web and Minecraft (Java) server scanner written in C.","archived":false,"fork":false,"pushed_at":"2024-11-02T18:06:44.000Z","size":115,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T10:16:58.226Z","etag":null,"topics":["c","http","minecaft","mongoc","mongodb","multithreading","scanner","socket"],"latest_commit_sha":null,"homepage":"","language":"C","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/Kyagara.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":"2024-05-28T16:01:09.000Z","updated_at":"2024-11-02T18:06:48.000Z","dependencies_parsed_at":"2024-11-02T04:21:29.172Z","dependency_job_id":"1d62d2c5-98fb-4e1e-9cb0-cc4c424d59a2","html_url":"https://github.com/Kyagara/hagelslag","commit_stats":null,"previous_names":["kyagara/hagelslag"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kyagara%2Fhagelslag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kyagara%2Fhagelslag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kyagara%2Fhagelslag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kyagara%2Fhagelslag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kyagara","download_url":"https://codeload.github.com/Kyagara/hagelslag/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245206534,"owners_count":20577582,"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":["c","http","minecaft","mongoc","mongodb","multithreading","scanner","socket"],"created_at":"2024-12-01T09:29:53.784Z","updated_at":"2025-10-30T09:17:00.101Z","avatar_url":"https://github.com/Kyagara.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hagelslag\n\ncool scanner \u003c(= w =)\u003e\n\n## Why\n\nI wanted to practice some C and I've heard of scanners for Minecraft servers some time ago and decided to do something similar. I'm not following any guides or searching on how scanners (in general) work.\n\nAs I am not a C programmer, Im sure I am either not doing something the C way, or just being plain stupid. I am not following any standards, just solving my own problems, one of them being 'how the hell do I store 3.7 billion integers properly'.\n\nThe `hagelslag` name came from a friend, well, eating a [Hagelslag](https://en.wikipedia.org/wiki/Hagelslag).\n\nOnly Linux is supported.\n\n## How\n\n`hagelslag` works by generating all possible IP addresses, all 4.3 billion of them, in a loop, checking if they are [reserved](https://en.wikipedia.org/wiki/Reserved_IP_addresses) then sending them to a thread pool for scanning.\n\nEach thread will retrieve an amount of `Task`s from the `Queue` and process these tasks.\n\nA thread in a loop will block and for each task inside of it, execute the `x_connect` and `x_scan` functions of the specified scanner. This is the biggest bottleneck in the project, as the tasks are not done concurrently.\n\n- `http`: send a `GET` request to that address. If successful (status code 2xx), it will read and add the response to the database, the response has a maximum size of 5 megabytes.\n\n- `minecraft`: send a `handshake` request to that address. If successful, send a status request and read the response.\n\n## Installing\n\nInstall the [mongoc driver libraries](https://www.mongodb.com/docs/languages/c/c-driver/current/libmongoc/tutorials/obtaining-libraries/installing/).\n\nRun `make` in the project root. You can also pass flags to it, for example:\n\n```\nmake SCANNER=MINECRAFT THREADS=16 DATABASE_URI=mongodb...\n```\n\nUse `make clean` after changing flags value, specially the `SCANNER` flag.\n\n## Ideas\n\n- As of now, `hagelslag` will take ages to finish scanning just once, use non-blocking sockets, maybe use libevent or something similar.\n\n- Maybe add bedrocks servers to the Minecraft scanner.\n\n- More error handling.\n\n- Spread logging properly, right now its either too spammy or too little information being logged on some levels.\n\n- Remove this weird virus that keeps adding Frieren in the code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyagara%2Fhagelslag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkyagara%2Fhagelslag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyagara%2Fhagelslag/lists"}