├── HTBHDBadgeGenerator.py ├── README.md └── assets ├── Example.PNG ├── htb_crosshair.png ├── htb_logo.webp └── htb_star.png /HTBHDBadgeGenerator.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | import sys,getopt,urllib.request,urllib.parse,base64 4 | 5 | banner = """ 6 | _ _ _ _____ _ ____ _ _ _ _ ____ __ ____ _ ____ _ 7 | | | | | __ _ ___| | _|_ _| |__ ___| __ ) _____ __ | | | (_) __ _| |__ | _ \ ___ / _| | __ ) __ _ __| | __ _ ___ / ___|_ __ ___ __ _| |_ ___ _ __ 8 | | |_| |/ _` |/ __| |/ / | | | '_ \ / _ \ _ \ / _ \ \/ / | |_| | |/ _` | '_ \| | | |/ _ \ |_ | _ \ / _` |/ _` |/ _` |/ _ \ | | | '__/ _ \/ _` | __/ _ \| '__| 9 | | _ | (_| | (__| < | | | | | | __/ |_) | (_) > < | _ | | (_| | | | | |_| | __/ _| | |_) | (_| | (_| | (_| | __/ | |___| | | __/ (_| | || (_) | | 10 | |_| |_|\__,_|\___|_|\_\ |_| |_| |_|\___|____/ \___/_/\_\ |_| |_|_|\__, |_| |_|____/ \___|_| |____/ \__,_|\__,_|\__, |\___| \____|_| \___|\__,_|\__\___/|_| 11 | |___/ |___/ 12 | 13 | By Flangvik 14 | """ 15 | def generateHTB(htbId): 16 | print(banner) 17 | htbUrl = "https://www.hackthebox.eu/badge/" + htbId 18 | 19 | signatureReq = urllib.request.urlopen(urllib.request.Request(htbUrl, headers={ 'User-Agent' : 'Mozilla/5.0 (Windows NT 6.1; Win64; x64)' })) 20 | signatureRaw = signatureReq.read().decode('utf-8') 21 | signatureBase64 = signatureRaw.split('document.write(window.atob("')[1].split('"))')[0] 22 | 23 | signatureHTML = base64.b64decode(signatureBase64).decode('utf-8') 24 | 25 | signatureHTML = signatureHTML.replace('https://www.hackthebox.eu/images/screenshot.png',"assets/htb_crosshair.png") 26 | signatureHTML = signatureHTML.replace('_thumb.png',".png") 27 | signatureHTML = signatureHTML.replace('https://www.hackthebox.eu/images/star.png',"assets/htb_star.png") 28 | signatureHTML = signatureHTML.replace('url(https://www.hackthebox.eu/images/icon20.png); ',"url('assets/htb_logo.webp'); background-size: 20px;") 29 | 30 | signatureFile = open(htbId + '.html','w') 31 | signatureFile.write(signatureHTML) 32 | signatureFile.close() 33 | 34 | print("Check " + htbId + ".html!") 35 | 36 | 37 | try: 38 | options, remainder = getopt.getopt( 39 | sys.argv[1:], 40 | '', 41 | ['htbid=']) 42 | except getopt.GetoptError as err: 43 | print ('HTBHDBadgeGenerator.py -htbid ') 44 | sys.exit(1) 45 | 46 | for opt, arg in options: 47 | if opt == '--htbid': 48 | htbId = arg 49 | 50 | generateHTB(htbId) 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # HTB-HDBadgeGenerator 2 | HackTheBox High Definition Badge Generator 3 | ![Example usage](https://raw.githubusercontent.com/SkiddieTech/HTB-HDBadgeGenerator/master/assets/Example.PNG) 4 | -------------------------------------------------------------------------------- /assets/Example.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Flangvik/HTB-HDBadgeGenerator/cf31aad5ae0312c18a27dd3d81dcca9d3c89e869/assets/Example.PNG -------------------------------------------------------------------------------- /assets/htb_crosshair.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Flangvik/HTB-HDBadgeGenerator/cf31aad5ae0312c18a27dd3d81dcca9d3c89e869/assets/htb_crosshair.png -------------------------------------------------------------------------------- /assets/htb_logo.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Flangvik/HTB-HDBadgeGenerator/cf31aad5ae0312c18a27dd3d81dcca9d3c89e869/assets/htb_logo.webp -------------------------------------------------------------------------------- /assets/htb_star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Flangvik/HTB-HDBadgeGenerator/cf31aad5ae0312c18a27dd3d81dcca9d3c89e869/assets/htb_star.png --------------------------------------------------------------------------------