Spoofing Browser Fingerprint in Selenium?

Discussion in 'General Scripting Chat' started by Sam Green, Feb 16, 2017.

  1. Sam Green

    Sam Green Junior Member

    Joined:
    Dec 15, 2016
    Messages:
    134
    Likes Received:
    31
    Im currently trying to use Random Agent Spoofer, a firefox extension, to randomize my fingerprint. By default though a lot of its better spoofing settings like timezone spoofing and setting my user agent to mobile are disabled.

    I cant find any way to edit the extension settings from selenium webdriver (python). Does anyone know where extensions save their settings? Or if not a better way of spoofing my browser fingerprint in selenium?
     
    Last edited: Feb 16, 2017
  2. Palesantos

    Palesantos Registered Member

    Joined:
    Dec 22, 2016
    Messages:
    93
    Likes Received:
    3
    Gender:
    Male
    I am currently using MultiLoginApp, it appears to be an independent spoofing and proxy app which supports chrome, firefox and many more.
     
  3. Sam Green

    Sam Green Junior Member

    Joined:
    Dec 15, 2016
    Messages:
    134
    Likes Received:
    31
    turns out selenium can actually edit extension settings actually. Extension settings are stored in the about:config menu where firefox stores all its other settings.

    in selenium you can edit about:config options including those of the extensions :D
     
  4. BloodyNinja

    BloodyNinja Power Member

    Joined:
    Oct 28, 2013
    Messages:
    624
    Likes Received:
    617
    Location:
    Deeptown
    Sorry for misinforming you then. Frankly didn't know about this possibility.
     
  5. Sam Green

    Sam Green Junior Member

    Joined:
    Dec 15, 2016
    Messages:
    134
    Likes Received:
    31
    No problem. The information about extension settings being stored there was rather hard to find. And your Multiloginapp suggestion is interesting I'll have to look into that.
     
  6. whiteroot

    whiteroot Junior Member

    Joined:
    Oct 22, 2015
    Messages:
    102
    Likes Received:
    33
    Gender:
    Male
    Occupation:
    Software engineer, freelancer
    Location:
    France
    create a profile where you store the user-agent you want (and other stuff) :

    profile = webdriver.FirefoxProfile('/home/user/.mozilla/firefox/n34w7dcm.user/')
    profile.set_preference("general.useragent.override","Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0")
    profile.set_preference("places.history.enabled", False)
    profile.set_preference("privacy.clearOnShutdown.offlineApps", True)
    profile.set_preference("privacy.clearOnShutdown.passwords", True)
    profile.set_preference("privacy.clearOnShutdown.siteSettings", True)
    profile.set_preference("privacy.sanitize.sanitizeOnShutdown", True)
    profile.update_preferences()
    driver = webdriver.Firefox(firefox_profile=profile)
     
    • Thanks Thanks x 1
  7. Palesantos

    Palesantos Registered Member

    Joined:
    Dec 22, 2016
    Messages:
    93
    Likes Received:
    3
    Gender:
    Male