Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language #5

Merged
merged 3 commits into from
May 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/cn/ac/ios/Bean/Attack.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class Attack {
public String suffix;
public AttackType type;
public PatternType patternType;
public String redos = "";
public String reDoS = "";

public Attack(String prefix, String infix, String suffix, AttackType type, PatternType patternType) {
this.prefix = prefix;
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/cn/ac/ios/ReDoSMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
Expand Down Expand Up @@ -357,7 +356,7 @@ public static ReDoSBean getPerl(ReDoSBean bean, String model) {
Output resultBean = dataBeanArrayList.get(0);
for (int i = 0; i < bean.getAttackBeanList().size(); i++) {
Attack attack = resultBean.attackArrayList.get(i);
String redos = attack.redos.toLowerCase();
String redos = attack.reDoS.toLowerCase();
if (redos.equals("true")) {
bean.setReDoS(true);
bean.getAttackBeanList().get(i).setPatternType(attack.patternType);
Expand All @@ -372,7 +371,7 @@ public static ReDoSBean getPerl(ReDoSBean bean, String model) {
} else {
bean.getAttackBeanList().get(i).setAttackSuccess(false);
}
bean.getAttackBeanList().get(i).msg = attack.redos;
bean.getAttackBeanList().get(i).msg = attack.reDoS;
}
return bean;
} catch (Exception e) {
Expand Down Expand Up @@ -424,7 +423,7 @@ public static ReDoSBean getPHP(ReDoSBean bean, String model) {
Output resultBean = dataBeanArrayList.get(0);
for (int i = 0; i < bean.getAttackBeanList().size(); i++) {
Attack attack = resultBean.attackArrayList.get(i);
String redos = attack.redos.toLowerCase();
String redos = attack.reDoS.toLowerCase();
if (redos.equals("true")) {
bean.setReDoS(true);
bean.getAttackBeanList().get(i).setPatternType(attack.patternType);
Expand All @@ -439,7 +438,7 @@ public static ReDoSBean getPHP(ReDoSBean bean, String model) {
} else {
bean.getAttackBeanList().get(i).setAttackSuccess(false);
}
bean.getAttackBeanList().get(i).msg = attack.redos;
bean.getAttackBeanList().get(i).msg = attack.reDoS;
}
return bean;
} catch (Exception e) {
Expand Down