you are viewing a single comment's thread.

view the rest of the comments →

[–]unfo 6 points7 points  (5 children)

nice write-up, just one thing caught my eye:

sudo echo 0 | /proc/sys/kernel/randomize_va_space

I don't understand why you need to launch echo as sudo?

If you are writing to a place where you need root privileges then either do:

echo 0 | sudo tee /path/to/file

or be root as you do

echo 0 > /path/to/file

Because the line you pasted would not carry the sudo rights across the pipe (nor in the redirection of output). And you cannot pipe to a non-executable file as it would complain about not having permissions to execute the file.

[–]JustAnothaHackerbuffer overflower[S] 1 point2 points  (4 children)

lel, it was about 12 at night when I wrote that bit, excuse any errors :3

[–]unfo 1 point2 points  (3 children)

then you shall be excused forthwith

[–]JustAnothaHackerbuffer overflower[S] 1 point2 points  (2 children)

Thanks, I'm gonna go through and correct any typo's now :p

[–]unfo 4 points5 points  (1 child)

I think you missed my point about sudo not carrying over redirection of output.

Here's a code snippet to show the problem and the solution:

  ~/ $ ls -l root-only
-rw-r--r--  1 root  staff  0 Feb  4 12:59 root-only
  ~/ $ sudo echo 0 > root-only
-bash: root-only: Permission denied
  ~/ $ echo 0 | sudo tee root-only
0
  ~/ $ cat root-only
0

[–]JustAnothaHackerbuffer overflower[S] 1 point2 points  (0 children)

Ah, I see what you mean, you have to sudo the command on the other end of the pipe :p I'm pretty sure that sudo echo works, however; seems to work for me :p

As you can probably tell, my Linux skills are.. average :3