def main(): stix_package = STIXPackage() ttp_phishing = TTP(title="Phishing") attack_pattern = AttackPattern() attack_pattern.capec_id = "CAPEC-98" attack_pattern.description = ("Phishing") ttp_phishing.behavior = Behavior() ttp_phishing.behavior.add_attack_pattern(attack_pattern) ttp_pivy = TTP(title="Poison Ivy Variant d1c6") malware_instance = MalwareInstance() malware_instance.add_name("Poison Ivy Variant d1c6") malware_instance.add_type("Remote Access Trojan") ttp_pivy.behavior = Behavior() ttp_pivy.behavior.add_malware_instance(malware_instance) ta_bravo = ThreatActor(title="Adversary Bravo") ta_bravo.identity = Identity(name="Adversary Bravo") related_ttp_phishing = RelatedTTP(TTP(idref=ttp_phishing.id_), relationship="Leverages Attack Pattern") ta_bravo.observed_ttps.append(related_ttp_phishing) related_ttp_pivy = RelatedTTP(TTP(idref=ttp_pivy.id_), relationship="Leverages Malware") ta_bravo.observed_ttps.append(related_ttp_pivy) stix_package.add_ttp(ttp_phishing) stix_package.add_ttp(ttp_pivy) stix_package.add_threat_actor(ta_bravo) print stix_package.to_xml()
def main(): stix_package = STIXPackage() ttp_phishing = TTP(title="Phishing") attack_pattern = AttackPattern() attack_pattern.capec_id = "CAPEC-98" attack_pattern.description = ("Phishing") ttp_phishing.behavior = Behavior() ttp_phishing.behavior.add_attack_pattern(attack_pattern) ttp_pivy = TTP(title="Poison Ivy Variant d1c6") malware_instance = MalwareInstance() malware_instance.add_name("Poison Ivy Variant d1c6") malware_instance.add_type("Remote Access Trojan") ttp_pivy.behavior = Behavior() ttp_pivy.behavior.add_malware_instance(malware_instance) ta_bravo = ThreatActor(title="Adversary Bravo") ta_bravo.identity = Identity(name="Adversary Bravo") related_ttp_phishing = RelatedTTP(TTP(idref=ttp_phishing.id_), relationship="Leverages Attack Pattern") ta_bravo.observed_ttps.append(related_ttp_phishing) related_ttp_pivy = RelatedTTP(TTP(idref=ttp_pivy.id_), relationship="Leverages Malware") ta_bravo.observed_ttps.append(related_ttp_pivy) stix_package.add_ttp(ttp_phishing) stix_package.add_ttp(ttp_pivy) stix_package.add_threat_actor(ta_bravo) print(stix_package.to_xml(encoding=None))
def _buildttp(i, expt): """Do some TTP stuff.""" ttp = TTP() ttp.title = str(i['name']) # The summary key is a list. In 1.2 this is represented # properly using description ordinality. ttp.description = i['summary'] attack_pattern = AttackPattern() attack_pattern.capec_id = "CAPEC-" + str(i['id']) ttp.behavior = Behavior() ttp.behavior.add_attack_pattern(attack_pattern) ttp.exploit_targets.append(ExploitTarget(idref=expt.id_)) return ttp
def _buildttp(data): ttp = TTP() ttp.title = data['name'] ttp.description = data['description'] attack_pattern = AttackPattern() attack_pattern.capec_id = "CAPEC-" + str(data['id']) attack_pattern.title = data['name'] attack_pattern.description = data['description'] ttp.behavior = Behavior() ttp.behavior.add_attack_pattern(attack_pattern) ttp.information_source = InformationSource() ttp.information_source.identity = Identity() ttp.information_source.identity.name = "The MITRE Corporation" ttp.information_source.references = data['references'] return ttp
from stix.ttp import TTP, Behavior from stix.ttp.behavior import AttackPattern, Exploit, MalwareInstance from stix.ttp.infrastructure import Infrastructure from stix.ttp.resource import Personas, Resource, Tools from stix.ttp.victim_targeting import VictimTargeting # TTP (Phishing) ttp = TTP(title='Phishing') ttp.description = 'Integer posuere erat a ante venenatis dapibus posuere velit aliquet.' ttp.short_description = 'Etiam Vestibulum Elit Ligula' ttp.add_intended_effect(IntendedEffect('Account Takeover')) # TTP - Attack Pattern attack_pattern = AttackPattern() attack_pattern.capec_id = 'CAPEC-98' attack_pattern.description = 'Phishing' attack_pattern.short_description = 'Phishing' ttp.behavior = Behavior() ttp.behavior.add_attack_pattern(attack_pattern) # TTP - Kill Chain Phase phase = KillChainPhase( name='Infect Machine', phase_id='example:TTP-7a0fb8e4-a778-4c79-9c7e-8747675da5f1') kc_phases = KillChainPhasesReference() kc_phases.append(KillChainPhaseReference(name=phase.name)) ttp.kill_chain_phases = kc_phases # TTP - Resource (Tool, Infrastructure, Personas) resource = Resource()