Skip to content

Instantly share code, notes, and snippets.

@t-rekttt
Created December 3, 2016 16:36
Show Gist options
  • Save t-rekttt/f8f38652a1ecc946d57f6b5f0b70a10c to your computer and use it in GitHub Desktop.
Save t-rekttt/f8f38652a1ecc946d57f6b5f0b70a10c to your computer and use it in GitHub Desktop.

Revisions

  1. @vietthao20000 vietthao20000 created this gist Dec 3, 2016.
    27 changes: 27 additions & 0 deletions encrypt.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    import requests, json

    def encr(text,key,ran):
    data = {
    'action':'ajax_encrypt',
    'key':key,
    'text':text,
    'algo':'rijndael-128',
    'mode':'ecb',
    'encode':'checked',
    'encode_method':'2'
    }

    headers = {
    'x-requested-with': 'XMLHttpRequest',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36',
    'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
    }

    html = requests.post('https://www.tools4noobs.com/',data=data,headers=headers,verify=False)
    print('http://violympic.vn/SendExamScore.aspx?encrypt='+html.text.split('"readonly">')[1].split('</textarea>')[0]+'&ran='+ran)
    return html.text.split('"readonly">')[1].split('</textarea>')[0]

    inp = raw_input("Data: ")
    spl = inp.split("|")
    encr(spl[0],spl[1],spl[2])