本文整理汇总了C#中IronWASP.Request.Send方法的典型用法代码示例。如果您正苦于以下问题:C# Request.Send方法的具体用法?C# Request.Send怎么用?C# Request.Send使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IronWASP.Request
的用法示例。
在下文中一共展示了Request.Send方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DownloadIronWASPFile
static void DownloadIronWASPFile(string FileName, string PseudoName)
{
Request IronWASPFileFetchReq = new Request(IronWASPDownloadBaseUrl + PseudoName);
IronWASPFileFetchReq.Source = RequestSource.Stealth;
Response IronWASPFileFetchRes = IronWASPFileFetchReq.Send();
if (!IronWASPFileFetchRes.IsSslValid)
{
throw new Exception("Invalid SSL Certificate provided by the server");
}
if (IronWASPFileFetchRes.Code != 200)
{
throw new Exception("Downloading updated IronWASP version failed");
}
if (FileName.Equals("Updater.exe"))
{
try
{
File.Delete(Config.Path + "\\Updater.exe");
}
catch { }
IronWASPFileFetchRes.SaveBody(Config.Path + "\\Updater.exe");
}
else
{
IronWASPFileFetchRes.SaveBody(Config.Path + "\\updates\\ironwasp\\" + FileName);
}
NewUpdateAvailable = true;
}
示例2: Inject
public Response Inject(Request RequestToInject)
{
RequestToInject.Source = RequestSource.Scan;
RequestToInject.ScanID = this.ScanID;
Response ResponseFromInjection = RequestToInject.Send();
return SessionHandler.GetInterestingResponse(RequestToInject, ResponseFromInjection);
}
示例3: SendRequest
Response SendRequest(Request Req)
{
if(SessionHandler != null && SessionHandler.Name.Length > 0)
Req = SessionHandler.DoBeforeSending(Req, null);
Req.SetSource(TesterLogSourceAttributeValue);
return Req.Send();
}
示例4: Crawl
void Crawl(Request Req, int Depth, bool Scraped)
{
if (Stopped) return;
if (Depth > MaxDepth) return;
if (WasCrawled(Req)) return;
if (!CanCrawl(Req)) return;
lock (PageSignatures)
{
PageSignatures.Add(GetPageSignature(Req));
}
Req.Source = RequestSource.Probe;
Req.SetCookie(Cookies);
if (UserAgent.Length > 0) Req.Headers.Set("User-Agent", UserAgent);
Response Res = Req.Send();
Cookies.Add(Req, Res);
bool Is404File = IsA404(Req, Res);
if (!Res.IsHtml)
{
try
{
Res.ProcessHtml();
}
catch
{
return;
}
}
if (Depth + 1 > MaxDepth) return;
List<Request> LinkClicks = GetLinkClicks(Req, Res);
foreach (Request LinkClick in LinkClicks)
{
AddToCrawlQueue(LinkClick, Depth + 1, true);
}
List<Request> FormSubmissions = GetFormSubmissionRequests(Req, Res);
foreach (Request FormSubmission in FormSubmissions)
{
AddToCrawlQueue(FormSubmission, Depth + 1, true);
}
Request DirCheck = Req.GetClone();
DirCheck.Method = "GET";
DirCheck.Body.RemoveAll();
DirCheck.Url = DirCheck.UrlDir;
if (!Req.Url.EndsWith("/"))
{
AddToCrawlQueue(DirCheck, Depth + 1, false);
}
if (PerformDirAndFileGuessing && !Is404File)
{
foreach (string File in FileNamesToCheck)
{
Request FileCheck = DirCheck.GetClone();
FileCheck.Url = FileCheck.Url + File;
AddToCrawlQueue(FileCheck, Depth + 1, false);
}
foreach (string Dir in DirNamesToCheck)
{
Request DirectoryCheck = DirCheck.GetClone();
DirectoryCheck.Url = DirectoryCheck.Url + Dir + "/";
AddToCrawlQueue(DirectoryCheck, Depth + 1, false);
}
}
if (Scraped || !Is404File)
{
lock (CrawledRequests)
{
CrawledRequests.Enqueue(Req);
}
IronUpdater.AddToSiteMap(Req);
}
}
示例5: StartCheck
static void StartCheck()
{
try
{
Request IronWASPManifestReq = new Request(IronWASPManifestUrl);
IronWASPManifestReq.Source = RequestSource.Stealth;
IronWASPManifestReq.Headers.Set("User-Agent", "IronWASP v" + CurrentVersion);
Response IronWASPManifestRes = IronWASPManifestReq.Send();
if (!IronWASPManifestRes.IsSslValid)
{
throw new Exception("Invalid SSL Certificate provided by the server");
}
IronWASPManifestFile = IronWASPManifestRes.BodyString;
Request ModulesDbReq = new Request(ModulesDbUrl);
ModulesDbReq.Source = RequestSource.Stealth;
ModulesDbReq.Headers.Set("User-Agent", "IronWASP v" + CurrentVersion);
Response ModulesDbRes = ModulesDbReq.Send();
if (!ModulesDbRes.IsSslValid)
{
throw new Exception("Invalid SSL Certificate provided by the server");
}
//The ASCII conversion and substring is done to remove the unicode characters introduced at the beginning of the xml. Must find out why this happens.
ModulesDbFile = Encoding.ASCII.GetString(ModulesDbRes.BodyArray);
ModulesDbFile = ModulesDbFile.Substring(ModulesDbFile.IndexOf('<'));
Request PluginManifestReq = new Request(PluginManifestUrl);
PluginManifestReq.Source = RequestSource.Stealth;
PluginManifestReq.Headers.Set("User-Agent","IronWASP v" + CurrentVersion);
Response PluginManifestRes = PluginManifestReq.Send();
if (!PluginManifestRes.IsSslValid)
{
throw new Exception("Invalid SSL Certificate provided by the server");
}
PluginManifestFile = PluginManifestRes.BodyString;
Request ModuleManifestReq = new Request(ModuleManifestUrl);
ModuleManifestReq.Source = RequestSource.Stealth;
ModuleManifestReq.Headers.Set("User-Agent", "IronWASP v" + CurrentVersion);
Response ModuleManifestRes = ModuleManifestReq.Send();
if (!ModuleManifestRes.IsSslValid)
{
throw new Exception("Invalid SSL Certificate provided by the server");
}
ModuleManifestFile = ModuleManifestRes.BodyString;
SetUpUpdateDirs();
GetNewIronWASP();
GetNewModulesDb();
GetNewPlugins();
GetNewModules();
if (NewUpdateAvailable)
{
try
{
Tools.Run(string.Format("{0}\\Updater.exe", Config.RootDir));
}
catch (Exception Exp) { IronException.Report("Unable to Open IronWASP Updater", Exp); }
}
}
catch(ThreadAbortException) { }
catch(Exception Exp)
{
IronException.Report("Software Update Failed", Exp);
}
}
示例6: DownloadPlugin
static void DownloadPlugin(string PluginType, string FileName, string PseudoName)
{
Request PluginFetchReq = new Request(PluginDownloadBaseUrl + PluginType + "/" + PseudoName);
PluginFetchReq.Source = RequestSource.Stealth;
Response PluginFetchRes = PluginFetchReq.Send();
if (!PluginFetchRes.IsSslValid)
{
throw new Exception("Invalid SSL Certificate provided by the server");
}
if (PluginFetchRes.Code != 200)
{
throw new Exception("Downloading updated plugins failed");
}
try
{
PluginFetchRes.SaveBody(Config.Path + "\\updates\\plugins\\" + PluginType + "\\" + FileName);
NewUpdateAvailable = true;
}
catch (Exception Exp) { IronException.Report(string.Format("Error Downloading Plugin: {0} - {1} - {2}", PluginType, FileName, PseudoName), Exp); }
}
示例7: DownloadModule
static void DownloadModule(string ModuleName, string PseudoName)
{
Request ModuleFetchReq = new Request(ModuleDownloadBaseUrl + "/" + PseudoName);
ModuleFetchReq.Source = RequestSource.Stealth;
Response ModuleFetchRes = ModuleFetchReq.Send();
if (!ModuleFetchRes.IsSslValid)
{
throw new Exception("Invalid SSL Certificate provided by the server");
}
if (ModuleFetchRes.Code != 200)
{
throw new Exception("Downloading updated modules failed");
}
try
{
ModuleFetchRes.SaveBody(Config.Path + "\\updates\\modules\\" + ModuleName + ".zip");
using (ZipFile ZF = ZipFile.Read(Config.Path + "\\updates\\modules\\" + ModuleName + ".zip"))
{
ZF.ExtractAll(Config.Path + "\\updates\\modules\\");
}
NewUpdateAvailable = true;
}
catch (Exception Exp) { IronException.Report(string.Format("Error Downloading Module: {0} - {1} ", ModuleName, PseudoName), Exp); }
}
示例8: StartCheck
static void StartCheck()
{
try
{
Request PluginManifestReq = new Request(PluginManifestUrl);
PluginManifestReq.Source = RequestSource.Stealth;
PluginManifestReq.Headers.Set("User-Agent","IronWASP v" + CurrentVersion);
Response PluginManifestRes = PluginManifestReq.Send();
if (!PluginManifestRes.IsSslValid)
{
throw new Exception("Invalid SSL Certificate provided by the server");
}
PluginManifestFile = PluginManifestRes.BodyString;
Request IronWASPManifestReq = new Request(IronWASPManifestUrl);
IronWASPManifestReq.Source = RequestSource.Stealth;
IronWASPManifestReq.Headers.Set("User-Agent", "IronWASP v" + CurrentVersion);
Response IronWASPManifestRes = IronWASPManifestReq.Send();
if (!IronWASPManifestRes.IsSslValid)
{
throw new Exception("Invalid SSL Certificate provided by the server");
}
IronWASPManifestFile = IronWASPManifestRes.BodyString;
SetUpUpdateDirs();
GetNewPlugins();
GetNewIronWASP();
if (NewUpdateAvailable)
{
try
{
Tools.Run(Config.RootDir + "/" + "Updater.exe");
}
catch (Exception Exp) { IronException.Report("Unable to Open IronWASP Updater", Exp); }
}
}
catch(ThreadAbortException) { }
catch(Exception Exp)
{
IronException.Report("Software Update Failed", Exp);
}
}