lib/pwn/plugins/transparent_browser.rb in pwn-0.5.197 vs lib/pwn/plugins/transparent_browser.rb in pwn-0.5.198

- old
+ new

@@ -126,10 +126,12 @@ this_profile['network.proxy.ssl_port'] = URI(proxy).port end end # args.push('--devtools') if devtools + # Private browsing mode + args.push('--private') options = Selenium::WebDriver::Firefox::Options.new( args: args, accept_insecure_certs: true ) @@ -151,10 +153,12 @@ if devtools args.push('--auto-open-devtools-for-tabs') args.push('--disable-hang-monitor') end + # Incognito browsing mode + args.push('--incognito') options = Selenium::WebDriver::Chrome::Options.new( args: args, accept_insecure_certs: true ) @@ -212,10 +216,12 @@ this_profile['network.proxy.ssl_port'] = URI(proxy).port end end args.push('--headless') + # Private browsing mode + args.push('--private') options = Selenium::WebDriver::Firefox::Options.new( args: args, accept_insecure_certs: true ) @@ -228,17 +234,18 @@ when :headless_chrome this_profile = Selenium::WebDriver::Chrome::Profile.new this_profile['download.prompt_for_download'] = false this_profile['download.default_directory'] = '~/Downloads' - args.push('--headless') - if proxy args.push("--host-resolver-rules='MAP * 0.0.0.0 , EXCLUDE #{tor_obj[:ip]}'") if tor_obj args.push("--proxy-server=#{proxy}") end + args.push('--headless') + # Incognito browsing mode + args.push('--incognito') options = Selenium::WebDriver::Chrome::Options.new( args: args, accept_insecure_certs: true ) @@ -675,10 +682,11 @@ devtools_tab_title = "DevTools-#{tab_id}" jmp_tab(browser_obj: browser_obj, keyword: 'DevTools', explicit: true) browser.execute_script("document.title = '#{devtools_tab_title}'") end + # TODO: Find replacement for hotkey - there must be a better way. browser.send_keys(:f12) if first_tab # TODO: replace sleep with something more reliable like an event listener sleep 1 browser.send_keys(:escape) @@ -703,24 +711,27 @@ browser = browser_obj[:browser] browser_type = browser_obj[:type] firefox_types = %i[firefox headless_firefox] chrome_types = %i[chrome headless_chrome] + # TODO: Find replacement for hotkey - there must be a better way. hotkey = [] case PWN::Plugins::DetectOS.type when :linux, :openbsd, :windows hotkey = %i[control shift] when :macos hotkey = %i[command option] end case panel when :elements, :inspector + hotkey.push('i') if chrome_types.include?(browser_type) hotkey.push('c') if firefox_types.include?(browser_type) when :console hotkey.push('j') if chrome_types.include?(browser_type) hotkey.push('k') if firefox_types.include?(browser_type) when :debugger, :sources + hotkey.push('s') if chrome_types.include?(browser_type) if firefox_types.include?(browser_type) # If we're in the console, we need to switch to the inspector first jmp_devtools_panel(browser_obj: browser_obj, panel: :inspector) sleep 1 hotkey.push('z') if firefox_types.include?(browser_type)