Coder Social home page Coder Social logo

h21lab / json2pcap Goto Github PK

View Code? Open in Web Editor NEW
16.0 2.0 7.0 107 KB

Script for pcap modification, reconstruction and anonymization

Home Page: https://www.h21lab.com/tools/json-to-pcap

License: GNU General Public License v2.0

Python 100.00%
tshark wireshark json packet-processing packet-crafting pcap packet-modifications pcap-anonymization pcap-anonymizer anonymization

json2pcap's People

Contributors

baterflyrity avatar h21lab avatar phreakocious avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

json2pcap's Issues

TLS support

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?

Decrypted TLS packets

Follow up to #5

  1. Any plans to update the version in the Wireshark repository - tools/json2pcap/json2pcap.py ?
  2. Is 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

Source mac address of all packets become same

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'?

Érror: 'frame_time' is not defined

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.