File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed
main/java/org/zaproxy/zap/extension/ascanrules
test/java/org/zaproxy/zap/extension/ascanrules Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -697,19 +697,26 @@ public String match(String contents) {
697697 }
698698
699699 private String matchNixDirectories (String contents ) {
700- Pattern procPattern = Pattern .compile ("(?:^|\\ W)proc(?:\\ W|$)" , Pattern .CASE_INSENSITIVE );
700+ Pattern procPattern =
701+ Pattern .compile ("(?:^|\\ W)proc(?:\\ W|$)" , Pattern .CASE_INSENSITIVE );
701702 Pattern etcPattern = Pattern .compile ("(?:^|\\ W)etc(?:\\ W|$)" , Pattern .CASE_INSENSITIVE );
702- Pattern bootPattern = Pattern .compile ("(?:^|\\ W)boot(?:\\ W|$)" , Pattern .CASE_INSENSITIVE );
703+ Pattern bootPattern =
704+ Pattern .compile ("(?:^|\\ W)boot(?:\\ W|$)" , Pattern .CASE_INSENSITIVE );
703705 Pattern tmpPattern = Pattern .compile ("(?:^|\\ W)tmp(?:\\ W|$)" , Pattern .CASE_INSENSITIVE );
704- Pattern homePattern = Pattern .compile ("(?:^|\\ W)home(?:\\ W|$)" , Pattern .CASE_INSENSITIVE );
706+ Pattern homePattern =
707+ Pattern .compile ("(?:^|\\ W)home(?:\\ W|$)" , Pattern .CASE_INSENSITIVE );
705708
706709 Matcher procMatcher = procPattern .matcher (contents );
707710 Matcher etcMatcher = etcPattern .matcher (contents );
708711 Matcher bootMatcher = bootPattern .matcher (contents );
709712 Matcher tmpMatcher = tmpPattern .matcher (contents );
710713 Matcher homeMatcher = homePattern .matcher (contents );
711714
712- if (procMatcher .find () && etcMatcher .find () && bootMatcher .find () && tmpMatcher .find () && homeMatcher .find ()) {
715+ if (procMatcher .find ()
716+ && etcMatcher .find ()
717+ && bootMatcher .find ()
718+ && tmpMatcher .find ()
719+ && homeMatcher .find ()) {
713720 return "etc" ;
714721 }
715722
Original file line number Diff line number Diff line change @@ -202,7 +202,6 @@ void shouldAlertIfAttackResponseListsLinuxDirectoriesInPlainText() throws Except
202202 assertThat (alertsRaised .get (0 ).getAlertRef (), is (equalTo ("6-3" )));
203203 }
204204
205-
206205 @ Test
207206 void shouldNotAlertIfAttackResponseListsHasFalsePositivePattern () throws Exception {
208207 // Given
@@ -420,8 +419,7 @@ protected String getDirs() {
420419
421420 private static class ListLinuxDirsOnAttackPlainText extends ListDirsOnAttack {
422421
423- private static final String DIRS_LISTING =
424- "etc root tmp bin boot dev home mnt opt proc" ;
422+ private static final String DIRS_LISTING = "etc root tmp bin boot dev home mnt opt proc" ;
425423
426424 public ListLinuxDirsOnAttackPlainText (String path , String param , String attack ) {
427425 super (path , param , attack );
You can’t perform that action at this time.
0 commit comments