operasoftware / operachromiumdriver

OperaDriver for Chromium-based Opera releases
Other
257 stars 47 forks source link

Fraud Protection #40

Open Heavenwalker opened 7 years ago

Heavenwalker commented 7 years ago

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

wladzynski commented 7 years ago

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

Heavenwalker commented 7 years ago

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()
wladzynski commented 6 years ago

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

1205747671 commented 7 months ago

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!