8000 Detect NMAP using its ports by gpotter2 · Pull Request #1179 · ivre/ivre · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Detect NMAP using its ports #1179

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

gpotter2
Copy link
Contributor
@gpotter2 gpotter2 commented Sep 26, 2021

part of #1175

This PR:

  • detects nmap when it uses a default list of 1000 ports

@gpotter2 gpotter2 force-pushed the detect-ports branch 2 times, most recently from 7160f0d to 0f864b0 Compare October 4, 2021 07:57
@p-l-
Copy link
Member
p-l- commented Oct 13, 2021

One question when merging records: what would happen if we merge a record with Nmap top 1k ports with another record with 1000 other (say, random) ports? Would we remove the Nmap tag?

@gpotter2
Copy link
Contributor Author

AFAIK, the merge functions never remove tags.
This only detects that ports follow a certain pattern and adds the tag if not already present, in which case it would be kept in any following merges;

@p-l-
Copy link
Member
p-l- commented Oct 13, 2021

That's what I understand too. Don't you think the tag should be removed in such situations?

@gpotter2
Copy link
Contributor Author

If there is a record that contains by itself 1k Nmap ports, wouldn't it make sense to consider that it was scanned?

@p-l-
Copy link
Member
p-l- commented Oct 14, 2021

Such records would always come from passive records, which only contain one port per record. So if, by chance, there is a moment where the record contains the top 1k ports, and then more ports are added, the resulting I think the resulting host should not have the Nmap tag.

Copy link
Member
@p-l- p-l- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could add this specification. What do you think?

@p-l-
Copy link
Member
p-l- commented Dec 2, 2021

Hi @gpotter2,

You should run black -t py36 against your code to fix the linting failure.

For the MongoDB failures, they do not come from your code, and have been fixed in #1248 (newer version of PyMongo no longer supports APIs that were used in IVRE). Just rebase your code against current master and everything should be fine.

Thanks!

# the list of ports scanned by default by a scanner, assume it
# is.
for (dports, scanner_name) in DEFAULT_SCANNED_PORTS.get(proto, []):
if scanner_name not in res.get("scanners", []):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you could remove this test, since you use res.setdefault("scanners", {}).setdefault(scanner_name, set()).add(...)

8000 Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I read the code correctly, that's necessary to not re-add the value to the set (in the add()) if it exists.

@gpotter2
Copy link
Contributor Author
gpotter2 commented Jul 3, 2024

Really sorry for the delay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0