LinuxQuestions.org
Help answer threads with 0 replies.
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 02-27-2010, 10:08 PM   #1
conconga
LQ Newbie
 
Registered: Dec 2009
Posts: 22

Rep: Reputation: 1
tips to run unkown-source-binary


Hi,

I got some binaries from internet (amule), but am afraid of using them, exposing my system. Since some run long simulations, it is not desirable to run in slow VM.

What do you gurus say if I run it as a new user? So the binaries would just be able to read and execute my binutils... Is that harmfull?

Tks in advance
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 02-28-2010, 03:18 AM   #2
nigelc
Member
 
Registered: Oct 2004
Location: Sydney, Australia
Distribution: Mageia 7
Posts: 406
Blog Entries: 4

Rep: Reputation: 80
Hi,
well I'm not a guru, but it should be ok running it as new user.
cheers
 
0 members found this post helpful.
Old 02-28-2010, 05:50 AM   #3
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by conconga View Post
Hi,

I got some binaries from internet (amule), but am afraid of using them, exposing my system. Since some run long simulations, it is not desirable to run in slow VM.

What do you gurus say if I run it as a new user? So the binaries would just be able to read and execute my binutils... Is that harmfull?

Tks in advance
Running unknown executable even as regular different user can be harmful.
You kernel may be vulnerable for local root exploit, for example.

More than that, if you don't trust this binary,
how can you trust it's output ?
And if you can't what's the point of running it at all ?
 
Old 02-28-2010, 06:08 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by nigelc View Post
it should be ok running it as new user.
While I understand most reasons LQ members will give, "not being a guru" is not a reason and those of the "I think", "I assume" or "it seems" kind even less. So please elaborate and tell us the exact reasons why you think that is OK? Details please.


Quote:
Originally Posted by conconga View Post
I got some binaries from internet
Most generic documents warn users about running "untrusted" binaries. Taking a product-agnostic stance towards things the first step 0) would be to verify that binaries or the contents of the archive are authentic, as the developer intended them to be. This should be done preferably by using the developers public GnuPG key on the accompanying signature of the object. Where a GnuPG key is not available, and unfortunately this happens in too many cases still, 1) one could fall back to comparing hashes but trustworthiness of these is a magnitude less. Still a magnitude less would be to 2) 'net research to see if any vulnerabilities are listed in say the CVE (mitre.org), on regular sites like SecurityFocus or Secunia or on exploit sites or 3) if any grave problems are listed in the community like the products fora, mailing lists (archives) or elsewhere.


Quote:
Originally Posted by conconga View Post
am afraid of using them, exposing my system. Since some run long simulations, it is not desirable to run in slow VM.
Letting any subjective reasoning ("my boss needs it NOW", "it seems harmless", "I think it's OK") interfere with or overrule an objective assessment is the best way to fsck things up. You're looking at two disparate things: 0) the risks and 1) seeking trade-offs. Understanding the risks means understanding in what way running binaries may be damaging to your system, a (any) network (or even your identity) and in what ways you could mitigate risks effectively.

Let's take some risks and see which way they can be traced and mitigated:
* Running an exploit. The binary contains malicious code that exploits a weakness in kernel or userland. If the exploit elevates the users rights to run commands as root user then such an event can lead to a complete compromise of the system. Tracing events means logging syscall and MAC policy violations (GRSecurity, SE Linux, LoggedFS to some extent, strace), logging network connections (iptables "-j LOG") and verifying the systems integrity (Samhain, Aide, Osiris, Integrit or even tripwire). PAX, ASLR, and MAC features may help protect a system from exploits. If run inside a VM then (chances are good that) this will only affect the guest OS and not the host. Propagating an exploit in well-known SW is rare for many reasons (the "many eyeballs" thing) but not impossible as cases of compromised SW mirrors have shown in the past.

* Opening up a (connect-back) backdoor. The binary opens up a port allowing remote hosts to connect to your system or opens up a connection to a remote host. If a remote host manages to connect to the port then the process would be run as the user. This means additional action is needed for system recon and exploiting anything. Binding to a port is bound to the Linux capabilities the unprivileged user has (meaning no port =< 1024) and not any port already in use and a favorable firewall policy. Tracing network communication between systems means logging network connections. A "default drop; allow only specific ports" firewall policy will block this traffic. A restrictive router policy may deny connections. A GRSecurity or SE Linux policy may deny a user ingress and egress traffic rights. Standard (security) tools like netstat, lsof, fuser, unhide, Tiger, Usat, Chkrootkit, Rootkit Hunter, may (help) expose a backdoor. A reactive IDS (Snort + Guardian?) may deny traffic.

