예제 #1
0
        public override void Attack()
        {
            Form[] forms=DataLayer.GetHostsForms(_hosts);

            Queue<Form> sharedQueue = new Queue<Form>();
            foreach (var form in forms)
                sharedQueue.Enqueue(form);

            object sharedLock = new object();

            XssAttackingSharedReource sharedResource = new XssAttackingSharedReource(sharedQueue, sharedLock, _attack);

            for (int i = 0; i < _numberOfThreads; i++)
            {
                SimpleXssAttackerAgent agent = new SimpleXssAttackerAgent(sharedResource);
                agent.AgentAttackCompleted += agent_AgentAttackCompleted;
                agent.AgentAttackStarted += agent_AgentAttackStarted;
                agent.AgentAttackAnnounced += agent_AgentAttackAnnounced;
                agent.AttackAsync();
            }
        }
예제 #2
0
        public override void Attack()
        {
            Form[] forms = DataLayer.GetHostsForms(_hosts);

            Queue <Form> sharedQueue = new Queue <Form>();

            foreach (var form in forms)
            {
                sharedQueue.Enqueue(form);
            }

            object sharedLock = new object();

            XssAttackingSharedReource sharedResource = new XssAttackingSharedReource(sharedQueue, sharedLock, _attack);

            for (int i = 0; i < _numberOfThreads; i++)
            {
                SimpleXssAttackerAgent agent = new SimpleXssAttackerAgent(sharedResource);
                agent.AgentAttackCompleted += agent_AgentAttackCompleted;
                agent.AgentAttackStarted   += agent_AgentAttackStarted;
                agent.AgentAttackAnnounced += agent_AgentAttackAnnounced;
                agent.AttackAsync();
            }
        }