Burp Suite User Forum

Login to post

Issues in using Burp with selenium through code

Ashish | Last updated: Nov 24, 2021 10:50AM UTC

Hi, We have been trying to integrate Burp with Selenium by adding the burp proxy to the browser settings in the automation solution written in c#. My code is as follows: var directory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); var pathDrivers = directory; ChromeOptions chromeOptions = new ChromeOptions(); chromeOptions.AddArguments("chrome.switches", "--disable-extensions", "disable-infobars"); chromeOptions.AddArguments("--disable-backgrounding-occluded-windows"); chromeOptions.AddUserProfilePreference("safebrowsing.enabled", true); Proxy proxy1 = new Proxy(); proxy1.HttpProxy = "X.X.X.X:8080"; proxy1.SslProxy = "X.X.X.X:8080"; chromeOptions.Proxy = proxy1; prg._chrome = new ChromeDriver(pathDrivers, chromeOptions); prg._chrome.Navigate().GoToUrl("https://google.com"); The issue I am facing is that it is not getting captured in Burp. I have switched the Intercept off in Proxy tab. I found one code snippet in the link https://portswigger.net/support/using-burp-with-selenium where Browser object is used to navigate to a site which internally calls the Chrome driver object. I looked for this class in various selenium packages but it seems it belongs to one of developer's own namespace. I tried to get the code but it is not available on site. Can you please make the code given in this link available to us or suggest a solution for the issue I am facing. Thanks in Advance, Ashish K

Hannah, PortSwigger Agent | Last updated: Nov 24, 2021 11:15AM UTC

Hi Ashish Thank you for your message. It looks like ChromeDriver refers to this executable: https://chromedriver.chromium.org/getting-started The most important part of those instructions is to make sure that your traffic is getting proxied through Burp Suite so that the traffic will appear in your proxy history and you can run an audit on the selected items. Please let us know if you need any further assistance. Cheers Hannah Law Technical Product Specialist PortSwigger

Ashish | Last updated: Nov 24, 2021 02:51PM UTC

Hi, The link I posted above contains C# code and the link you posted contains Java and Python code, moreover it is not a portswigger link. My link https://portswigger.net/support/using-burp-with-selenium is a portswigger article, thats why I asked whether you can make the full codebase available for the code snippet given in the article and in the video. Else, please let me know if there is any issue with my code snippet posted above. Thanks Ashish K

You need to Log in to post a reply. Or register here, for free.