From 623fe249540bfab7d49bd797b7e21ec6a44ff6db Mon Sep 17 00:00:00 2001 From: JoyChou Date: Fri, 22 Sep 2017 11:09:07 +0800 Subject: [PATCH] bug fix --- .gitignore | 1 - .idea/compiler.xml | 18 + .idea/kotlinc.xml | 7 + .../Maven__com_google_guava_guava_21_0.xml | 13 + ...Maven__commons_codec_commons_codec_1_6.xml | 13 + ..._commons_logging_commons_logging_1_1_3.xml | 13 + .../Maven__javax_servlet_servlet_api_2_5.xml | 13 + ...__org_apache_commons_commons_lang3_3_0.xml | 13 + ..._apache_httpcomponents_fluent_hc_4_3_6.xml | 13 + ...apache_httpcomponents_httpclient_4_3_6.xml | 13 + ...g_apache_httpcomponents_httpcore_4_3_3.xml | 13 + ..._tomcat_embed_tomcat_embed_core_8_0_23.xml | 13 + ...he_tomcat_embed_tomcat_embed_el_8_0_23.xml | 13 + ...embed_tomcat_embed_logging_juli_8_0_23.xml | 13 + ...at_embed_tomcat_embed_websocket_8_0_23.xml | 13 + ...ring_boot_starter_tomcat_1_2_4_RELEASE.xml | 13 + .idea/misc.xml | 29 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + .idea/workspace.xml | 877 ++++++++++++++++++ src/main/java/checkURL.java | 2 +- src/main/java/test.java | 12 +- target/classes/{url.class => CheckURL.class} | Bin 1457 -> 1478 bytes target/classes/IPAddress.class | Bin 2323 -> 825 bytes target/classes/ssrf.class | Bin 2979 -> 2979 bytes target/classes/test.class | Bin 1892 -> 1664 bytes trident.iml | 144 ++- 27 files changed, 1239 insertions(+), 34 deletions(-) create mode 100644 .idea/compiler.xml create mode 100644 .idea/kotlinc.xml create mode 100644 .idea/libraries/Maven__com_google_guava_guava_21_0.xml create mode 100644 .idea/libraries/Maven__commons_codec_commons_codec_1_6.xml create mode 100644 .idea/libraries/Maven__commons_logging_commons_logging_1_1_3.xml create mode 100644 .idea/libraries/Maven__javax_servlet_servlet_api_2_5.xml create mode 100644 .idea/libraries/Maven__org_apache_commons_commons_lang3_3_0.xml create mode 100644 .idea/libraries/Maven__org_apache_httpcomponents_fluent_hc_4_3_6.xml create mode 100644 .idea/libraries/Maven__org_apache_httpcomponents_httpclient_4_3_6.xml create mode 100644 .idea/libraries/Maven__org_apache_httpcomponents_httpcore_4_3_3.xml create mode 100644 .idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_8_0_23.xml create mode 100644 .idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_8_0_23.xml create mode 100644 .idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_logging_juli_8_0_23.xml create mode 100644 .idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_8_0_23.xml create mode 100644 .idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_1_2_4_RELEASE.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml rename target/classes/{url.class => CheckURL.class} (66%) diff --git a/.gitignore b/.gitignore index 9f11b75..e69de29 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +0,0 @@ -.idea/ diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..2d50b32 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml new file mode 100644 index 0000000..1c24f9a --- /dev/null +++ b/.idea/kotlinc.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_google_guava_guava_21_0.xml b/.idea/libraries/Maven__com_google_guava_guava_21_0.xml new file mode 100644 index 0000000..a923456 --- /dev/null +++ b/.idea/libraries/Maven__com_google_guava_guava_21_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__commons_codec_commons_codec_1_6.xml b/.idea/libraries/Maven__commons_codec_commons_codec_1_6.xml new file mode 100644 index 0000000..e8a6a9f --- /dev/null +++ b/.idea/libraries/Maven__commons_codec_commons_codec_1_6.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__commons_logging_commons_logging_1_1_3.xml b/.idea/libraries/Maven__commons_logging_commons_logging_1_1_3.xml new file mode 100644 index 0000000..01c7b8e --- /dev/null +++ b/.idea/libraries/Maven__commons_logging_commons_logging_1_1_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__javax_servlet_servlet_api_2_5.xml b/.idea/libraries/Maven__javax_servlet_servlet_api_2_5.xml new file mode 100644 index 0000000..679e09a --- /dev/null +++ b/.idea/libraries/Maven__javax_servlet_servlet_api_2_5.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_commons_commons_lang3_3_0.xml b/.idea/libraries/Maven__org_apache_commons_commons_lang3_3_0.xml new file mode 100644 index 0000000..de0cf71 --- /dev/null +++ b/.idea/libraries/Maven__org_apache_commons_commons_lang3_3_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_httpcomponents_fluent_hc_4_3_6.xml b/.idea/libraries/Maven__org_apache_httpcomponents_fluent_hc_4_3_6.xml new file mode 100644 index 0000000..9773cee --- /dev/null +++ b/.idea/libraries/Maven__org_apache_httpcomponents_fluent_hc_4_3_6.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_httpcomponents_httpclient_4_3_6.xml b/.idea/libraries/Maven__org_apache_httpcomponents_httpclient_4_3_6.xml new file mode 100644 index 0000000..04cad1e --- /dev/null +++ b/.idea/libraries/Maven__org_apache_httpcomponents_httpclient_4_3_6.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_httpcomponents_httpcore_4_3_3.xml b/.idea/libraries/Maven__org_apache_httpcomponents_httpcore_4_3_3.xml new file mode 100644 index 0000000..a821fc2 --- /dev/null +++ b/.idea/libraries/Maven__org_apache_httpcomponents_httpcore_4_3_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_8_0_23.xml b/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_8_0_23.xml new file mode 100644 index 0000000..7e2d2eb --- /dev/null +++ b/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_8_0_23.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_8_0_23.xml b/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_8_0_23.xml new file mode 100644 index 0000000..29f4076 --- /dev/null +++ b/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_8_0_23.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_logging_juli_8_0_23.xml b/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_logging_juli_8_0_23.xml new file mode 100644 index 0000000..8683ea2 --- /dev/null +++ b/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_logging_juli_8_0_23.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_8_0_23.xml b/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_8_0_23.xml new file mode 100644 index 0000000..0250d9a --- /dev/null +++ b/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_8_0_23.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_1_2_4_RELEASE.xml b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_1_2_4_RELEASE.xml new file mode 100644 index 0000000..a28ccd7 --- /dev/null +++ b/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_1_2_4_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..5faeabe --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + 1.8 + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..9f4bb74 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..1414abb --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,877 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + project + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1505893746923 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/checkURL.java b/src/main/java/checkURL.java index a17f266..77fa8e5 100644 --- a/src/main/java/checkURL.java +++ b/src/main/java/checkURL.java @@ -9,7 +9,7 @@ import java.net.URL; import com.google.common.net.InternetDomainName; -public class checkURL { +public class CheckURL { /** * 检测传入的URL是否在白名单的域名里 diff --git a/src/main/java/test.java b/src/main/java/test.java index e5159ce..2a68a8a 100644 --- a/src/main/java/test.java +++ b/src/main/java/test.java @@ -1,22 +1,22 @@ /** - * Author: JoyChou - * Mail: viarus#qq.com + * Author: JoyChou + * Mail: joychou@joychou.org * Date: 2017.09.05 */ import org.apache.http.client.fluent.Request; -public class test { +public class Test { public static void main(String[] args) throws Exception { // URL白名单组件测试 - checkURL urlCheck = new checkURL(); + CheckURL urlCheck = new CheckURL(); String[] urlWList = {"joychou.com", "joychou.me"}; Boolean ret = urlCheck.checkUrlWlist("http://test.joychou.org", urlWList); System.out.println(ret); // SSRF组件测试 SSRF check = new SSRF(); - String url = "http://dns_rebind.joychou.me"; + String url = "http://127.0.0.1.xip.io"; ret = check.checkSSRF(url); if (ret){ String con = Request.Get(url).execute().returnContent().toString(); @@ -26,6 +26,8 @@ public class test { System.out.println("Bad boy. The url is illegal"); } + // 获取客户端IP测试 + } } diff --git a/target/classes/url.class b/target/classes/CheckURL.class similarity index 66% rename from target/classes/url.class rename to target/classes/CheckURL.class index d720be844c633cfdb6b07d771e7e0619c8052c05..0e6da8ec091e353b11cef6d6da93de65938f5665 100644 GIT binary patch delta 188 zcmdnUeTg;9>A&aN=R`VsK(-@aAFg zVesW)@MG}jVF&;T2QmaPG6-iSmL=-vB<7{-yH+Hp7L;V>=P@#H!0cjV5I`vKPs&P7 QE@5O4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vhcV&=`9Tv%Qck*7g K5@QQC&i@NI@ba$! diff --git a/target/classes/ssrf.class b/target/classes/ssrf.class index aadcd8b8c7493a19b9059777c694513e0edeff1e..d32563bbe88e47ab5a46bfd1b35070457bdb242e 100644 GIT binary patch delta 37 icmZ21zF2&N2qQ~yaFE+(3C15#mI!kclvTuH$PNI`>k3N% delta 37 icmZ21zF2&N2qQ~zaZ%c43C15#mI!kclvTuH$PNJMD+|j2 diff --git a/target/classes/test.class b/target/classes/test.class index f2102a26cb48bb51d02dcd4aa5fe62fc28fe6b2c..efc25c6f3af20164083ad3c60469bb3e1d1cc73d 100644 GIT binary patch delta 536 zcmYL`%Tg0T6o$VZLVD76TpI7j8!Bp&fd~lRffzAfNCxkUaU9JcWl|6bO8 zLdu03cRYvBL2)`%VR!ZU`<(v&zfX1l+y6D2Y;FJk0|b09rJTgOrue+OeqG|R+bfJc0Gza-K70_Ra29^(Oz4L;!3g{D>7lc+ASuyu6nRfByBpdyAapfIOKS9?Eqj@vvk?K_xgi z{0sG?e|$t@x?l7;Dto(2;26gx%W#6cm^kq^DYRg#HU<;TL2TW$#hi E0X^AHqW}N^ delta 750 zcmZWm%Tg0j5IuKDawo$;S(Ft-Q9wlk$b?KHlEfEa5Ml%*2ofJLB$H%f9^=d;B^!04 zdn#+cz?E1flveox?)(Q=euQOTEOp^j_3b`=yHB6K^Qz~2@5`@0KYalZMq9yY#5i;X zlJIdE2^m*pTos9Heq6^51#_6^SWwW7n2ejkClxH>mVzZLizB7rHqr|2U`14~%2?yL zs~{j6)@5WwxFLG(acpu4TYKgbbNBX5uQ%PYYn@RRO*@WVN-%U0W{^yap*y|2Hdid# zhU3tMl6+n;EZ1x{9FF^hGtHJ=Fc!_4!Qgid$JMI&c3#C940YbJRAn1kjt43p;t|JV z6*)X%@Q5)CgB91c;-OHn;pA*%$7~d}YIC5&LS?;osd(;+>o!iJ;5MT_LPA8OJ& zDM=fc)4Ju@0~aRdw+C2LZ|O2DdQ}~>hA)a!+An}jN$^339FH_YdE|QLZdfzF^iTNdHB)<#O*dz;+mMAgk)axbY03w8axJ3OP>YO3F IOtFO7Un$sybpQYW diff --git a/trident.iml b/trident.iml index eacd736..863a334 100644 --- a/trident.iml +++ b/trident.iml @@ -1,28 +1,118 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +