Improve Linkvertise bypass (re timmyRS#747)

This commit is contained in:
ikancupang 2019-12-19 22:33:35 +07:00 committed by GitHub
parent a9ae2f1121
commit daf5591740
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -509,39 +509,40 @@ if(document instanceof HTMLDocument)
}, },
pause:()=>{} pause:()=>{}
}]} }]}
let xhr=new XMLHttpRequest(), ensureDomLoaded(()=>{
url="/main-es5.f1fb1c6609d5e9bbcd58.js", let xhr=new XMLHttpRequest(),
o={timestamp:new Date().getTime()} script=document.querySelectorAll("script[src]"),
const xhrget=f=>{ url=script[script.length-1].src,
xhr.onload=f o={timestamp:new Date().getTime()}
xhr.open("GET",url) const xhrget=f=>{
xhr.send() xhr.onload=f
} xhr.open("GET",url)
xhrget(()=>{ xhr.send()
const regex=/random\\:"([^"]+)"/
let matches=regex.exec(xhr.responseText)
if(matches&&matches[1])
{
o.random=matches[1]
url="https://linkvertise.net/api/v1/redirect/link/static"+location.pathname
} }
xhrget(()=>{ xhrget(()=>{
let json=JSON.parse(xhr.responseText) const regex=/random\\:"([^"]+)"/
if(json&&json.data.link.id) let matches=regex.exec(xhr.responseText)
if(matches&&matches[1])
{ {
o.link_id=json.data.link.id o.random=matches[1]
url="https://linkvertise.net/api/v1/redirect/link"+location.pathname+"/target?serial="+btoa(JSON.stringify(o)) url="https://linkvertise.net/api/v1/redirect/link/static"+location.pathname
} }
xhrget(()=>{ xhrget(()=>{
let json=JSON.parse(xhr.responseText) let json=JSON.parse(xhr.responseText)
if(json&&json.data.target) if(json&&json.data.link.id)
{ {
safelyNavigate(json.data.target) o.link_id=json.data.link.id
url="https://linkvertise.net/api/v1/redirect/link"+location.pathname+"/target?serial="+btoa(JSON.stringify(o))
} }
xhrget(()=>{
let json=JSON.parse(xhr.responseText)
if(json&&json.data.target)
{
location.assign(json.data.target)
}
})
}) })
}) })
})
ensureDomLoaded(()=>{
var div = document.createElement('div'); var div = document.createElement('div');
div.id = "ogxzi8ZzrLy8S4zhUwyc3jPMlXi1h91bA0bASIiZtyT6cOTlX78HtEyXTK0WUGCY3CO8E4hBYI02ZD9mr7jit7R1YqPdkllJ"; div.id = "ogxzi8ZzrLy8S4zhUwyc3jPMlXi1h91bA0bASIiZtyT6cOTlX78HtEyXTK0WUGCY3CO8E4hBYI02ZD9mr7jit7R1YqPdkllJ";
document.body.appendChild(div); document.body.appendChild(div);