Tag Info

New answers tagged

3

It's because you are too early, if you wait until the UIDs are changed then your process runs as basic4_pwned. This worked for me: ./shellcode4js "test" & PID=$! sleep 0.0005 kill -SIGSTOP $PID grep ^Uid /proc/$PID/status Another try is to add a delay with usleep() and send the SIGSTOP later during that sleep. Then the programm runs with basic4_pwned ...


1

Is the program running on a filesystem that honors the setuid bit on files (mount -o nosuid)? If I were debugging this, I would print the output of getuid() and geteuid() on program startup, to see whether the setuid bit is being honored.


0

You're starting out too big. Starting out with small pieces of code that you've made sure work is better. Why start with a daemon right away, and why that weird signalling to invoke poll_kbd. In C, you should be checking error codes too. Rant finished. Now why it's not working: This >>f = fopen(LOG_FILE, "w"); truncates the log file in each kbd_poll ...


0

Just don't write your loop so weird. until ping host -c 1 -w 3 do sleep 1 done >/dev/null Doing the above will require at most two ^C keystrokes in a row to exit the loop - and that's because of sleep. But if you layer it one more time: sh -c ' until ping host -c 1 -w 3 do sleep 1 done' >/dev/null ...you won't need even the ...


3

trap "exit 1" INT while true; do ping host -c 1 -w 3 > /dev/null && break; sleep 1 done trap - INT # restore handler


1

There is no. Very easy to write one with perl. Here's untrap script: #!/usr/bin/perl $SIG{INT} = "DEFAULT"; exec { $ARGV[0] } @ARGV or die "couldn't exec $ARGV[0]: $!"; Example usage: #!/bin/bash untrap bash -c ' sleep 3 echo aaa ' & trap '' INT wait $! If you remove untrap prefix, Ctrl-C won't kill the script. More versatile script: ...



Top 50 recent answers are included