Skip to content

Latest commit

 

History

History
41 lines (28 loc) · 1013 Bytes

流量分析1.md

File metadata and controls

41 lines (28 loc) · 1013 Bytes

流量分析1

知识点

python流量分析处理数据

sql盲注数据

解题

首先用wireshark打开流量包,发现是一个http类型的流量包,过滤http类型的流量,发现使用了gopher协议与sql注入进行了二次url编码后获取flag

使用python对数据进行处理

import pyshark
from urllib.parse import unquote

def update_max_value(dictionary, key, value):
    if key not in dictionary or value > dictionary[key]:
        dictionary[key] = value

dic = {}
pcap = pyshark.FileCapture('./challenge.pcapng', display_filter="http.request")

for i, v in enumerate(pcap):
    uris = unquote(unquote(v.http.request_uri_query))
    try:
        data = int(uris.split('\n')[-1].split("'")[1])
        pos = int(uris.split('\n')[-1].split(",")[1])
        update_max_value(dic, pos, data)
    except:
        # print(e)
        pass

[print(chr(x), end='') for x in dic.values()]