Comments (4)
Hey, I'm interesting replacing pynids.
May I know why do you need pynids?
What pynids has but scapy doesn't have?
from flower.
Hi cothan!
Thanks for the interest.
If I remember well, when flower was written there wasn't a nice API to reassembly TCP streams with scrapy, while pynids provided exactly what we needed in only a few lines of python.
From a fast search, it seems it is now possible. Your PR is highly welcomed!
Feel free to write me if you need any help.
from flower.
Hi @nicomazz ,
Similar question here: https://stackoverflow.com/questions/2259458/how-to-reassemble-tcp-segment
I have some reasons that it is can not easily be done in in Python, or at least need to use Python Binding wrapper.
Some promising library I found that support TCP reassembly is:
So basically libpcap, libint, and pcap++ are good.
https://pcapplusplus.github.io/docs/benchmark
All of the solution seem a bit complicated, from my little understanding of the code base, a simple tcpflow -r capture.pcap
will do the job, the Python code will do the parsing data output from tcpflow
.
By looking at some example from: https://github.com/simsong/tcpflow
The file name is: 128.129.130.131.02345-010.011.012.013.45103
We use Python to parse and read IP, port, high level step as follow:
- Read
report.xml
output fromtcpflow
- Parse
report.xml
base ontcpflow startime
, reorder packet base on port, IP and time. This approach will keep the conversation betweenIP1:port1 <=> IP2:port2
display in the same box. - Feed to database.
Do you think so ? This will require writing to disk, but straight forward to parse and do TCP reassembly.
from flower.
Tbh I'm not a great fan of tcpflow
for several reasons:
- first, tests in the repo are not passing. Then, compared to the other, the codebase seems a bit neglected.
- Passing through the disk seems adding a lot of useless overhead: during a real CTF there is an incredible number of packets (potentially more than 100GB), and doing a filesystem IO operation for each of them is too expensive, both for the time needed and for the lifespan of your SSD maybe.
The two options you've proposed seem great! Both support ipv6, that is a requirement of the new replacement, and they have ready to use examples:
PcapPlusPlus
has an example that generates the output in thetcpflow
format. Maybe you can change that to avoid writing a file to the filesystem? The great thing here is that both ip v4 and v6 are supported- Also
libtins
has already a pretty nice interface for what we need. It is basically the same as what we are using now in python.
Let me know if you need any help!
from flower.
Related Issues (12)
- Running flower on server HOT 2
- Support ipv6
- Fix export to pwntools
- Real time sync of favourite flows
- Enhance the UI
- Add several types of favourites, other than the heart HOT 1
- Real time searching
- Add a refresh button to the page, that appears only when there are new flows available
- Add a toggle for html rendering in the top bar
- Reduce the list of evil node dependencies
- Convert everything in typescript
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flower.