Page 2 of 3

Re: Remote exploit vulnerability in bash

PostPosted: 2014-09-27 18:01
by micksulley
I added the squeeze-lts today as it was suggested in a thread I found as a supposed fix for this. I have just removed them again and it still does not work.

Code: Select all
mick@mick-deb-laptop:~$ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
mick@mick-deb-laptop:~$ env VAR='() { :;}; echo Bash is vulnerable!' bash -c "echo Bash Test"
Bash is vulnerable!
Bash Test
mick@mick-deb-laptop:~$

source is now

deb http://download.virtualbox.org/virtualbox/debian/ wheezy contrib
deb http://ftp.uk.debian.org/debian/ wheezy-updates main contrib non-free
deb-src http://ftp.uk.debian.org/debian/ wheezy-updates main contrib non-free
deb http://ftp.uk.debian.org/debian/ wheezy main non-free
deb-src http://ftp.uk.debian.org/debian/ wheezy main non-free
deb http://www.deb-multimedia.org/ wheezy main non-free
# deb http://http.debian.net/debian/ squeeze-lts main contrib non-free
# deb-src http://http.debian.net/debian/ squeeze-lts main contrib non-free

Re: Remote exploit vulnerability in bash

PostPosted: 2014-09-28 06:37
by teeitup
What version of bash is actually installed?

Your sources list has a duplicate repository with a more restrictive component list.

Re: Remote exploit vulnerability in bash

PostPosted: 2014-09-28 08:21
by Hallvor
micksulley: What is the point of hijacking this thread? This is general discussion.

Re: Remote exploit vulnerability in bash

PostPosted: 2014-09-28 08:45
by micksulley
teeitup wrote:What version of bash is actually installed?

Your sources list has a duplicate repository with a more restrictive component list.


Bash version is 4.2.37(1)-release (x86_64-pc-linux-gnu)


Sorry I don't understand your comment about a more restrictive component list, which one should I remove?

Thanks
Mick

Re: Remote exploit vulnerability in bash

PostPosted: 2014-09-28 10:37
by kedaha
@micksulley: By the way, you should definitely include security in your SourcesList:

Code: Select all
deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free

Re: Remote exploit vulnerability in bash

PostPosted: 2014-09-28 13:11
by micksulley
Many thanks. I added the security repo's updated and now my Bash is secure again!

Regarding the earlier comments about my lack of understanding or sources, if anyone can point me to something that explains what you should have and why, I would certainly study it. The links posted earlier do nothing to tell you which ones you need, rules on mixing them, the fact that you should add the security repro, which ones contain which packages etc. I really have tried to unserstand this in the past, it seems that the people who know 'just know', there does not seem to be any useful tutorial on this subject.

Again, thanks for helping me to fix it.

Mick

Re: Remote exploit vulnerability in bash

PostPosted: 2014-09-28 16:58
by kedaha
All this is off topic but, since you ask: Providing the network gets configured during installation, which is not always the case when non-free drivers are required, then apt is properly configured with all the necessary software sources including security. Manually editing /etc/apt/sources.list/ is a little tricky; the sources.list man page explains it in detail but of course, an appropriate mirror site needs to be inserted. With regard to both stability and security, following basic precautions, neither mixing different suites nor adding potentially untrusted software sources, like, for example, deb-multimedia, is recommended as advised here. Finally, for best security, a stable system without admixture of software that doesn't comply with DFSG is to be recommended as detailed here.

Re: Remote exploit vulnerability in bash

PostPosted: 2014-09-28 17:12
by mardybear
When searching online, always google 'debian wiki whatever_subject' and usually you'll find something. It has a good Wheezy example:
https://wiki.debian.org/SourcesList

If you're still unsure you can repost your sources.list for review.

Re: Remote exploit vulnerability in bash

PostPosted: 2014-09-28 18:59
by Ohm
Just thought I would say that this is what I used to make bash not vulnerable, as far as I know:

apt-get update && apt-get install --only-upgrade bash

Re: Remote exploit vulnerability in bash

PostPosted: 2014-09-28 21:25
by micksulley
Ohm wrote:Just thought I would say that this is what I used to make bash not vulnerable, as far as I know:

apt-get update && apt-get install --only-upgrade bash

That only worked for me after I had added the security repo

Re: Remote exploit vulnerability in bash

PostPosted: 2014-09-28 21:37
by dasein
Yes, the security repo is is necessary for security updates. (I wonder if that has anything to do with why they call it the "security" repo?)

Re: Remote exploit vulnerability in bash

PostPosted: 2014-09-28 22:53
by jackdaws
I happen to have been reinstalling debian yesterday anyway, and after installing the base debian system - without any tasks or standard utilities selected - bash is installed and listed as manually installed (i.e. not installed because it is depended upon or recommended by another installed package). It's also listed as being an "important" package, despite (on this barebones operating system) not having any installed packages dependent on it.

As people have been reminding one another lately, debian moved away from bash a very long time ago, and now uses dash (whatever that means in practice, since the consoles on most desktops that I've seen tend to use bash by default). So, one might think it safe to remove bash, and just use dash for my command line work. This I did, just as an experiment, with no immediate effect. At reboot, all went well until login. Here, running the login details merely took me back to login again, whether I logged in as root or a standard user.

Suffice to say, you can reinstall bash in "single user" recovery mode, but I'm thinking that something probably very simple would have done the job of safely removing bash whilst no affecting the system, but only super brains who cast scorn at the miserable frightened herd are capable of working it out, and if I asked for help here I'd run the risk of being named and shamed by my superiors as just another hijacker...

One other thought, for those who haven't browsed away somewhere else: According to the latest popularity contest, bash is listed at number 30 on installs, and number 32 on actually used packages, so clearly the move from bash to dash wasn't as complete as some might think.

Re: Remote exploit vulnerability in bash

PostPosted: 2014-09-29 05:38
by texbrew
Thanks for the tip. After reading this, I promptly upgraded bash on this machine - Wheezy 7.6 - and will do so on the others upon next power-up.

Have not read through all the external links in this thread, but I bet the linux haters are cackling with glee. But thanks to the Debian maintainers, it seems the fix(es?) was or were done very quickly.

tex

Re: Remote exploit vulnerability in bash

PostPosted: 2014-09-29 07:13
by mardybear
How to Protect your Server Against the Shellshock Bash Vulnerability:
https://www.digitalocean.com/community/ ... nerability

The article recommends running the following in a bash terminal:
Code: Select all
env VAR='() { :;}; echo Bash is vulnerable!' bash -c "echo Bash Test"

The highlighted echo Bash is vulnerable! portion of the command represents where a remote attacker could inject malicious code; arbitrary code following a function definition within an environment variable assignment. Therefore, if you see the following output, your version of Bash is vulnerable and should be updated:

Bash is vulnerable!
Bash Test

Otherwise, if your output does not include the simulated attacker's payload, i.e. "Bash is vulnerable" is not printed as output, your version of bash is not vulnerable. It may look something like this:

bash: warning: VAR: ignoring function definition attempt
bash: error importing function definition for `VAR'
Bash Test


My old Squeeze-based Ubuntu received 3 bash updates between Sept 24th-29th. It now passes the bash test and just returns 'Bash Test' :)

Re: Remote exploit vulnerability in bash

PostPosted: 2014-09-29 14:01
by gnulux
Many thanks, mardybear, for this useful command. It's nice to get Bash Test :-)