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

packs: Update reverse shell query pack to check for a valid remote_port #7567

Merged
merged 1 commit into from
Apr 29, 2022
Merged

packs: Update reverse shell query pack to check for a valid remote_port #7567

merged 1 commit into from
Apr 29, 2022

Conversation

raj3shp
Copy link
Contributor

@raj3shp raj3shp commented Apr 22, 2022

Hi,
I would like to make a minor improvement to avoid false positives for Behavioral_Reverse_Shell query in osx-attacks pack. Certain build processes are spawned by IDEs such as Xcode which do not have any open files, but have an open socket that is not a network socket which results in remote_port being 0 and remote_address empty.

In this PR, I basically add a check for process_open_sockets.remote_port > 0 to avoid all possible false positives which do not indicate a reverse shell. We can confirm it's safe considering port 0 is reserved and cannot be used for network sockets.

@raj3shp raj3shp requested review from a team as code owners April 22, 2022 22:26
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Apr 22, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: raj3shp / name: Rajesh Pangare (f8a367e)

@mike-myers-tob mike-myers-tob added macOS packs ready for review Pull requests that are ready to be reviewed by a maintainer labels Apr 25, 2022
@mike-myers-tob mike-myers-tob merged commit e312ee1 into osquery:master Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
macOS packs ready for review Pull requests that are ready to be reviewed by a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants