h21lab / json2pcap Goto Github PK
View Code? Open in Web Editor NEWScript for pcap modification, reconstruction and anonymization
Home Page: https://www.h21lab.com/tools/json-to-pcap
License: GNU General Public License v2.0
Script for pcap modification, reconstruction and anonymization
Home Page: https://www.h21lab.com/tools/json-to-pcap
License: GNU General Public License v2.0
Hi! I have a capture file with embedded decryption secrets, which I exported as a JSON file. I was hoping this project could reconstruct a pcap with the JSON data, but the generated file only displays [Malformed Packet] information.
Is this a feature you are considering in the future?
Follow up to #5
json2pcap
a possible solution to Export PCAP containing decrypted traffic?The http
information is in the JSON output but json2pcap
produces a garbled pcap:
No. Time Source Destination Protocol Length Info
8 0.003271 1b:38:67:ef:04:a6 14:00:00:0c:85:90 0x4acc 201 Ethernet II
9 0.004183 e7:10:24:77:49:b5 14:00:00:0c:3b:fa 0xdcf1 301 Ethernet II
10 0.004814 48:54:54:50:2f:31 47:45:54:20:2f:20 0x2e30 119 Ethernet II
11 0.005169 2e:30:20:32:30:30 48:54:54:50:2f:31 0x206f 4427 Ethernet II
The output above is from Files: dump.pcapng, premaster.txt
from the Wireshark Wiki Sample Captures - SSL with decryption keys
Converting from .pcap to .json and then back to .pcap without touching, although file size remain exactly same, but the source mac of all packets all became '00:a0:20:08:00:00', while destination mac address all became '00:00:24:00:24:40'?
Hi,
I tried to use your code, but I get the following error:
Traceback (most recent call last): File "./json2pcap.py", line 645, in <module> new_packet.time = float(frame_time) NameError: name 'frame_time' is not defined
The only thing I changed into my code was the #!/usr/bin/python3
, not sur eif this supports python3. this is the ocmmand I run:
/json2pcap.py -i ~/pcaps/dtag/poc/sample_pcap/test3.json -o test.pcap
Is there an additional parameter I should pass? I only intend to convert back a dissected json into pcap.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.