Skip to content

Commit

Permalink
验证通过?
Browse files Browse the repository at this point in the history
  • Loading branch information
jianjianai committed Jun 6, 2024
1 parent 730b616 commit 7ceb26e
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 40 deletions.
71 changes: 71 additions & 0 deletions src/CFTNormalUring.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<script>
//验证通过器
(() => {
//解析器
function pathOrUrl(value) {
if (!value) {
return undefined;
}
if ((typeof value) != "string") {
value = `${value};`
}
try {
return new URL(value);
} catch (e) {
if (value.startsWith("/")) {
let url = new URL(`${window.location.origin}${value}`)
return url
} else {
return new URL(`${window.location.href.substring(0, window.location.href.lastIndexOf("/"))}/${value}`);
}
}
}
//feth请求编辑
const myFetch = window.fetch;
window.fetch = (input, init) => {
let url = pathOrUrl(input);
if (url) {
url.pathname = url.pathname.replace("/cdn-cgi/", "/pocybig/");
console.log("已拦重定向请求=>", input, url.toString());
return myFetch(url, init);
}
return myFetch(input, init);
}
//xml请求编辑
const myXMLHttpRequestOpen = window.XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function () {
if ((typeof arguments[1]) == "string") {
arguments[1] = arguments[1].replace("/cdn-cgi/", "/pocybig/");
}
return myXMLHttpRequestOpen.apply(this, arguments);
}

document.myCreateElement = document.createElement;
document.createElement = function () {
const el = document.myCreateElement(...arguments);
if (arguments[0] == "img") {
// el = new Proxy(el,{
// set(target, property, value){
// console.log("setImg",property,value);
// target[property] = value;
// }
// })
Object.defineProperty(el, "src", {
set(value) {
console.log("set img src",value);
value = value.replace("/cdn-cgi/","/pocybig/");
el.setAttribute("src",value);
console.log(el);
},
get() {
return el.getAttribute("src");
}
})
console.log("createElement", el, arguments);
}
return el;
}

})();
console.log("注入成功!");
</script>
33 changes: 0 additions & 33 deletions src/CFTuring.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,38 +38,5 @@
return rtf;
}
});

(() => {
//解析器
function pathOrUrl(value) {
if (!value) {
return undefined;
}
if ((typeof value) != "string") {
value = `${value};`
}
try {
return new URL(value);
} catch (e) {
if (value.startsWith("/")) {
let url = new URL(`${window.location.origin}${value}`)
return url
} else {
return new URL(`${window.location.href.substring(0, window.location.href.lastIndexOf("/"))}/${value}`);
}
}
}
//feth请求编辑
const myFetch = window.fetch;
window.fetch = (input, init) => {
let url = pathOrUrl(input);
if (url) {
url.pathname = url.pathname.replace("/cdn-cgi/","/pocybig/");
console.log("已拦重定向请求=>", input, url.toString());
return myFetch(url, init);
}
return myFetch(input, init);
}
})();
console.log("注入成功!");
</script>
18 changes: 11 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import { proxyLinkHttp } from "./proxyLink/proxyLinkHttp";
import { usIps } from './ips/usIps';
import CopilotNetWork from './CopilotNetWork.html';
import CFTuring from './CFTuring.html';
import CFTNormalUring from './CFTNormalUring.html';


const XForwardedForIP = usIps[Math.floor(Math.random()*usIps.length)][0];
console.log(XForwardedForIP)
Expand Down Expand Up @@ -120,6 +122,7 @@ export default {
url.pathname.startsWith("/pocybig/")
){
originUrl.hostname = "www.bing.com"
// originUrl.pathname = originUrl.pathname.replace("/pocybig/","/cdn-cgi/");
}
resHeaders.set('Origin',originUrl.toString());
}
Expand Down Expand Up @@ -147,11 +150,10 @@ export default {
url.pathname.startsWith("/pocybig/")
){
refererUrl.hostname = "www.bing.com"
// if(url.pathname.endsWith("/normal")){
// refererUrl = "https://www.bing.com/";
// }else{

// }
refererUrl.pathname = refererUrl.pathname.replace("/pocybig/","/cdn-cgi/");
if(url.pathname.endsWith("/normal")){
refererUrl = "https://www.bing.com/";
}
}
resHeaders.set('Referer',refererUrl.toString());
}
Expand Down Expand Up @@ -235,7 +237,7 @@ export default {
retBody = retBody.replace(/https?:\/\/sydney\.bing\.com(:[0-9]{1,6})?/g, `${porxyOrigin}`);
retBody = retBody.replace(/https?:\/\/login\.live\.com(:[0-9]{1,6})?/g, `${porxyOrigin}`);
retBody = retBody.replace(/https?:\/\/copilot\.microsoft\.com(:[0-9]{1,6})?/g, `${porxyOrigin}`);
retBody = retBody.replace(/https?:\/\/www\.bing\.com\/images\/create\//g,`${porxyOrigin}/images/create/`);
retBody = retBody.replace(/https?:\/\/www\.bing\.com(:[0-9]{1,6})?/g,`${porxyOrigin}`);
retBody = retBody.replace(/https?:\/\/storage\.live\.com(:[0-9]{1,6})?/g, `${porxyOrigin}`);
// retBody = retBody.replace(/https?:\\\/\\\/copilot\.microsoft\.com(:[0-9]{1,6})?/g, `${porxyOrigin.replaceAll("/",`\\/`)}`);
// retBody = retBody.replaceAll(`"copilot.microsoft.com"`,`"${porxyHostName}"`);
Expand All @@ -258,9 +260,11 @@ export default {
retBody = retBody.replaceAll("location","myCFLocation");
retBody = retBody.replaceAll("window","myCFWindow");
}

if(resUrl.pathname.startsWith("/cdn-cgi/challenge-platform/")){
retBody = retBody.replaceAll("/cdn-cgi/","/pocybig/");
if(resUrl.pathname.endsWith("/normal")){
retBody = injectionHtml(retBody,CFTNormalUring);
}
}
config.body = retBody;
return config;
Expand Down

0 comments on commit 7ceb26e

Please sign in to comment.