Skip to content

Instantly share code, notes, and snippets.

@JoyGhoshs
Created March 22, 2022 17:21
Show Gist options
  • Save JoyGhoshs/986d22437c54a59921bc29cf2edb4cc6 to your computer and use it in GitHub Desktop.
Save JoyGhoshs/986d22437c54a59921bc29cf2edb4cc6 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
from json.tool import main
import sys
import requests
import json
from rich.console import Console
from rich.table import Table
"""
__Author__: Joy Ghosh
__org__:system00 security bangladesh
__web__:https://system00-sec.om
"""
def hackerone_hackitivity():
table = Table(title="Hackerone Hacktivity")
table.add_column("Reporter", justify="right", style="red", no_wrap=True)
table.add_column("Program", style="magenta")
table.add_column("Vulnerability", justify="left", style="green")
table.add_column("Bounty", justify="right", style="green")
headers = {'Content-Type':'application/json'}
data = '{"operationName":"HacktivityPageQuery","variables":{"querystring":"","where":{"report":{"disclosed_at":{"_is_null":false}}},"orderBy":null,"secureOrderBy":{"latest_disclosable_activity_at":{"_direction":"DESC"}},"count":20},"query":"query HacktivityPageQuery($querystring: String, $orderBy: HacktivityItemOrderInput, $secureOrderBy: FiltersHacktivityItemFilterOrder, $where: FiltersHacktivityItemFilterInput, $count: Int, $cursor: String) {\n hacktivity_items(first: $count, after: $cursor, query: $querystring, order_by: $orderBy, secure_order_by: $secureOrderBy, where: $where) {\n ...HacktivityList\n }\n}\n\nfragment HacktivityList on HacktivityItemConnection {\n edges {\n node {\n ... on HacktivityItemInterface {\n ...HacktivityItem\n }\n }\n }\n}\n\nfragment HacktivityItem on HacktivityItemUnion {\n ... on Undisclosed {\n id\n ...HacktivityItemUndisclosed\n }\n ... on Disclosed {\n ...HacktivityItemDisclosed\n }\n ... on HackerPublished {\n ...HacktivityItemHackerPublished\n }\n}\n\nfragment HacktivityItemUndisclosed on Undisclosed {\n reporter {\n username\n ...UserLinkWithMiniProfile\n }\n team {\n handle\n name\n url\n ...TeamLinkWithMiniProfile\n }\n latest_disclosable_action\n latest_disclosable_activity_at\n requires_view_privilege\n total_awarded_amount\n currency\n}\n\nfragment TeamLinkWithMiniProfile on Team {\n handle\n name\n }\n\nfragment UserLinkWithMiniProfile on User {\n username\n}\n\nfragment HacktivityItemDisclosed on Disclosed {\n reporter {\n username\n ...UserLinkWithMiniProfile\n }\n team {\n handle\n name\n url\n ...TeamLinkWithMiniProfile\n }\n report {\n title\n substate\n url\n }\n latest_disclosable_activity_at\n total_awarded_amount\n severity_rating\n currency\n}\n\nfragment HacktivityItemHackerPublished on HackerPublished {\n reporter {\n username\n ...UserLinkWithMiniProfile\n }\n team {\n handle\n name\n medium_profile_picture: profile_picture(size: medium)\n url\n ...TeamLinkWithMiniProfile\n }\n report {\n url\n title\n substate\n }\n latest_disclosable_activity_at\n severity_rating\n}\n"}'.replace('\n','\\n')
main_data = requests.post("https://hackerone.com/graphql", data=data, headers=headers)
main_data = json.loads(main_data.text)
main_data = main_data['data']['hacktivity_items']['edges']
for i in range(len(main_data)):
data=main_data[i]['node']
username=data['reporter']['username']
username=str(username)
reported_to=data['team']['name']
reported_to=str(reported_to)
report_title=data['report']['title']
report_url=data['report']['url']
award_amount=data['total_awarded_amount']
award_amount=str(award_amount)
severity_rating=data['severity_rating']
severity_rating=str(severity_rating)
report=report_title+" ("+report_url+")"
report=str(report)
table.add_row(username,reported_to,report,award_amount)
console = Console()
console.print(table)
hackerone_hackitivity()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment