operachromiumdriver icon indicating copy to clipboard operation
operachromiumdriver copied to clipboard

Fraud Protection

Open Heavenwalker opened this issue 7 years ago • 4 comments

Opening a malicious site using operadriver will not display the warning page (when Opera would block it). Any idea why this is happening?

Heavenwalker avatar Jun 24 '17 16:06 Heavenwalker

Hi @Heavenwalker ! Could you please provide a minimal test case for this issue? Thanks, Wojtek

wladzynski avatar Jun 26 '17 12:06 wladzynski

This is the code i use (Python 3). I have tried without providing User Diirectory but nothing changes. A Url that is blacklisted at the moment is this http://mmedia.pl/erab/norc.lerf/shus/alet.php

from selenium import webdriver
from selenium.webdriver.opera.options import Options
from selenium.webdriver.common.keys import Keys
import time
options = Options()
options.add_argument("user-data-dir=C:/Users/me/AppData/Roaming/Opera 
Software/Opera Stable")


def checksite():
    driver = webdriver.Opera(opera_options=options)
    driver.get("malicious site")
    #you can find malicious sites from phishtank#
    time.sleep(30)
    driver.quit()

checksite()

Heavenwalker avatar Jun 28 '17 18:06 Heavenwalker

Hi @Heavenwalker! It turns out, that by default operadriver launches Opera with '--disable-background-networking' parameter, which among other things disables fraud protection. In order to be able to test a site against fraud protection functionality, you need to start Opera first and then attach operadriver to it. This way Opera will run without the aforementioned parameter and fraud protection should be nicely triggered, when navigating to a malicious site. Here is simple python script showing how it can be done: https://gist.github.com/wladzynski/471cbb84bb444f41d49e01bacdaf0a15

wladzynski avatar Nov 24 '17 13:11 wladzynski

Hi @Heavenwalker! It turns out, that by default operadriver launches Opera with '--disable-background-networking' parameter, which among other things disables fraud protection. In order to be able to test a site against fraud protection functionality, you need to start Opera first and then attach operadriver to it. This way Opera will run without the aforementioned parameter and fraud protection should be nicely triggered, when navigating to a malicious site. Here is simple python script showing how it can be done: https://gist.github.com/wladzynski/471cbb84bb444f41d49e01bacdaf0a15

Thank you for your answer! I understand the reason why fraud protection is disabled by default when launching the browser. However, if I want to use webdriver to launch Opera and enable malicious website detection, what should I do? Is there any way to manually add or modify some parameters when launching Opera with webdriver to achieve this function? I look forward to your reply and possible solutions. Thank you!

1205747671 avatar Dec 21 '23 02:12 1205747671