| | |
- Struct
- openCVSS
class Struct |
| |
Allows for the creations of enums
Thanks to norvig.com/python-iaq.html |
| |
- __init__(self, **entries)
|
class openCVSS |
| |
openCVSS class consisting of 2 core functions
1 function will take all the arguments in and the other will calculate the score based on those arguments |
| |
- __init__(self)
- Define the global variables and create enums to store variables in a clean fashion
- calcAdjustedBaseScore(self)
- Calculates the AdjustedBaseScore and then calls setAdjustedBaseScore
- calcAdjustedImpactScore(self)
- Calculates the AdjustedImpactScore and then calls setAdjustedImpactScore
AdjustedImpact = Min(10, 10.41*(1-(1-ConfImpact*ConfReq)*(1-IntegImpact*IntegReq)*(1-AvailImpact*AvailReq)))
- calcAdjustedTemporalScore(self)
- Calculates the AdjustedTemporalScore and then calls setAdjustedTemporalScore
AdjustedTemporal = TemporalScore recomputed with the Impact sub-equation replaced with the following AdjustedImpact equation.
- calcBaseScore(self)
- Calculates the BaseScore and then calls setBaseScore
BaseScore = (.6*Impact +.4*Exploitability-1.5)*f(Impact)
- calcEnviromentalScore(self)
- Calculates the EnviromentalScore by calling several "adjusted" functions
After calculation setEnviromentalScore is called
EnvironmentalScore=(AdjustedTemporal+(10-AdjustedTemporal)*CollateralDamagePotential) * TargetDistribution
- calcExploitabilityScore(self)
- Calculates the ExploitabilityScore and then calls setExploitabilityScore
Exploitability = 20*AccessComplexity*Authentication*AccessVector
- calcImpactScore(self)
- Calculates the ImpactScore and then calls setImpactScore
Impact = 10.41*(1-(1-ConfImpact)(1-IntegImpact)*(1-AvailImpact))
- calcTemporalScore(self)
- Calculates the TemporalScore and then calls setTemporalScore
TemporalScore=BaseScore*Exploitability*RemediationLevel*ReportConfidence
- calculate(self)
- Calculate all the values that were defined in the scores function
Calculations are made based on the latest CVSS scores.
http://nvd.nist.gov/cvsseq2.htm
- decideImpacter(self, anyImpactScore)
- Decide what the impacter is based on the incoming impact score, then return.
Mimics - f(Impact) = 0 if Impact=0; 1.176 otherwise
- displayResults(self)
- print the results from the calculations
- getAC(self)
- get AC value
- getAI(self)
- get AI value
- getAR(self)
- get AR value
- getAU(self)
- get AU value
- getAV(self)
- get AV value
- getAdjustedBaseScore(self)
- get AdjustedBaseScore value
- getAdjustedImpactScore(self)
- get AdjustedImpactScore value
- getAdjustedTemporalScore(self)
- get AdjustedTemporalScore value
- getBaseScore(self)
- get BaseScore value
- getCD(self)
- get CD value
- getCI(self)
- get CI value
- getCR(self)
- get CR value
- getEX(self)
- get EX value
- getEnviromentalScore(self)
- get EnviromentalScore value
- getExploitabilityScore(self)
- get ExploitabilityScore value
- getII(self)
- get II value
- getIR(self)
- get IR value
- getImpactScore(self)
- get ImpactScore value
- getRC(self)
- get RC value
- getRL(self)
- get RL value
- getTD(self)
- get TD value
- getTemporalScore(self)
- get TemporalScore value
- info(self)
- Print a banner on the top of the screen. Functions as nothing more than an add-on
- scores(self, AV, AC, AU, CI, II, AI, EX, RL, RC, CD, TD, CR, IR, AR)
- scores takes in 14 arguments representing several aspects of what make up a CVSS score
- setAC(self, AC)
- set AC to a value or throw exception
- setAI(self, AI)
- set AI to a value or throw exception
- setAR(self, AR)
- set AR to a value
- setAU(self, AU)
- set AU to a value or throw exception
- setAV(self, AV)
- set AV to a value or throw exception
- setAdjustedBaseScore(self, adjustedBaseScoreCalculated)
- set AdjustedBaseScore value
- setAdjustedImpactScore(self, adjustedImpactScoreCalculated)
- set AdjustedImpactScore value
- setAdjustedTemporalScore(self, adjustedTemporalScoreCalculated)
- set AdjustedTemporalScore value
- setBaseScore(self, baseScoreCalculated)
- set BaseScore value
- setCD(self, CD)
- set CD to a value
- setCI(self, CI)
- set CI to a value or throw exception
- setCR(self, CR)
- set CR to a value
- setEX(self, EX)
- set EX to a value
- setEnviromentalScore(self, enviromentalScoreCalculated)
- set EnviromentalScore value
- setExploitabilityScore(self, exploitabilityScoreCalculated)
- set ExploitabilityScore value
- setII(self, II)
- set II to a value or throw exception
- setIR(self, IR)
- set IR to a value
- setImpactScore(self, impactScoreCalculated)
- set ImpactScore value
- setRC(self, RC)
- set RC to a value
- setRL(self, RL)
- set RL to a value
- setTD(self, TD)
- set TD to a value
- setTemporalScore(self, temporalScoreCalculated)
- set TemporalScore value
| |