{"id":13539482,"url":"https://github.com/justmao945/mallory","last_synced_at":"2025-12-17T07:56:18.638Z","repository":{"id":15941015,"uuid":"18683271","full_name":"justmao945/mallory","owner":"justmao945","description":"HTTP/HTTPS proxy over SSH","archived":false,"fork":false,"pushed_at":"2023-12-20T08:23:00.000Z","size":242,"stargazers_count":324,"open_issues_count":11,"forks_count":68,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-08-13T20:44:06.944Z","etag":null,"topics":["http-proxy","proxy","proxy-server","ssh"],"latest_commit_sha":null,"homepage":"","language":"Go","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/justmao945.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":"2014-04-11T17:46:16.000Z","updated_at":"2025-08-10T21:29:13.000Z","dependencies_parsed_at":"2024-06-18T20:12:11.695Z","dependency_job_id":"4d7bfd5f-c788-4da9-9606-b5ba3c2318e2","html_url":"https://github.com/justmao945/mallory","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/justmao945/mallory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justmao945%2Fmallory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justmao945%2Fmallory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justmao945%2Fmallory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justmao945%2Fmallory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/justmao945","download_url":"https://codeload.github.com/justmao945/mallory/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justmao945%2Fmallory/sbom","scorecard":{"id":544304,"data":{"date":"2025-08-11","repo":{"name":"github.com/justmao945/mallory","commit":"acabe6b26e52940fda9989a7c7e2a303a8f21c9c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":4,"reason":"Found 8/18 approved changesets -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":6,"reason":"dependency not pinned by hash detected -- score normalized to 6","details":["Warn: containerImage not pinned by hash: Dockerfile:1: pin your Docker image by updating golang:1.11.3-stretch to golang:1.11.3-stretch@sha256:19d4cd4c36fd65ee4eeffa63fcd85e2a6b8d8906fc3a1756256f2384923c3eac","Info:   0 out of   1 containerImage dependencies pinned","Info:   2 out of   2 goCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"14 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2023-2402 / GHSA-45x7-px36-x8w8","Warn: Project is vulnerable to: GO-2024-3321 / GHSA-v778-237x-gjrc","Warn: Project is vulnerable to: GO-2025-3487 / GHSA-hcg3-q754-cr77","Warn: Project is vulnerable to: GO-2022-0969 / GHSA-69cg-p879-7622","Warn: Project is vulnerable to: GO-2023-1495 / GHSA-fxg5-wq6x-vr4w","Warn: Project is vulnerable to: GO-2022-1144 / GHSA-xrjj-mj9h-534m","Warn: Project is vulnerable to: GO-2023-1571 / GHSA-vvpx-j8f3-3w6h","Warn: Project is vulnerable to: GO-2023-1988 / GHSA-2wrh-6pvc-2jm9","Warn: Project is vulnerable to: GO-2023-2102 / GHSA-4374-p667-p6c8","Warn: Project is vulnerable to: GHSA-qppj-fm5r-hxr3","Warn: Project is vulnerable to: GO-2024-2687 / GHSA-4v7x-pqxf-cx7m","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 20 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T09:05:05.447Z","repository_id":15941015,"created_at":"2025-08-20T09:05:05.447Z","updated_at":"2025-08-20T09:05:05.447Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27779779,"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-12-17T02:00:08.291Z","response_time":55,"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":["http-proxy","proxy","proxy-server","ssh"],"created_at":"2024-08-01T09:01:26.504Z","updated_at":"2025-12-17T07:56:18.619Z","avatar_url":"https://github.com/justmao945.png","language":"Go","funding_links":[],"categories":["\u003ca id=\"1a9934198e37d6d06b881705b863afc8\"\u003e\u003c/a\u003e通信\u0026\u0026代理\u0026\u0026反向代理\u0026\u0026隧道","\u003ca id=\"d03d494700077f6a65092985c06bf8e8\"\u003e\u003c/a\u003e工具","Network Tools","Go","Tools","Network","Awesome Penetration Testing (\"https://github.com/Muhammd/Awesome-Pentest\")"],"sub_categories":["\u003ca id=\"56acb7c49c828d4715dce57410d490d1\"\u003e\u003c/a\u003e未分类-Proxy","\u003ca id=\"b6f25145e99ea944cbb528a24afaa0be\"\u003e\u003c/a\u003eHTTP\u0026\u0026HTTPS","Proxies and Machine-in-the-Middle (MITM) Tools","Network Tools","Tools"],"readme":"## mallory\nHTTP/HTTPS proxy over SSH.\n\n## Installation\n* Local machine: `go install github.com/justmao945/mallory/cmd/mallory@latest`\n* Remote server: need our old friend sshd\n\n## Configuration\n### Config file\nDefault path is `$HOME/.config/mallory.json`, can be set when start program\n```\nmallory -config path/to/config.json\n```\n\nContent:\n* `id_rsa` is the path to our private key file, can be generated by `ssh-keygen`\n* `local_smart` is the local address to serve HTTP proxy with smart detection of destination host\n* `local_normal` is similar to `local_smart` but send all traffic through remote SSH server without destination host detection\n* `remote` is the remote address of SSH server\n* `blocked` is a list of domains that need use proxy, any other domains will connect to their server directly\n\n```json\n{\n  \"id_rsa\": \"$HOME/.ssh/id_rsa\",\n  \"local_smart\": \":1315\",\n  \"local_normal\": \":1316\",\n  \"remote\": \"ssh://user@vm.me:22\",\n  \"blocked\": [\n    \"angularjs.org\",\n    \"golang.org\",\n    \"google.com\",\n    \"google.co.jp\",\n    \"googleapis.com\",\n    \"googleusercontent.com\",\n    \"google-analytics.com\",\n    \"gstatic.com\",\n    \"twitter.com\",\n    \"youtube.com\"\n  ]\n}\n```\n\nBlocked list in config file will be reloaded automatically when updated, and you can do it manually:\n```\n# send signal to reload\nkill -USR2 \u003cpid of mallory\u003e\n\n# or use reload command by sending http request\nmallory -reload\n```\n\n### System config\n* Set both HTTP and HTTPS proxy to `localhost` with port `1315` to use with block list\n* Set env var `http_proxy` and `https_proxy` to `localhost:1316` for terminal usage\n\n### Get the right suffix name for a domain\n```\nmallory -suffix www.google.com\n```\n\n### A simple command to forward all traffic for the given port\n```sh\n# install it: go get github.com/justmao945/mallory/cmd/forward\n\n# all traffic through port 20022 will be forwarded to destination.com:22\nforward -network tcp -listen :20022 -forward destination.com:22\n\n# you can ssh to destination:22 through localhost:20022\nssh root@localhost -p 20022\n```\n\n### TODO\n* return http error when unable to dial\n* add host to list automatically when unable to dial\n* support multiple remote servers\n\n### Docker container\n\nConsidering the following config file:\n\n```\n$ cat mallory.json\n{\n  \"id_rsa\": \"/tmp/id_rsa\",\n  \"local_smart\": \":1315\",\n  \"local_normal\": \":1316\",\n  \"remote\": \"ssh://bhenrion@10.151.0.11:22\"\n}\n```\n\nYou can run the container (`zoobab/mallory`) my mounting the config file, the SSH key, and mapping the 2 ports:\n\n```\n$ docker run -v $PWD/mallory.json:/root/.config/mallory.json -p 1316:1316 -p 1315:1315 -v $PWD/.ssh/id_rsa:/tmp/id_rsa zoobab/mallory\nmallory: 2020/03/30 16:51:10 main.go:22: Starting...\nmallory: 2020/03/30 16:51:10 main.go:23: PID: 1\nmallory: 2020/03/30 16:51:10 config.go:103: Loading: /root/.config/mallory.json\nmallory: 2020/03/30 16:51:10 main.go:30: Connecting remote SSH server: ssh://bhenrion@10.151.0.11:22\nmallory: 2020/03/30 16:51:10 main.go:38: Local normal HTTP proxy: :1316\nmallory: 2020/03/30 16:51:10 main.go:48: Local smart HTTP proxy: :1315\n```\n\nMy use case was to connect to a Kubernetes cluster (Openshift) installed behind an SSH bastion:\n\n```\n$ export http_proxy=http://localhost:1316\n$ export https_proxy=https://localhost:1316\n$ oc login https://master.mycluster.zoobab.com:8443\nAuthentication required for https://master.mycluster.zoobab.com:8443 (openshift)\nUsername: bhenrion\nPassword:\nLogin successful.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustmao945%2Fmallory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustmao945%2Fmallory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustmao945%2Fmallory/lists"}