This is the old XigmaNAS forum in read only mode,
it will taken offline by the end of march 2021!



I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!

Shellshock vulnerability

For "upgrading" from FreeNAS/NAS4Free Legacy to XigmaNAS and upgrading XigmaNAS to newer builds.
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
wimr
NewUser
NewUser
Posts: 1
Joined: 25 Sep 2014 11:29
Status: Offline

Shellshock vulnerability

Post by wimr »

I tested bash in NAS4Free and it is vulnerable for Shellshock. Can you give an update on when we can expect a patch for this serious issue?

ku-gew
Advanced User
Advanced User
Posts: 172
Joined: 29 Nov 2012 09:02
Location: Den Haag, The Netherlands
Status: Offline

Re: Shellshock vulnerability

Post by ku-gew »

Well first there has to be a patch in bash itself, then you can have a patch in NAS4free.
I really hope the patch to N4F will come quickly after the bash patch.
HP Microserver N40L, 8 GB ECC, 2x 3TB WD Red, 2x 4TB WD Red
XigmaNAS stable branch, always latest version
SMB, rsync

mekonghigh
Starter
Starter
Posts: 39
Joined: 13 Oct 2013 18:03
Status: Offline

Re: Shellshock vulnerability

Post by mekonghigh »

env x='() { :;}; echo vulnerable' bash -c "echo this is a test"

Code: Select all

nas4free ~/ root~$ env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
vulnerable
this is a test
nas4free ~/ root~$ 

Martino
NewUser
NewUser
Posts: 4
Joined: 05 May 2013 23:46
Location: Vercelli, Italy
Status: Offline

Re: Shellshock vulnerability

Post by Martino »

I suppose that this kind of test has not be executed with root privileges...

User avatar
zambogiulio
experienced User
experienced User
Posts: 82
Joined: 15 Sep 2012 22:36
Status: Offline

Re: Shellshock vulnerability

Post by zambogiulio »

We did it without root privileges but the respons is the same. Who have a solution help us, please!

kenZ71
Advanced User
Advanced User
Posts: 379
Joined: 27 Jun 2012 20:18
Location: Northeast, USA
Status: Offline

Re: Shellshock vulnerability

Post by kenZ71 »

I saw one comment on stackoverflow that suggested a symbolic link from sh to ksh since korn shell don't support symbolic links.

I think I am going to let this be as is for another 24 hours then see what the people smarter than me have come up with. I am smart enough to know there are many way smarter than I :)
11.2-RELEASE-p3 | ZFS Mirror - 2 x 8TB WD Red | 28GB ECC Ram
HP ML10v2 x64-embedded on Intel(R) Core(TM) i3-4150 CPU @ 3.50GHz

Extra memory so I can host a couple VMs
1) Unifi Controller on Ubuntu
2) Librenms on Ubuntu

User avatar
MikeMac
Forum Moderator
Forum Moderator
Posts: 429
Joined: 07 Oct 2012 23:12
Location: Moscow, Russia
Contact:
Status: Offline

Re: Shellshock vulnerability

Post by MikeMac »

I have compiled patched bash at chroot, see https://translate.google.ru/translate?s ... edit-text=

(and blog4avatar did the same in jail)
But I could not transfer patched bash to host system - see comment https://translate.googleusercontent.com ... w#t1337680

maxpower
NewUser
NewUser
Posts: 3
Joined: 22 Sep 2014 05:16
Status: Offline

Re: Shellshock vulnerability

Post by maxpower »

I don't know much of anything compared to most on this board. From what I've read though, to exploit "shellshock" through SSH, it would have to be from an authenticated user (so far as we know), correct? As a follow-up to that: if your authenticated users are given "SCP only" login for example, can they get to bash to use the vulnerability? If you're running a webserver of course it's much more dire. Apologies if these are dumb questions, I'm a n00b.

kenZ71
Advanced User
Advanced User
Posts: 379
Joined: 27 Jun 2012 20:18
Location: Northeast, USA
Status: Offline

Re: Shellshock vulnerability

Post by kenZ71 »

maxpower wrote:I don't know much of anything compared to most on this board. From what I've read though, to exploit "shellshock" through SSH, it would have to be from an authenticated user (so far as we know), correct? As a follow-up to that: if your authenticated users are given "SCP only" login for example, can they get to bash to use the vulnerability? If you're running a webserver of course it's much more dire. Apologies if these are dumb questions, I'm a n00b.
Actually this sounds like a great idea. Since this bug is limited to bash set all user accounts to use ksh instead.

Not a perfect fix but better than nothing.

Also, unless you get malware on your machine not much chance of infection. Of course torrents could have malware or other bad stuff.
11.2-RELEASE-p3 | ZFS Mirror - 2 x 8TB WD Red | 28GB ECC Ram
HP ML10v2 x64-embedded on Intel(R) Core(TM) i3-4150 CPU @ 3.50GHz

Extra memory so I can host a couple VMs
1) Unifi Controller on Ubuntu
2) Librenms on Ubuntu

