ultrafunkamsterdam / undetected-chromedriver

Custom Selenium Chromedriver | Zero-Config | Passes ALL bot mitigation systems (like Distil / Imperva/ Datadadome / CloudFlare IUAM)
https://github.com/UltrafunkAmsterdam/undetected-chromedriver
GNU General Public License v3.0
9.86k stars 1.16k forks source link

FalixNodes successfully detected UC-Driver #1321

Open xAffan opened 1 year ago

xAffan commented 1 year ago

Discussed in https://github.com/ultrafunkamsterdam/undetected-chromedriver/discussions/1320

Originally posted by **xAffan** June 8, 2023 The website will redirect if it detects that something is wrong. Code to reproduce the issue. ```py import time import undetected_chromedriver as uc driver = uc.Chrome() with driver: driver.get('https://falix.gg/?id=12345678') while True: #The website does not redirect to about:blank if the browser is undetected if driver.current_url == "about:blank": print('Browser detected!') break else: time.sleep(2) ``` Visit the same url normally = no such issue.
xAffan commented 1 year ago

I would like to add that the website detects dev tools and redirects you. I think detecting dev tools correlates to detecting UC - Driver.

ultrafunkamsterdam commented 1 year ago
driver = uc.Chrome()
with driver:
    driver.get('https://falix.gg/?id=12345678')
xAffan commented 1 year ago
driver = uc.Chrome()
with driver:
    driver.get('https://falix.gg/?id=12345678')

Updated the code to work using with. However, the issue still persists. Check the code above.

ultrafunkamsterdam commented 1 year ago

I've got the same issue when using genuine Chrome , but having devtools open. However it takes some more seconds

xAffan commented 1 year ago

I've got the same issue when using genuine Chrome , but having devtools open. However it takes some more seconds

Yes, I pointed that out in my second reply. This means detecting devtools means confirmed detection of uc driver. However, that certain website is usable on normal browser (if you have devtools closed). It is not usable AT ALL on uc driver. I hope there can be something that could be done in this regard.

I also looked at their JS but its too obfuscated for me to understand.

ultrafunkamsterdam commented 1 year ago

Oh no, just search for about:blank and you find several lines. Just block the whole request url and you;'re good to go.

Why even use such a bogus query param (12345678) ? without it, it works fine.

xAffan commented 1 year ago

Oh no, just search for about:blank and you find several lines. Just block the whole request url and you;'re good to go.

Why even use such a bogus query param (12345678) ? without it, it works fine.

