예제 #1
0
        public override ECheck Check()
        {
            NetworkSniffer s = null;

            try
            {
                //if (!SystemHelper.IsAdministrator())
                //    WriteError("Require admin rights");

                IPayloadSniffer pay = (IPayloadSniffer)Payload;
                if (!pay.Check())
                {
                    return(ECheck.Error);
                }

                s = new NetworkSniffer(Interface);
                s.Start();

                return(ECheck.Ok);
            }
            catch { return(ECheck.Error); }
            finally
            {
                if (s != null)
                {
                    s.Dispose();
                }
            }
        }
예제 #2
0
        public override ECheck Check()
        {
            NetworkSniffer s = null;

            try
            {
                if (!SystemHelper.IsAdministrator())
                {
                    WriteError("Require admin rights");
                }

                if (!DumpFolder.Exists)
                {
                    WriteError("DumpFolder must exists");
                    return(ECheck.Error);
                }

                s        = new NetworkSniffer(LocalAddress);
                s.Filter = new SnifferPortFilter(this.LocalPort);
                s.Start();

                return(ECheck.Ok);
            }
            catch { return(ECheck.Error); }
            finally
            {
                if (s != null)
                {
                    s.Dispose();
                }
            }
        }