LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-06-2020, 01:34 PM   #1
Linux_Kidd
Member
 
Registered: Jan 2006
Location: USA
Posts: 737

Rep: Reputation: 78
Looking for Tool


I am looking for a tool that can sweep a system (linux for now) that can find all of the binaries, ID their version info, and then report on if it's outdated and/or needs a patch. And, if the file has no good meta data info just flag it in a report as "suspect".

Does anything like this exist? If not, how would you create a script that can do it?

Last edited by Linux_Kidd; 05-06-2020 at 02:04 PM.
 
Old 05-06-2020, 02:27 PM   #2
sevendogsbsd
Senior Member
 
Registered: Sep 2017
Distribution: FreeBSD
Posts: 2,252

Rep: Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011
Use the package system of the Linux distro. Is this not sufficient? This is exactly what package management systems are supposed to do. What distribution of Linux are you running?
 
Old 05-06-2020, 05:23 PM   #3
Linux_Kidd
Member
 
Registered: Jan 2006
Location: USA
Posts: 737

Original Poster
Rep: Reputation: 78
That's only good if the binary was installed via the package system. We are doing threat hunting, and native package tools are rather useless if a "bad" (un-wanted) binary is copied down to the filesystem, like via gunzip or other ways, etc.
 
Old 05-06-2020, 09:32 PM   #4
kfritz
Member
 
Registered: Aug 2006
Distribution: Slackware, OpenBSD, CentOS, Ubuntu
Posts: 99

Rep: Reputation: 31
Take a look at OpenVAS. IIRC, it did some amount of scanning for non-managed binaries, but only on a few popular distros. This requires that an ssh account be created so that the tool can log in and check. Its quite complicated, and may be more than you're looking for.
 
1 members found this post helpful.
Old 05-08-2020, 01:43 AM   #5
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,150

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Normally, is there a specific extension for those binaries? Or a file can exist without extension but is considered a binary file?
 
Old 05-08-2020, 03:00 PM   #6
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Some thoughts:
"Binaries" means (to me) a compiled program, so "not a text file" One could use find to identify such. See the -type test
Scripts are not necessarily compiled, but may be executable. Again the find command has an -executable test.

Use find to search for what's present; compare to a list of what should be present*. Things it finds that are not on the list are suspect.

*That's going to be the hard part. Maybe build a "clean" system and compile the list from that?
 
Old 05-08-2020, 05:38 PM   #7
Linux_Kidd
Member
 
Registered: Jan 2006
Location: USA
Posts: 737

Original Poster
Rep: Reputation: 78
Finding the file type is not the ask here. I can find what I want, then need to strip out the meta data of the file, and then somehow go lookup if there's a newer version or not, or perhaps just a patch available. Everything past the 'find' part is the challenge.

Can essentially also do some reverse weeding, try and ID the package the file came from, and then see if that package has updates available or not, but for items that did not come from a package install, need to somehow see if it perhaps has associated vulns, and if such item has updates or patches available.

It's not an ez task, and it's a gap my sec team has identified. Sure, we can flag it as "suspicious" if it did not come from a package, but doing all the manual work beyond that is not very practical when you look at enterprise scale. And it's why I was looking for any existing COTS tools that may do it.

We will look at OpenVAS to see what it can/cannot do.

Last edited by Linux_Kidd; 05-08-2020 at 05:52 PM.
 
Old 05-09-2020, 03:43 AM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by Linux_Kidd View Post
Finding the file type is not the ask here.
But you yourself wrote:
Quote:
Originally Posted by Linux_Kidd View Post
I am looking for a tool that (...) can find all of the binaries
That implies a certain file type - that of a binary.
 
1 members found this post helpful.
Old 05-13-2020, 11:39 AM   #9
Linux_Kidd
Member
 
Registered: Jan 2006
Location: USA
Posts: 737

Original Poster
Rep: Reputation: 78
Quote:
Originally Posted by ondoho View Post
But you yourself wrote:
Quote:
Originally Posted by Linux_Kidd
I am looking for a tool that (...) can find all of the binaries
That implies a certain file type - that of a binary.
No, I wrote:
Quote:
I am looking for a tool that can sweep a system (linux for now) that can find all of the binaries, ID their version info, and then report on if it's outdated and/or needs a patch.
Yes, file type of binary. So what's your question?

VT has some new threat intel stuff going, but I don't yet see they have what I am looking for, I reached out to them.

https://support.virustotal.com/hc/en...e-Introduction

Last edited by Linux_Kidd; 05-13-2020 at 11:45 AM.
 
1 members found this post helpful.
Old 05-16-2020, 05:44 PM   #10
OlgaM
Member
 
Registered: Mar 2019
Distribution: Debian Bullseye
Posts: 65

Rep: Reputation: Disabled
I am wonder if raw socket can be used for that reason. Can system owner find "bad" program activity with unix/internet sockets?
 
Old 05-18-2020, 03:09 PM   #11
Linux_Kidd
Member
 
Registered: Jan 2006
Location: USA
Posts: 737

Original Poster
Rep: Reputation: 78
Quote:
Originally Posted by OlgaM View Post
I am wonder if raw socket can be used for that reason. Can system owner find "bad" program activity with unix/internet sockets?
What makes you think a binary has a socket?
 
Old 05-24-2020, 07:41 PM   #12
OlgaM
Member
 
Registered: Mar 2019
Distribution: Debian Bullseye
Posts: 65

Rep: Reputation: Disabled
I mean, if binary file was infected app will send some data to hacker. Is it possible to check transfer via socket? Can i know if you found the solution?
 
Old 06-04-2020, 01:08 PM   #13
Linux_Kidd
Member
 
Registered: Jan 2006
Location: USA
Posts: 737

Original Poster
Rep: Reputation: 78
Quote:
Originally Posted by OlgaM View Post
I mean, if binary file was infected app will send some data to hacker. Is it possible to check transfer via socket? Can i know if you found the solution?
Will let network and/or HIDS technology try to detect that.

I am only looking to ID programs that may have vulns associated with them, and the availability of a fix.

No solution just yet. We use Qualys for a lot of scanning/compliance/reporting, and we are a var-partner and are working with them to get this feature put into their product. Some development work is in motion but nobody wants to commit to an ETA.
 
1 members found this post helpful.
Old 06-04-2020, 01:43 PM   #14
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,173

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
The hard part of your ask is identifying the unmanaged binary and then cheeking if it is current.
If you find a binary named foxitreader.bin, how do you expect to get version info? I would imagine you need to use strings or some such program to try to determine the version info. Then figure out the website and check what is current.

What about some Python file just named runme.py inside a directory named for some legit sounding project. Technically not a binary, so you may need to expand your search. Python 2 is being phased out, will checking for Python 3 versions be included?

I don't think there is any open source tool that can do this. Seems like something a security company builds and charges people to use.
 
Old 06-05-2020, 04:27 AM   #15
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,803

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by JJJCR View Post
Normally, is there a specific extension for those binaries? Or a file can exist without extension but is considered a binary file?
File extensions are mostly a crutch for humans. Much of UNIX and Linux doesn't, in general, rely on file extensions to determine what to do with files [1]. My scripts -- shell, Perl, or Python (except modules) -- tend to not have file extensions (see file(1)). Compiled programs? The same---although file(1) is unable to tell you what the source language was.

I'm not sure if there's any easier way to check for packages that need an update/patch than to issue something like:
Code:
zypper list-updates -a
or whatever the equivalent is on your systems' distributions.

As for those "suspect" executables, if you're considering a roll-your-own solution: Don't package managers have the ability to list all the files contained in a specified package? Comparing a list of all files that are part of each installed package against a list of all executables found on the system ought to reveal those "suspects". Something like:
Code:
grep -v -f list-of-all-installed-package-files list-of-all-system-executables
Obtaining that list of files to ignore would be the trick.



[1] -- There are exceptions: gcc gets confused when you try something like "cc hello.x"---even when it's a valid C source file. :^)
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
pthread_cond_wait sys call is getting assert failure when using helgrind tool in valgrind but not failed with memcheck tool with valgrind kalyan.vangipurapu Programming 7 06-21-2017 08:28 AM
Application crashing with assertion failure with helgrind tool but not with memcheck tool kalyan.vangipurapu Linux - Software 2 06-03-2017 07:45 AM
LXer: GNOME Tweak Tool - A tool for changing specialised or advanced GNOME3 settings LXer Syndicated Linux News 0 10-12-2011 11:50 PM
Cross-tool 0.42: Tool-chain compilation process fail ueagle Linux From Scratch 2 03-26-2011 03:43 AM
URLSCAN tool MS = Linux tool ? OB1 Linux - Security 3 10-05-2002 12:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 05:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration