subscribe by email and YouTube to get notification of new posts. & videos.

Categoría: Uncategorized

  • Proxies can be detected

    resume if you ask «can js know if you’re behind a proxy ?»

    google shows

    JavaScript cannot directly access your system’s proxy settings or network configuration due to browser security sandboxing. However, JS can be used to infer that you are behind a proxy through several indirect technical methods

    1. WebRTC IP Leakage

    JavaScript can use the WebRTC API (specifically RTCPeerConnection) to bypass your proxy and discover your «real» local or public IP address. If the IP detected via WebRTC differs from the IP making the HTTP request, the site knows a proxy or VPN is in use. 

    2. Network Latency Analysis (TCP Handshake)

    Sites can compare the time it takes for a JavaScript-initiated request (like a WebSocket message) to reach their server against the initial TCP handshake time. 

    • Normal: Handshake and JS request have similar latencies.
    • Proxy Detect: The TCP handshake happens between the server and the proxy, while the JS request must travel the full distance from your browser, through the proxy, to the server. This discrepancy flags proxy usage. 

    3. Timezone and Geolocation Mismatches

    JS can check your local system time (Intl.DateTimeFormat) and browser language settings. If your system clock is set to London (GMT) but your IP address shows you are in New York (EST), it is a strong indicator of a proxy or location-spoofing tool. 

    4. Detecting HTTP Headers

    While JS itself can’t see the headers of the request it is currently running in, it can make a fetch request to an endpoint (like httpbin.org) that echoes back the headers. Many proxies automatically inject headers like: 

    • X-Forwarded-For
    • Via
    • X-Client-IP 

    5. Advanced Fingerprinting 

    Modern anti-bot scripts (like Cloudflare or Akamai) use JS to collect dozens of data points about your hardware, fonts, and browser behavior. They compare this «fingerprint» against databases of known proxy data centers. If your browser fingerprint matches a profile typically associated with automated scripts or data center IPs, you will be flagged. 

    SO, I will be examining those factors, be aware that some are not true at all

    example: https://stackoverflow.com/questions/19767589/how-to-detect-a-proxy-using-javascript this said can detect a proxy, but it does not

    ANY WAY: THINGS TO CONSIDER

    Use the bots on same country (time zone) where the IPs you’ll use are located. So do not use say USA IP’s if your Virtual machines are located on say GErmaby

  • Saved on wayback machine

    In order for its long term availability, as for the truth must be preserved

    https://web.archive.org/web/20260120172129/https://www.doninam.com/

  • Human Emulation Scroll

    To be a litle more difficult, cause, in emulating cursor (previous article) the target website (so youtube) does not know if any code was injected (as no one code was injected) cause the Bot app emulate the cursor, easy, but, in scrolling, some sources says to use , where N = bla bla

    browser.ExecuteScriptAsync("window.scroll(0,N);");

    but , say to IA «can js detect browser.ExecuteScriptAsync»

    results in

    JavaScript cannot directly detect the execution of a browser.ExecuteScriptAsync call because this method is part of the host application’s API (such as WebView2 or CefSharp) and operates outside the standard JavaScript environment. 

    However, a script can indirectly detect its own injection or «presence» using the following methods:

    1. Self-Identification via State

    If the host application uses ExecuteScriptAsync to set a global variable, standard JavaScript can check for that variable’s existence. 

    • Detection logic: if (window.myInjectionFlag) { ... }

    2. Monitoring DOM or Event Changes

    Since ExecuteScriptAsync is often used to modify the DOM or trigger events, JavaScript can use a MutationObserver to watch for unexpected changes that did not originate from the page’s original scripts. 

    3. Stack Trace Analysis

    In some environments, if a script is executed via an external command, the Error().stack property might reveal a unique trace (e.g., <anonymous> or specific internal wrappers), though this is highly implementation-specific and unreliable for robust detection. 

    4. Communication Back to Host

    The most common way for JavaScript to «acknowledge» an external script execution is to use host-provided bridges like:

    • WebView2: window.chrome.webview.postMessage().
    • CefSharp: CefSharp.PostMessage() or bound objects. 

    For more details on implementing these interfaces, see the official documentation for WebView2 APIs or the CefSharp WebBrowserExtensions

    so, 2 things

    May my app can use a non injected script, say to scrollgthe browser instance ? if not, then ooohh need to test

    So I ask the following (while listen to Im looking at gthe windows Stieve vai):

    can js detect is u use oin winformn a webview2 with Document.Window.ScrollTo(0, 0) ?

    which results in:

    In 2026, JavaScript running inside a WebView2 control can detect the fact that a scroll occurred, but it cannot inherently distinguish whether that scroll was caused by a WinForms Document.Window.ScrollTo(0, 0) command or a user’s manual action. 

    How JS Detects the Scroll

    • The scroll Event: Whenever the scroll position changes—whether programmatically via C# or manually by a user—the JavaScript scroll event fires.
    • The scrollend Event: Modern browsers (including the Edge/Chromium engine used by WebView2) support scrollend, which fires when any scroll animation completes. 

    SO, js , so youtube, cannot detect using this last method, if our app is a bot or not, so OK, camon men

    So code, to record a human real scrolls, to put on database

    UNFORTUNATELY, WebView2 does not allow to scroll without injecting JS, and the old WebBrowser does, but it is not supported on loading many websites, including youtube, that they reject tyo show, if this old browser is used.


    So, 2 opcions, use other control or scroll by moving the mouse (not emulating the scroll wheel), eyy eyyy, wait a moment, am I said Scroll wheel ??? let me checkl if I can control mouse scroll wheel ??

    I’ve got this code

    Imports System.Runtime.InteropServices
    
    Public Class Form1
        Private WithEvents Tmr As New Timer With {.Interval = 2000}
    
        Private Const MOUSEEVENTF_WHEEL As Integer = &H800 'The amount of movement is specified in mouseData.
        Private Const MOUSEEVENTF_HWHEEL As Integer = &H1000 'Not available for 2000 or XP
    
        <DllImport("user32.dll", EntryPoint:="mouse_event")> _
        Private Shared Sub mouse_event(ByVal dwFlags As UInteger, ByVal dx As Integer, ByVal dy As Integer, ByVal dwData As Integer, ByVal dwExtraInfo As UInteger)
        End Sub
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Me.KeyPreview = True
            Tmr.Start()
        End Sub
    
        Private Sub Tmr_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Tmr.Tick
            MouseScroll(False, 10) 'scrolls Down 10 wheel clicks
            'MouseScroll(True, 1) 'scrolls Up 1 wheel click
        End Sub
    
        Private Sub MouseScroll(ByVal up As Boolean, ByVal clicks As Integer)
            If up Then
                mouse_event(MOUSEEVENTF_WHEEL, 0, 0, (clicks * 120), 0)
            Else
                mouse_event(MOUSEEVENTF_WHEEL, 0, 0, -(clicks * 120), 0)
            End If
        End Sub
    End Class

    Does it work ?

    And now, how can I record a human natural scroll ? to later port to playback ?

    YES, in winforms, there’s the _MouseWheel Event

    say

    Private Sub WebView2_MouseWheel(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseWheel
    
    e.delta 
    
    End Sub

    So I need to make my own recorder / playback for

    ERROR: On the VB.bnet applicartion seems that the event handler of WebView2.MouseWheel is not fired, oops

    Victor

    Unfortunately, the current latest version of the WebView2 1.0.674-prerelease don’t support MouseWhell events too. If is possible to download and run examples from https://github.com/MicrosoftEdge/WebView2Samples.

    Hey its get fired but with no url loaded

    Lets see over the entire form, no it does not work, soo

    We have a problem MIKE

    Well not at all, as the Winform allows (yes) to catch the e.delta on scrolls, thaen I can record like if i was on the webview2, just to grab some human movements, them the question is

    Will I be able to apply those recorded events (scroll) on the webview2, lets see

    YESSSSSS, DONEEE

    It was a litle bit trciky, cause, hmnn let me show the code used

    following is the unfinished code, but does what it is needed, so to get actions based on 10 ms timer, to get 0 = no scroll, +120 = scrollup or -120 = scroll down

    VB.NET Winforms 4.7 CODE

    #Region "Imports"
    Imports System.Security.Policy
    Imports Microsoft.Web.WebView2.WinForms
    Imports System.Runtime.InteropServices
    Imports System.Runtime.CompilerServices 'Required to load low level Win DLL's
    #End Region
    Public Class ScrollRecPlay
    #Region "OS DLL"
        Private Const MOUSEEVENTF_WHEEL As Integer = &H800 'The amount of movement is specified in mouseData.
        Private Const MOUSEEVENTF_HWHEEL As Integer = &H1000 'Not available for 2000 or XP
        <DllImport("user32.dll", EntryPoint:="mouse_event")>
        Private Shared Sub mouse_event(ByVal dwFlags As UInteger, ByVal dx As Integer, ByVal dy As Integer, ByVal dwData As Integer, ByVal dwExtraInfo As UInteger)
        End Sub
    #End Region
    #Region "Variables"
        Private WithEvents TiRec As New Timer With {.Interval = 50} : Private WithEvents TiPlay As New Timer With {.Interval = 50}
        Private LastScrollDelta As Integer
    #End Region
    #Region "Buttons"
        Private Sub btnLoad_Click(sender As Object, e As EventArgs) Handles btnLoad.Click
            WebView21.Source = New Uri(txtUrl.Text)
        End Sub
        Private Sub btnRec_Click(sender As Object, e As EventArgs) Handles btnRec.Click
            TxtValues.Text = ""
            btnRec.Enabled = False : BtnStop.Enabled = True
            TiRec.Enabled = True
        End Sub
        Private Sub BtnStop_Click(sender As Object, e As EventArgs) Handles BtnStop.Click
            btnRec.Enabled = True : btnPlay.Enabled = True : TiRec.Enabled = False
        End Sub
        Private Sub btnPlay_Click(sender As Object, e As EventArgs) Handles btnPlay.Click
            'mouse_event(MOUSEEVENTF_WHEEL, 0, 0, (clicks * 120), 0)
            Me.Text = "Be Sure "
            btnPlay.Enabled = False
            TiPlay.Enabled = True
    
        End Sub
    #End Region
    #Region "Timers"
        Private Sub TiRec_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles TiRec.Tick
            TxtValues.Text = TxtValues.Text & "," & LastScrollDelta
            LastScrollDelta = 0
        End Sub
        Private Sub TiPlay_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles TiPlay.Tick
            MouseScroll(False, 100)
            Me.Text = "done"
        End Sub
    #End Region
    #Region "WebView2"
    
    #End Region
    #Region "Functions"
        Private Sub MouseScroll(ByVal up As Boolean, ByVal clicks As Integer)
            If up Then
                mouse_event(MOUSEEVENTF_WHEEL, 0, 0, (clicks * 120), 0)
            Else
                mouse_event(MOUSEEVENTF_WHEEL, 0, 0, -(clicks * 120), 0)
            End If
        End Sub
    
    #End Region
    
    
        Private Sub ScrollRecPlay_MouseWheel(sender As Object, e As MouseEventArgs) Handles Me.MouseWheel
            If Not btnPlay.Enabled = False Then 'to not get fired if playback (which will call to scroll)
                LastScrollDelta = e.Delta
            End If
    
        End Sub
    
    
    
    End Class

    Note: the minimum effective interval is at 50 ms, so a bit far from those 10 ms but it should be ok, I think.

    Deja una respuesta

    Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

  • Human Emulation Mouse

    Ask to the IA (which it is best , to not use it)

    «create me an html with js, with a timer that, once first click on mouse, records the mouse coordinates (each 10 ms) relatives from the original mouse position just before the frst click on a mouse, in pixels, until a new click mouse happens, and once that, show the coordinates in form of text in a text like say : 0:0 (before or on first click), -10:5, +12:5, 1+22:21, etc where on comma delimiter is a step each 10 ms. Once finished, it will also show the screen size, but not the enite, just the portion of where this code is shown, say 500×350, then on the this click it will reproduce the mouse movement recorded on the screen, on the same screen itself. Be aware thaty if say during 5 seconds the mouse is recorded, then, as each step is recorded each 10 ms, then in this example must show 500 records»

    use https://jsfiddle.net/rwvad1n9/ <– ok

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Mouse Movement Recorder</title>
        <style>
            body { font-family: sans-serif; padding: 20px; overflow: hidden; background: #f4f4f9; }
            #status { font-weight: bold; margin-bottom: 10px; color: #333; }
            #output { 
                width: 100%; height: 150px; margin-top: 10px; 
                font-family: monospace; font-size: 12px; 
                background: white; border: 1px solid #ccc; overflow-y: auto; word-break: break-all;
            }
            #ghost-cursor {
                width: 12px; height: 12px; background: red; border-radius: 50%;
                position: absolute; pointer-events: none; display: none;
                box-shadow: 0 0 5px rgba(255,0,0,0.5); z-index: 9999;
            }
            .info { color: #666; font-size: 0.9em; }
        </style>
    </head>
    <body>
    
        <div id="status">Click anywhere to start recording...</div>
        <div class="info" id="screen-info"></div>
        <div id="output">Coordinates will appear here...</div>
        <div id="ghost-cursor"></div>
    
        <script>
            let state = 'WAITING'; // WAITING, RECORDING, FINISHED
            let startTime, timerInterval;
            let originX = 0, originY = 0;
            let currentMouseX = 0, currentMouseY = 0;
            let records = [];
    
            const statusEl = document.getElementById('status');
            const outputEl = document.getElementById('output');
            const screenEl = document.getElementById('screen-info');
            const ghost = document.getElementById('ghost-cursor');
    
            // Track current mouse position constantly to have it ready for the 10ms interval
            window.addEventListener('mousemove', (e) => {
                currentMouseX = e.clientX;
                currentMouseY = e.clientY;
            });
    
            window.addEventListener('click', (e) => {
                if (state === 'WAITING') {
                    startRecording(e);
                } else if (state === 'RECORDING') {
                    stopRecording();
                } else if (state === 'FINISHED') {
                    replayMovement();
                }
            });
    
            function startRecording(e) {
                state = 'RECORDING';
                statusEl.innerText = "RECORDING... Click again to stop.";
                
                // Set Origin (0:0)
                originX = e.clientX;
                originY = e.clientY;
                records = ["0:0"];
    
                // Start 10ms Timer
                timerInterval = setInterval(() => {
                    let relX = currentMouseX - originX;
                    let relY = currentMouseY - originY;
                    
                    // Format with plus sign for positive numbers as requested
                    let strX = relX >= 0 ? `+${relX}` : relX;
                    let strY = relY >= 0 ? `+${relY}` : relY;
                    
                    records.push(`${strX}:${strY}`);
                }, 10);
            }
    
            function stopRecording() {
                state = 'FINISHED';
                clearInterval(timerInterval);
                statusEl.innerText = "RECORDING FINISHED. Click again to REPLAY.";
                
                // Show recorded text
                outputEl.innerText = records.join(', ');
    
                // Show viewport size (portion where code is shown)
                const w = window.innerWidth;
                const h = window.innerHeight;
                screenEl.innerText = `Viewable Area: ${w}x${h} pixels | Total steps: ${records.length}`;
            }
    
            function replayMovement() {
                statusEl.innerText = "REPLAYING...";
                ghost.style.display = 'block';
                let index = 0;
    
                const replayInterval = setInterval(() => {
                    if (index >= records.length) {
                        clearInterval(replayInterval);
                        statusEl.innerText = "REPLAY FINISHED. Refresh to reset.";
                        ghost.style.display = 'none';
                        return;
                    }
    
                    // Parse "X:Y" format (handling the + sign)
                    let parts = records[index].split(':');
                    let relX = parseInt(parts[0]);
                    let relY = parseInt(parts[1]);
    
                    // Calculate absolute position based on original starting point
                    ghost.style.left = (originX + relX) + 'px';
                    ghost.style.top = (originY + relY) + 'px';
    
                    index++;
                }, 10);
            }
        </script>
    </body>
    </html>
    

    So, I use the code above to record some actions done by a real human (me) to insert into the database (table HUMAN.ACTIONS)

    Deja una respuesta

    Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

  • Against the Youtube rules

    Or better know, check what Javascript can do, then programm the Human Behavior

    What Javascript can detect

    (so what the superbots will emulate to be against while complain with the tested youtube anti-artificial count-stats methodology)

    check https://blog.bitsrc.io/javascript-device-detection-bf75eb782fdf

    Say brand and model of his device, the resolution (current, as say a dekstop computer can change it, as opposed to a phone), O.S, bla bla, and most important, ¿Can detect JS so youtube, is a device is Bot based, or Human, based ? NO, not at all , if you do it well, but be aware, this will be a bit difficult for you, or not.

    see more articles about in this website

    be sure to check, human vs bot, to develop your bot, to catch the human

    https://irdeto.com/blog/visualize-evidence-to-catch-bots-with-confidence#:~:text=This%20is%20most%20obvious%20for,positions%20created%20by%20a%20human

    Deja una respuesta

    Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

  • Database Arquitecture part II

    To be implemented later, when ready to start

    bellow a few ideas

    ORDERS

    • [ID].[User] FK ([ID].[User]) (USERS)
    • [ID].[URL] FK ([ID].[URL]) ([URLS])
    • [DEF].[URLS].[Kind].[Action] FK
    • [ID].[ORDERS] PK
    • [ORDERS].[HYBRID] Bit NULL nullable
      • NULL, then so order only for [URL]
      • FALSE, then so order only for [URL_Mobile]
      • TRUE, then, so order will execute both Dekstop & Mobile url’s
    • [ORDERS].[Created] Datetime2
    • [Amount] Int

    [PURCHASES]

    • [ID].[User] FK ([ID].[User]) (USERS)
    • [ID].[ORDERS] FK ([ID].[Order]) (ORDERS) NON UNIQUE
    • [ID].[Purchase] PK int UNIQUE FROM (ID_USER & ID_ORDER)

    [PURCHASES].[MONEY]

    • [ID].[Purchase] FK
    • [Money]
    • [Currency] Char(3)

    [Identifier tables]

    If using FK’s must be only FK’s from[DEF].Tables

    [DEF].[URLS].[Kind]

    :: Must be, in order to derive actions based on these

    • [ID].[DEF].[Kind] PK
    • [DEF].[URLS].[Kind].[Name]
      • Example: Youtube, twitch, kick, and newer kinds that may appear over the time

    [DEF].[URLS].[Kind].[Action]

    • [ID].[DEF].[Kind] FK
    • [ID].[DEF].[URLS].[Kind].[Action] PK TinyInt
    • [ID].[DEF].[URLS].[Kind].[Action].[Name] NVarChar(33)
      • Example: Play, Like, Unlike Comment, and other that may come to kind


    [DEF].[PRICES].[URLS]

    [DEF].[PRICES].[URLS].[PACKS]

    [DEF].[PRICES].[URLS].[PACKS].[ACTIONS]

    [DEF].[PRICES].[URLS].[PACKS].[ACTIONS]

    [DEF].[PRICES].[URLS].[PACKS].[ACTIONS].[Price]

    Deja una respuesta

    Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *