本文整理汇总了C#中IO2Finding类的典型用法代码示例。如果您正苦于以下问题:C# IO2Finding类的具体用法?C# IO2Finding怎么用?C# IO2Finding使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IO2Finding类属于命名空间,在下文中一共展示了IO2Finding类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: addTrace
public static void addTrace(IO2Finding o2Finding, List<string> values, string key)
{
foreach (string value in values)
{
o2Finding.o2Traces.Add(new O2Trace(key + " = " + value));
}
}
开发者ID:SiGhTfOrbACQ,项目名称:O2.Platform.Scripts,代码行数:7,代码来源:O2AssesmentLoad_WebScarab.cs
示例2: createCopy
public static IO2Finding createCopy(IO2Finding o2Finding, bool processChildTraces)
{
var newO2Finding = new O2Finding
{
actionObject = o2Finding.actionObject,
callerName = o2Finding.callerName,
context = o2Finding.context,
columnNumber = o2Finding.actionObject,
confidence = o2Finding.confidence,
exclude = o2Finding.exclude,
file = o2Finding.file,
lineNumber = o2Finding.lineNumber,
ordinal = o2Finding.ordinal,
projectName = o2Finding.projectName,
propertyIds = o2Finding.propertyIds,
recordId = o2Finding.recordId,
severity = o2Finding.severity,
text = createCopy(o2Finding.text),
vulnName = o2Finding.vulnName,
vulnType = o2Finding.vulnType
};
if (processChildTraces)
newO2Finding.o2Traces = createCopy(o2Finding.o2Traces);
return newO2Finding;
}
开发者ID:pusp,项目名称:o2platform,代码行数:26,代码来源:OzasmtCopy.cs
示例3: createCopy
public static IO2Finding createCopy(IO2Finding o2Finding, bool processChildTraces)
{
var newO2Finding = new O2Finding();
newO2Finding.vulnType = o2Finding.vulnType;
newO2Finding.vulnName = o2Finding.vulnName;
newO2Finding.text = createCopy(o2Finding.text);
newO2Finding.severity = o2Finding.severity;
newO2Finding.recordId = o2Finding.recordId;
newO2Finding.propertyIds = o2Finding.propertyIds;
newO2Finding.projectName = o2Finding.projectName;
newO2Finding.ordinal = o2Finding.ordinal;
newO2Finding.lineNumber = o2Finding.lineNumber;
newO2Finding.file = o2Finding.file;
newO2Finding.exclude = o2Finding.exclude;
newO2Finding.confidence = o2Finding.confidence;
newO2Finding.columnNumber = o2Finding.actionObject;
newO2Finding.context = o2Finding.context;
newO2Finding.callerName = o2Finding.callerName;
newO2Finding.actionObject = o2Finding.actionObject;
if (processChildTraces)
newO2Finding.o2Traces = createCopy(o2Finding.o2Traces);
return newO2Finding;
}
开发者ID:njmube,项目名称:FluentSharp,代码行数:25,代码来源:OzasmtCopy.cs
示例4: addFindingDataToO2Finding
private static void addFindingDataToO2Finding(AssessmentAsmntFileFinding finding, IO2Finding o2Finding, AssessmentRun assessmentRun)
{
AssessmentRunFindingData findingData = assessmentRun.FindingDataPool[finding.data_id-1];
AssessmentRunSite siteData = assessmentRun.SitePool[findingData.site_id - 1];
if (findingData.id != finding.data_id || siteData.id != findingData.site_id)
DI.log.error("in addFindingDataToO2Finding findingData.id != (finding.data_id-1) or siteData.id != (findingData.site_id - 1)");
else
{
o2Finding.actionObject = findingData.ao_id;
o2Finding.callerName = getStringIndexValue(siteData.caller, assessmentRun);
o2Finding.columnNumber = siteData.cn;
o2Finding.confidence = (byte) findingData.conf;
o2Finding.context = getStringIndexValue(siteData.cxt, assessmentRun);
o2Finding.exclude = finding.excluded;
o2Finding.file = getFileIndexValue(siteData.file_id, assessmentRun);
o2Finding.lineNumber = siteData.ln;
o2Finding.method = getStringIndexValue(siteData.method, assessmentRun);
o2Finding.ordinal = siteData.ord;
o2Finding.projectName = getStringIndexValue(findingData.project_name, assessmentRun);
o2Finding.propertyIds = findingData.prop_ids; /**/
o2Finding.recordId = findingData.rec_id;
o2Finding.severity = (byte) findingData.sev;
// o2Finding.signature = getStringIndexValue(siteData.sig, assessmentRun);
o2Finding.text = null; /**/
o2Finding.vulnName = getStringIndexValue(siteData.sig, assessmentRun); /*making the sig the vuln name*/
o2Finding.vulnType = getStringIndexValue(findingData.vtype, assessmentRun);
}
}
开发者ID:o2platform,项目名称:O2.Platform.Projects.Misc_and_Legacy,代码行数:29,代码来源:OzasmUtils_OunceV6_1.cs
示例5: loadO2Finding
public void loadO2Finding(IO2Finding _o2Finding)
{
Threads_ExtensionMethods.invokeOnThread((Control) this, () =>
{
o2Finding = _o2Finding;
showO2TraceTree();
return null;
});
}
开发者ID:pusp,项目名称:o2platform,代码行数:9,代码来源:ascx_TraceTreeView.Controllers.cs
示例6: createCopyAndGlueTraceSinkWithTrace
public static IO2Finding createCopyAndGlueTraceSinkWithTrace(IO2Finding o2TemplateFinding,
List<IO2Trace> o2TracesToGlue)
{
IO2Finding o2NewFinding = OzasmtCopy.createCopy(o2TemplateFinding);
//IO2Trace newFindingSink = OzasmtUtils.getKnownSink(o2NewFinding.o2Traces);
IO2Trace newFindingSink = OzasmtUtils.getSink(o2NewFinding.o2Traces);
newFindingSink.traceType = TraceType.Root_Call;
foreach (O2Trace o2TraceToGlue in o2TracesToGlue)
{
o2TraceToGlue.traceType = TraceType.Root_Call;
newFindingSink.childTraces.Add(o2TraceToGlue);
}
return o2NewFinding;
}
开发者ID:njmube,项目名称:FluentSharp,代码行数:14,代码来源:OzasmtGlue.cs
示例7: createAllPartialTraces
public static void createAllPartialTraces(IEnumerable<IO2Trace> o2TracesToFollow, ICollection<IO2Trace> o2PartialTraces, IO2Finding parentFinding, ICollection<IO2Finding> findingsCreated)
{
// process all traces
foreach (var o2TraceToFollow in o2TracesToFollow)
{
// create a copy of the current trace
var newO2Trace = OzasmtCopy.createCopy(o2TraceToFollow, false);
//newO2Trace.childTraces = new List<IO2Trace>(); // remove the child traces
// add it to the trace we are building
o2PartialTraces.Add(newO2Trace);
// create a copy of the parent finding
var newO2Finding = OzasmtCopy.createCopy(parentFinding);
findingsCreated.Add(newO2Finding);
// and trigger the recursive execution on all child traces
createAllPartialTraces(o2TraceToFollow.childTraces, newO2Trace.childTraces, parentFinding, findingsCreated);
}
}
开发者ID:pusp,项目名称:o2platform,代码行数:17,代码来源:Filter_CreateAllPartialTraces.cs
示例8: addTraceToO2Finding
private static void addTraceToO2Finding(string traces, IO2Finding o2Finding, AssessmentRun assessmentRun)
{
if (false == string.IsNullOrEmpty(traces))
{
var splittedTraces = traces.Split(',');
var traceStack = new Stack<List<IO2Trace>>(); // use to keep track of where we add the trace
traceStack.Push(o2Finding.o2Traces); // the first one is the main o2Findings.o2Traces
foreach(var traceItem in splittedTraces)
{
var splittedTrace = traceItem.Split('.'); // in this version the dots mean how many nodes we have to go up
int traceIndex;
if (Int32.TryParse(splittedTrace[0], out traceIndex))
{
AssessmentRunTaint taint = assessmentRun.TaintPool[traceIndex - 1];
AssessmentRunSite siteData = assessmentRun.SitePool[taint.site_id - 1];
var o2Trace = new O2Trace
{
caller = getStringIndexValue(siteData.caller, assessmentRun),
columnNumber = siteData.cn,
context = getStringIndexValue(siteData.cxt, assessmentRun),
file = getFileIndexValue(siteData.file_id, assessmentRun),
lineNumber = siteData.ln,
method = getStringIndexValue(siteData.method, assessmentRun),
ordinal = siteData.ord,
signature = getStringIndexValue(siteData.sig, assessmentRun),
argument = taint.arg,
direction = taint.dir,
traceType =((TraceType) Enum.Parse(typeof (TraceType), taint.trace_type.ToString()))
};
//o2Trace.clazz = getStringIndexValue(,assessmentRun); // check if siteData.caller is a good match for clazz
//o2Trace.taintPropagation = ;
//o2Trace.text = ;
traceStack.Peek().Add(o2Trace); // add the current trace as a child of the the item on the top of traceStack
traceStack.Push(o2Trace.childTraces); // and make the current trace the item on the top of traceStack (which will be changed if there were dots in the traceItem (handled below))
}
else
{
DI.log.error("in addTraceToO2Finding , could not parse into int {0} from {1}", splittedTrace[0], traceItem);
}
if (splittedTrace.Length > 1) // means there were dots in the traceitem
for (var i = 1; i < splittedTrace.Length; i++)
traceStack.Pop();
}
o2Finding.o2Traces[0].signature += traces;
}
}
开发者ID:o2platform,项目名称:O2.Platform.Projects.Misc_and_Legacy,代码行数:46,代码来源:OzasmUtils_OunceV6_1.cs
示例9: applySinkRuleToFindingAndTrace
public static List<IO2Finding> applySinkRuleToFindingAndTrace(IO2Finding o2Finding, string traceSignature, IDictionary<string, List<IO2Rule>> indexedRules)
{
var newFindings = new List<IO2Finding>();
if (traceSignature != "" && indexedRules.ContainsKey(traceSignature))
{
// apply rules settings to it
foreach (var o2Rule in indexedRules[traceSignature])
{
// create copy of finding
var newO2Finding = OzasmtCopy.createCopy(o2Finding);
// apply rule
newO2Finding.severity = OzasmtUtils.getSeverityFromString(o2Rule.Severity);
newO2Finding.vulnName = o2Rule.Signature;
newO2Finding.vulnType = o2Rule.VulnType;
newFindings.Add(newO2Finding);
}
}
return newFindings;
}
开发者ID:o2platform,项目名称:O2.Platform.Projects.Misc_and_Legacy,代码行数:19,代码来源:FiltersUtils.cs
示例10: openInFloatWindow
public static void openInFloatWindow(IO2Finding o2Finding)
{
O2Thread.mtaThread(
() =>
{
var windowName = "Finding Editor for: " + o2Finding;
O2Messages.openControlInGUISync(typeof (ascx_FindingEditor), O2DockState.Float,
windowName);
O2Messages.getAscx(windowName, guiControl =>
{
if (guiControl != null &&
guiControl is ascx_FindingEditor)
{
var findingEditor =
(ascx_FindingEditor) guiControl;
findingEditor.loadO2Finding(
o2Finding, false);
}
});
});
}
开发者ID:njmube,项目名称:FluentSharp,代码行数:21,代码来源:ascx_FindingEditor.Controllers.cs
示例11: applyRuleToTrace
private static bool applyRuleToTrace(IO2Trace o2Trace, ICollection<IO2Trace> o2PartialTraces, IO2Finding parentO2Finding, List<IO2Finding> findingsCreated, IDictionary<string, List<IO2Rule>> indexedRules)
{
// if (o2Trace.signature.IndexOf("System.Data.SqlClient.SqlCommand") > -1)
// DI.log.info(o2Trace.signature);
var signatureToFind = MakeSignatureCompatibleWithOunceRules(o2Trace.signature);
// if (signatureToFind.IndexOf("System.Data.SqlClient") > -1)
// DI.log.info(signatureToFind);
if (indexedRules.ContainsKey(signatureToFind)) // means we have a match
{
// rename to shouldAbortRulesCreation
if (shouldAbortRulesExecution(indexedRules[signatureToFind]))
{
if (o2Trace.traceType == TraceType.Known_Sink || o2Trace.traceType == TraceType.Lost_Sink)
return false;
return true;
}
// check if we are a sink at the root of the tree with no child nodes (and if so skip trace creation)
if (parentO2Finding.o2Traces.Count == 0 )//; && (o2Trace.traceType == TraceType.Known_Sink || o2Trace.traceType == TraceType.Lost_Sink || o2Trace.traceType == TraceType.Root_Call))
return true;
// check if there are no sources on the trace
if (((O2Finding)parentO2Finding).Source == "")
return false;
var newTrace = OzasmtCopy.createCopy(o2Trace, false); //create new trace (which will be modified
newTrace.traceType = TraceType.Known_Sink; // make the trace a sink
o2PartialTraces.Add(newTrace); // add it to the partial trace
var newFindingWithSinkTrace = OzasmtCopy.createCopy(parentO2Finding); // create template finding which will be applied the rules
findingsCreated.AddRange(FiltersUtils.applySinkRuleToFindingAndTrace(newFindingWithSinkTrace, signatureToFind, indexedRules)); // apply rules and add resulting findings to findingsCreated list
//remove the new trace since the invokeOnAllPartialTraces loop will add its own copy
o2PartialTraces.Remove(newTrace);
}
return true; // in this case return true since we want to process ALL traces
}
开发者ID:o2platform,项目名称:O2.Platform.Projects.Misc_and_Legacy,代码行数:39,代码来源:Filter_MapSinksToAllTraces.cs
示例12: calculateTreeNodeText
private static string calculateTreeNodeText(IO2Finding o2Finding, string propertyToUse, string filterToUse)
{
string nodeText;
try
{
switch (propertyToUse)
{
case "severity":
return OzasmtUtils.getSeverityFromId(o2Finding.severity);
case "confidence":
return OzasmtUtils.getConfidenceFromId(o2Finding.confidence);
case "o2Traces":
var allO2Traces = OzasmtUtils.getAllTraces(o2Finding.o2Traces);
return (allO2Traces.Keys.Count > 0) ? string.Format("# nodes: {0}", allO2Traces.Keys.Count) : "";
default:
nodeText = DI.reflection.getProperty(propertyToUse, o2Finding).ToString();
break;
}
if (nodeText != "")
if (RegEx.findStringInString(nodeText, filterToUse) || nodeText.IndexOf(filterToUse) > -1)
return nodeText;
else
return "";
return nodeText;
}
catch (Exception ex)
{
DI.log.error("in calculateTreeNodeText: {0}", ex.Message);
return "[O2 Error (check logs for details)]";
}
}
开发者ID:pusp,项目名称:o2platform,代码行数:34,代码来源:ascx_FindingsViewer.Controllers.cs
示例13: findingWith_Traces_LostSinks
public static bool findingWith_Traces_LostSinks(IO2Finding o2Finding)
{
return ((O2Finding)o2Finding).LostSink != "";
}
开发者ID:CallMeSteve,项目名称:O2.Platform.Scripts,代码行数:4,代码来源:Analysis_WorkFlow_Phase_2.cs
示例14: findingWith_Traces_KnownSinks
public static bool findingWith_Traces_KnownSinks(IO2Finding o2Finding)
{
return ((O2Finding)o2Finding).KnownSink != "";
}
开发者ID:CallMeSteve,项目名称:O2.Platform.Scripts,代码行数:4,代码来源:Analysis_WorkFlow_Phase_2.cs
示例15: findingWith_Traces
public static bool findingWith_Traces(IO2Finding o2Finding)
{
return o2Finding.o2Traces.Count > 0;
}
开发者ID:CallMeSteve,项目名称:O2.Platform.Scripts,代码行数:4,代码来源:Analysis_WorkFlow_Phase_2.cs
示例16: mapFindingsToSourceCode
/*public bool loadReferenceFindings(string ozasmtFileWithReferenceFindings)
{
if (File.Exists(ozasmtFileWithReferenceFindings) && Path.GetExtension(ozasmtFileWithReferenceFindings).ToLower() == ".ozasmt")
{
O2Thread.mtaThread(
() =>
{
var thread =
findingsViewerfor_ReferenceFindings.loadO2Assessment(ozasmtFileWithReferenceFindings);
thread.Join();
this.invokeOnThread(
() =>
{
lbNumberOfReferenceFindingsLoaded.Text =
findingsViewerfor_ReferenceFindings.currentO2Findings.Count.ToString();
mapFindingsToSourceCode(findingsViewerfor_ReferenceFindings.currentO2Findings, dgvfunctionsMappings);
});
});
return true;
}
return false;
}*/
/*public void mapFindingsToSourceCode()
{
this.invokeOnThread(() =>mapFindingsToSourceCode(findingsViewerfor_ReferenceFindings.currentO2Findings, dgvfunctionsMappings));
}
public void mapFindingsToSourceCode(List<IO2Finding> o2FindingsToMap,DataGridView targetDataGridView)
{
DI.log.info("Mapping findings to Source Code");
var o2time = new O2Timer("Compled mapping").start();
var mappedMethodsToSourceCode = new Dictionary<string, string>();
foreach (var o2Finding in o2FindingsToMap)
{
addFindingToMappedSourceCode(o2Finding, mappedMethodsToSourceCode);
}
showMethodsMappedToSourceCodeInDataGridView(mappedMethodsToSourceCode, targetDataGridView);
o2time.stop();
}*/
public void addFindingToMappedSourceCode(IO2Finding o2Finding, Dictionary<string, string> mappedMethodsToSourceCode)
{
var findingUniqueTraces = ((O2Finding) o2Finding).getUniqueTraces();
foreach (O2Trace o2Trace in findingUniqueTraces)
if (doesSignatureRepresentAMethodOnTheFilenameReference(o2Trace.signature, o2Trace.SourceCode))
{
string sourceCodeReference = string.Format("{0}::{1}", o2Finding.file, o2Finding.lineNumber);
if (!mappedMethodsToSourceCode.ContainsKey(o2Finding.vulnName))
mappedMethodsToSourceCode.Add(o2Finding.vulnName, sourceCodeReference);
else if (mappedMethodsToSourceCode[o2Finding.vulnName] != sourceCodeReference)
{
}
}
}
开发者ID:o2platform,项目名称:O2.Platform.Projects.Misc_and_Legacy,代码行数:58,代码来源:ascx_CreateSpringMvcMappings.Controllers.cs
示例17: loadO2Finding
private void loadO2Finding(IO2Finding o2Finding, bool fromSerializedData)
{
o2FindingLoadedViaSerializedData = fromSerializedData;
loadO2Finding(o2Finding);
}
开发者ID:pusp,项目名称:o2platform,代码行数:6,代码来源:ascx_FindingEditor.Controllers.cs
示例18: getAssessmentAssessmentFileFinding
public static AssessmentAssessmentFileFinding getAssessmentAssessmentFileFinding(IO2Finding o2Finding, Dictionary<string, uint> dStringIndexes, Dictionary<string, uint> dFilesIndexes)
{
try
{
var finding = new AssessmentAssessmentFileFinding
{
actionobject_id = o2Finding.actionObject,
caller_name_id =
addTextToStringIndexes(o2Finding.callerName, dStringIndexes).ToString(),
column_number = o2Finding.columnNumber,
confidence = o2Finding.confidence,
cxt_id = addTextToStringIndexes(o2Finding.context, dStringIndexes).ToString(),
exclude = o2Finding.exclude,
line_number = o2Finding.lineNumber,
ordinal = o2Finding.ordinal,
project_name_id =
addTextToStringIndexes(o2Finding.projectName, dStringIndexes).ToString(),
property_ids = o2Finding.propertyIds,
record_id = o2Finding.recordId,
severity = o2Finding.severity,
Text = (o2Finding.text!=null) ? o2Finding.text.ToArray(): null,
vuln_name_id = addTextToStringIndexes(o2Finding.vulnName, dStringIndexes).ToString(),
vuln_type_id = addTextToStringIndexes(o2Finding.vulnType, dStringIndexes).ToString()
};
if (o2Finding.o2Traces.Count > 0)
{
var callInvocations = new List<CallInvocation>();
foreach (O2Trace o2trace in o2Finding.o2Traces)
callInvocations.Add(getCallInvocationObjectFromO2Trace(o2trace, dStringIndexes, dFilesIndexes));
finding.Trace = callInvocations.ToArray();
}
//if (o2Finding.o2Trace != null)
// finding.Trace = new[] {getCallInvocationObjectFromO2Trace((o2Finding.o2Trace), assessmentRun)};
return finding;
}
catch (Exception ex)
{
ex.log("in getAssessmentAssessmentFileFinding");
}
return null;
}
开发者ID:paul-green,项目名称:O2.Platform.Scripts,代码行数:42,代码来源:OzasmtUtils_OunceV6.cs
示例19: openInFloatWindow
public static Thread openInFloatWindow(IO2Finding o2Finding)
{
return openInFloatWindow(new List<IO2Finding> { o2Finding });
}
开发者ID:pusp,项目名称:o2platform,代码行数:4,代码来源:ascx_FindingsViewer.Controllers.cs
示例20: show
public static ascx_TraceTreeView show(this ascx_TraceTreeView traceViewer, IO2Finding iO2Finding)
{
traceViewer.loadO2Finding(iO2Finding);
return traceViewer;
}
开发者ID:SiGhTfOrbACQ,项目名称:O2.Platform.Scripts,代码行数:5,代码来源:Findings_ExtensionMethods.cs
注:本文中的IO2Finding类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论