The bogus query param is needed to actually emulate the detection. Without using the param, the website will go to some other place. I did try blocking that certain JS, however it broke other things (can't click add) on the website, it seems like a somewhat similar implementation to cf turnstile (doing client side JS verification stuff).

ultrafunkamsterdam commented 1 year ago

I like custom implmentations. sure it's breakable. Besides having 3.5.0 launch, i will also try and break this one.

ultrafunkamsterdam commented 1 year ago
function(t, e, n) {
    "use strict";
    n.d(e, "a", (function() {
        return d
    }
    )),
    n.d(e, "b", (function() {
        return g
    }
    )),
    n.d(e, "d", (function() {
        return _
    }
    )),
    n.d(e, "c", (function() {
        return I
    }
    )),
    n.d(e, "e", (function() {
        return k
    }
    ));
    var r = n(2)
      , o = n(5)
      , i = n(0)
      , a = n(4)
      , c = n(10)
      , s = n(3)
      , u = n(1)
      , l = ["getLog", "getState"];
    function d(t, e, n) {
        try {
            switch (Object(i.h)(l, t) && (Object(u.b)(new Error("Debug call made: ".concat(t)), "debugPublicApi-call-".concat(t)),
            l = l.filter((function(e) {
                return e !== t
            }
            ))),
            t) {
            case "getLog":
                return r.a.getState().eventLog;
            case "getState":
                return r.a.getState();
            case "enable":
                return D("fake_bids", !0),
                "DEBUG MODE ENABLED";
            case "disable":
                return D("fake_bids", !1),
                "DEBUG MODE DISABLED";
            case "enableConsole":
                return g(!1, "command"),
                "Debug console enabled";
            case "enableConsoleV2":
                return g(!0, "command"),
                "Debug console v2 enabled";
            case "disableConsole":
                try {
                    D("console", !1),
                    D("console_v2", !1),
                    null !== f && document.body.removeChild(f),
                    y = !1,
                    Object(o.b)() && o.a.getDefault().localStorage.removeItem(a.f)
                } catch (e) {
                    Object(u.b)(e, "disableDebugConsole", {
                        makeVisibleToAllUsers: !0
                    })
                }
                return "Debug console disabled";
            case "setDebug":
                return (D(e, n) ? "Set debug mode '" : "Failed to set debug mode '").concat(e, "' to '").concat(n, "'");
            default:
                return "unknown debug argument"
            }
        } catch (e) {
            return Object(u.b)(e, "debugPublicApi", {
                makeVisibleToAllUsers: !0
            }),
            "error"
        }
    }
    var f, b, p, m, y = !1;
    function g() {
        var t, e = 0 < arguments.length && void 0 !== arguments[0] && arguments[0], n = 1 < arguments.length ? arguments[1] : void 0;
        try {
            D(e ? "console_v2" : "console", !0),
            y || (t = {
                url: e ? r.a.getState().cfg.DEBUG_APP_HTML_V2 : r.a.getState().cfg.DEBUG_APP_HTML,
                onload: h,
                onerror: function() {
                    return Object(u.b)(new Error("Error Loading Debug Console"), "enableDebugConsole-".concat(e ? "v2" : "v1", "-onerror"), {
                        makeVisibleToAllUsers: !0
                    })
                }
            },
            Object(c.d)(t),
            setTimeout((function() {
                try {
                    var t = {
                        _type: "debugLoad",
                        mode: e ? 2 : 1
                    };
                    Object(i.k)(r.a.getState().config, "pubID") && (t.src = r.a.getState().config.pubID),
                    null !== n && (t.method = n),
                    Object(s.b)(t)
                } catch (t) {
                    Object(u.b)(t, "enableDebugConsole-setTimeout", {
                        makeVisibleToAllUsers: !0
                    })
                }
            }
            ), 5e3))
        } catch (t) {
            Object(u.b)(t, "enableDebugConsole", {
                makeVisibleToAllUsers: !0
            })
        }
    }
    function h(t) {
        try {
            var e = t.responseText
              , n = (f = document.createElement("div"),
            b = document.createElement("div"),
            p = document.createElement("iframe"),
            200);
            _("console_v2") && (n = 330),
            Object(o.b)() && null !== o.a.getDefault().localStorage.getItem(a.f) && (n = parseInt(o.a.getDefault().localStorage.getItem(a.f), 10)),
            (isNaN(n) || n > window.innerHeight) && (n = 200),
            f.style.background = "#eaeded",
            f.style.zIndex = "2147483647",
            f.style.bottom = "0",
            f.style.position = "fixed !important",
            f.style.display = "block !important",
            f.style.left = "0",
            f.style.right = "0",
            f.style.height = "".concat(n, "px"),
            b.style.cursor = "row-resize",
            b.style.height = "2px",
            b.style.position = "absolute",
            b.style.top = "0",
            b.style.left = "0",
            b.style.right = "0",
            b.style.backgroundColor = "RGBA(0,0,0,0)",
            f.appendChild(b),
            p.frameBorder = "0",
            p.marginHeight = "0",
            p.marginWidth = "0",
            p.scrolling = "no",
            p.id = "apstag-debug-iframe",
            p.src = "about:blank",
            p.style.display = "block",
            p.style.width = "100%",
            p.style.height = "".concat(n, "px"),
            f.appendChild(p),
            document.body.appendChild(f),
            null !== p.contentDocument && (p.contentDocument.open(),
            p.contentDocument.write(e),
            p.contentDocument.close()),
            b.addEventListener("mousedown", j)
        } catch (t) {
            Object(u.b)(t, "renderDebugConsole", {
                makeVisibleToAllUsers: !0
            })
        }
    }
    function O(t) {
        try {
            var e = window.innerHeight - t.clientY;
            return e < 200 && (e = 200),
            f.style.height = "".concat(e, "px"),
            p.style.height = "".concat(e, "px"),
            e
        } catch (t) {
            return Object(u.b)(t, "resizeDebugConsole", {
                makeVisibleToAllUsers: !0
            }),
            200
        }
    }
    function v(t) {
        try {
            return t.stopPropagation && t.stopPropagation(),
            t.preventDefault && t.preventDefault(),
            t.cancelBubble = !0,
            t.returnValue = !1
        } catch (t) {
            return Object(u.b)(t, "preventEvent", {
                makeVisibleToAllUsers: !0
            }),
            !1
        }
    }
    function j() {
        try {
            void 0 === m && ((m = document.createElement("div")).style.position = "fixed",
            m.style.left = "0",
            m.style.right = "0",
            m.style.top = "0",
            m.style.bottom = "0",
            m.style.zIndex = "9999999999"),
            f.appendChild(m),
            window.addEventListener("mouseup", w),
            window.addEventListener("mousemove", S)
        } catch (t) {
            Object(u.b)(t, "resizeBarMouseDownListener", {
                makeVisibleToAllUsers: !0
            })
        }
    }
    function S(t) {
        try {
            return O(t),
            v(t)
        } catch (t) {
            return Object(u.b)(t, "resizeBarMouseMoveListener", {
                makeVisibleToAllUsers: !0
            }),
            !1
        }
    }
    function w(t) {
        try {
            null !== m && f.removeChild(m),
            window.removeEventListener("mousemove", S),
            window.removeEventListener("mouseup", w);
            var e = O(t);
            return Object(o.b)() && o.a.getDefault().localStorage.setItem(a.f, "".concat(e)),
            v(t)
        } catch (t) {
            return Object(u.b)(t, "resizeBarMouseUpListener", {
                makeVisibleToAllUsers: !0
            }),
            !1
        }
    }
xAffan commented 1 year ago

https://antifraud.mqrio.dev/agents/js?v=ace65a67be7133cf0a12b061253921bc the certain JS in question. It randomly changes v param when reloading though (cant click add if blocked)

ultrafunkamsterdam commented 1 year ago

Some good news, but not for now.... The v3 driverless version i'm working on works just fine, but yeah... not released yet . -edit- i need to test the correct url of course ... -edit2- it was the correct url. it's just redirecting to clients.failixnodes.net

# api will change of course.. won't do such harm to you guys

from undetected_chromedriver.v3 import Chrome 
driver = await Chrome.create()
await driver.tabs[0].get('https://client.falixnodes.net/timer?id=12345678')
data = await driver.capture_screenshot('png')
with open('data.png', 'w+b') as fs:
    fs.write(base64.b64decode(data))

data

xAffan commented 1 year ago

Some good news, but not for now.... The v3 driverless version i'm working on works just fine, but yeah... not released yet . -edit- i need to test the correct url of course ... -edit2- it was the correct url. it's just redirecting to clients.failixnodes.net

# api will change of course.. won't do such harm to you guys

from undetected_chromedriver.v3 import Chrome 
driver = await Chrome.create()
await driver.tabs[0].get('https://client.falixnodes.net/timer?id=12345678')
data = await driver.capture_screenshot('png')
with open('data.png', 'w+b') as fs:
    fs.write(base64.b64decode(data))

data

gg. the URL is indeed correct. I hope this version v3 gets released soon (or at least early access) because I am in dire need to get around this

NCLnclNCL commented 1 year ago

Some good news, but not for now.... The v3 driverless version i'm working on works just fine, but yeah... not released yet . -edit- i need to test the correct url of course ... -edit2- it was the correct url. it's just redirecting to clients.failixnodes.net

# api will change of course.. won't do such harm to you guys

from undetected_chromedriver.v3 import Chrome 
driver = await Chrome.create()
await driver.tabs[0].get('https://client.falixnodes.net/timer?id=12345678')
data = await driver.capture_screenshot('png')
with open('data.png', 'w+b') as fs:
    fs.write(base64.b64decode(data))

data

i need it

xAffan commented 1 year ago

Some good news, but not for now.... The v3 driverless version i'm working on works just fine, but yeah... not released yet . -edit- i need to test the correct url of course ... -edit2- it was the correct url. it's just redirecting to clients.failixnodes.net

# api will change of course.. won't do such harm to you guys

from undetected_chromedriver.v3 import Chrome 
driver = await Chrome.create()
await driver.tabs[0].get('https://client.falixnodes.net/timer?id=12345678')
data = await driver.capture_screenshot('png')
with open('data.png', 'w+b') as fs:
    fs.write(base64.b64decode(data))

data

i need it

what do you need?