1010import com .drops .utils .*;
1111
1212import java .util .Map ;
13+ import java .util .Properties ;
1314import java .util .Scanner ;
1415import java .util .UUID ;
1516
@@ -78,7 +79,7 @@ public boolean check404(String target){
7879 // Spring Boot 1.x版本端点在根URL下注册。
7980 public boolean checkActuatorPointV1 (String target ){
8081 for (String point : info .pointListV1 ){
81- if (SpringbootUtils .checkPoint (target , point )){
82+ if (this . SpringbootUtils .checkPoint (target , point )){
8283 this .setSpringbootVersionV1 (true );
8384 }
8485 }
@@ -87,7 +88,7 @@ public boolean checkActuatorPointV1(String target){
8788 // Spring Boot 2.x版本端点移动到/actuator/路径
8889 public boolean checkActuatorPointV2 (String target ){
8990 for (String point : info .pointListV2 ){
90- if (SpringbootUtils .checkPoint (target , point )){
91+ if (this . SpringbootUtils .checkPoint (target , point )){
9192 this .setSpringbootVersionV1 (false );
9293 }
9394 }
@@ -96,8 +97,11 @@ public boolean checkActuatorPointV2(String target){
9697
9798 // Spring Boot env端点存在环境属性覆盖和XStream反序列化漏洞
9899 void checkEnvPointV1 (String addr ){
99- String url = URLUtil .normalizeURL (addr ) + "env" ;
100- SnakeYAMLRCEPOC yamlrcepoc = new SnakeYAMLRCEPOC ();
100+ String url = URLUtil .normalizeURL (addr ) + "env" ;
101+ HttpResponse response = HTTPUtils .getRequest (url );
102+ PropertiesBean properties = this .EnvParser (this .scannerOutput (new Scanner (ResponseUtil .getBoby (response ))));
103+ this .parseProperties (properties );
104+ SnakeYAMLRCEPOC yamlrcepoc = new SnakeYAMLRCEPOC ();
101105 if (!yamlrcepoc .hasSnakeYAMLRCE (url )){
102106 EurekaXstreamRCEPOC xstreamRCEPOC = new EurekaXstreamRCEPOC ();
103107 if (!xstreamRCEPOC .hasEurekaXstreamRCE (url )){
@@ -117,8 +121,10 @@ void checkEnvPointV1(String addr){
117121
118122 // Spring Boot 2.x版本存在H2配置不当导致的RCE,目前非正则判断,测试阶段
119123 void checkEnvPointV2 (String addr ){
120- final String url = addr +"actuator/env" ;
121- // HttpResponse response = HTTPUtils.getRequest(url);
124+ final String url = addr +"actuator/env" ;
125+ HttpResponse response = HTTPUtils .getRequest (url );
126+ PropertiesBean properties = this .EnvParser (this .scannerOutput (new Scanner (ResponseUtil .getBoby (response ))));
127+ this .parseProperties (properties );
122128 SnakeYAMLRCEPOC yamlrcepoc = new SnakeYAMLRCEPOC ();
123129 if (!yamlrcepoc .hasSnakeYAMLRCE (url )){
124130 EurekaXstreamRCEPOC xstreamRCEPOC = new EurekaXstreamRCEPOC ();
@@ -140,7 +146,7 @@ void checkEnvPointV2(String addr){
140146
141147 }
142148
143- public PropertiesBean EnvParser (String result ){
149+ public PropertiesBean EnvParser (String result ){
144150 PropertiesBean propertiesBean = new PropertiesBean ();
145151 try {
146152 JSONObject jsonObject = JSON .parseObject (result );
@@ -187,6 +193,17 @@ public String scannerOutput(Scanner scanner){
187193 }
188194
189195
196+ void parseProperties (PropertiesBean properties ){
197+ if (properties .getHaveInfo ()){
198+ // this.mainController.logTextArea.appendText();
199+ // infoCheck.
200+ this .mainController .logTextArea .appendText (Utils .log ("\t JVM信息:\t \t " +properties .getJvmName ()));
201+ this .mainController .logTextArea .appendText (Utils .log ("\t 端口信息:\t \t " +properties .getServerPort ()));
202+ this .mainController .logTextArea .appendText (Utils .log ("\t Java版本:\t \t " +properties .getJavaVersion ()));
203+ this .mainController .logTextArea .appendText (Utils .log ("\t 用户名:\t \t " +properties .getUserName ()));
204+ }
205+ }
206+
190207
191208
192209
0 commit comments