@@ -0,0 +1,1233 @@
+package com.baidu.openrasp.hook.ssrf;%0A%0Aimport com.baidu.openrasp.tool.Reflection;%0Aimport com.baidu.openrasp.tool.annotation.HookAnnotation;%0Aimport javassist.CannotCompileException;%0Aimport javassist.CtClass;%0Aimport javassist.NotFoundException;%0A%0Aimport java.io.IOException;%0A%0A/**%0A * @program openrasp%0A * @description: okhttp%E7%9A%84ssrf%E6%A3%80%E6%B5%8Bhook%E7%82%B9%0A * @author: anyang%0A * @create: 2018/10/09 19:40%0A */%0A@HookAnnotation%0Apublic class OkHttpHook extends AbstractSSRFHook%7B%0A    @Override%0A    public boolean isClassMatched(String className) %7B%0A        return %22okhttp3/HttpUrl%22.equals(className);%0A    %7D%0A%0A    @Override%0A    protected void hookMethod(CtClass ctClass) throws IOException, CannotCompileException, NotFoundException %7B%0A        String src = getInvokeStaticSrc(OkHttpHook.class, %22checkOkHttpUrl%22,%0A                %22$1,$_%22, String.class,Object.class);%0A        insertAfter(ctClass, %22parse%22, %22(Ljava/lang/String;)Lokhttp3/HttpUrl;%22, src);%0A    %7D%0A%0A    public static void checkOkHttpUrl(String url, Object httpUrl)%7B%0A        String host = null;%0A        if (httpUrl!=null)%7B%0A            host = Reflection.invokeStringMethod(httpUrl, %22host%22, new Class%5B%5D%7B%7D);%0A        %7D%0A        if (host != null) %7B%0A            checkHttpUrl(url, host, %22okhttp%22);%0A        %7D%0A    %7D%0A%7D%0A

add okhttp ssrf