2

I was trying to exploit capacity leaking to a C program (see below), by taking advantage of the non-existence of fclose() function to a file, that the program previously opened.

In short, the exploitation included the following command

sudo echo some_random_string >&3

The thing is I run the same command using >&2, >&1 and >&0, as well (stdin, stdout, stderr).

My PC lags since then (for example mouse click doesn't work on browser from times to times)

Any idea about what is going on?

The C program is the following:

#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>

void main() {
    int fd;
    char *v[2];

    fd = open("/etc/zzz", O_RDWR | O_APPEND);

    if ( fd == -1 ) {
        printf("Cannot open /etc/zzz\n");
        exit(0);
    }

    printf("fd is %d\n", fd);

    setuid(getuid());

    v[0] = "\\bin\\sh"; 
    v[1] = 0;
    execve(v[0], v, 0);

}
3
  • No, none of these processes are still running. I rebooted the pc several times, in any case.
    – HelloWorld
    Aug 8, 2019 at 10:39
  • 4
    Please edit your question and include that the problem persists after rebooting, that's important. It also means that the issue is likely something completely different. Was &3 attached to a specific file when you ran this? By the way, sudo echo foo >&3 is pointless. Only the echo will run with sudo, the >&3 is run as a regular user (this is why sudo echo foo > /newfile will fail).
    – terdon
    Aug 8, 2019 at 11:03
  • 2
    What about top -- does that show some process using lots of CPU?
    – Elias
    Aug 8, 2019 at 13:00

0

You must log in to answer this question.

Browse other questions tagged .