{"id":30155402,"url":"https://github.com/cavefire/tapo-klap-mitm","last_synced_at":"2025-08-11T12:37:52.135Z","repository":{"id":307810286,"uuid":"1030768664","full_name":"cavefire/tapo-klap-mitm","owner":"cavefire","description":"KLAP Interceptor for MITM Proxy (e.g. Vacuum RV30..)","archived":false,"fork":false,"pushed_at":"2025-08-02T10:41:05.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-02T11:44:38.752Z","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":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cavefire.png","metadata":{"files":{"readme":"readme.txt","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-02T09:31:14.000Z","updated_at":"2025-08-02T10:41:09.000Z","dependencies_parsed_at":"2025-08-02T11:44:42.205Z","dependency_job_id":"0147af2d-3606-4914-a945-4a5c017e99a0","html_url":"https://github.com/cavefire/tapo-klap-mitm","commit_stats":null,"previous_names":["cavefire/tapo-klap-mitm"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/cavefire/tapo-klap-mitm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cavefire%2Ftapo-klap-mitm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cavefire%2Ftapo-klap-mitm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cavefire%2Ftapo-klap-mitm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cavefire%2Ftapo-klap-mitm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cavefire","download_url":"https://codeload.github.com/cavefire/tapo-klap-mitm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cavefire%2Ftapo-klap-mitm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269890906,"owners_count":24491736,"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","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"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":"2025-08-11T12:37:51.413Z","updated_at":"2025-08-11T12:37:52.118Z","avatar_url":"https://github.com/cavefire.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"tapo-klap-mitm\n=========================\n\nThis codebase provides tools for intercepting, decrypting, and visualizing KLAP protocol traffic from tapo smart vacuum robots.\n\nMain Components:\n----------------\n1. klap_mitm_plugin.py\n   - mitmproxy plugin for intercepting KLAP traffic, decrypting requests/responses, and injecting commands.\n   - Requires environment variables: KLAP_TARGET_DEVICE, KLAP_USERNAME, KLAP_PASSWORD.\n   - Stores decrypted messages in the 'messages' directory.\n\n2. klap_viewer.py\n   - GUI application to view decrypted KLAP requests and responses.\n   - Run with: python3 klap_viewer.py\n\n3. vacuum_map_converter.py\n   - Converts KLAP map response JSON files to PNG floor plan images.\n   - Run with: python3 vacuum_map_converter.py [input_file.json]\n\n4. decryptor.py\n   - Implements KLAP protocol decryption and encryption logic.\n\n5. start-mitm.sh\n   - Shell script to start mitmproxy with the KLAP plugin and required environment variables.\n\nSetup:\n------\n- Install dependencies: pip install -r requirements.txt\n- Set environment variables for your device and credentials.\n- Start mitmproxy using start-mitm.sh.\n- Use klap_viewer.py to view decrypted messages.\n- Use vacuum_map_converter.py to convert map responses to images.\n\nDirectory Structure:\n--------------------\n- messages/: Stores decrypted KLAP messages and injected commands.\n- to_send.json: Used for command injection via mitmproxy plugin.\n\nFor more details, see comments in each script.\n\nAcknowledgements:\n-----------------\nSpecial thanks to the python-kasa contributors for their work on the KLAP protocol.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcavefire%2Ftapo-klap-mitm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcavefire%2Ftapo-klap-mitm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcavefire%2Ftapo-klap-mitm/lists"}