Skip to content

SharpPcap.PcapException: 'Failed to open Error Code: 3)' #509

@haunwoo

Description

@haunwoo

using Newtonsoft.Json.Linq;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Chromium;
using PacketDotNet;
using SharpPcap;
using SharpPcap.WinDivert;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Net.WebSockets;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

private WinDivertDevice device;

private void Form1_Load_1(object sender, EventArgs e)
{
  this.ws = new EvoWs(this);
  this.Height = 100;
  this.service = ChromeDriverService.CreateDefaultService();
  ((DriverService) this.service).HideCommandPromptWindow = true;
  ((DriverService) this.service).DriverServicePath = "./";
  ((DriverService) this.service).DriverServiceExecutableName = "chromedriver.exe";
  this.options = new ChromeOptions();
  ((ChromiumOptions) this.options).AddArguments(new string[12]
  {
    "--disable-notifications",
    "--disable-popup-blocking",
    "--disable-blink-features=AutomationControlled",
    "--disable-infobars",
    "--disable-gpu",
    "--start-maximized",
    "--disable-web-security",
    "--ignore-certificate-errors",
    "--allow-running-insecure-content",
    "--proxy-auto-detect",
    "--disable-quic",
    "--mute-audio"
  });

        this.device = new WinDivertDevice();
        this.device.Filter = "tcp.SrcPort == 443 || tcp.DstPort == 443";

        CaptureDeviceExtensions.Open((IPcapDevice)this.device, (DeviceModes)0, 1); 
        this.device.OnPacketArrival += new PacketArrivalEventHandler(this.Device_OnPacketArrival);
        this.device.StartCapture();


    }

2024-03-04 22 51 29

An unknown exception is being thrown
Can anyone predict this exception?
If so, please let me know Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions