Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add new RegEx for facebook tokens #225

Merged
4 commits merged into from
Nov 10, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions fixtures/file
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,9 @@ doi:10.1392/BC1.0
10.1000/123

a80122b2565c3e26a61cbf58d1d1aad7-us5

1201566843289141|401fec62f46bc340d4c0e7e75132f731
1201566843289141|WG1OAKQ-dY0lSj5NKyA6uFkvF7w

EAARE0ZATePjUBAFxfm2L2aWdtNXOSscOnMYktEPYJuOSrteSQZCh9VWVVKnhSSYNumEnju6XItaRhija3pA7LFPHquTbi4IDZC8k9EMByeQ4NJzCFsc40FMIQIgvnCTOK5qt6xBZCUMf7S95X6nnqCUVw2iS0DRDbqttxauxIDgBRYJ7zZABXe9V0CY872DUl3BfyINIYfCXmRZC8loACc
EAARE0ZATePjUBAHVHoVVbRc9N0u2lNC5eJab59qwD9mG5ZCRgcg3qlbPZC07EkP65Ji3BnPzPKZBMqN7WyOfJ8Riky4RD66aSqX8U0d14EWwHx94rZCtM6qfULiXOrqWKiG2KLyJJnRzAus3ubodKUwTuZCBcPmcGJcvq5Krfk8xgLQVZBoFLGLJs5wT4SlBxiWAdytlggqzQZDZD
33 changes: 31 additions & 2 deletions pywhat/Data/regex.json
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@
},
{
"Name": "Facebook Access Token",
"Regex": "^(EAACEdEose0cBA[0-9A-Za-z]{512})$",
"Regex": "^(EA[0-9A-Za-z]{190,})$",
"plural_name": false,
"Description": null,
"Exploit": null,
Expand All @@ -437,7 +437,14 @@
"Bug Bounty",
"Credentials",
"Facebook"
]
],
"Examples": {
"Valid": [
"EAARE0ZATePjUBAFxfm2L2aWdtNXOSscOnMYktEPYJuOSrteSQZCh9VWVVKnhSSYNumEnju6XItaRhija3pA7LFPHquTbi4IDZC8k9EMByeQ4NJzCFsc40FMIQIgvnCTOK5qt6xBZCUMf7S95X6nnqCUVw2iS0DRDbqttxauxIDgBRYJ7zZABXe9V0CY872DUl3BfyINIYfCXmRZC8loACc",
"EAARE0ZATePjUBAHVHoVVbRc9N0u2lNC5eJab59qwD9mG5ZCRgcg3qlbPZC07EkP65Ji3BnPzPKZBMqN7WyOfJ8Riky4RD66aSqX8U0d14EWwHx94rZCtM6qfULiXOrqWKiG2KLyJJnRzAus3ubodKUwTuZCBcPmcGJcvq5Krfk8xgLQVZBoFLGLJs5wT4SlBxiWAdytlggqzQZDZD"
],
"Invalid": []
}
},
{
"Name": "Facebook Secret Key",
Expand Down Expand Up @@ -1309,6 +1316,28 @@
]
}
},
{
"Name": "Facebook App Token",
"Regex": "^([0-9]{10,}\\|[A-Za-z0-9\\-]{27,})$",
"plural_name": false,
"Description": null,
"Exploit": null,
"Rarity": 0.8,
"URL": "https://developers.facebook.com/tools/debug/accesstoken/?access_token=",
"Tags": [
"API Keys",
"Bug Bounty",
"Credentials",
"Facebook"
],
"Examples": {
"Valid": [
"1201566843289141|401fec62f46bc340d4c0e7e75132f731",
"1201566843289141|WG1OAKQ-dY0lSj5NKyA6uFkvF7w"
],
"Invalid": []
}
},
{
"Name": "Google Cloud Platform API Key",
"Regex": "(?i)^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
Expand Down
14 changes: 14 additions & 0 deletions tests/test_click.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,20 @@ def test_file_fixture_slack_webhook():
assert re.findall("Slack Webhook", str(result.output))


def test_file_fixture_facebook_access_token():
runner = CliRunner()
result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Facebook Access Token", str(result.output))


def test_file_fixture_facebook_app_token():
runner = CliRunner()
result = runner.invoke(main, ["fixtures/file"])
assert result.exit_code == 0
assert re.findall("Facebook App Token", str(result.output))


def test_format():
runner = CliRunner()
result = runner.invoke(
Expand Down