Guest User

Untitled

a guest
Jul 18th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.99 KB | None | 0 0
  1. <?php
  2. $register_globals = (bool) ini_get('register_gobals');
  3. $system = ini_get('system');
  4. $unix = (bool) $unix;
  5. $win = (bool) $windows;
  6. //
  7. If ($register_globals)
  8. {
  9. $ip = getenv(REMOTE_ADDR);
  10. $self = $PHP_SELF;
  11. }
  12. else
  13. {
  14. $submit = $_GET['submit'];
  15. $host = $_GET['host'];
  16. $ip = $_SERVER['REMOTE_ADDR'];
  17. $self = $_SERVER['PHP_SELF'];
  18. };
  19. // form submitted ?
  20. If ($submit == "Traceroute!")
  21. {
  22. // replace bad chars
  23. $host= preg_replace ("/[^A-Za-z0-9.]/","",$host);
  24. echo '<body bgcolor="#FFFFFF" text="#000000"></body>';
  25. echo("Trace Output:<br>");
  26. echo '<pre>';
  27. //check target IP or domain
  28. if ($unix)
  29. {
  30. system ("traceroute $host");
  31. system("killall -q traceroute");// kill all traceroute processes in case there are some stalled ones or use echo 'traceroute' to execute without shell
  32. }
  33. else
  34. {
  35. system("tracert $host");
  36. }
  37. echo '</pre>';
  38. echo '...trace complete';
  39. }
  40. else
  41. {
  42. echo '<body bgcolor="#FFFFFF" text="#000000"></body>';
  43. echo '<font size="2">Your IP is: '.$ip.'</font>';
  44. echo '<form methode="post" action="'.$self.'">';
  45. echo 'Enter IP or Host <input type="text" name="host" value="'.$ip.'"></input>';
  46. echo '<input type="submit" name="submit" value="Traceroute!"></input>';
  47. echo '</form>';
  48. echo '<br><b>'.$system.'</b>';
  49. echo '</body></html>';
  50. }
  51. ?><?php
  52. $register_globals = (bool) ini_get('register_gobals');
  53. $system = ini_get('system');
  54. $unix = (bool) $unix;
  55. $win = (bool) $windows;
  56. //
  57. If ($register_globals)
  58. {
  59. $ip = getenv(REMOTE_ADDR);
  60. $self = $PHP_SELF;
  61. }
  62. else
  63. {
  64. $submit = $_GET['submit'];
  65. $host = $_GET['host'];
  66. $ip = $_SERVER['REMOTE_ADDR'];
  67. $self = $_SERVER['PHP_SELF'];
  68. };
  69. // form submitted ?
  70. If ($submit == "Traceroute!")
  71. {
  72. // replace bad chars
  73. $host= preg_replace ("/[^A-Za-z0-9.]/","",$host);
  74. echo '<body bgcolor="#FFFFFF" text="#000000"></body>';
  75. echo("Trace Output:<br>");
  76. echo '<pre>';
  77. //check target IP or domain
  78. if ($unix)
  79. {
  80. system ("traceroute $host");
  81. system("killall -q traceroute");// kill all traceroute processes in case there are some stalled ones or use echo 'traceroute' to execute without shell
  82. }
  83. else
  84. {
  85. system("tracert $host");
  86. }
  87. echo '</pre>';
  88. echo '...trace complete';
  89. }
  90. else
  91. {
  92. echo '<body bgcolor="#FFFFFF" text="#000000"></body>';
  93. echo '<font size="2">Your IP is: '.$ip.'</font>';
  94. echo '<form methode="post" action="'.$self.'">';
  95. echo 'Enter IP or Host <input type="text" name="host" value="'.$ip.'"></input>';
  96. echo '<input type="submit" name="submit" value="Traceroute!"></input>';
  97. echo '</form>';
  98. echo '<br><b>'.$system.'</b>';
  99. echo '</body></html>';
  100. }
  101. ?>
Add Comment
Please, Sign In to add comment