Skip to content
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

Add Shellscript risk detection. #2375

Merged
merged 1 commit into from
Apr 10, 2024
Merged

Conversation

utoni
Copy link
Collaborator

@utoni utoni commented Apr 7, 2024

Please sign (check) the below before submitting the Pull Request:

I am not sure about the FTP Data detection. Sounds like a false positive to me.
Also the risk is not that accurate, but setting binary application xfer would also not be accurate.

@IvanNardi
Copy link
Collaborator

The FTPData dissector identifies FTP data flows simply looking for some "magic words" at the beginning of the flow, to identify some specific file types. The basic idea is: if the payload is some known file type -> this is a FTP transfer.
Let avoid discussing now if that makes (still) sense... [spoiler: it doesn't...]

Since the Bash script is among the pattern that the FTPData dissector is looking for, I was not surprised that one of your flows matches it; I was surprised that some of them didn't' match!!! [The reason is: FTPData looks only for TCP and for "#!/b" pattern; your second TCP flow begin with "#! /", with a space...]

@IvanNardi
Copy link
Collaborator

Just to be clear: I am fine with the patch "as-is". But I am also fine if you decide to remove lines 121-123 from ftp_data.c...

@utoni
Copy link
Collaborator Author

utoni commented Apr 8, 2024

I think I'll remove those lines from the FTP dissector. It does not really makes sense to me.

@utoni utoni force-pushed the add/shellscript-risk-detection branch from 6b68274 to ab27b2a Compare April 9, 2024 05:47
@IvanNardi
Copy link
Collaborator

@utoni, could you rebase, please?

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
@utoni utoni force-pushed the add/shellscript-risk-detection branch from ab27b2a to 677aeef Compare April 10, 2024 12:41
Copy link

sonarcloud bot commented Apr 10, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link
Collaborator

@IvanNardi IvanNardi left a comment

Choose a reason for hiding this comment

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

Thanks

@utoni utoni merged commit 1d0be6c into ntop:dev Apr 10, 2024
33 checks passed
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