コード例 #1
0
 /// <summary>
 /// Deprecated Method for adding a new object to the XAttackParams EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToXAttackParams(XAttackParam xAttackParam)
 {
     base.AddObject("XAttackParams", xAttackParam);
 }
コード例 #2
0
        private string CreateAttackVector(XAttackParam[] attackParams, Form form)
        {
            string postData = "";
            for (int i = 0; i < form.FormElements.Count; i++)
            {
                FormElement element = form.FormElements.ElementAt(i);

                if(!(form.Method=="get" && element.Type=="submit"))
                    postData+=string.Format("{0}={1}&",element.Name,HttpUtility.UrlEncode(attackParams[i].Value));
            }

            postData = postData.Substring(0, postData.Length - 1);

            if (form.Method == "get")
                postData = "?" + postData;

            if (form.Method=="get" && !form.Action.EndsWith("/"))
                postData = "/" + postData;

            return postData;
        }
コード例 #3
0
 /// <summary>
 /// Create a new XAttackParam object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="formElementId">Initial value of the FormElementId property.</param>
 /// <param name="xAttackId">Initial value of the XAttackId property.</param>
 public static XAttackParam CreateXAttackParam(global::System.Int32 id, global::System.Int32 formElementId, global::System.Int32 xAttackId)
 {
     XAttackParam xAttackParam = new XAttackParam();
     xAttackParam.Id = id;
     xAttackParam.FormElementId = formElementId;
     xAttackParam.XAttackId = xAttackId;
     return xAttackParam;
 }