победить recaptcha

Discussion in 'PHP' started by WR778129, 31 Jul 2014.

  1. WR778129

    WR778129 Member

    Joined:
    25 Jan 2013
    Messages:
    88
    Likes Received:
    39
    Reputations:
    0
    https://www.google.com/recaptcha/intro/index.html
    Не разобрался как генерируется сылка на изображение с капчей. Кто победил уже?
     
  2. look2009

    look2009 Member

    Joined:
    3 Jun 2009
    Messages:
    80
    Likes Received:
    63
    Reputations:
    5
    Code:
    curl_setopt($sh,CURLOPT_URL, 'http://www.google.com/recaptcha/api/challenge?k='.$captha);
    curl_setopt($sh,CURLOPT_FOLLOWLOCATION,true);
    curl_setopt($sh,CURLOPT_RETURNTRANSFER,true);
    curl_setopt($sh, CURLOPT_REFERER, "xxxxxxxxxx");
    curl_setopt($sh,CURLOPT_HEADER,true);
    curl_setopt($sh,CURLOPT_HTTPHEADER,$header);
    $response = curl_exec($sh);
    $challenge=explode("challenge : '",$response);
    $challenge=explode("',",$challenge[1]);
    $captcha_i=$challenge[0];
    $captcha_img='https://www.google.com/recaptcha/api/image?c='.$captcha_i;
    curl_setopt($sh,CURLOPT_URL, $captcha_img);
    curl_setopt($sh,CURLOPT_FOLLOWLOCATION,true);
    curl_setopt($sh,CURLOPT_RETURNTRANSFER,true);
    curl_setopt($sh, CURLOPT_REFERER, "xxxxxxxxxx");
    curl_setopt($sh,CURLOPT_HEADER,false);
    curl_setopt($sh,CURLOPT_HTTPHEADER,$header);
    $response = curl_exec($sh);
    
    $captha идёт в теле документа который ты загружаешь.
    Referer ставишь свой который нужен
     
  3. begunok79

    begunok79 New Member

    Joined:
    19 Nov 2012
    Messages:
    0
    Likes Received:
    0
    Reputations:
    0
    Помогите победить параметр th!
    Алгоритм такой:
    Есть код сайта, идем по адресу
    http://www.google.com/recaptcha/api/challenge?k=кодсайта
    Получаем в ответе challenge параметр,
    Далее нужно перейти по https://www.google.com/recaptcha/api/reload?c=challenge_полученный_выше&type=image&lang=ru&th=тут_много_буков_и_цифер для получения Recaptcha.finish_reload

    Но вот тут полный ступор. параметр th формируется на стороне браузера скриптом https://www.google.com/js/th/кодсайта.js
    Скрипт закодирован. После Декодера выглядит вот так:

    Code:
    var f = function (a, b, c)
    {
        if (b = typeof a, "object" == b)
        {
            if (a) 
            {
                if (a instanceof Array) {
                    return "array";
                }
                if (a instanceof Object) {
                    return b;
                }
                if (c = Object.prototype.toString.call(a), "[object Window]" == c) {
                    return "object";
                }
                if ("[object Array]" == c || "number" == typeof a.length && "undefined" != typeof a.splice && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("splice")) {
                    return "array";
                }
                if ("[object Function]" == c || "undefined" != typeof a.call && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("call")) {
                    return "function" ;
                }
            }
            else {
                return "null";
            }
            else if ("function" == b && "undefined" == typeof a.call)
            {
                return "object";
            }
            return b;
        }
    },
    n = function (a, b, c, d, e)
    {
        c = a.split("."), d = g, c[0]in d || !d.execScript || d.execScript("var " + c[0]);
        for (; c.length && (e = c.shift()); ) {
            c.length || b === k ? d = d[e] ? d[e] : d[e] = {} : d[e] = b;
        }
    },
    s = function (a, b, c)
    {
        return 2 >= arguments.length ? q.slice.call(a, b) : q.slice.call(a, b, c);
    },
    q = Array.prototype, k = void 0, g = this, t, z = (new function () {}, function (a, b, c, d, e, h)
    {
        try
        {
            if (this.c = [], v(this, this.b, 0), v(this, this.k, 0), v(this, this.r, 0), v(this, this.h, []), 
            v(this, this.d, []), v(this, this.I, "object" == typeof window ? window : g), v(this, this.J, 
            this), v(this, this.m, 0), v(this, this.p, 0), v(this, this.H, 0), v(this, this.f, w(4)), v(this, 
            this.q, []), v(this, this.l, {}), v(this, this.j, 2048), this.s = true, a && "," == a[0]) this.n = a;
            else
            {
                if (window.atob)
                {
                    for (c = window.atob(a), a = [], e = d = 0; e < c.length; e++) {
                        for (h = c.charCodeAt(e); 255 < h; ) {
                            a[d++] = h & 255, h >>= 8;
                        }
                        a[d++] = h
                    }
                    b = a
                }
                else {
                    b = null;
                }
                (this.e = b) && this.e.length ? (this.L = [], this.t()) : this.g(this.U);
            }
        }
        catch (l) {
            y(this, l)
        }
    }), B = (z.prototype.g = function (a, b, c, d)
    {
        d = this.a(this.k), a = [a, d >> 8 & 255, d & 255], c != k && a.push(c), 0 == this.a(this.h).length && (this.c[this.h] = k, 
        v(this, this.h, a)), c = "", b && (b.message && (c += b.message), b.stack && (c += ":" + b.stack)), 
        b = this.a(this.j), 3 < b && (c = c.slice(0, b - 3), b -= c.length + 3, c = A(c), B(this, this.f, 
        C(c.length, 2).concat(c), this.ba)), v(this, this.j, b);
    },
    function (a, b, c, d, e, h)
    {
        for (e = a.a(b), b = b == a.f ? function (b, c, d, h)
        {
            if (c = e.length, d = c - 4 >> 3, e.da != d)
            {
                e.da = d, d = (d << 3) - 4, h = [0, 0, 0, a.a(a.H)];
                try {
                    e.ca = D(E(e, d), E(e, d + 4), h)
                }
                catch (r) {
                    throw r;
                }
            }
            e.push(e.ca[c & 7]^b)
        }
         : function (a)
        {
            e.push(a)
        },
        d && b(d & 255), d = c.length, h = 0;
        h < d;
        h++) b(c[h])
    }), F = function (a, b, c, d, e, h, l, p, m)
    {
        return c = function (a, r, u)
        {
            for (a = d[e.G], r = a === b, a = a && a[e.G], u = 0; a && a != h && a != l && a != p && a != m && 20 > u; ) {
                u++, a = a[e.G];
            }
            return c[e.ga + r +!(!a + (u >> 2))];
        },
        d = function ()
        {
            return c();
        },
        e = z.prototype, h = e.t, l = e.Q, m = e.g, p = z, d[e.K] = e, c[e.fa] = a, a = k, d;
    },
    G = function (a, b)
    {
        return b <= a.$ ? b == a.h || b == a.d || b == a.f || b == a.q ? a.o : b == a.N || b == a.I || b == a.J || b == a.l ? a.v : b == a.w ? a.i : b == a.j || b == a.p || b == a.b || b == a.k || b == a.u ? 2 : b == a.m ? 1 : 4 : [1, 
        2, 4, a.o, a.v, a.i][b % a.aa]
    },
    H = function (a, b, c)
    {
        if (b = a.a(a.b), !(b in a.e)) {
            throw a.g(a.Y), a.B;
        }
        return a.A == k && (a.A = E(a.e, b - 4), a.D = k), a.D != b >> 3 && (a.D = b >> 3, c = [0, 0, 0, a.a(a.r)], 
        a.Z = D(a.A, a.D, c)), v(a, a.b, b + 1), a.e[b]^a.Z[b % 8];
    },
    A = function (a, b, c, d, e)
    {
        for (a = a.replace(/\r\n/g, "\n"), b = [], d = c = 0; d < a.length; d++)
        {
            e = a.charCodeAt(d), 128 > e ? b[c++] = e : (2048 > e ? b[c++] = e >> 6 | 192 : (b[c++] = e >> 12 | 224, 
            b[c++] = e >> 6 & 63 | 128), b[c++] = e & 63 | 128);
        }
        return b;
    },
    v = function (a, b, c)
    {
        if (b == a.b || b == a.k) {
            a.c[b] ? a.c[b].V(c) : a.c[b] = I(c);
        }
        else if (b != a.d && b != a.f && b != a.h || !a.c[b]) {
            a.c[b] = F(c, a.a);
        }
        b == a.r && (a.A = k, v(a, a.b, a.a(a.b) + 4));
    },
    D = function (a, b, c, d)
    {
        try
        {
            for (d = 0; 76138654016 != d; ) {
                a += (b << 4^b >>> 5) + b^d + c[d & 3], d += 2379332938, b += (a << 4^a >>> 5) + a^d + c[d >>> 11 & 3];
            }
            return [a >>> 24, a >> 16 & 255, a >> 8 & 255, a & 255, b >>> 24, b >> 16 & 255, b >> 8 & 255, 
            b & 255]
        }
        catch (e) {
            throw e;
        }
    },
    J = (z.prototype.la = function (a, b)
    {
        b.push(a[0] << 24 | a[1] << 16 | a[2] << 8 | a[3]), b.push(a[4] << 24 | a[5] << 16 | a[6] << 8 | a[7]), 
        b.push(a[8] << 24 | a[9] << 16 | a[10] << 8 | a[11])
    },
    function (a, b, c, d)
    {
        for (b = {}, b.O = a.a(H(a)), b.P = H(a), c = H(a) - 1, d = H(a), b.self = a.a(d), b.F = []; c--; ) d = H(a), 
        b.F.push(a.a(d));
        return b;
    }), L = (z.prototype.ja = function (a, b, c, d)
    {
        if (3 == a.length)
        {
            for (c = 0; 3 > c; c++) {
                b[c] += a[c];
            }
            for (d = [13, 8, 13, 12, 16, 5, 3, 10, 15], c = 0; 9 > c; c++) {
                b[3](b, c % 3, d[c]);
            }
        }
    },
    function (a, b, c, d)
    {
        return c = a.a(a.b), a.e && c < a.e.length ? (v(a, a.b, a.e.length), K(a, b)) : v(a, a.b, b), d = a.t(), 
        v(a, a.b, c), d;
    }), M = function (a, b, c, d)
    {
        if (8192 > a.length) {
            return String.fromCharCode.apply(null, a);
        }
        for (b = "", c = 0; c < a.length; c += 8192) {
            d = s(a, c, c + 8192), b += String.fromCharCode.apply(null, d);
        }
        return b;
    },
    C = (z.prototype.ka = function (a, b, c, d)
    {
        d = a[(b + 2) % 3], a[b] = a[b] - a[(b + 1) % 3] - d^(1 == b ? d << c : d >>> c);
    },
    function (a, b, c, d)
    {
        for (d = b - 1, c = []; 0 <= d; d--) {
            c[b - 1 - d] = a >> 8 * d & 255;
        }
        return c;
    }), I = function (a, b, c)
    {
        return b = function ()
        {
            return c();
        },
        b.V = function (b)
        {
            a = b;
        },
        c = function ()
        {
            return a;
        },
        b
    },
    N = function (a, b, c, d)
    {
        return function ()
        {
            if (!d || a.s) {
                return v(a, a.N, arguments), v(a, a.l, c), L(a, b);
            }
        }
    },
    K = (z.prototype.a = function (a, b)
    {
        if (b = this.c[a], b === k) {
            throw this.g(this.ea, 0, a), this.B;
        }
        return b();
    },
    function (a, b)
    {
        a.L.push(a.c.slice()), a.c[a.b] = k, v(a, a.b, b);
    }), E = function (a, b)
    {
        return a[b] << 24 | a[b + 1] << 16 | a[b + 2] << 8 | a[b + 3];
    },
    w = function (a, b)
    {
        for (b = Array(a); a--; ) {
            b[a] = 255 * Math.random() | 0;
        }
        return b;
    },
    y = function (a, b)
    {
        a.n = ("E:" + b.message + ":" + b.stack).slice(0, 2048)
    };
    t = z.prototype, t.M = [function () {}, function (a, b, c, d, e)
    {
        b = H(a), c = H(a), d = a.a(b), b = G(a, b), e = G(a, c), e == a.i || e == a.o ? d = "" + d : 0 < b && (1 == b ? d &= 255 : 2 == b ? d &= 65535 : 4 == b && (d &= 4294967295)), 
        v(a, c, d);
    },
    function (a, b, c, d, e, h, l, p, m)
    {
        if (b = H(a), c = G(a, b), 0 < c) {
            for (d = 0; c--; ) {
                d = d << 8 | H(a);
            }
            v(a, b, d)
        }
        else if (c != a.v)
        {
            if (d = H(a) << 8 | H(a), c == a.i)
            {
                if (c = "", a.c[a.w] != k) {
                    for (e = a.a(a.w); d--; ) {
                        h = e[H(a) << 8 | H(a)], c += h;
                    }
                }
                else 
                {
                    for (c = Array(d), e = 0; e < d; e++) {
                        c[e] = H(a);
                    }
                    for (d = c, c = [], h = e = 0; e < d.length; )
                    {
                        l = d[e++], 128 > l ? c[h++] = String.fromCharCode(l) : 191 < l && 224 > l ? (p = d[e++], 
                        c[h++] = String.fromCharCode((l & 31) << 6 | p & 63)) : (p = d[e++], m = d[e++], c[h++] = String.fromCharCode((l & 15) << 12 | (p & 63) << 6 | m & 63));
                    }
                    c = c.join("") 
                }
                else {
                    for (c = Array(d), e = 0; e < d; e++) {
                        c[e] = H(a);
                    }
                }
                v(a, b, c);
            }
        }
    },
    function (a)
    {
        H(a)
    },
    function (a, b, c, d)
    {
        b = H(a), c = H(a), d = H(a), c = a.a(c), b = a.a(b), v(a, d, b[c]);
    },
    function (a, b, c)
    {
        b = H(a), c = H(a), b = a.a(b), v(a, c, f(b));
    },
    function (a, b, c, d, e)
    {
        b = H(a), c = H(a), d = G(a, b), e = G(a, c), c != a.h && (d == a.i && e == a.i ? (a.c[c] == k && v(a, 
        c, ""), v(a, c, a.a(c) + a.a(b))) : e == a.o && (0 > d ? (b = a.a(b), d == a.i && (b = A("" + b)), 
        c != a.d && c != a.f && c != a.q || B(a, c, C(b.length, 2)), B(a, c, b)) : 0 < d && B(a, c, C(a.a(b), 
        d))));
    },
    function (a, b, c)
    {
        b = H(a), c = H(a), v(a, c, function (a)
        {
            return eval(a)
        }
        (a.a(b)))
    },
    function (a, b, c)
    {
        b = H(a), c = H(a), v(a, c, a.a(c) - a.a(b));
    },
    function (a, b)
    {
        b = J(a), v(a, b.P, b.O.apply(b.self, b.F));
    },
    function (a, b, c)
    {
        b = H(a), c = H(a), v(a, c, a.a(c) % a.a(b));
    },
    function (a, b, c, d, e)
    {
        b = H(a), c = a.a(H(a)), d = a.a(H(a)), e = a.a(H(a)), a.a(b).addEventListener(c, N(a, d, e, true), 
        false);
    },
    function (a, b, c, d)
    {
        b = H(a), c = H(a), d = H(a), a.a(b)[a.a(c)] = a.a(d);
    },
    function () {}, function (a, b, c)
    {
        b = H(a), c = H(a), v(a, c, a.a(c) + a.a(b));
    },
    function (a, b, c)
    {
        b = H(a), c = H(a), 0 != a.a(b) && v(a, a.b, a.a(c));
    },
    function (a, b, c, d)
    {
        b = H(a), c = H(a), d = H(a), a.a(b) == a.a(c) && v(a, d, a.a(d) + 1);
    },
    function (a, b, c, d)
    {
        b = H(a), c = H(a), d = H(a), a.a(b) > a.a(c) && v(a, d, a.a(d) + 1);
    },
    function (a, b, c, d)
    {
        b = H(a), c = H(a), d = H(a), v(a, d, a.a(b) << c);
    },
    function (a, b, c, d)
    {
        b = H(a), c = H(a), d = H(a), v(a, d, a.a(b) | a.a(c));
    },
    function (a, b)
    {
        b = a.a(H(a)), K(a, b);
    },
    function (a, b, c, d)
    {
        if (b = a.L.pop()) {
            for (c = H(a); 0 < c; c--) {
                d = H(a), b[d] = a.c[d];
            }
            a.c = b
        }
        else {
            v(a, a.b, a.e.length);
        }
    },
    function (a, b, c, d)
    {
        b = H(a), c = H(a), d = H(a), v(a, d, (a.a(b) in a.a(c)) + 0);
    },
    function (a, b, c, d)
    {
        b = H(a), c = a.a(H(a)), d = a.a(H(a)), v(a, b, N(a, c, d));
    },
    function (a, b, c)
    {
        b = H(a), c = H(a), v(a, c, a.a(c) * a.a(b));
    },
    function (a, b, c, d)
    {
        b = H(a), c = H(a), d = H(a), v(a, d, a.a(b) >> c);
    },
    function (a, b, c, d)
    {
        b = H(a), c = H(a), d = H(a), v(a, d, a.a(b) || a.a(c));
    },
    function (a, b, c, d, e)
    {
        b = J(a), c = b.F, d = b.self, e = b.O;
        switch (c.length)
        {
            case 0:
                c = new d[e];
                break;
            case 1:
                c = new d[e](c[0]);
                break;
            case 2:
                c = new d[e](c[0], c[1]);
                break;
            case 3:
                c = new d[e](c[0], c[1], c[2]);
                break;
            case 4:
                c = new d[e](c[0], c[1], c[2], c[3]);
                break;
            default:
                a.g(a.C);
                return
        }
        v(a, b.P, c)
    },
    function (a, b, c, d, e, h)
    {
        if (b = H(a), c = H(a), d = H(a), e = H(a), b = a.a(b), c = a.a(c), d = a.a(d), a = a.a(e), "object" == f(b)) {
            for (h in e = [], b) {
                e.push(h);
            }
            b = e
        }
        for (h = b.length, e = 0; e < h; e += d) {
            c(b.slice(e, e + d), a);
        }
    }], t.b = 0, t.r = 1, t.h = 2, t.k = 3, t.d = 4, t.w = 5, t.N = 6, t.j = 7, t.u = 8, t.I = 9, t.J = 10, 
    t.m = 11, t.p = 12, t.H = 13, t.f = 14, t.q = 15, t.l = 16, t.$ = 17, t.R = 253, t.ba = 254, t.S = 248, 
    t.T = 216, t.aa = 6, t.i =- 1, t.o =- 2, t.v =- 3, t.U = 17, t.W = 21, t.C = 22, t.ea = 30, t.Y = 31, 
    t.X = 33, t.B = {}, t.G = "caller", t.K = "toString", t.ga = 34, t.fa = 36, z.prototype.ia = function (a)
    {
        return (a = window.performance) && a.now ? function () {
            return a.now() | 0
        }
         : function ()
        {
            return + new Date;
        }
    }(),
    z.prototype.Q = function (a, b, c, d, e, h, l, p, m, x, r)
    {
        if (this.n) {
            return this.n;
        }
        try
        {
            if (this.s = false, b = this.a(this.d).length, c = this.a(this.f).length, d = this.a(this.j), 
            this.c[this.u] && L(this, this.a(this.u)), e = this.a(this.h), 0 < e.length && B(this, this.d, 
            C(e.length, 2).concat(e), this.R), h = this.a(this.p) & 255, h -= this.a(this.d).length + 4, l = this.a(this.f), 
            4 < l.length && (h -= l.length + 3), 0 < h && B(this, this.d, C(h, 2).concat(w(h)), this.S), 4 < l.length && B(this, 
            this.d, C(l.length, 2).concat(l), this.T), p = [241].concat(this.a(this.d)), window.btoa ? (x = window.btoa(M(p)), 
            m = x = x.replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "")) : m = k, m) m = "," + m;
            else for (m = "", e = 0;
            e < p.length;
            e++) r = p[e][this.K](16), 1 == r.length && (r = "0" + r), m += r;
            this.a(this.d).length = b, this.a(this.f).length = c, v(this, this.j, d), this.s = true, a = m
        }
        catch (u) {
            y(this, u), a = this.n
        }
        return a;
    },
    z.prototype.t = function (a, b, c, d, e, h)
    {
        try
        {
            for (a = this.e.length, b = 5001, c = k, d = 0; --b && (d = this.a(this.b)) < a; )
            {
                try 
                {
                    v(this, this.k, d), e = H(this) % this.M.length, (c = this.M[e]) ? c(this) : this.g(this.W, 
                    0, e) 
                }
                catch (l) {
                    l != this.B && ((h = this.a(this.m)) ? (v(this, h, l), v(this, this.m, 0)) : this.g(this.C, 
                    l)) ;
                }
            }
            b || this.g(this.X)
        }
        catch (p) {
            try {
                this.g(this.C, p)
            }
            catch (m) {
                y(this, m)
            }
        }
        return this.a(this.l);
    },
    z.prototype.ha = function (a, b)
    {
        return b = this.Q(), a && a(b), b;
    };
    try {
        window.addEventListener("unload", function () {}, false)
    }
    catch (O) {}
    n("thintinel.th", z), n("thintinel.th.prototype.exec", z.prototype.ha);
    Помогите сформировать th параметр!
    p.s. Целевой отвергает Recaptcha.finish_reload код, полученный без параметра th, но с радостью хавает код скопированный из Firebugа с этим параметром.
    p.s.2 все заголовки заданы, печеньки всем раздаются.
    p.s.3 С js плохо дружу, готов поделится денежкой с тем, кто все это разгребет (ну или готовым скриптом - победителем рекапчи).
     
    #3 begunok79, 24 Sep 2014
    Last edited: 24 Sep 2014
  4. begunok79

    begunok79 New Member

    Joined:
    19 Nov 2012
    Messages:
    0
    Likes Received:
    0
    Reputations:
    0
    Пример параметра:
    th=,8bDzBfzFToBRgrYdn1pf8j6DfPAAAABXoAAAABbYANj9R2FCYF8DJ7eBtLy3s4rmpuPVTxc59-stZ1jwnK8djEp74yJXLpMAIn_FKgbz7rYJL-W9LIqm7WaW1AYSkk5D_cYNL58q__mAviHYyyf4m2DSZviJ_hIUOklEbrPT-FzUwZ_7WHfBlzwsyF-MEljYltb-uoX8yY2NGyZQ8TY8lZfVd0ZBzDS36D5pZ3jCUvGfhgyr7FYqsc59doPxKoM7Ah0xGiIVPZv5wXemy6T8c70LtXDNLPlfcJcIEIg8CnlqSHsiz6uNdxDg8sn8rnEkgMUegy9ADLI

    Нужен алгоритм его формирования.
     
    #4 begunok79, 24 Sep 2014
    Last edited: 24 Sep 2014
  5. barnaki

    barnaki Elder - Старейшина

    Joined:
    2 Nov 2008
    Messages:
    676
    Likes Received:
    139
    Reputations:
    4
    когда то можно просто сохранить ее в файл передав ее id и refferrer . и потом послать на antigate .