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

Added and removed some of the tags #123

Merged
2 commits merged into from
Jul 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
67 changes: 25 additions & 42 deletions pywhat/Data/regex.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
"Rarity": 1,
"URL": null,
"Tags": [
"PGP",
"Pretty Good Privacy",
"Public Key"
"PGP"
]
},
{
Expand All @@ -20,9 +18,7 @@
"Rarity": 1,
"URL": null,
"Tags": [
"PGP",
"Pretty Good Privacy",
"Private Key"
"PGP"
]
},
{
Expand All @@ -34,9 +30,7 @@
"URL": null,
"Tags": [
"Credentials",
"Cyber Security",
"Public Key",
"RSA Public Key"
"SSH Public Key"
]
},
{
Expand All @@ -48,8 +42,6 @@
"URL": null,
"Tags": [
"Credentials",
"Cyber Security",
"Public Key",
"SSH Public Key"
]
},
Expand All @@ -62,8 +54,6 @@
"URL": null,
"Tags": [
"Credentials",
"Cyber Security",
"Public Key",
"SSH Public Key"
]
},
Expand All @@ -87,7 +77,7 @@
"Rarity": 1,
"URL": null,
"Tags": [
"Cyber Security"
"CTF Flag"
]
},
{
Expand All @@ -98,7 +88,7 @@
"Rarity": 1,
"URL": null,
"Tags": [
"Cyber Security"
"CTF Flag"
]
},
{
Expand All @@ -109,7 +99,7 @@
"Rarity": 1,
"URL": null,
"Tags": [
"Cyber Security"
"CTF Flag"
]
},
{
Expand Down Expand Up @@ -146,7 +136,6 @@
"Rarity": 1,
"URL": null,
"Tags": [
"Internet",
"Networking",
"AWS"
]
Expand All @@ -159,7 +148,6 @@
"Rarity": 1,
"URL": null,
"Tags": [
"Internet",
"Networking",
"AWS"
]
Expand All @@ -174,7 +162,7 @@
"Tags": [
"API Keys",
"Credentials",
"Square"
"Square API"
]
},
{
Expand All @@ -187,7 +175,7 @@
"Tags": [
"API Keys",
"Credentials",
"Square"
"Square API"
]
},
{
Expand Down Expand Up @@ -224,8 +212,7 @@
"Tags": [
"Identifiers",
"Networking",
"AWS",
"AWS ARN"
"AWS"
]
},
{
Expand All @@ -238,7 +225,7 @@
"Tags": [
"Identifiers",
"Networking",
"IPv6"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason we used specific tags here was so people could pick and choose what they wanted specifically, if we can filter on names this isn't needed :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IPv4 and IPv6 are the ones that may actually come useful, so they can be added back yeah. Are there any others?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, it may be better to add individual tags to all entries.

"IP"
]
},
{
Expand All @@ -263,7 +250,7 @@
"Tags": [
"Identifiers",
"Networking",
"IPv4"
"IP"
]
},
{
Expand All @@ -274,7 +261,6 @@
"Rarity": 0.7,
"URL": "https://www.blockchain.com/btc/address/",
"Tags": [
"Cryptocurrency",
"Finance",
"Cryptocurrency Wallet",
"Bitcoin Wallet"
Expand Down Expand Up @@ -362,8 +348,6 @@
"URL": null,
"Tags": [
"Credentials",
"Password",
"Username",
"SSN"
]
},
Expand All @@ -375,7 +359,8 @@
"Rarity": 0.5,
"URL": "https://www.youtube.com/channel/",
"Tags": [
"Media"
"Media",
"YouTube"
]
},
{
Expand All @@ -386,7 +371,7 @@
"Rarity": 0.5,
"URL": null,
"Tags": [
"Security",
"Credentials",
"Token",
"API Keys"
]
Expand Down Expand Up @@ -574,7 +559,8 @@
"Rarity": 0.3,
"URL": null,
"Tags": [
"Credit Card"
"Credit Card",
"Finance"
]
},
{
Expand Down Expand Up @@ -760,8 +746,6 @@
"Rarity": 0.2,
"URL": null,
"Tags": [
"Security",
"Hacking",
"Token",
"Website",
"JWT Token"
Expand All @@ -776,7 +760,7 @@
"URL": null,
"Tags": [
"Credentials",
"Cyber Security",
"API Keys",
"AWS"
]
},
Expand All @@ -789,7 +773,7 @@
"URL": null,
"Tags": [
"Credentials",
"Cyber Security",
"API Keys",
"AWS"
]
},
Expand All @@ -813,7 +797,8 @@
"Rarity": 0.2,
"URL": "https://www.youtube.com/watch?v=",
"Tags": [
"Media"
"Media",
"YouTube Video"
]
},
{
Expand All @@ -824,7 +809,7 @@
"Rarity": 0.2,
"URL": null,
"Tags": [
"Time"
"UNIX Timestamp"
]
},
{
Expand All @@ -835,7 +820,7 @@
"Rarity": 0.2,
"URL": null,
"Tags": [
"Time"
"UNIX Timestamp"
]
},
{
Expand All @@ -846,7 +831,7 @@
"Rarity": 0.2,
"URL": null,
"Tags": [
"Time"
"UNIX Timestamp"
]
},
{
Expand All @@ -857,7 +842,7 @@
"Rarity": 0.2,
"URL": null,
"Tags": [
"Time"
"UNIX Timestamp"
]
},
{
Expand All @@ -868,9 +853,7 @@
"Rarity": 0,
"URL": null,
"Tags": [
"Credentials",
"Password",
"Username"
"Credentials"
]
}
]
2 changes: 1 addition & 1 deletion tests/test_click.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ def test_only_text():
def test_boundaryless():
runner = CliRunner()
result = runner.invoke(
main, ["-be", "identifiers, security", "abc118.103.238.230abc"]
main, ["-be", "identifiers, token", "abc118.103.238.230abc"]
)
assert result.exit_code == 0
assert "Nothing found" in result.output
Expand Down
4 changes: 2 additions & 2 deletions tests/test_identifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ def test_identifier_works3():


def test_identifier_filtration():
filter = {"Tags": ["Password"]}
filter = {"Tags": ["Credentials"]}
r = identifier.Identifier(dist=Distribution(filter))
regexes = r.identify("fixtures/file", only_text=False)["Regexes"]["file"]
for regex in regexes:
assert "Password" in regex["Regex Pattern"]["Tags"]
assert "Credentials" in regex["Regex Pattern"]["Tags"]


def test_identifier_filtration2():
Expand Down