mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-16 16:34:24 +00:00
feat: basic PoC script
basic repo info retrieval
This commit is contained in:
1 file changed
+32
@@ -0,0 +1,32 @@
|
||||
import json
|
||||
|
||||
import requests
|
||||
|
||||
TOKEN = "token"
|
||||
ENDPOINT = "https://api.github.com/graphql"
|
||||
|
||||
headers = {"Authorization": f"Bearer {TOKEN}", "Content-Type": "application/json"}
|
||||
|
||||
query = """
|
||||
{
|
||||
user(login: "HugoPBrito") {
|
||||
login
|
||||
twoFactorAuthentication {
|
||||
enabled
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
response = requests.post(ENDPOINT, headers=headers, json={"query": query})
|
||||
|
||||
if response.status_code == 200:
|
||||
print(json.dumps(response.json(), indent=2))
|
||||
|
||||
data = response.json()
|
||||
two_factor_authentication = data["data"]["user"]["twoFactorAuthentication"][
|
||||
"enabled"
|
||||
]
|
||||
print(two_factor_authentication)
|
||||
else:
|
||||
print(f"Error {response.status_code}: {response.text}")
|
||||
Reference in new issue
Block a user