Exemplo n.º 1
0
        public void Attack()
        {
            Host[] hosts = DataLayer.GetCrawlRunHosts(_crawlId);

            if (UseSimpleXssAttacker)
            {
                Attack attack = new Attack();
                attack.CrawlSettingId = _crawlId;
                DataLayer.Save(attack);

                SimpleXssAttacker simpleXssAttacker = new SimpleXssAttacker(attack, _numberOfThreads,hosts);
                simpleXssAttacker.AttackAnnounced += Attacker_AttackAnnounced;
                simpleXssAttacker.AttackCompleted += Attacker_AttackCompleted;
                simpleXssAttacker.AttackStarted += Attacker_AttackStarted;
                attack.StartTime = DateTime.Now;
                simpleXssAttacker.Attack();

                DataLayer.Save(attack);
            }

            if (UseEncodedXssAttacker)
            {
                Attack attack = new Attack();
                attack.CrawlSettingId = _crawlId;
                attack.StartTime = DateTime.Now;
                DataLayer.Save(attack);

                EncodedXssAttacker encodedXssAttacker = new EncodedXssAttacker(attack, _numberOfThreads, hosts);
                encodedXssAttacker.AttackAnnounced += Attacker_AttackAnnounced;
                encodedXssAttacker.AttackCompleted += Attacker_AttackCompleted;
                encodedXssAttacker.AttackStarted += Attacker_AttackStarted;

                encodedXssAttacker.Attack();
            }
        }
Exemplo n.º 2
0
 public EncodedXssAttacker(Attack attack, int numberOfThreads, Host[] hosts)
     : base(attack,numberOfThreads)
 {
     _hosts = hosts;
 }
Exemplo n.º 3
0
 public static void Save(Attack attack)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 4
0
 public AttackingSharedReource(object sharedLock,Attack sharedAttack)
 {
     this.SharedAttack = sharedAttack;
     this.SharedLock = sharedLock;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Create a new Attack object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="attackType">Initial value of the AttackType property.</param>
 /// <param name="hostId">Initial value of the HostId property.</param>
 /// <param name="crawlSettingId">Initial value of the CrawlSettingId property.</param>
 public static Attack CreateAttack(global::System.Int32 id, global::System.Int32 attackType, global::System.Int32 hostId, global::System.Int32 crawlSettingId)
 {
     Attack attack = new Attack();
     attack.Id = id;
     attack.AttackType = attackType;
     attack.HostId = hostId;
     attack.CrawlSettingId = crawlSettingId;
     return attack;
 }
Exemplo n.º 6
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Attacks EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToAttacks(Attack attack)
 {
     base.AddObject("Attacks", attack);
 }
 public XssAttackingSharedReource(Queue<Form> sharedQueue, object sharedLock,Attack sharedAttack)
     : base(sharedLock, sharedAttack)
 {
     this.SharedQueue = sharedQueue;
 }