fp = open(r"C:\Users\lhy\Desktop\1.json", 'r') c = json.load(fp) print(c[1]['_source']['layers']['http']['http.user_agent'])
u_e = [] for i in c: agent = i['_source']['layers']['http']['http.user_agent'] if'sqlmap'in agent: cookie = i['_source']['layers']['http']['http.cookie'] cookie = cookie.split(";")[0] cookie_en = cookie.split("=")[-1] u_e.append(cookie_en)
defrot13(message): res = '' for item in message: if (item >= 'A'and item <= 'M') or (item >= 'a'and item <= 'm'): res += chr(ord(item) + 13) elif (item >= 'N'and item <= 'Z') or (item >= 'n'and item <= 'z'): res += chr(ord(item) - 13) else: res += item return res
s = "" for test in u_e: try: test = test.replace("%3D", "=") test = test.replace("%3d", "=") test = rot13(test) test = base64.b64decode(test) # assert isinstance(test, bytes) test = test.decode("utf8", errors='ignore') if (test.find('!=') != -1) and (test.find('message') != -1): test = test.split("!=")[-1] test = test.split(",")[0] # print(test) s += chr(int(test)) except: continue print(s)
# 2my_password_is_ilovedaliang0balabalabala1!
经过判断,message为 my_password_is_ilovedaliang
part2 md5碰撞
描述
下载内容后,上传.提示它添加了slat.于是添加它的密码作为salt,给出提示,no same file. 扫描文件,发现文件备份 .***.php.swp 下载内容,源码为