本文整理汇总了C#中IronWASP.Session类的典型用法代码示例。如果您正苦于以下问题:C# Session类的具体用法?C# Session怎么用?C# Session使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Session类属于IronWASP命名空间,在下文中一共展示了Session类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddToCheckResponse
internal static void AddToCheckResponse(Session Sess)
{
lock (CheckResponse)
{
CheckResponse.Enqueue(Sess);
}
}
示例2: AddToCheckRequest
internal static void AddToCheckRequest(Session Sess)
{
lock (CheckRequest)
{
CheckRequest.Enqueue(Sess);
}
}
示例3: ProcessBurpMessage
static void ProcessBurpMessage(string BurpMessage, string MetaLine)
{
string[] BurpMessageParts = BurpMessage.Split(new string[] { "\r\n======================================================\r\n" }, 2, StringSplitOptions.RemoveEmptyEntries);
Session IrSe = null;
if (BurpMessageParts.Length > 0)
{
Request Req = ReadBurpRequest(BurpMessageParts[0], MetaLine);
if (Req != null)
{
IrSe = new Session(Req);
IrSe.ID = Interlocked.Increment(ref Config.ProxyRequestsCount);
IronUpdater.AddProxyRequest(IrSe.Request.GetClone(true));
PassiveChecker.AddToCheckRequest(IrSe);
}
}
if (BurpMessageParts.Length == 2)
{
if (IrSe != null)
{
try
{
Response Res = new Response(BurpMessageParts[1]);
IrSe.Response = Res;
IrSe.Response.ID = IrSe.Request.ID;
IronUpdater.AddProxyResponse(IrSe.Response.GetClone(true));
PassiveChecker.AddToCheckResponse(IrSe);
}
catch
{
}
}
}
}
示例4: AddToCheckRequest
internal static void AddToCheckRequest(Session Sess)
{
switch (Sess.Request.Source)
{
case RequestSource.Proxy:
if (!RunOnProxyTraffic) return;
break;
case RequestSource.Shell:
if (!RunOnShellTraffic) return;
break;
case RequestSource.Test:
if (!RunOnTestTraffic) return;
break;
case RequestSource.Scan:
if (!RunOnScanTraffic) return;
break;
case RequestSource.Probe:
if (!RunOnProbeTraffic) return;
break;
default:
if (!Sess.Request.CanRunPassivePlugins) return;
break;
}
lock (CheckRequest)
{
CheckRequest.Enqueue(Sess);
}
}
示例5: DoesMatchResponseInterceptionRules
public bool DoesMatchResponseInterceptionRules(Session Sess)
{
if (Sess.Response == null)
{
return false;
}
else
{
return IronProxy.CanInterceptBasedOnFilter(Sess.Request, Sess.Response);
}
}
示例6: DoesMatchRules
public bool DoesMatchRules(Session Sess)
{
if (Sess.Response == null)
{
return this.DoesMatchRequestInterceptionRules(Sess);
}
else
{
return this.DoesMatchResponseInterceptionRules(Sess);
}
}
示例7: RunAllRequestBasedInlinePassivePlugins
public static void RunAllRequestBasedInlinePassivePlugins(Session IrSe)
{
foreach (string Name in PassivePlugin.GetInLinePluginsForRequest())
{
PassivePlugin P = PassivePlugin.Get(Name);
if ((P.WorksOn == PluginWorksOn.Request) || (P.WorksOn == PluginWorksOn.Both))
{
if (P.CallingState == PluginCallingState.Inline)
{
try
{
PluginEngine.RunPassivePlugin(P, IrSe);
}
catch (Exception Exp)
{
IronException.Report("Error executing 'BeforeRequestInterception' Passive Plugin - " + Name, Exp.Message, Exp.StackTrace);
}
}
}
}
}
示例8: RunAllPassivePluginsAfterRequestInterception
public static void RunAllPassivePluginsAfterRequestInterception(Session IrSe)
{
foreach (string Name in PassivePlugin.List())
{
PassivePlugin P = PassivePlugin.Get(Name);
if ((P.WorksOn == PluginWorksOn.Request) || (P.WorksOn == PluginWorksOn.Both))
{
if ((P.CallingState == PluginCallingState.AfterInterception) || (P.CallingState == PluginCallingState.Both))
{
try
{
PluginStore.RunPassivePlugin(P, IrSe);
}
catch(Exception Exp)
{
IronException.Report("Error executing 'AfterRequestInterception' Passive Plugin - " + Name, Exp.Message, Exp.StackTrace);
}
}
}
}
}
示例9: SendSessionToProxy
internal static void SendSessionToProxy(Session IrSe)
{
if (UI.ProxyInterceptTabs.InvokeRequired)
{
SendSessionToProxy_d sstp_d = new SendSessionToProxy_d(SendSessionToProxy);
UI.Invoke(sstp_d, new object[] { IrSe });
}
else
{
if (IronProxy.ManualTamperingFree)
{
FillInterceptorTab(IrSe);
if (!UI.main_tab.SelectedTab.Name.Equals("mt_proxy")) UI.main_tab.SelectTab("mt_proxy");
MakeUiTopMost(true);
}
else
{
string ID = IrSe.ID.ToString();
if (IrSe.FiddlerSession.state == Fiddler.SessionStates.HandTamperRequest)
{
ID = ID + "-Request";
}
else
{
ID = ID + "-Response";
}
lock (IronProxy.SessionsQ)
{
IronProxy.SessionsQ.Enqueue(ID);
}
}
}
}
示例10: FillInterceptorTab
internal static void FillInterceptorTab(Session IrSe)
{
IronProxy.ManualTamperingFree = false;
IronProxy.CurrentSession = IrSe;
ResetProxyInterceptionFields();
if (IrSe.FiddlerSession.state == Fiddler.SessionStates.HandTamperRequest)
{
UI.ProxyInterceptTabs.SelectedIndex = 0;
IronProxy.CurrentSession.OriginalRequest = IrSe.Request.GetClone(true);
FillProxyFields(IrSe.Request);
MakeProxyRequestFieldsReadOnly(false);
}
else
{
UI.ProxyInterceptTabs.SelectedIndex = 1;
IronProxy.CurrentSession.OriginalResponse = IrSe.Response.GetClone(true);
FillProxyFields(IrSe.Response, IrSe.Request);
FillProxyFields(IrSe.Request);
MakeProxyResponseFieldsReadOnly(false);
}
IronProxy.ResetChangedStatus();
UI.ProxyBaseSplit.Panel1.BackColor = Color.SkyBlue;
UI.ProxySendBtn.Enabled = true;
UI.ProxyDropBtn.Enabled = true;
}
示例11: RunPassivePlugin
public static PluginResults RunPassivePlugin(PassivePlugin P, Session Irse)
{
PluginResults Results = new PluginResults();
P.Check(Irse, Results);
foreach (PluginResult PR in Results.GetAll())
{
PR.Plugin = P.Name;
IronUpdater.AddPluginResult(PR);
}
return Results;
}
示例12: FillLogDisplayFields
internal static void FillLogDisplayFields(Session IrSe)
{
if (UI.LogDisplayTabs.InvokeRequired)
{
FillLogDisplayFields_d FLDF_d = new FillLogDisplayFields_d(FillLogDisplayFields);
UI.Invoke(FLDF_d, new object[] { IrSe });
}
else
{
if (IrSe == null) return;
if (IrSe.Request != null) FillLogFields(IrSe.Request);
if (IrSe.Response != null) FillLogFields(IrSe.Response, IrSe.Request);
//FillLogReflection(Reflection);
try
{
UI.LogSourceLbl.Text = "Source: " + IronLog.CurrentSourceName;
UI.LogIDLbl.Text = "ID: " + IronLog.CurrentID.ToString();
}
catch { }
UI.ProxyShowOriginalRequestCB.Checked = false;
UI.ProxyShowOriginalResponseCB.Checked = false;
UI.ProxyShowOriginalRequestCB.Visible = IrSe.OriginalRequest != null;
UI.ProxyShowOriginalResponseCB.Visible = IrSe.OriginalResponse != null;
IronUI.ResetLogStatus();
}
}
示例13: GetClone
public Session GetClone()
{
Session ClonedIrSe = null;
if (this.Response != null)
{
ClonedIrSe = new Session(this.Request.GetClone(), this.Response.GetClone());
}
else
{
ClonedIrSe = new Session(this.Request.GetClone());
}
return ClonedIrSe;
}
示例14: BeforeRequest
internal static void BeforeRequest(Fiddler.Session Sess)
{
if (Sess.HTTPMethodIs("Connect"))
{
if (IronProxy.UseUpstreamProxy)
{
string UpstreamProxyString = string.Format("{0}:{1}", IronProxy.UpstreamProxyIP, IronProxy.UpstreamProxyPort.ToString());
Sess.oFlags.Add("x-overrideGateway", UpstreamProxyString);
}
if (Config.HasFiddlerFlags)
{
string[,] Flags = Config.GetFiddlerFlags();
for (int i = 0; i < Flags.GetLength(0); i++)
{
Sess.oFlags.Add(Flags[i, 0], Flags[i, 1]);
}
}
return;
}
if(Sess.oFlags.ContainsKey("IronFlag-BuiltBy"))
{
if (Sess.oFlags["IronFlag-BuiltBy"].Equals("Stealth"))
{
if (IronProxy.UseUpstreamProxy)
{
string UpstreamProxyString = string.Format("{0}:{1}", IronProxy.UpstreamProxyIP, IronProxy.UpstreamProxyPort.ToString());
Sess.oFlags.Add("x-overrideGateway", UpstreamProxyString);
}
if (Config.HasFiddlerFlags)
{
string[,] Flags = Config.GetFiddlerFlags();
for (int i = 0; i < Flags.GetLength(0); i++)
{
Sess.oFlags.Add(Flags[i, 0], Flags[i, 1]);
}
}
return;
}
}
Session IrSe;
try
{
IrSe = new Session(Sess);
}
catch(Exception Exp)
{
IronException.Report("Error reading Request", Exp.Message, Exp.StackTrace);
return;
}
if (IrSe == null)
{
IronException.Report("Error reading Request", "", "");
return;
}
if (IrSe.Request == null)
{
IronException.Report("Error reading Request", "", "");
return;
}
if (IrSe.FiddlerSession == null)
{
IronException.Report("Error reading Request", "", "");
return;
}
//Needs to be turned on to read the response body
IrSe.FiddlerSession.bBufferResponse = true;
IrSe.Request.TimeObject = DateTime.Now;
if (Sess.oFlags.ContainsKey("IronFlag-Ticks"))
{
IrSe.FiddlerSession.oFlags["IronFlag-Ticks"] = IrSe.Request.TimeObject.Ticks.ToString();
}
else
{
IrSe.FiddlerSession.oFlags.Add("IronFlag-Ticks", IrSe.Request.TimeObject.Ticks.ToString());
}
//try
//{
// Session ClonedIronSessionWithRequest = IrSe.GetClone();
// if (ClonedIronSessionWithRequest != null && ClonedIronSessionWithRequest.Request != null)
// PassiveChecker.AddToCheckRequest(ClonedIronSessionWithRequest);
// else
// IronException.Report("IronSession Request Couldn't be cloned at ID - " + IrSe.ID.ToString(),"","");
//}
//catch(Exception Exp)
//{
// IronException.Report("Error Cloning IronSession in BeforeRequest", Exp.Message, Exp.StackTrace);
//}
if (PluginEngine.ShouldRunRequestBasedPassivePlugins())
{
try
{
PluginEngine.RunAllRequestBasedInlinePassivePlugins(IrSe);
IrSe.UpdateFiddlerSessionFromIronSession();
}
catch (Exception Exp)
{
//.........这里部分代码省略.........
示例15: CanInterceptResponse
static bool CanInterceptResponse(Session Sess)
{
if (ScriptedInterceptionEnabled)
{
try
{
return ScInt.ShouldIntercept(Sess);
}
catch (Exception Exp)
{
IronUI.ShowProxyException("Error in Scripted Interception Script");
IronException.Report("Error in Scripted Interception Script", Exp);
return false;
}
}
else if (InterceptResponse)
{
return CanInterceptBasedOnFilter(Sess.Request, Sess.Response);
}
else
{
return false;
}
}