Skip to content

Instantly share code, notes, and snippets.

@mrhalix
Created June 9, 2018 22:14
Show Gist options
  • Save mrhalix/431fcc8e2acba1d2509f63d26270c8d7 to your computer and use it in GitHub Desktop.
Save mrhalix/431fcc8e2acba1d2509f63d26270c8d7 to your computer and use it in GitHub Desktop.
HotGram Proxy Leecher for telegram + Send proxy to telegram channel
import telebot, requests, json, base64
# ------ CONFIG
API_TOKEN = "GOFUCKYOURSELF=)))))"
CHANNEL_ID = "@MrHalix"
def get_proxy():
response = requests.get("http://lh58.hotgram.ir/v1/proxy?slt=77799000&appId=3")
return json.loads(response.text)
def AESDecrypt(textToDecrypt, secretKey, iv=""):
headers = {
'origin': 'https://www.devglan.com',
'accept-encoding': 'gzip, deflate, br',
'accept-language': 'en-US,en;q=0.9',
'user-agent': 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.79 Safari/537.36',
'content-type': 'application/json;charset=UTF-8',
'accept': 'application/json, text/plain, */*',
'referer': 'https://www.devglan.com/online-tools/aes-encryption-decryption',
'authority': 'www.devglan.com',
'cookie': 'JSESSIONID=5DA4A9AE2683681C36CA034A47B0832F; _ga=GA1.2.433856436.1528579208; _gid=GA1.2.1501345519.1528579208',
'alexatoolbar-alx_ns_ph': 'AlexaToolbar/alx-4.0.3',
}
data = '{"textToDecrypt":"' + textToDecrypt + '","secretKey":"' + secretKey + '","mode":"CBC","keySize":"128","dataFormat":"Base64","iv":"' + iv + '"}'
response = requests.post('https://www.devglan.com/online-tools/aes-decryption', headers=headers, data=data)
return json.loads(response.text)
def fixIP(ip):
ip = ip.split(".")
return ".".join([ip[1], ip[0], ip[2], ip[3]])
hashedProxy = get_proxy()['data'][0]
base64Proxy = AESDecrypt(hashedProxy, "KCH@LQj#>6VCqqLg", iv = "YC\'2bmK=b%#NQ?9j")['output']
js = json.loads(base64.b64decode(base64Proxy))
proxy = (fixIP(js['ip']), js['prt'], js['usr'], js['pwd'])
link = "https://t.me/socks?server={}&port={}&user={}&pass={}".format(proxy[0], proxy[1], proxy[2], proxy[3])
print link
#send to telegram
bot = telebot.TeleBot(API_TOKEN)
bot.send_message(CHANNEL_ID, link)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment