Exemple #1
0
        public override ECheck Check()
        {
            WriteInfo("Updating tor exit node list", TorHelper.UpdateTorExitNodeList(false).ToString(), ConsoleColor.Green);

            bool res = TorHelper.IsTorExitNode(RemoteIp);

            WriteInfo("Check tor exit node '" + RemoteIp.ToString() + "' results", res ? "EXIT-NODE DETECTED!" : "NOT LISTED", res ? ConsoleColor.Red : ConsoleColor.Green);

            Thread.Sleep(1000);

            return(res ? ECheck.Ok : ECheck.Error);
        }
Exemple #2
0
        public bool IsAllowed(IPEndPoint source, IPEndPoint dest, IPProtocolType protocol)
        {
            TorHelper.UpdateTorExitNodeList(true);

            if (TorHelper.IsTorExitNode(source.Address))
            {
                return(true);
            }
            if (TorHelper.IsTorExitNode(dest.Address))
            {
                return(true);
            }

            return(false);
        }
Exemple #3
0
        public bool IsAllowed(TcpHeader packet)
        {
            TorHelper.UpdateTorExitNodeList(true);

            if (TorHelper.IsTorExitNode(packet.IpHeader.DestinationAddress))
            {
                return(true);
            }
            if (TorHelper.IsTorExitNode(packet.IpHeader.SourceAddress))
            {
                return(true);
            }

            return(false);
        }
        /// <summary>
        ///  Check if the ip it's a Tor exit node
        /// </summary>
        /// <param name="ipAddress">Instance of the IPAddress, that should be reversed </param>
        /// <param name="allowRefresh">Refresh exit node list</param>
        public static bool IsTorExitNode(this IPAddress ipAddress, bool allowRefresh)
        {
            if (ipAddress == null)
            {
                return(false);
            }

            //Refresh
            if (allowRefresh)
            {
                TorHelper.UpdateTorExitNodeList(true);
            }
            // Check
            return(TorHelper.IsTorExitNode(ipAddress));
        }