Skip to content

Instantly share code, notes, and snippets.

@YasserGersy
Last active November 19, 2018 14:54
Show Gist options
  • Save YasserGersy/c97eb6ecd0ef5e055e7f6e472ce0b14d to your computer and use it in GitHub Desktop.
Save YasserGersy/c97eb6ecd0ef5e055e7f6e472ce0b14d to your computer and use it in GitHub Desktop.
H1LP.py loads hackerone open programs
#!/bin/python
import requests
try:
requests.packages.urllib3.disable_warnings()
except:
print 'Error'
print 'Hackerone programs loader'
print '--------------------------------------------------------'
fush='\033[95m'
white='\033[37m'
green='\033[32m'
load=True
programs=[]
ri=0
pi=0
while load:
try:
ri=ri+1
ix=str(ri)
url='https://hackerone.com/programs/search?query=type%3Ahackerone&sort=published_at%3Adescending&page='+ix
r=requests.get(url=url,verify=False)
text=r.text.encode('utf-8')
if r.status_code!=200:
load=False
break
if ',"url":"' in text:
spl=text.split(',"url":"')
for x in spl:
if x.startswith('/') and '"' in x:
pi=pi+1
px=str(pi)
pname=x.split('"')[0].strip()[1:]
if pname not in programs:
opennow='"submission_state":"paused"' not in x
statue="[open] " if opennow else "[paused]"
color = green if opennow else fush
if opennow:
programs.append(pname)
print color+ix+(' '*(10-len(ix)) )+px+(' '*(10-len(px)) )+ statue +pname
except Exception,ex:
print str(ex)
print white+'--------------------- Done --------------------'
try:
open('programs.txt','w').write('\n'.join(programs))
print 'Saved'
except:
print 'Error saving '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment