Skip to content

Commit

Permalink
Merge pull request #204 from PabloLec/main
Browse files Browse the repository at this point in the history
Add sshpass
  • Loading branch information
piatrashkakanstantinass authored Oct 11, 2021
2 parents 0765321 + e42d52d commit 669682c
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
4 changes: 3 additions & 1 deletion fixtures/file
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,6 @@ b2ced6f5-2542-4f7d-b131-e3ada95d8b75
5fc7c33a7ef88b139122a38a
01ERJ58HMWDN3VTRRHZQV2T5R5

otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example
otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example

sshpass -p MyPassw0RD! ssh root@10.0.0.10
15 changes: 14 additions & 1 deletion pywhat/Data/regex.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 7 additions & 0 deletions tests/test_click.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
10 changes: 10 additions & 0 deletions tests/test_regex_identifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 669682c

Please sign in to comment.