User avatar
ava1ar
NewUser
NewUser
Posts: 3
Joined: 18 Apr 2014 08:16
Location: New York City, USA
Status: Offline

Re: Shellshock vulnerability

Post by ava1ar »

MiceMac, thanks for sharing! I will copy my instruction here in English for those who are interested.


Part 1 - building new bash inside jail

1) Create new full jail в TheBrig. Do not forget to select
FreeBSD-amd64-9.2-RELEASE-src.txz to work with ports tree.
Start jail after creation.

2) Enter newly created jail:

jexec <jail_id> $SHELL

3) Update ports tree:

portsnap fetch
portsnap extract


4) Configure pkg:

rm /usr/local/etc/pkg.conf

mkdir -p /usr/local/etc/pkg/repos/

Create file /usr/local/etc/pkg/repos/FreeBSD.conf with content:

FreeBSD: {
url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
mirror_type: "srv",
signature_type: "fingerprints",
fingerprints: "/usr/share/keys/pkg",
enabled: yes
}


mkdir -p /usr/share/keys/pkg/trusted/

Create file /usr/share/keys/pkg/trusted/pkg.freebsd.org with content:

function: "sha256"
fingerprint: "b0170035af3acc5f3f3ae1859dc717101b4e6c1d0a794ad554928ca0cbb2f438"


5) Build new bash (may take a while, since dependencies are also being built (i.e. perl).
Use all default options when asked:

cd /usr/ports/shells/bash
make install clean


Check bash version:

/usr/local/bin/bash --version

At the monent of writing, it is 4.3.27(0)-release

6) Exit jail and shut it down


Part 2 - replace system bash with new one

1) Create a temporary folder somewhere inside the pool:

mkdir /mnt/data/tmp

2) Copy system image to this folder and unpack it:

cp /cf/mfsroot.gz /mnt/data/tmp/
cd /mnt/data/tmp/
gzip -d ./mfsroot.gz


3) Mount the unpacked image:

mdconfig -a -t vnode -f ./mfsroot -u 2
mkdir md
mount /dev/md2 ./md


4) Replace bash binary inside mounted image. Be sure to replace file inside /usr/local/bin,
since /bin folder holds just symlink to the bash, not the binary itself:

cp /mnt/data/jail/dev/usr/local/bin/bash ./md/usr/local/bin/

5) Unmount updated image and pack it:

umount ./md
mdconfig -d -u md2
gzip -9 ./mfsroot


6) Replace packed image on usb flash, remounting card as read-write:

mount -uw /cf
rm /cf/mfsroot.gz
mv ./mfsroot.gz /cf
mount -ur /cf


7) Remove temporary directory and reboot the system

rm -rf /mnt/data/tmp/
reboot


8) Check the bash version after reboot

bash --version

Should get 4.3.27(0)-release

9) Done!

Please, be sure to make a backup before doing this and check yourself you are understanding what is happening here. If you are not sure, better wait for official build, otherwise you may break your system.
NAS: NAS4Free 9.2.0.1 - Shigawire (revision 972) x64 embedded
HP MicroServer N40L: RAID-Z1 on 5xWD20EFRX 2Tb (Red series), KVR1333D3E9SK2/16G, HP NC360T Dual Port Gigabit Ethernet Card (with LAGG on), HP MicroServer Remote Access Card

Martino
NewUser
NewUser
Posts: 4
Joined: 05 May 2013 23:46
Location: Vercelli, Italy
Status: Offline

Re: Shellshock vulnerability

Post by Martino »

Point is: bash is vulnerable, nothing to do.
BUT is there a chance that someone WITHOUT ACCESS to the shell or to the webgui can hack into the system?
My system is behind a router, only port 80 (for webgui with https), transmission and another one for SSH (not the traditional one) are available outside.
No webserver, no root ssh access.
Assuming that my passwords are safe, is there any real threat? I highly doubt that.

User avatar
b0ssman
Forum Moderator
Forum Moderator
Posts: 2438
Joined: 14 Feb 2013 08:34
Location: Munich, Germany
Status: Offline

Re: Shellshock vulnerability

Post by b0ssman »

i am confused. you say port 80 is available outside.
but then go on to say no webserver. the webgui is a webserver.
Nas4Free 11.1.0.4.4517. Supermicro X10SLL-F, 16gb ECC, i3 4130, IBM M1015 with IT firmware. 4x 3tb WD Red, 4x 2TB Samsung F4, both GEOM AES 256 encrypted.

maxpower
NewUser
NewUser
Posts: 3
Joined: 22 Sep 2014 05:16
Status: Offline

Re: Shellshock vulnerability

Post by maxpower »

b0ssman wrote:i am confused. you say port 80 is available outside.
but then go on to say no webserver. the webgui is a webserver.
I think I follow, but I'm completely ignorant on how the webgui works. Does it use CGI scripts? I think if the answer is no, you have nothing to worry about.

User avatar
b0ssman
Forum Moderator
Forum Moderator
Posts: 2438
Joined: 14 Feb 2013 08:34
Location: Munich, Germany
Status: Offline

Re: Shellshock vulnerability

Post by b0ssman »

I would strongly suggest to disable the access to the web gui. If you need remote access to the web use ssh port forwarding.
Also for security I would strongly suggest disabling ssh password authentication and use public private key authentication. You would not believe the amount of brute force attacks you get on open ports.


Sent from my iPhone using Tapatalk
Nas4Free 11.1.0.4.4517. Supermicro X10SLL-F, 16gb ECC, i3 4130, IBM M1015 with IT firmware. 4x 3tb WD Red, 4x 2TB Samsung F4, both GEOM AES 256 encrypted.

fumantsu
Starter
Starter
Posts: 69
Joined: 04 Mar 2014 12:15
Location: Athens->Brno
Status: Offline

Re: Shellshock vulnerability

Post by fumantsu »

ava1ar wrote:MiceMac, thanks for sharing! I will copy my instruction here in English for those who are interested.

.
.
.

Please, be sure to make a backup before doing this and check yourself you are understanding what is happening here. If you are not sure, better wait for official build, otherwise you may break your system.
Well I tried this way (not difficult, needs only backup and pay attention) but the updated mfsroot.gz is little bigger that the old one, enough not to be able to be copied back to /cf. Any advice?

EDIT:
for some reason with cp and not mv it worked.
Fractal Node 304, Avoton C2550 Quad-Core Processor, 8GB RAM ECC, 4 x 4TB WD RED in mirrors , NAS4Free 9.2.0.1 build 972

Martino
NewUser
NewUser
Posts: 4
Joined: 05 May 2013 23:46
Location: Vercelli, Italy
Status: Offline

Re: Shellshock vulnerability

Post by Martino »

b0ssman wrote:I would strongly suggest to disable the access to the web gui. If you need remote access to the web use ssh port forwarding.
Good point, problem is that I can not establish a direct connection to that port when I'm at work (our firewall filters everything except 80 and 443 as far as I know), my only precaution is forcing https on port 80.
BUT: with only access to the webgui login screen you can exploit the bug?
b0ssman wrote:Also for security I would strongly suggest disabling ssh password authentication and use public private key authentication. You would not believe the amount of brute force attacks you get on open ports.
True, anyway they have to "guess" port, username and password (a complex one) to get in, and then guess the root password; I've not seen any login attempt since I've changed the port.

User avatar
F8BOE
experienced User
experienced User
Posts: 106
Joined: 03 Jun 2013 23:09
Location: France
Status: Offline

Re: Shellshock vulnerability

Post by F8BOE »

Hello,

Yes Sir! You can exploit it through the "Advanced | Command line" function... If you get on the Web-GUI anyhow...

Ciao @+

Martino
NewUser
NewUser
Posts: 4
Joined: 05 May 2013 23:46
Location: Vercelli, Italy
Status: Offline

Re: Shellshock vulnerability

Post by Martino »

F8BOE wrote:Hello,

Yes Sir! You can exploit it through the "Advanced | Command line" function... If you get on the Web-GUI anyhow...

Ciao @+
which is NOT in the login screen. if someone manage to breake my login password, well... the shellshock is the last of my problems :)

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4865
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: Shellshock vulnerability

Post by raulfg3 »

Patched on latest r1004 build, please wait until was compiled and upload for download.

http://sourceforge.net/p/nas4free/code/commit_browser

http://sourceforge.net/p/nas4free/code/1004/
12.1.0.4 - Ingva (revision 7743) on SUPERMICRO X8SIL-F 8GB of ECC RAM, 11x3TB disk in 1 vdev = Vpool = 32TB Raw size , so 29TB usable size (I Have other NAS as Backup)

Wiki
Last changes

HP T510

User avatar
F8BOE
experienced User
experienced User
Posts: 106
Joined: 03 Jun 2013 23:09
Location: France
Status: Offline

Re: Shellshock vulnerability

Post by F8BOE »

Hello,

Ah I see... "9.2.0.1 - Shigawire (revision 972)+1"... Good idea!

Ciao @+

User avatar
johl
NewUser
NewUser
Posts: 14
Joined: 29 Jun 2012 07:53
Location: Örebro
Status: Offline

Re: Shellshock vulnerability

Post by johl »

Hi all, i couldn't wait ;) I installed FreeBSD 9.2 AMD64 in Parallels Desktop and installed the latest package through

Code: Select all

pkg install bash
the latest os-updated

Code: Select all

freebsd-update fetch install
and then move the bash-binary to my N4F with ftp on internal network and tried to start shell

Code: Select all

/usr/local/bin/bash 
and the ran

Code: Select all

bash --version
and it all worked as planned.
But first i did a backup of the old bash-binary with

Code: Select all

mv /usr/local/bin/bash /usr/local/bin/bash.old
I'll run this for awhile and hope it won't start any problems and errors due to missing libs and others.
I could posted this binary in an URL, but i don't know if you would trust that my binary is pure or if it's against forum rules. I wouldn't download any others :mrgreen:
Best J

Post Reply

Return to “Upgrade XigmaNAS”