diff --git a/fixtures/file b/fixtures/file index b5bc63e..1101af0 100644 --- a/fixtures/file +++ b/fixtures/file @@ -93,4 +93,6 @@ b2ced6f5-2542-4f7d-b131-e3ada95d8b75 5fc7c33a7ef88b139122a38a 01ERJ58HMWDN3VTRRHZQV2T5R5 -otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example \ No newline at end of file +otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example + +sshpass -p MyPassw0RD! ssh root@10.0.0.10 \ No newline at end of file diff --git a/pywhat/Data/regex.json b/pywhat/Data/regex.json index f9c5df4..7bfd25c 100644 --- a/pywhat/Data/regex.json +++ b/pywhat/Data/regex.json @@ -1011,7 +1011,20 @@ "Credentials", "TOTP", "Bug Bounty" - ] + ] + }, + { + "Name": "SSHPass Clear Password Argument", + "Regex": "^(sshpass [^\\n]*-p[ ]+[^ ]+)$", + "plural_name": false, + "Description": null, + "Rarity": 1, + "URL": null, + "Tags": [ + "Credentials", + "SSH", + "Bug Bounty" + ] }, { "Name": "Google Cloud Platform API Key", diff --git a/tests/test_click.py b/tests/test_click.py index b6a54f6..c8c51b5 100644 --- a/tests/test_click.py +++ b/tests/test_click.py @@ -625,3 +625,10 @@ def test_file_fixture_totp_URI(): result = runner.invoke(main, ["fixtures/file"]) assert result.exit_code == 0 assert re.findall("Time-Based One-Time Password [(]TOTP[)] URI", str(result.output)) + + +def test_file_fixture_sshpass(): + runner = CliRunner() + result = runner.invoke(main, ["fixtures/file"]) + assert result.exit_code == 0 + assert re.findall("SSHPass Clear Password Argument", str(result.output)) diff --git a/tests/test_regex_identifier.py b/tests/test_regex_identifier.py index f91ace3..ba81485 100644 --- a/tests/test_regex_identifier.py +++ b/tests/test_regex_identifier.py @@ -1044,3 +1044,13 @@ def test_complex_totp_URI(): ] ) _assert_match_first_item("Time-Based One-Time Password (TOTP) URI", res) + + +def test_sshpass(): + res = r.check(["sshpass -p MyPassw0RD!"]) + _assert_match_first_item("SSHPass Clear Password Argument", res) + + +def test_sshpass_multiple_args(): + res = r.check(["sshpass -P 'Please enter your password' -p MyPassw0RD!"]) + _assert_match_first_item("SSHPass Clear Password Argument", res)