from pyshark import*import recapture =FileCapture('traffic.pcap')# Fake flag will be updated as pcap processedflag =list("CTF{deadbeefdeadc0dedeadbeefdeadc0de}")for i, packet inenumerate(capture):try:# Grab SQL queries sql_query = packet.tds.queryif'SUBSTRING'in sql_query:# If the response length is 200 then condition is trueif capture[i +1].length =='200':# Extract the char position and decimal value extracted = re.match(r'.*,(\d+),\d+\)\)\>(\d+)', sql_query, re.M | re.I) char_index = extracted.group(1) char_value = extracted.group(2)# Update the flag flag[int(char_index)-1]=chr(int(char_value) +1)exceptAttributeErroras e:pass# Profit?print(''.join(flag))