-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
p0f rewritten #1923
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
p0f rewritten #1923
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution !
However, there isn’t much left :/ all the actually useful functions have been removed :/ do you think you could make them work ?
The new parsing is however great !
Codecov Report
@@ Coverage Diff @@
## master #1923 +/- ##
===========================================
- Coverage 85.89% 63.24% -22.65%
===========================================
Files 187 126 -61
Lines 42746 30506 -12240
===========================================
- Hits 36716 19295 -17421
- Misses 6030 11211 +5181
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
I have a couple of suggestions.
BTW, since p0f v2 and v3 differ a lot, what would you think of renaming the existing module (maybe to something like p0fv2
) so that we can have both?
Only Python 3 compatible | ||
""" | ||
a = line.split(splitchar)[:n] | ||
yield from a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yield from a | |
for elt in a: | |
yield elt |
""" | ||
a = line.split(splitchar)[:n] | ||
yield from a | ||
yield from [default] * (n - len(a)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yield from [default] * (n - len(a)) | |
for _ in range(n - len(a)): | |
yield default |
def lparse(line, n, default='', splitchar=':'): | ||
""" | ||
Function for nice parcing of 'a:b:c:d:e' lines | ||
Only Python 3 compatible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only Python 3 compatible |
gen = p0fdb.tcp_correl(direction, p0f_out, olayout, quirks) | ||
return max(list(gen), key=lambda x: sum(x[0]))[1] | ||
|
||
if __name__ == '__main__': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should go in a separate .uts
file rather than here.
I added a reference to this PR in #399 and I am closing it due to no activity. |
Uh oh!
There was an error while loading. Please reload this page.