{"id":23537716,"url":"https://github.com/prod3v3loper/php-honeypot-robots-bait","last_synced_at":"2025-07-03T17:05:06.897Z","repository":{"id":159024016,"uuid":"417790993","full_name":"prod3v3loper/php-honeypot-robots-bait","owner":"prod3v3loper","description":"🍯  HoneyPot Robots Bait","archived":false,"fork":false,"pushed_at":"2024-05-14T00:30:23.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-26T03:18:57.779Z","etag":null,"topics":["backend","honey-pot","html","ip","ip-address","log","logging","php","robots","robots-txt","robotstxt","server"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prod3v3loper.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":"2021-10-16T10:15:04.000Z","updated_at":"2024-05-14T00:30:26.000Z","dependencies_parsed_at":"2024-05-14T01:39:33.203Z","dependency_job_id":"a436fa33-bdae-4354-afb4-a9d462d001dc","html_url":"https://github.com/prod3v3loper/php-honeypot-robots-bait","commit_stats":null,"previous_names":["prod3v3loper/php-honeypot-robots-bait"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prod3v3loper%2Fphp-honeypot-robots-bait","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prod3v3loper%2Fphp-honeypot-robots-bait/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prod3v3loper%2Fphp-honeypot-robots-bait/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prod3v3loper%2Fphp-honeypot-robots-bait/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prod3v3loper","download_url":"https://codeload.github.com/prod3v3loper/php-honeypot-robots-bait/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239250704,"owners_count":19607512,"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":["backend","honey-pot","html","ip","ip-address","log","logging","php","robots","robots-txt","robotstxt","server"],"created_at":"2024-12-26T03:19:01.803Z","updated_at":"2025-02-17T07:26:56.806Z","avatar_url":"https://github.com/prod3v3loper.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# PHP 🍯 HoneyPot Robots Bait\n\nThe goal is to confuse or distract the hacker.\nHowever, there are differences, automated or manual.\n\n### Manual\n\nIn order to code an attack manually, one would also have to debug. Which means that it will not be enough on your test system.\n\n### Automatic\n\nA finished tool, however, which is already more advanced, will not need this. Because these are programmed specifically for systems and run automatically. But both can be misled.\n\n\u003c/div\u003e\n\n# Bait\n\nWe issue a `robots.txt` if it doesn't exist. If there is one, we write the following in it.\n\n```\nUser-agent: *\nDisallow: /admin-login.php\n```\n\n\u003e **Malicious**\n\u003e\n\u003e If the bot or a hacker looks up the `robots.txt` and calls up the unauthorized pages, it is a sign of malicious intent.\n\nIn this case the `robots.txt` serves as a bait in which we display a file with the important name `admin-login.php`, which is our honeypot.\n\n# Confuse\n\nIn our honepot file, so in this example the `admin-login.php` contains the following information:\n\n\u003e **Choose**\n\u003e\n\u003e The name for the file `admin-login` is freely chosen here and can be named as desired.\n\nOur `logger.php` is located above the HTML, which writes the data to our `honeypot.log` file.\nAnd includes our two classes `class.HoneyPot.php` (Logging) and `class.Server.php` (Data)\n\n```php\n\u003c?php require_once 'logger.php'; ?\u003e\n```\n\nWe show the bot or hacker that it landed on a non-existent page, so we're just faking it and log him in our honeypot.\n\n```html\n\u003chtml\u003e\n  \u003cscript type=\"text/javascript\"\u003e\n    window[\"_gaUserPrefs\"] = {\n      ioo: function () {\n        return true;\n      },\n    };\n  \u003c/script\u003e\n  \u003chead\u003e\n    \u003ctitle\u003e404 Not Found\u003c/title\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003ch1\u003eNot Found\u003c/h1\u003e\n    \u003cp\u003eThe requested URL was not found on this server.\u003c/p\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n# Refuse\n\nOnce everything has been implemented, the attacker's data is written to a file with the help of the `class.HoneyPot.php`\n\n## Log file permissions\n\nThe rights for the file are therefore set in `class.HoneyPot.php`.\n\n\u003e **Important**\n\u003e\n\u003e The `honeypot.log` must not be read from the browser.\n\nRead and write permissions for the owner, none for everyone else.\n\n```php\nchmod(\"/somedir/somefile\", 0600)\n```\n\n## Example log\n\nThe file called `honeypot.log` contains all the attackers\n\n```log\n[15.10.2021 - 18:14:41]\nIP: 127.0.0.1\nAGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36\nHOST: 127.0.0.1\n```\n\n# Checking\n\n- [x] Add `classes` folder to project root\n- [x] Created or edited `robots.txt` is in project root\n- [x] Add `admin-login.php` and `logger.php` in project root\n\n\u003e **Information**\n\u003e\n\u003e If mod_rewrite is activated, it may not work because all inquiries, e.g. for CMS systems, are forwarded to the index via htaccess.\n\u003e\n\u003e And that's a good thing because the other pages or sub-folders should not be accessible.\n\u003e\n\u003e But it is mostly so that you can sometimes call it via the browser, because this was not prevented.\n\n\u003cdiv align=\"center\"\u003e\n\n# Conclusion\n\nThis is a method to possibly receive information about an attack.\nThere are of course many other options that I will present here.\n\n# Contribute\n\nPlease an [issue](https://github.com/prod3v3loper/php-honeypot-robots-bait/issues) if you\nthink something could be improved. Please submit Pull Requests when ever\npossible.\n\n# Authors\n\n**Samet Tarim** [prod3v3loper](https://www.prod3v3loper.com) - _All works_\n\n# License\n\n[GNU](https://github.com/prod3v3loper/php-honeypot-robots-bait/blob/master/LICENSE)\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprod3v3loper%2Fphp-honeypot-robots-bait","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprod3v3loper%2Fphp-honeypot-robots-bait","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprod3v3loper%2Fphp-honeypot-robots-bait/lists"}