{"id":13481861,"url":"https://github.com/CHH/stack-honeypot","last_synced_at":"2025-03-27T12:31:40.009Z","repository":{"id":13462259,"uuid":"16152005","full_name":"CHH/stack-honeypot","owner":"CHH","description":"Inserts a trap for spam bots into responses.","archived":false,"fork":false,"pushed_at":"2014-01-30T15:54:20.000Z","size":191,"stargazers_count":23,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-30T21:15:39.606Z","etag":null,"topics":["honeypot","middleware","php","stack"],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/CHH.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-22T20:43:36.000Z","updated_at":"2024-09-21T11:31:22.000Z","dependencies_parsed_at":"2022-09-06T10:01:08.415Z","dependency_job_id":null,"html_url":"https://github.com/CHH/stack-honeypot","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CHH%2Fstack-honeypot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CHH%2Fstack-honeypot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CHH%2Fstack-honeypot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CHH%2Fstack-honeypot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CHH","download_url":"https://codeload.github.com/CHH/stack-honeypot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245845047,"owners_count":20681821,"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":["honeypot","middleware","php","stack"],"created_at":"2024-07-31T17:00:56.858Z","updated_at":"2025-03-27T12:31:39.711Z","avatar_url":"https://github.com/CHH.png","language":"PHP","readme":"# Stack\\Honeypot\n\nA port of [Rack::Honeypot](https://github.com/sunlightlabs/rack-honeypot) to Stack for PHP.\n\n## Install\n\n    composer require stack/honey-pot:~1.0\n\n## Usage\n\nWrap your HttpKernelInterface app in an instance of `CHH\\Stack\\Honeypot` or add it to your middleware stack.\n\nWith [stack/builder](https://github.com/stackphp/builder):\n\n```php\n\u003c?php\n\n$options = [];\n\n$app = (new Stack\\Builder)\n    -\u003epush(CHH\\Stack\\Honeypot::class, $options)\n    -\u003eresolve($app);\n```\n\nWithout the builder:\n\n```php\n$app = new Stack\\Honeypot($app, $options);\n```\n\n### From [Rack::Honeypot](https://github.com/sunlightlabs/rack-honeypot):\n\nThis middleware acts as a spam trap. It inserts, into every outputted `\u003cform\u003e`, a text field that a spambot will really want to fill in, but is actually not used by the app. The field is hidden to humans via CSS, and includes a warning label for screenreading software.\n\nIn the `\u003cbody\u003e`:\n\n    \u003cform\u003e\n      \u003cdiv class='phonetoy'\u003e\n        \u003clabel for='email'\u003eDon't fill in this field\u003c/label\u003e\n        \u003cinput type='text' name='email' value=''/\u003e\n      \u003c/div\u003e\n    [...]\n\nIn the `\u003chead\u003e`:\n  \n    \u003cstyle type='text/css' media='all'\u003e\n      div.phonetoy {\n        display:none;\n      }\n    \u003c/style\u003e\n\nThen, for incoming requests, the middleware will check if the text field has been set to an unexpected value. If it has, that means a spambot has altered the field, and the spambot is booted to a dead end blank page.\n\nThere are a few options you can pass to the constructor (or to the Stack\nBuilder):\n  \n  * `class_name` is the class assigned to the parent div of the honeypot. Defaults to \"phonetoy\", an anagram of honeypot.\n  * `label` is the warning label displayed to those with CSS disabled. Defaults to \"Don't fill in this field\".\n  * `input_name` is the name of the form field. Ensure that this is tempting to a spambot if you modify it. Defaults to \"email\".\n  * `input_value` is the value of the form field that would only be modified by a spambot. Defaults to blank.\n  * `always_enabled` (defaults to `true`) set to `false` if you don't\n    want to insert the trap into all responses returned by your app.\n    Just add `X-Honeypot: enabled` to your response headers to enable the\n    trap for this response.\n\n## License\n\nSee [LICENSE.txt](LICENSE.txt).\n","funding_links":[],"categories":["Honeypots","\u003ca name=\"honeypots\"\u003e\u003c/a\u003e Honeypots"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCHH%2Fstack-honeypot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCHH%2Fstack-honeypot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCHH%2Fstack-honeypot/lists"}