Skip to content
New issue

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

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

Already on GitHub? # to your account

Add sshpass #204

Merged
3 commits merged into from
Oct 11, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
PabloLec marked this conversation as resolved.
Show resolved Hide resolved
"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)