Skip to content

Instantly share code, notes, and snippets.

@gokaybiz
Last active June 4, 2017 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gokaybiz/fa0e51e8d44abc477726051c291a022b to your computer and use it in GitHub Desktop.
Save gokaybiz/fa0e51e8d44abc477726051c291a022b to your computer and use it in GitHub Desktop.
Link.tl bypass
<?php
function linktlCURL($link, $ref) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$link);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_REFERER, $ref);
curl_setopt($ch, CURLOPT_COOKIE, "ads_impression=19; ads_impression3=19;");
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36");
$ret = curl_exec($ch);
curl_close($ch);
return $ret;
}
function linktlAPI($link) {
preg_match("/link.tl\/([^&]+)/", $link, $id);
$id = (isset($id[1])) ? ($id[1]) : (NULL);
if ($id == NULL)
return json_encode(["err" => 1, "msg" => "invalid_link"]);
$get = linktlCURL("http://link.tl/fly/go.php?to={$id}", "http://link.tl/{$id}");
preg_match_all("/<div class=\"skip_btn2\"><a href=\"(.*)\"/", $get, $target);
if(!empty($target[1][0])) {
if(preg_match("/link.tl\/fly\/site.php\?to=([^&]+)/", $target[1][0])) {
$get = linktlCURL($target[1][0], "http://link.tl/fly/go.php?to={$id}");
preg_match_all("/<iframe class=\"site_frame\" src=\"(.*)\" scr/", $get, $target);
return json_encode(["err" => -1, "msg" => $target[1][0]]);
}
return json_encode(["err" => 0, "msg" => $target[1][0]]);
}
return json_encode(["err" => 2, "msg" => "broken_link"]);
}
echo linktlAPI("http://link.tl/a");
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment