DaemonForums  

Go Back   DaemonForums > Miscellaneous > Programming

Programming C, bash, Python, Perl, PHP, Java, you name it.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 7th July 2020
Torronf Torronf is offline
Real Name: Francisco
PHP Developer
 
Join Date: Jul 2020
Location: Rep. Dominicana
Posts: 1
Default IP Spoofing for IPTV

Hi everyone, I am developing this PHP to be able to view this video. But the source server diverts me with error 403. I am trying to do an IP Spoofing to bypass that with control. Here I leave the PHP for you to play to see if we all look for the way it works. Thank you.

Code:
if (isset($_GET['ts'])) {
	header('Content-type: text/plain');
	error_reporting(0);
    echo curl_get (rtrim($_GET['ts']));
    exit();
    }

$server2 = "http://{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}";
header('Content-type: text/plain');
//$cat = $_GET['cat'];
//$ch = $_GET['ch'];

$cat='espana';
$ch='antena3';

$baseurl="https://adictosalatele.com/TV/".$cat."/".$ch."/";

$comp_ip = parse_url($baseurl);
# print_r($comp_ip);exit();
$ip=gethostbyname($comp_ip['host']);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$baseurl);
curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$rs = curl_exec($ch);
preg_match('@(http.+?embed.+?)"@', $rs, $link);
$id=$link[1];
$id= trim($id);
$ch2 = curl_init();
curl_setopt($ch2, CURLOPT_URL, $id);
curl_setopt($ch2, CURLOPT_HTTPHEADER, array("REMOTE_ADDR: $ip", "HTTP_X_FORWARDED_FOR: $ip"));
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch2, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36 Edg/83.0.478.45');
curl_setopt($ch2, CURLOPT_REFERER, $baseurl);
$html = curl_exec($ch2);

$bodytag = str_replace("window==window.top", "", $html);

$regex2='parentId\|(.+?)\|(.+?)\|startMuted';
preg_match("/".$regex2."/is", $bodytag, $param);

$token = $param[2];
$timestamp = $param[1];
preg_match('@embed/(.+)@',$id,$match);
$url="https://ul.cdn946.net:8443/hls/".$match[1].".m3u8?s=".$token."&e=".$timestamp;
$comp_ip_2 = parse_url($id);
$ip_2=gethostbyname($comp_ip_2['host']);

$userAgent = 'Chrome';
$header[] = 'Connection: keep-alive';
$header[] = 'User-Agent:'.$userAgent;
$header[] = 'Accept: */*';
$header[] = 'Origin:'.$comp_ip_2['host'];
$header[] = 'Sec-Fetch-Site: cross-site';
$header[] = 'Sec-Fetch-Mode: cors';
$header[] = 'Sec-Fetch-Dest: empty';
$header[] = 'Referer:'.$embedurl;
$header[] = "Remote_Addr:".$ip;
$header[] = "Http_X_Forwarded_For:".$ip;
$header[] = 'Accept-Language: en-US,en;q=0.9,es;q=0.8';
$header[] = 'If-None-Match: "5efa96e8-3a9"';
$header[] = 'If-Modified-Since:'.date(DATE_RFC822);

	
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);
	curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	$contenido = curl_exec($ch);	
	curl_close($ch);	
	print_r ($contenido);

Last edited by J65nko; 8th July 2020 at 09:03 AM. Reason: Added [code] and [/code] tags ;-)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Playing IPTV Multicast stream tomageeni OpenBSD General 2 18th July 2010 09:28 PM
spoofing with iptables dk_netsvil General software and network 6 29th October 2008 08:22 PM


All times are GMT. The time now is 09:53 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick