Skip to content

Commit

Permalink
ip_id_password tripple - fix
Browse files Browse the repository at this point in the history
  • Loading branch information
babenek committed Oct 25, 2023
1 parent 5e2df31 commit d2cc837
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion credsweeper/rules/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
severity: medium
type: pattern
values:
- (^|(?P<variable>(?i:\bip[\s/]+id[\s/]+pw[\s/:]*))|(?P<url>://)|\s)(?P<ip>[0-2]?[0-9]{1,2}\.[0-2]?[0-9]{1,2}\.[0-2]?[0-9]{1,2}\.[0-2]?[0-9]{1,2})((?P<lpar>\s*\()?\s*|(?(variable)[\s,/]+|\s*(?(url)[,]|[,/])\s*))[\w.-]{3,}[\s,/]+(?P<value>(?(lpar)[^)\s/]{4,}|(?(url)[^\s/]{4,}|[^\s]{4,})))
- (^|(?P<variable>(?i:\bip[\s/]+id[\s/]+pw[\s/:]*))|(?://)|\s)(?P<ip>[0-2]?[0-9]{1,2}\.[0-2]?[0-9]{1,2}\.[0-2]?[0-9]{1,2}\.[0-2]?[0-9]{1,2})((?P<lpar>\s*(\w+\s+)?\()?\s*|(?(variable)[\s,/]+|\s*[,/])\s*)[\w.-]{3,}[\s,/]+(?P<value>(?(lpar)[^)\s]{4,}|[^\s/]{4,}))(?:\s|[^/]|$)
filter_type:
- ValueAllowlistCheck
- ValuePatternCheck
Expand Down
14 changes: 7 additions & 7 deletions tests/data/doc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8186,13 +8186,13 @@
"line_num": 14,
"path": "tests/samples/doc_various",
"info": "tests/samples/doc_various|RAW",
"value": "(master/IhqSb1Gg)",
"value_start": 17,
"value_end": 34,
"value": "IhqSb1Gg",
"value_start": 25,
"value_end": 33,
"variable": null,
"entropy_validation": {
"iterator": "BASE64_CHARS",
"entropy": 3.606584859926771,
"entropy": 3.0,
"valid": false
}
}
Expand Down Expand Up @@ -8750,13 +8750,13 @@
"line_num": 48,
"path": "tests/samples/doc_various",
"info": "tests/samples/doc_various|RAW",
"value": "IhqSb1Gg,master",
"value": "IhqSb1Gg,master/IhqSb1Gg",
"value_start": 19,
"value_end": 34,
"value_end": 43,
"variable": null,
"entropy_validation": {
"iterator": "BASE64_CHARS",
"entropy": 3.64643122256795,
"entropy": 3.727255729857775,
"valid": false
}
}
Expand Down
3 changes: 3 additions & 0 deletions tests/samples/doc_ip_id_password_triple
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
IP ID PW 192.168.0.1 master IhqSb1Gg

IP/ID/PW 192.168.0.1/master/IhqSb1Gg

# FALSE
<p tst="auto">sirius 192.168.0.1/mnt/user/USBx/\\[Root_Test\\]UseCase/12345678/76125-733_FFB_2038_judgement_day6_238811_6524.apk</p>

0 comments on commit d2cc837

Please sign in to comment.