Prv8 Shell
Server : Apache
System : Linux server.mata-lashes.com 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64
User : matalashes ( 1004)
PHP Version : 8.1.29
Disable Function : NONE
Directory :  /usr/share/systemtap/examples/io/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/systemtap/examples/io/capture_ssl_master_secrets.stp
#!/usr/bin/stap

function cast_char_to_unsigned_char (val:long)
{
  if (val < 0) {
    return val + 256;
  } else {
    return val;
  }
}

function print_buffer (buf:long, len:long)
{
  for (i = 0; i < len; i++) {
    printf("%02x", cast_char_to_unsigned_char(user_char(buf + i)));
  }
}

probe process("/usr/lib*/libssl.so.*").function("tls1_generate_master_secret").return !,
      process("/usr/lib/*/libssl.so.*").function("tls1_generate_master_secret").return
{
  printf("# %d %s %s (%d)\n", gettimeofday_us(), pp(), execname(), pid());
  printf("CLIENT_RANDOM ");
  print_buffer(@entry($s->s3->client_random), 32);
  printf(" ");
  print_buffer(@entry($out), $return);
  printf("\n");
}

probe process("/usr/lib*/libgnutls.so.*").function("generate_normal_master").return !,
      process("/usr/lib/*/libgnutls.so.*").function("generate_normal_master").return
{
  printf("# %d %s %s (%d)\n", gettimeofday_us(), pp(), execname(), pid());
  printf("CLIENT_RANDOM ");
  print_buffer(@entry($session) + 72, 32);
  printf(" ");
  print_buffer(@entry($session) + 24, 48);
  printf("\n");
}

haha - 2025