zeerx7

[PHP][CLI] Cek Http/Https

Aug 7th, 2020 (edited)
657
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.56 KB | None | 0 0
  1. <?php
  2. // Coded by me (Zeerx7)
  3. // XploitSec-ID
  4. error_reporting(0);
  5. class ssl_cek{
  6.  var $url;
  7.  var $path;
  8.  var $output;
  9.  public function ssl($dom){
  10.   // Set host and port.
  11.   //$host   = 'google.com';
  12.   $host = $dom;
  13.   $port   = 443;
  14.  
  15.   // Initiate a socket connection with 'example.com' and check the result.
  16.   $fp     = fsockopen('ssl://'. $host, $port, $errno, $errstr, 30);
  17.   $result = ($fp) ? 1 : 0;
  18.   if($result == 1){
  19.     $res = "https://$host".$this->path;
  20.     echo $res;
  21.     $this->save($this->output,$res."\n");
  22.   }else{
  23.     $res = "http://$host".$this->path;
  24.     echo $res;
  25.     $this->save($this->output,$res."\n");
  26.   }echo "\n";
  27.  }
  28.  public function parse($url){
  29.   //$url = $this->url;
  30.   if(!preg_match("#http://|https://#",$url)){
  31.     $url = 'http://'.$url;
  32.   }
  33.   $dom = parse_url($url);
  34.   $this->path = $dom['path'];
  35.   $dom = $dom['host'];
  36.   $this->ssl($dom);
  37.  }
  38.  public function execute(){
  39.    echo $this->banner();
  40.    echo "Input File: ";
  41.    $A = trim(fgets(STDIN));
  42.    if(file_exists($A)){
  43.     echo "Input Name Output: ";
  44.     $this->output = trim(fgets(STDIN));
  45.     $pausiGans = trim(file_get_contents($A));
  46.     $pausi_ = explode("\n",$pausiGans);
  47.     foreach($pausi_ as $ganteng => $banget){
  48.      $this->parse(trim($banget));
  49.     }
  50.    }else{ echo "File Not Found\n"; }
  51.  }
  52.  public function banner(){
  53.    return "
  54. ,',',',',',',',
  55. Coded by Zeerx7
  56.  XploitSec-ID
  57. ',',',',',',','
  58.  
  59. ";
  60.  }
  61.  public function save($a,$b){
  62.   $a = fopen($a,'a+');
  63.   fwrite($a,$b);
  64.   fclose($a);
  65.  }
  66. }
  67.  
  68. $pausi = new ssl_cek;
  69. $pausi->execute();
Add Comment
Please, Sign In to add comment