コード例 #1
0
ファイル: DetectTorExitNode.cs プロジェクト: santatic/Xploit
        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);
        }
コード例 #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);
        }
コード例 #3
0
ファイル: SnifferTorFilter.cs プロジェクト: santatic/Xploit
        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);
        }
コード例 #4
0
ファイル: IPAddressExtension.cs プロジェクト: santatic/Xploit
        /// <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));
        }