* Running a sniffer. The binary runs a listening device that gathers information. If run in promiscuous mode (which only root may do) information may be learned, stored and shared that may compromise your or other systems or any aspect of your identity. Tracing sniffers, unless well-hidden, is covered by a lot of the tools mentioned before. A GRSecurity or SE Linux policy may deny a user to run processes requiring certain rights. Finding backdoors or sniffers in well-known SW again is very rare but not impossible. Running in a VM guest OS may or may not offer additional protection where sniffing in promiscuous mode is concerned depending on how it is networked.

* Running an arbitrary process or having unsolicited "features". The binary runs a process or feature unknown to the user or a standard system utility that may "phone home" for whatever reasons, infect binaries with RST-B, damage files, send bulk email, send commands to other machines, join IRC channels or simply help you into The Wrong Trousers. Rights to execute processes may be governed by for instance GRSecurity (Trusted Path Execution) or a SE Linux sandbox policy (or PolicyKit? I haven't had the time to play with it yet). Detecting and regulating network connections was handled above. Make backups ;-p Running a VM guest does not offer additional protection out of the box: any detection methods and access restrictions have to be configured beforehand. A VM may be beneficial wrt damage as you can "lock" a disk and restore contents to a previous state. Running an arbitrary process or having unsolicited "features" is a far-fetched scenario for the same reasons mentioned above. Still a nice recent (2009) one comes to mind masking itself as a nice Waterfall(?) screensaver but running a shell script instead.

In short this reply only serves to educate, not to spread FUD or damage. It isn't exhaustive but I hope it shows you that logging and auditing are important aspects to be and remain in control, that methods for detection exist, that a VM can be helpful under certain circumstances and that available methods do not necessarily have to be hard to implement: some GNU/Linux distributions already come with them enabled like SE Linux (RHEL, Fedora, Centos), GRSecurity (Gentoo) or AppArmor (SuSE, Ubuntu). One aspect I left out was (aiding) identity theft. This spans not just one level of detection or protection. If somebody wants to fill in that gap: go right ahead.


Quote:
Originally Posted by conconga View Post
What do you gurus say if I run it as a new user? So the binaries would just be able to read and execute my binutils... Is that harmfull?
Depending on where you got it from, depending on how it can be verified to be authentic and depending on the risks you're willing to take you can run that binary from a cleanly created, unprivileged user account. However in your case the point of running unknown binaries is moot since the source-code for Amule is readily available (if not from your distributions core or a third party repo then) from the developers Sourceforge site and instructons are available here. So in your case there simply is no need to run the binary: just verify and compile yourself.
 
4 members found this post helpful.
Old 02-28-2010, 06:32 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Post Scriptum: I sometimes have to run potentially hostile code myself and I value my and other peoples systems and networks too much to run hostile code outside a fortified VM or Live CD. I started running VM when I still had a SMP PIII with 512MB RAM so to me "slow" is relative.
 
3 members found this post helpful.
Old 02-28-2010, 07:07 AM   #6
mrclisdue
Senior Member
 
Registered: Dec 2005
Distribution: Slackware
Posts: 1,134

Rep: Reputation: 277Reputation: 277Reputation: 277
Great response, unSpawn. Needless to say, it's bookmarked.

cheers,
 
1 members found this post helpful.
Old 02-28-2010, 09:04 PM   #7
nigelc
Member
 
Registered: Oct 2004
Location: Sydney, Australia
Distribution: Mageia 7
Posts: 406
Blog Entries: 4

Rep: Reputation: 80
If the binary was just running just as a user, not as root, it can't get really do too much harm.
 
0 members found this post helpful.
Old 03-01-2010, 10:19 AM   #8
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by nigelc View Post
If the binary was just running just as a user, not as root, it can't get really do too much harm.
Your response, just like your previous one, leads me to believe you should be posting questions, not make statements.
 
3 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
How to run a binary file shipon_97 Linux - Newbie 4 05-22-2006 11:02 AM
tips to make Le2005 run faster...?? thinhla Mandriva 14 07-23-2005 02:49 PM
can't run binary files abs Slackware 12 01-21-2005 01:56 AM
Why won't this binary run? islandkid Linux - General 15 09-01-2002 02:51 PM
How to run binary at booting time hai_rajneesh Linux - Software 2 06-23-2002 03:31 AM

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

All times are GMT -5. The time now is 06:58 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