<?php include('/opt/GoSMS/config.php'); if($_REQUEST['SmsStatus'] == "delivered" && isset($_REQUEST['To'])){ $phoneNo = $_REQUEST['To']; echo "[?] Searching for running campaigns\n"; $curl = new curl(); $curl->url = "$GophishAPIURL/api/campaigns/?api_key=$key"; $list = $curl->curlQuery(); if(isset($list->message) && $list->message == "Invalid API Key"){ echo "[!] Invalid API key\n"; exit(0); }else{ foreach($list as $id){ if($id['status'] == "In progress"){ echo "[+] Found: ID: ".$id['id']." Name: ".$id['name']."\n"; foreach($id['results'] as $victim){ echo "[?] Searching for victim with $phoneNo\n"; if($victim['email'] == "$phoneNo@gophish.sms"){ echo "[+] Found RID: ".$victim['id']."\n"; echo "[!] Grabbing tracking image\n"; $curl->url = "$PhishURL/track?rid=".$victim['id']; $list = $curl->curlQuery(); } } } } } exit(0); } class curl { public function curlQuery() { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $this->url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, True); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //curl_setopt($ch, CURLOPT_VERBOSE, true); // verbose mode for debugging $json = curl_exec($ch); curl_close($ch); $array = json_decode($json, true); return $array; } } ?>