Skip to content

Instantly share code, notes, and snippets.

@tsondt
Created January 11, 2018 07:36
Show Gist options
  • Save tsondt/8ce8a9b4cfd355960c34f0272525bd6f to your computer and use it in GitHub Desktop.
Save tsondt/8ce8a9b4cfd355960c34f0272525bd6f to your computer and use it in GitHub Desktop.
from lxml import etree
ifile = open('capec_v2.6.xml', 'r')
for ev, el in etree.iterparse(ifile,events=('start',), tag='{http://capec.mitre.org/capec-2}Category'):
for i in el.iter():
if 'Name' in i.attrib:
if i.get('Status') == 'Draft':
if 'WASC' not in i.get('Name'):
print 'CAPEC-' + i.get('ID') + '-' + i.get('Name')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment