View Single Post
  #4   (View Single Post)  
Old 22nd August 2008
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,128
Default

How did you echo?
  1. echo linux_enable="YES" > /boot/loader
  2. echo linux_enable="YES" >> /boot/loader
The first command will have overwritten "boot/loader" with linux_enable=YES. IOW the former contents is gone, which is bad.

The second command only will have appended linux_enable=YES to the end of the program/binary loader which usually is not that harmful.

I just did this on OpenBSD
Code:
$ mkdir temp
$ cd temp
$ cp /bin/ls .
$ ls -l

total 448
-r-xr-xr-x  1 j65nko  j65nko  210416 Aug 23 01:20 ls

$ chmod +w ls
$ ls -l

total 448
-rwxr-xr-x  1 j65nko  j65nko  210416 Aug 23 01:20 ls

$ echo echo linux_enable="YES" >>ls
$ ls -l

total 448
-rwxr-xr-x  1 j65nko  j65nko  210438 Aug 23 01:21 ls

$ ./ls -l

total 448
-rwxr-xr-x  1 j65nko  j65nko  210438 Aug 23 01:21 ls
Here the ls binary with the appended text just executes. Cannot guarantee loader will do the same or whether BTX will complain

From man loader
Code:
DESCRIPTION
     The program called loader is the final stage of FreeBSD's kernel boot-
     strapping process.  On IA32 (i386) architectures, it is a BTX client.  It
     is linked statically to libstand(3) and usually located in the directory
     /boot.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote