Commit ac890656 authored by wang's avatar wang

开始按压验证码

parent 1d0a419b
...@@ -3887,6 +3887,7 @@ try { ...@@ -3887,6 +3887,7 @@ try {
f(n = {}, "PX12210", t); f(n = {}, "PX12210", t);
f(n, "PX12343", e); f(n, "PX12343", e);
var a = n; var a = n;
console.log('PX12040.add', a)
Po["push"](a); Po["push"](a);
} }
} }
...@@ -4267,14 +4268,28 @@ try { ...@@ -4267,14 +4268,28 @@ try {
var r = n - ff; var r = n - ff;
Jc = "mousemove"; Jc = "mousemove";
(function (t, e) { (function (t, e) {
t && t["movementX"] && t["movementY"] && (Mf["length"] < 10 && Mf["push"](+t["movementX"]["toFixed"](2) + "," + +t["movementY"]["toFixed"](2) + "," + Ee(e)), gf["length"] < 50 && gf["push"](function (t) { if (
t && t["movementX"] && t["movementY"] )
{
if (Mf["length"] < 10){
console.log('PX11393.add', t["movementX"]["toFixed"](2), t["movementY"]["toFixed"](2))
Mf["push"](+t["movementX"]["toFixed"](2) + "," + +t["movementY"]["toFixed"](2) + "," + Ee(e));
if (gf["length"] < 50){
gf["push"](function (t) {
var r = +((t["touches"] || t["changedTouches"]) && (t["touches"] || t["changedTouches"])[0] ? ((t["touches"] || t["changedTouches"]) && (t["touches"] || t["changedTouches"])[0])["clientX"] : t["clientX"])["toFixed"](0); var r = +((t["touches"] || t["changedTouches"]) && (t["touches"] || t["changedTouches"])[0] ? ((t["touches"] || t["changedTouches"]) && (t["touches"] || t["changedTouches"])[0])["clientX"] : t["clientX"])["toFixed"](0);
var i = +((t["touches"] || t["changedTouches"]) && (t["touches"] || t["changedTouches"])[0] ? ((t["touches"] || t["changedTouches"]) && (t["touches"] || t["changedTouches"])[0])["clientY"] : t["clientY"])["toFixed"](0); var i = +((t["touches"] || t["changedTouches"]) && (t["touches"] || t["changedTouches"])[0] ? ((t["touches"] || t["changedTouches"]) && (t["touches"] || t["changedTouches"])[0])["clientY"] : t["clientY"])["toFixed"](0);
var a = function (t) { var a = function (t) {
return +(t["timestamp"] || t["timeStamp"] || 0)["toFixed"](0); return +(t["timestamp"] || t["timeStamp"] || 0)["toFixed"](0);
}(t); }(t);
console.log('PX11698.add', r,i,a)
return ""["concat"](r, ",")["concat"](i, ",")["concat"](a); return ""["concat"](r, ",")["concat"](i, ",")["concat"](a);
}(t))); }(t))
}
}
}
})(t, n); })(t, n);
if (r > 50) { if (r > 50) {
var i; var i;
...@@ -4321,6 +4336,7 @@ try { ...@@ -4321,6 +4336,7 @@ try {
var r = Ot(); var r = Ot();
"mousemove" !== e && e !== jt && (t["PX11699"] = Ee(r)); "mousemove" !== e && e !== jt && (t["PX11699"] = Ee(r));
var i = ht(t); var i = ht(t);
console.log('PX12040.add', Kc)
(af += 1.4 * i["length"]) >= 15e3 ? (Kc && tf["push"](Kc), Tf("PX11859")) : (tf["push"](t), tf["length"] >= 50 && (Kc && tf["push"](Kc), Tf("PX12002"))); (af += 1.4 * i["length"]) >= 15e3 ? (Kc && tf["push"](Kc), Tf("PX11859")) : (tf["push"](t), tf["length"] >= 50 && (Kc && tf["push"](Kc), Tf("PX12002")));
} }
} }
......
...@@ -1968,6 +1968,11 @@ try { ...@@ -1968,6 +1968,11 @@ try {
z["PX12040"] = function () { z["PX12040"] = function () {
var u = v, var u = v,
n = {}; n = {};
console.log('PX12040.Un', Un);
console.log('PX12040.an', an);
console.log('PX12040.Wn', Wn);
console.log('PX12040.kn', kn);
console.log('PX12040.Xn', Xn);
return Un["length"] > 0 && (Un["splice"](In), n["PX12097"] = Un), an["length"] > 0 && (an["splice"](In), n["PX11926"] = an), Wn["length"] > 0 && (Wn["splice"](In), n["PX11749"] = Wn), kn["length"] > 0 && (n["PX11698"] = D(kn)["slice"](0, ln)), Xn["length"] > 0 && (n["PX11433"] = D(Xn)["slice"](0, ln)), n; return Un["length"] > 0 && (Un["splice"](In), n["PX12097"] = Un), an["length"] > 0 && (an["splice"](In), n["PX11926"] = an), Wn["length"] > 0 && (Wn["splice"](In), n["PX11749"] = Wn), kn["length"] > 0 && (n["PX11698"] = D(kn)["slice"](0, ln)), Xn["length"] > 0 && (n["PX11433"] = D(Xn)["slice"](0, ln)), n;
}(); }();
z["PX12160"] = Tn; z["PX12160"] = Tn;
......
...@@ -480,6 +480,6 @@ function genPayload(uuid, vid, hash, hash2, hashv, token, ci, init_time) { ...@@ -480,6 +480,6 @@ function genPayload(uuid, vid, hash, hash2, hashv, token, ci, init_time) {
// console.log(createPX11393()) // console.log(createPX11393())
// console.log(createPX11698()) // console.log(createPX11698())
console.log(JSON.stringify(genPayload('5af66531-7040-1031-a4fe-f4f13a20ca16', '8a1cf585-731d-11ee-a049-4540749b826f', 'e489057d4871bdb110166705657e4c9df363995fabd20e45ccc1d1937400', '6bb20b8e2f18a4e623671f46447476f4fc4b69adcd5f9743c8eaa72f623d2875', '18', '23d4886f5746682304c4bb56cc4741f6260c78f48924ffdb988454b469bd0cff47b4c0b7cf548728e4ba57210ecbd16569ce6e877d8258a72aed61c5bd0a689d', '89?8', 1698228126238)[2])) // console.log(JSON.stringify(genPayload('5af66531-7040-1031-a4fe-f4f13a20ca16', '8a1cf585-731d-11ee-a049-4540749b826f', 'e489057d4871bdb110166705657e4c9df363995fabd20e45ccc1d1937400', '6bb20b8e2f18a4e623671f46447476f4fc4b69adcd5f9743c8eaa72f623d2875', '18', '23d4886f5746682304c4bb56cc4741f6260c78f48924ffdb988454b469bd0cff47b4c0b7cf548728e4ba57210ecbd16569ce6e877d8258a72aed61c5bd0a689d', '89?8', 1698228126238)[2]))
console.log(createPX1132("ac9e3049cb2f7f391f38d2426d3e07be19cd069a490b05aea023f2cc5681", "6bb20b8e2f18a4e623671f46447476f4fc4b69adcd5f9743c8eaa72f623d2875", "18")) console.log(createPX1132("22b0f3c54180124fd02b1bcce129b9992f252bc858988104f0632a9640099", "5393fe46579bdd80d081f53b9bb41917d06401059d4db662cafd3aa36748aa2b", "12"))
\ No newline at end of file \ No newline at end of file
...@@ -10,18 +10,18 @@ ...@@ -10,18 +10,18 @@
<body> <body>
<script> <script>
window._pxVid = ''; window._pxVid = '';
window._pxUuid = '9d34ee9d-8ce8-11ee-bd03-c34b343d7e39'; window._pxUuid = '81da0909-8d01-11ee-a0dc-c1014f687990';
window._pxAppId = 'PXVb73hTEg'; window._pxAppId = 'PXVb73hTEg';
window._pxHostUrl = 'https://collector-PXVb73hTEg.perimeterx.net'; window._pxHostUrl = 'https://collector-PXVb73hTEg.perimeterx.net';
window._pxCustomLogo = ''; window._pxCustomLogo = '';
window._pxJsClientSrc = '//client.perimeterx.net/PXVb73hTEg/main.min.js'; window._pxJsClientSrc = '//client.perimeterx.net/PXVb73hTEg/main.min.js';
window._pxFirstPartyEnabled = 'false'; window._pxFirstPartyEnabled = 'false';
var script = document.createElement('script'); var script = document.createElement('script');
script.src = '//captcha.perimeterx.net/PXVb73hTEg/captcha.js?a=c&u=9d34ee9d-8ce8-11ee-bd03-c34b343d7e39&v=&m=0'; script.src = '//captcha.perimeterx.net/PXVb73hTEg/captcha.js?a=c&u=81da0909-8d01-11ee-a0dc-c1014f687990&v=&m=0';
document.head.appendChild(script); document.head.appendChild(script);
script.onerror = function () { script.onerror = function () {
script = document.createElement('script'); script = document.createElement('script');
script.src = 'https://captcha.px-cloud.net/PXVb73hTEg/captcha.js?a=c&u=9d34ee9d-8ce8-11ee-bd03-c34b343d7e39&v=&m=0'; script.src = 'https://captcha.px-cloud.net/PXVb73hTEg/captcha.js?a=c&u=81da0909-8d01-11ee-a0dc-c1014f687990&v=&m=0';
script.onerror = window._pxDisplayErrorMessage; script.onerror = window._pxDisplayErrorMessage;
document.head.appendChild(script); document.head.appendChild(script);
}; };
......
...@@ -12,7 +12,7 @@ import requests ...@@ -12,7 +12,7 @@ import requests
import tls_client import tls_client
from loguru import logger from loguru import logger
from env import PxEnv from env_captcha import PxEnv
from utils import PxUtils from utils import PxUtils
...@@ -33,6 +33,8 @@ def unsinged_right_shift(x, y): ...@@ -33,6 +33,8 @@ def unsinged_right_shift(x, y):
class PxCaptchaBypass(): class PxCaptchaBypass():
ci = ''
uuid = ''
# PX11431 o111ooo1 # PX11431 o111ooo1
ts: str = '' ts: str = ''
cs: str = '' cs: str = ''
...@@ -67,7 +69,7 @@ class PxCaptchaBypass(): ...@@ -67,7 +69,7 @@ class PxCaptchaBypass():
prox = 'http://user-uni001-region-us-sessid-1111-sesstime-5-keep-true:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600' prox = 'http://user-uni001-region-us-sessid-1111-sesstime-5-keep-true:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600'
# prox = 'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:9000' # prox = 'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:9000'
prox = f'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:{random.randint(10000, 13500)}' prox = f'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:{random.randint(10000, 13500)}'
prox = 'http://127.0.0.1:7890' prox = 'http://127.0.0.1:8890'
session.proxies = { session.proxies = {
'http': prox, 'http': prox,
'https': prox, 'https': prox,
...@@ -151,7 +153,7 @@ class PxCaptchaBypass(): ...@@ -151,7 +153,7 @@ class PxCaptchaBypass():
self.seq = 0 self.seq = 0
self.rsc = 1 self.rsc = 1
self._step_1() self._step_1()
self.seq += 1 # self.seq += 1
# self._step_11() # self._step_11()
# time.sleep(1.5) # time.sleep(1.5)
...@@ -203,8 +205,8 @@ class PxCaptchaBypass(): ...@@ -203,8 +205,8 @@ class PxCaptchaBypass():
self.vid = vid_list[0] self.vid = vid_list[0]
self.uuid = re.findall("window\._pxUuid = '([0-9a-z\-]+)';", res.text)[0] self.uuid = re.findall("window\._pxUuid = '([0-9a-z\-]+)';", res.text)[0]
with open('../index.html', 'w') as f: # with open('../index.html', 'w') as f:
f.write(res.text) # f.write(res.text)
def _uuid(self): def _uuid(self):
# return str(uuid.uuid4()) # return str(uuid.uuid4())
...@@ -395,9 +397,9 @@ class PxCaptchaBypass(): ...@@ -395,9 +397,9 @@ class PxCaptchaBypass():
print(response) print(response)
if response['status_code'] == 302: if response['status_code'] == 302:
print(response['text']) print(response['text'])
else: # else:
with open('index.html', 'w') as f: # with open('index.html', 'w') as f:
f.write(response['text']) # f.write(response['text'])
print(response['status_code']) print(response['status_code'])
def _step_2(self, nn): def _step_2(self, nn):
...@@ -432,14 +434,18 @@ class PxCaptchaBypass(): ...@@ -432,14 +434,18 @@ class PxCaptchaBypass():
self.do_collector(data) self.do_collector(data)
def update_sid_vid(self, data: dict): def update_sid_vid(self, data: dict):
if self.session.cookies.get_dict().get('_pxhd', None) != None: # if self.session.cookies.get_dict().get('_pxhd', None) != None:
data.update({ # data.update({
'pxhd': self.session.cookies.get_dict().get('_pxhd', None) # 'pxhd': self.session.cookies.get_dict().get('_pxhd', None)
}) # })
if self.vid != "": if self.vid != "":
data.update({ data.update({
'vid': self.vid 'vid': self.vid
}) })
if self.ci != "":
data.update({
'ci': self.ci
})
if self.cs != "": if self.cs != "":
data.update({ data.update({
'cs': self.cs 'cs': self.cs
...@@ -464,8 +470,10 @@ class PxCaptchaBypass(): ...@@ -464,8 +470,10 @@ class PxCaptchaBypass():
# self.str1, self.uuid,self.startTs, self.startTs2, self.performanceNow, self.px12280) # self.str1, self.uuid,self.startTs, self.startTs2, self.performanceNow, self.px12280)
p = PxEnv(self.target_url, self.sid, self.vid, self.ts, self.num1, self.num2, p = PxEnv(self.target_url, self.sid, self.vid, self.ts, self.num1, self.num2,
self.str1, self.uuid, self.str1, self.uuid,
self.startTs, self.startTs2, self.performanceNow, self.px12280) self.startTs, self.startTs2, self.performanceNow, self.px12280,
data = [p.get_px12123(), p.get_px11891(), p.get_px11547()] self.ci, self.token, self.token2,
self.hash, self.hash2, self.hashv)
data = [p.get_px12123(), p.get_px11891(), p.get_px11547(), p.get_px561(), p.get_px11547()]
self.do_collector(data) self.do_collector(data)
def parse_resp(self, resp): def parse_resp(self, resp):
...@@ -475,6 +483,18 @@ class PxCaptchaBypass(): ...@@ -475,6 +483,18 @@ class PxCaptchaBypass():
self.log.info(json.dumps(cks, indent=True)) self.log.info(json.dumps(cks, indent=True))
for i in cks: for i in cks:
tmp = i.split('|') tmp = i.split('|')
if tmp[0] == 'o1oo11':
# "o1oo11|1|22b0f3c54180124fd02b1bcce129b9992f252bc858988104f0632a9640099
# |5393fe46579bdd80d081f53b9bb41917d06401059d4db662cafd3aa36748aa2b
# |12|false"
self.hash = tmp[2]
self.hash2 = tmp[3]
self.hashv = tmp[4]
if tmp[0] == '11oo1o':
self.ci = tmp[2]
self.token = tmp[4].split('_')[0]
self.token2 = tmp[4].split('_')[1]
if tmp[0] == 'o111ooo1': if tmp[0] == 'o111ooo1':
self.ts = tmp[1] self.ts = tmp[1]
if tmp[0] == 'o111oooo': if tmp[0] == 'o111oooo':
......
This diff is collapsed.
import math
import random
import numpy as np
from typing import Union, Optional, Dict, List
import bezier
import math
import random
from typing import Tuple, List, Optional
class Vector:
def __init__(self, x: float, y: float):
self.x = x
self.y = y
def __repr__(self):
return "x: {}, y: {}".format(self.x, self.y)
origin = Vector(0, 0)
def sub(a: Vector, b: Vector) -> Vector:
return Vector(a.x - b.x, a.y - b.y)
def div(a: Vector, b: float) -> Vector:
return Vector(a.x / b, a.y / b)
def mult(a: Vector, b: float) -> Vector:
return Vector(a.x * b, a.y * b)
def add(a: Vector, b: Vector) -> Vector:
return Vector(a.x + b.x, a.y + b.y)
def direction(a: Vector, b: Vector) -> Vector:
return sub(b, a)
def perpendicular(a: Vector) -> Vector:
return Vector(a.y, -1 * a.x)
def magnitude(a: Vector) -> Vector:
return math.sqrt(a.x**2 + a.y**2)
def unit(a: Vector) -> Vector:
return div(a, magnitude(a))
def setMagnitude(a: Vector, amount: float) -> Vector:
return mult(unit(a), amount)
def randomVectorOnLine(a: Vector, b: Vector) -> Vector:
vec = direction(a, b)
multiplier = random.random()
return add(a, mult(vec, multiplier))
def randomNormalLine(a: Vector, b: Vector, range_: float) -> Tuple[Vector, Vector]:
randMid = randomVectorOnLine(a, b)
normalV = setMagnitude(perpendicular(direction(a, randMid)), range_)
return randMid, normalV
def generateBezierAnchors(a: Vector, b: Vector, spread: float) -> List[Vector]:
side = 1 if round(random.random()) == 1 else -1
def calc() -> Vector:
randMid, normalV = randomNormalLine(a, b, spread)
choice = mult(normalV, side)
return randomVectorOnLine(randMid, add(randMid, choice))
return sorted([calc(), calc()], key=lambda vec: vec.x)
def clamp(target: float, min_: float, max_: float) -> float:
return min(max_, max(min_, target))
def overshoot(coordinate: Vector, radius: float) -> Vector:
a = random.random() * 2 * math.pi
rad = radius * math.sqrt(random.random())
vector = Vector(rad * math.cos(a), rad * math.sin(a))
return add(coordinate, vector)
def bezierCurve(
start: Vector, finish: Vector, overrideSpread: Optional[float]
) -> bezier.curve.Curve:
min_ = 2
max_ = 200
vec = direction(start, finish)
length = magnitude(vec)
spread = clamp(length, min_, max_)
anchors = generateBezierAnchors(
start, finish, overrideSpread if overrideSpread is not None else spread
)
all_vectors = [start] + anchors + [finish]
nodes = [
[el.x for el in all_vectors],
[el.y for el in all_vectors],
]
return bezier.curve.Curve.from_nodes(nodes)
def fitts(distance: float, width: float) -> float:
a = 0
b = 2
id_ = math.log2(distance / width + 1)
return a + b * id_
def path(
start: Vector, end: Union[Dict, Vector], spreadOverride: Optional[float] = None
) -> List[Vector]:
defaultWidth = 100
minSteps = 25
if isinstance(end, dict):
width = end["width"]
end = Vector(end["x"], end["y"])
else:
width = defaultWidth
curve = bezierCurve(start, end, spreadOverride)
length = curve.length * 0.8
baseTime = random.random() * minSteps
steps = int(
math.ceil((math.log2(fitts(length, width) + 1) + baseTime) * 3)
* (8 + random.random())
)
s_vals = np.linspace(0.0, 1.0, steps)
points = curve.evaluate_multi(s_vals)
vectors = []
for i in range(steps):
vectors.append(Vector(points[0][i], points[1][i]))
return clampPositive(vectors)
def clampPositive(vectors: List[Vector]) -> List[Vector]:
clamp0 = lambda elem: max(0, elem)
return [Vector(clamp0(el.x), clamp0(el.y)) for el in vectors]
overshootThreshold = 500
def should_overshoot(a: Vector, b: Vector) -> bool:
return magnitude(direction(a, b)) > overshootThreshold
def get_path(start: Dict, end: Dict) -> List[Dict]:
vectors = path(Vector(**start), Vector(**end))
return [el.__dict__ for el in vectors]
def get_random_box_point(
box: Dict, padding_percentage: Optional[float] = None
) -> Vector:
"""Get a random point on a box"""
paddingWidth = paddingHeight = 0
if (
padding_percentage is not None
and padding_percentage > 0
and padding_percentage < 100
):
paddingWidth = box["width"] * padding_percentage / 100
paddingHeight = box["height"] * padding_percentage / 100
return Vector(
box["x"] + (paddingWidth / 2) + random.random() * (box["width"] - paddingWidth),
box["y"]
+ (paddingHeight / 2)
+ random.random() * (box["height"] - paddingHeight),
)
# start = {
# "x": 220,
# "y": 402,
# }
# end = {
# "x": 902,
# "y": 1032,
# }
def getRandomPath(num=100):
while True:
startX = random.randint(100, 1200)
startY = random.randint(100, 1000)
endX = random.randint(100, 1200)
endY = random.randint(100, 1000)
route = get_path({"x": startX, "y": startY}, {"x": endX, "y": endY})
if len(route) < num:
continue
return route[:num]
if __name__ == "__main__":
print(getRandomPath())
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment