Pcapdnet: monitor mode + full support without dnet + cleanup#1350
Pcapdnet: monitor mode + full support without dnet + cleanup#1350p-l- merged 6 commits intosecdev:masterfrom gpotter2:pcapdnetremaster
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1350 +/- ##
==========================================
+ Coverage 85.07% 85.14% +0.06%
==========================================
Files 174 174
Lines 40299 40102 -197
==========================================
- Hits 34285 34144 -141
+ Misses 6014 5958 -56
|
guedou
left a comment
There was a problem hiding this comment.
Nice PR. Please see my comments.
scapy/arch/linux.py
Outdated
scapy/arch/linux.py
Outdated
scapy/arch/linux.py
Outdated
scapy/arch/linux.py
Outdated
There was a problem hiding this comment.
I have no idea what the "direction" represents, so as the PR removes this feature (which is only available and used in this function), I left the comments.
Otherwise, we could simply remove this "recv" function, as it only calls its super one.
There was a problem hiding this comment.
I means that the packet was sent locally, see http://man7.org/linux/man-pages/man7/packet.7.html We don't use at al.
scapy/arch/pcapdnet.py
Outdated
There was a problem hiding this comment.
Could you make this line shorter?
scapy/arch/pcapdnet.py
Outdated
|
Given the state of current libpcap Python bindings, I think that we can clean the code even further and only keep pcapy support. I would like to have #1315 merged before applying this PR. |
|
@guedou Problem with pcapy is that it does not support monitor mode :/ On the other hand, |
Yeah the current situation of libdnet bindings (or even dnet itself for that matter) is quite suboptimal as well as a lot of the other python based low level network toolkits. I have been trying to maintain it here: https://github.com/pynetwork/pydumbnet, but that has in practice really meant just unbreaking pip installation in some cases and nothing much else. pypcap is in a similar situation and it would be great if we could get some other people to help out with that. |
|
This PR "theoretically" adds support for monitor mode using If someone has a computer that supports monitor mode (which I currently don't), it would require for that very nice person to:
|
scapy/arch/pcapdnet.py
Outdated
There was a problem hiding this comment.
Can you specify the required version?
There was a problem hiding this comment.
The fact is, the version supporting that is not merged yet.
https://github.com/pynetwork/pypcap/pull/67/files
They are awaiting our confirmation that it works to merge it, but I can’t test it as I don’t have access anymore to a machine supporting monitor mode
scapy/arch/pcapdnet.py
Outdated
There was a problem hiding this comment.
Same here, could you specify the version?
There was a problem hiding this comment.
Done (they published 1.2.1)
|
Awesome. See my two new comments. After rebasing, this PR can be merged quickly. |
|
A file is conflicting. |
|
@guedou @p-l- @speakinghedge Sorry for bothering.. Has one of you access to a computer with the WiFi card supporting monitor mode ? If so, would it be possible for you to test this PR using: I will try to find a computer with monitor mode supported, but it might take a while |
|
@gpotter2 I can't test it either: |
|
Will do. |
|
Just to make sure that I'm on the right path: I set If the above statement is true -> After adding the monitor flag I got the expected output: |
|
@speakinghedge Thank you very much !!! |
|
@guedou I won't remove DNET on this PR, as its deprecation needs to be warned during at least a version, but it really is the next thing to do |
|
It looks that some tests are failing because they hang. |
|
I restarted the failing tests but the hangs looks related to this PR. |
>>> p = PipeEngine()
>>>
>>> s = SniffSource()
>>> d1 = Drain(name="d1")
>>> c = QueueSink(name="c")
>>> s > d1 > c
<c [d1>#]>
>>>
>>> p.add(s)
>>> p.start()
Exception RuntimeError: RuntimeError('maximum recursion depth exceeded in cmp',) in Exception RuntimeError: RuntimeError('maximum recursion depth exceeded in cmp',) in Exception RuntimeError: RuntimeError('maximum recursion depth exceeded in cmp',) in Exception RuntimeError: RuntimeError('maximum recursion depth exceeded in cmp',) in Exception RuntimeError: RuntimeError('maximum recursion depth exceeded in cmp',) in Exception RuntimeError: RuntimeError('maximum Will have a look |
|
@guedou Hi, news about this PR:
The next PR of that kind (will wait a bit), will fully remove DNET |
|
(please ignore the failing test, passing on my repo: https://travis-ci.org/gpotter2/scapy/builds/372462884) |
scapy/arch/pcapdnet.py
Outdated
| # DEPRECATED | ||
|
|
||
| if conf.use_dnet: | ||
| warning("Dnet usage with scapy is deprecated, and will be removed in a future version.") |
|
@p-l- could you also have a look? |
|
@gpotter2 this is great work! Thanks! |
This PR:
recv_rawfunction, which receives the packet, calculates its TimeStamp and returns the info required to build it. It will then be built in therecvfunction, which is now common to all SuperSockets.conf.use_pcapuseable withoutconf.use_dnet