{"id":19211349,"url":"https://github.com/truebrain/homij_mitm","last_synced_at":"2026-06-10T21:32:16.943Z","repository":{"id":48042720,"uuid":"201660925","full_name":"TrueBrain/homij_mitm","owner":"TrueBrain","description":"Homij man-in-the-middle forwarder","archived":false,"fork":false,"pushed_at":"2022-12-09T07:22:17.000Z","size":22,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-13T21:02:01.252Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/TrueBrain.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}},"created_at":"2019-08-10T17:19:51.000Z","updated_at":"2021-11-27T11:37:33.000Z","dependencies_parsed_at":"2023-01-25T12:15:14.707Z","dependency_job_id":null,"html_url":"https://github.com/TrueBrain/homij_mitm","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/TrueBrain/homij_mitm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrueBrain%2Fhomij_mitm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrueBrain%2Fhomij_mitm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrueBrain%2Fhomij_mitm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrueBrain%2Fhomij_mitm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TrueBrain","download_url":"https://codeload.github.com/TrueBrain/homij_mitm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrueBrain%2Fhomij_mitm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34172196,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-09T13:42:14.090Z","updated_at":"2026-06-10T21:32:16.921Z","avatar_url":"https://github.com/TrueBrain.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Homij Forwarder\n\nHomij offers monitoring of a modern house, by checking information from all kinds of equipment throughout the house.\nFor example: WTW, Boiler, Inverter, etc.\nThis information is collected on a Raspberry Pi, and sent to BaseN over HTTPS.\nThis man-in-the-middle server intercepts the HTTPS request to BaseN, and passes it along to BaseN.\nIn the meantime, it also tries to understand the request, and forwards it to InfluxDB.\n\nIn case you wonder how this could work, it is simply because all code explicitly ignores any certificate error.\n\n## Installation\n\nRun this Docker on a machine in the same subnet.\nSee `Configuration` section for more information for what settings to pass along.\n\nNext, run these commands on the Raspberry Pi:\n\n```bash\niptables -t nat -A OUTPUT -p tcp --dport 443 -j DNAT --to-destination \u003cIP of this MITM server\u003e:443\n```\n\nNow all HTTPS traffic is redirected to your MITM.\nThis also means you can monitor no other HTTPS traffic is being done.\n\n## Certificate\n\nYou can get this in various of ways.\nMost likely the easiest is to generate a self-signed.\n\n```bash\nopenssl req -x509 -newkey rsa:4096 -keyout selfsigned.key -out selfsigned.cert -days 365\n```\n\n## Configuration\n\nThe `--help` shows all the possible commands. In short:\n\n```\nOptions:\n  --cert-file FILE        Certificate to use for SSL  [required]\n  --key-file FILE         Private key of the certificate to use for SSL\n                          [required]\n  --log-folder DIRECTORY  Folder to log the raw requests in\n  --basen-id TEXT         The ID of the BaseN to intercept  [required]\n  --influxdb-url TEXT     URL of the InfluxDB server  [required]\n  --influxdb-token TEXT   Token to access the InfluxDB server  [required]\n  --influxdb-org TEXT     Organisation of the InfluxDB server  [required]\n  --influxdb-bucket TEXT  Bucket to use in the InfluxDB server  [default:\n                          metrics]\n  --port INTEGER          Port of the server  [default: 443]\n  -h, --help              Show this message and exit.\n```\n\n## Testing\n\nFire up a curl command like (this is one of the stats that tells how long the system has been running; rather boring, but it is just as an example):\n\n```bash\ncurl -k -d '{\"id\":\"testing\",\"content\":{\"password\":\"password\",\"username\":\"username\",\"c\":[{\"write\":{\"rows\":[{\"path\":\"dsmr\",\"time\":\"1628513892000\",\"channels\":[{\"channel\":\"power\",\"double\":\"0.0\",\"comment\":\"\",\"unit\":\"kW\"},{\"channel\":\"energy_low\",\"double\":\"7237.292\",\"comment\":\"\",\"unit\":\"kWh\"},{\"channel\":\"energy_high\",\"double\":\"3865.991\",\"comment\":\"\",\"unit\":\"kWh\"},{\"channel\":\"energy_low_prod\",\"double\":\"5334.853\",\"comment\":\"\",\"unit\":\"kWh\"},{\"channel\":\"energy_high_prod\",\"double\":\"12597.142\",\"comment\":\"\",\"unit\":\"kWh\"},{\"channel\":\"tariff\",\"double\":\"2.0\",\"comment\":\"\",\"unit\":\"\"},{\"channel\":\"power_prod\",\"double\":\"1.234\",\"comment\":\"\",\"unit\":\"kW\"}]}]}}]}}}' --header 'Host: www.example.org' https://127.0.0.1:443/_ua/testing/\n```\n\nThe `-k` is used here, as we are using a self-signed certificate.\nThe request returns a 404, as that is the response `https://www.example.org/_ua/testing/` returns.\nFeel free to use any other URL to test this out with.\n\n## FAQ\n\n### How did you get in the Raspberry Pi?\n\nI did not.\nI simply shut it down, got the SD card out, opened it via a PC, and inserted a SSH public key.\nNow you can simply SSH to the machine, and get root access that way.\n\n### Why did you build this?\n\nHomij for a long time did not give credentials to login to BaseN myself.\nAfter they did, it turns out the information they supply is so poorly, it was of no use to me.\nSo, as a true ITer, I wrote this MITM to process the data myself.\nIn result, I now have pretty graphs of everything that is going on in my house.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftruebrain%2Fhomij_mitm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftruebrain%2Fhomij_mitm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftruebrain%2Fhomij_mitm/lists"}