ToKeiChun

Simple WebTester [Test mail() , SSL , and Deceptive]

Jan 25th, 2021 (edited)
901
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.29 KB | None | 0 0
  1. <?php
  2. /*
  3.   - Author : @tokeichun
  4.   - this is simple website tester to check several testing method (mail function, checking SSL, and Checking if site showing Red Page)
  5.   - change $get_mail value to your own email address!
  6.   - or if you want to change your email each time, you can simply edit it to ( $get_mail = $_GET['mail']; ) // usage = http://xyz.tld/test.php?mail=mail@hosting.com
  7. */
  8. error_reporting(NULL);
  9. function has_ssl( $domain ) {
  10.     $ssl_check = @fsockopen( 'ssl://' . $domain, 443, $errno, $errstr, 30 );
  11.     $res = !! $ssl_check;
  12.     if ( $ssl_check ) { fclose( $ssl_check ); }
  13.     return $res;
  14. }
  15. if (function_exists('curl_exec')) {
  16.   $url = 'https://'.$_SERVER['SERVER_NAME'].'/';
  17.   $ch = curl_init($url);
  18.   curl_setopt($ch, CURLOPT_HEADER, true);
  19.   curl_setopt($ch, CURLOPT_NOBODY, true);
  20.   curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
  21.   curl_setopt($ch, CURLOPT_TIMEOUT,10);
  22.   $output = curl_exec($ch);
  23.   $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  24.   curl_close($ch);
  25.  
  26.   if ($httpcode == null) {
  27.     print_r('SERVER HTTP | SSL Disabled<br>');
  28.   }
  29.   else {
  30.    print_r('SERVER HTTP(s) | SSL Enabled<br>');
  31.   }
  32. }
  33. elseif (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {
  34.   print_r('SERVER HTTP(s) | SSL Enabled<br>');
  35. }
  36. else {
  37.   if (has_ssl($_SERVER['SERVER_NAME']) == null) {
  38.     print_r('SERVER HTTP | SSL Disabled<br>');
  39.   }
  40.   else {
  41.    print_r('SERVER HTTP(s) | SSL Enabled<br>');
  42.   }
  43. }
  44. if(function_exists('mail')){
  45.   $get_mail = "aqilnaila23@gmail.com";
  46.   $nonce_id = rand();
  47.   $subject = "Result Report Test [".$_SERVER["HTTP_HOST"]."] - ".$nonce_id."";
  48.   $e_message = "".$nonce_id." WORKING !!!";
  49.   mail($get_mail,$subject,$e_message);
  50.   echo "Report ".$nonce_id." Sent to ".$get_mail."<br>";
  51. }
  52. else {
  53.  print_r('mail() function Disabled<br>');
  54. }
  55. $googletrans = file_get_contents("https://transparencyreport.google.com/transparencyreport/api/v3/safebrowsing/status?site=".$_SERVER["HTTP_HOST"]."");
  56. if (preg_match('/2,0,0,1/', $googletrans)) {
  57.     print_r('Domain Deceptive | RED PAGE!<br>');
  58. }
  59. else {
  60.     print_r('Domain Clean | PAGE WORKING!<br>');
  61. }
  62. $ds = @ini_get("disable_functions");
  63. if (!empty($ds)) {
  64.   print_r('Disable Function : '.$ds);}
  65. else {
  66.   print_r('Disable Function : None');
  67. }
  68. unlink(basename($_SERVER['PHP_SELF']));
  69. ?>
Add Comment
Please, Sign In to add comment