-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
SocketLogger: A class to log all socket traffic. #4893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
antoniovazquezblanco
commented
Jan 3, 2026
BTW, please let me know if you have any suggestion. I was never that happy with the naming I chose nor the way I've implemented this. If you have any better ideas they will be appreciated :)
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@ ## master #4893 +/- ## ========================================== - Coverage 80.85% 80.81% -0.04% ========================================== Files 369 370 +1 Lines 90961 90988 +27 ========================================== - Hits 73542 73536 -6 - Misses 17419 17452 +33
🚀 New features to boost your workflow:
|
gpotter2
commented
Jan 4, 2026
Hi ! Thanks for the PR.
A few notes:
- if this were to be merged, it should be added to
supersocket.pyand inherit a super socket. Most likely you could inherit aSimpleSocket - I would use a code pattern that uses
superinstead of storing the initial method, if possible.
I'm not sure if this isn't too specific to end up in Scapy. But those are breaking in any case ^^
Thanks & happy new year !
antoniovazquezblanco
commented
Jan 4, 2026
Hi @gpotter2!
Thanks for your comments. Just for clarification, you mean that I should implement the functionality in the base socket and allow to specify a pcapwriter on it's creation?
Otherwise, if I go the inheritance route, this cannot be enabled/disabled and it would not work for the sockets that do not inherit from SimpleSocket. Or am I missing something?
Happy new year! :D
gpotter2
commented
Jan 5, 2026
If I recall properly, SimpleSocket already acts as a wrapper of any existing socket. So it would make sense to inherit it
Not everything seems to inherit from simple socket...
I can implement this as part of SuperSocket wich seems to be the root node...
Checklist:
tox)I've created a dummy package that I've been using to log all socket traffic to a pcap file. Sometimes this was useful for debugging my own scripts.
@polybassa noticed this package and commented if I could create a PR to upstream that utility: antoniovazquezblanco/scapy-socketlogger#3