willysec_id

API Reverse IP

Jun 13th, 2022 (edited)
642
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.81 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. class willysan{
  4.   public $ip;
  5.   public $key;
  6.   public $validkey = "memekcyna";
  7.   public $api = "https://domains.tntcode.com/ip/";
  8.   public $worker1 = 0;
  9.   public $worker2 = 0;
  10.   public function revip(){
  11.       $html =
  12.         file_get_contents($this->api.$this->ip);
  13.     $start = stripos($html, '<textarea cols="50" rows="10">');
  14.     $end = stripos($html, '</textarea>', $offset = $start);
  15.     $length = $end - $start;
  16.     $htmlSection = substr($html, $start, $length);
  17.     $result = str_replace('<textarea cols="50" rows="10">',"",$htmlSection);str_replace('</textarea>',"",$htmlSection);
  18.     if($result != NULL){
  19.       $this->worker1 = 1;
  20.       return $result;
  21.     }
  22.   }
  23.  
  24.   public function apikey(){
  25.     if($this->key != $this->validkey){
  26.       return "Invalid Api Key";
  27.     }else{
  28.       $this->worker2 = 1;
  29.     }
  30.   }
  31. }
  32.  
  33. class willy extends willysan {
  34.   public function ip($ip){
  35.       $this->ip = $ip;
  36.       willy::revip();
  37.   }
  38.   public function key($key){
  39.     $this->key = $key;
  40.     willy::apikey();
  41.   }
  42.   public function validate(){
  43.     $worker1 = $this->worker1;
  44.     $worker2 = $this->worker2;
  45.     if($worker1 == NULL){
  46.       echo "Wrong Ip Format";die();
  47.     }elseif($worker2 == NULL){
  48.       echo willy::apikey();die();
  49.     }elseif($worker1 != NULL && $worker2 != NULL){
  50.       echo willy::revip();
  51.     }else{
  52.       echo "ngontol";
  53.     }
  54.   }
  55. }
  56.  
  57. $willy = new willy();
  58. if(isset($_GET["ip"]) && isset($_GET["key"])){
  59.   if(isset($_GET["key"])){if($_GET["key"] == NULL){echo "Please Enter ApiKey";die();}}
  60.   $willy->ip($_GET["ip"]);
  61.   $willy->key($_GET["key"]);
  62.   $willy->validate();
  63. }else{
  64.   if(isset($_GET["ip"])){if($_GET["ip"] == NULL){echo "Please Enter IP Address";die();}else{echo "Require key parameter";die();}}
  65.   echo "Usage: ?ip=ipaddress&key=apikey";
  66. }
Add Comment
Please, Sign In to add comment