Example #1
0
 public UserDetail(string user)
 {
     name  = user;
     pass  = PortExploits.getRandomPassword();
     type  = 1;
     known = false;
 }
Example #2
0
 public UserDetail(string user)
 {
     this.name  = user;
     this.pass  = PortExploits.getRandomPassword();
     this.type  = (byte)1;
     this.known = false;
 }
Example #3
0
        public override void disconnectionDetected(Computer c, OS os)
        {
            base.disconnectionDetected(c, os);
            double time = 20.0 * Utils.random.NextDouble();

            os.delayer.Post(ActionDelayer.Wait(time), (Action)(() =>
            {
                if (os.connectedComp != null && !(os.connectedComp.ip != c.ip))
                {
                    return;
                }
                for (int index = 0; index < c.ports.Count; ++index)
                {
                    c.closePort(c.ports[index], "LOCAL_ADMIN");
                }
                if (this.ResetsPassword)
                {
                    c.setAdminPassword(PortExploits.getRandomPassword());
                }
                c.adminIP = c.ip;
                if (c.firewall != null)
                {
                    c.firewall.solved = false;
                    c.firewall.resetSolutionProgress();
                }
            }));
        }
Example #4
0
        public override void disconnectionDetected(Computer c, OS os)
        {
            base.disconnectionDetected(c, os);
            for (var index = 0; index < c.ports.Count; ++index)
            {
                c.closePort(c.ports[index], "LOCAL_ADMIN");
            }
            if (c.firewall != null)
            {
                c.firewall.resetSolutionProgress();
                c.firewall.solved = false;
            }
            if (c.hasProxy)
            {
                c.proxyActive        = true;
                c.proxyOverloadTicks = c.startingOverloadTicks;
            }
            var    time   = 20.0 * Utils.random.NextDouble();
            Action action = () =>
            {
                if (os.connectedComp != null && !(os.connectedComp.ip != c.ip))
                {
                    return;
                }
                for (var index = 0; index < c.ports.Count; ++index)
                {
                    c.closePort(c.ports[index], "LOCAL_ADMIN");
                }
                if (ResetsPassword)
                {
                    c.setAdminPassword(PortExploits.getRandomPassword());
                }
                c.adminIP = c.ip;
                if (c.firewall == null)
                {
                    return;
                }
                c.firewall.resetSolutionProgress();
            };

            if (IsSuper)
            {
                action();
            }
            else
            {
                os.delayer.Post(ActionDelayer.Wait(time), action);
            }
        }
Example #5
0
 public Computer(string compName, string compIP, Vector2 compLocation, int seclevel, byte compType, OS opSystem)
 {
     name          = compName;
     ip            = compIP;
     location      = compLocation;
     type          = compType;
     files         = generateRandomFileSystem();
     idName        = compName.Replace(" ", "_");
     os            = opSystem;
     traceTime     = -1f;
     securityLevel = seclevel;
     adminIP       = NetworkMap.generateRandomIP();
     users         = new List <UserDetail>();
     adminPass     = PortExploits.getRandomPassword();
     users.Add(new UserDetail("admin", adminPass, 1));
     ports     = new List <int>(seclevel);
     portsOpen = new List <byte>(seclevel);
     openPortsForSecurityLevel(seclevel);
     links   = new List <int>();
     daemons = new List <Daemon>();
 }