repo stringlengths 7 55 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 19 28.4k | docstring stringlengths 1 46.9k | docstring_tokens listlengths 1 1.97k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
the01/python-flotils | flotils/loadable.py | Loadable._load_json_file | def _load_json_file(self, file, decoder=None):
"""
Load data from json file
:param file: Readable file or path to file
:type file: FileIO | str | unicode
:param decoder: Use custom json decoder
:type decoder: T <= flotils.loadable.DateTimeDecoder
:return: Json da... | python | def _load_json_file(self, file, decoder=None):
"""
Load data from json file
:param file: Readable file or path to file
:type file: FileIO | str | unicode
:param decoder: Use custom json decoder
:type decoder: T <= flotils.loadable.DateTimeDecoder
:return: Json da... | [
"def",
"_load_json_file",
"(",
"self",
",",
"file",
",",
"decoder",
"=",
"None",
")",
":",
"try",
":",
"res",
"=",
"load_json_file",
"(",
"file",
",",
"decoder",
"=",
"decoder",
")",
"except",
"ValueError",
"as",
"e",
":",
"if",
"\"{}\"",
".",
"format"... | Load data from json file
:param file: Readable file or path to file
:type file: FileIO | str | unicode
:param decoder: Use custom json decoder
:type decoder: T <= flotils.loadable.DateTimeDecoder
:return: Json data
:rtype: None | int | float | str | list | dict
:... | [
"Load",
"data",
"from",
"json",
"file"
] | 5954712776bb590107e5b2f4362d010bf74f77a1 | https://github.com/the01/python-flotils/blob/5954712776bb590107e5b2f4362d010bf74f77a1/flotils/loadable.py#L470-L492 | train |
the01/python-flotils | flotils/loadable.py | Loadable._save_json_file | def _save_json_file(
self, file, val,
pretty=False, compact=True, sort=True, encoder=None
):
"""
Save data to json file
:param file: Writable file or path to file
:type file: FileIO | str | unicode
:param val: Value or struct to save
:type val: None |... | python | def _save_json_file(
self, file, val,
pretty=False, compact=True, sort=True, encoder=None
):
"""
Save data to json file
:param file: Writable file or path to file
:type file: FileIO | str | unicode
:param val: Value or struct to save
:type val: None |... | [
"def",
"_save_json_file",
"(",
"self",
",",
"file",
",",
"val",
",",
"pretty",
"=",
"False",
",",
"compact",
"=",
"True",
",",
"sort",
"=",
"True",
",",
"encoder",
"=",
"None",
")",
":",
"try",
":",
"save_json_file",
"(",
"file",
",",
"val",
",",
"... | Save data to json file
:param file: Writable file or path to file
:type file: FileIO | str | unicode
:param val: Value or struct to save
:type val: None | int | float | str | list | dict
:param pretty: Format data to be readable (default: False)
:type pretty: bool
... | [
"Save",
"data",
"to",
"json",
"file"
] | 5954712776bb590107e5b2f4362d010bf74f77a1 | https://github.com/the01/python-flotils/blob/5954712776bb590107e5b2f4362d010bf74f77a1/flotils/loadable.py#L494-L520 | train |
the01/python-flotils | flotils/loadable.py | Loadable._load_yaml_file | def _load_yaml_file(self, file):
"""
Load data from yaml file
:param file: Readable object or path to file
:type file: FileIO | str | unicode
:return: Yaml data
:rtype: None | int | float | str | unicode | list | dict
:raises IOError: Failed to load
"""
... | python | def _load_yaml_file(self, file):
"""
Load data from yaml file
:param file: Readable object or path to file
:type file: FileIO | str | unicode
:return: Yaml data
:rtype: None | int | float | str | unicode | list | dict
:raises IOError: Failed to load
"""
... | [
"def",
"_load_yaml_file",
"(",
"self",
",",
"file",
")",
":",
"try",
":",
"res",
"=",
"load_yaml_file",
"(",
"file",
")",
"except",
":",
"self",
".",
"exception",
"(",
"\"Failed to load from {}\"",
".",
"format",
"(",
"file",
")",
")",
"raise",
"IOError",
... | Load data from yaml file
:param file: Readable object or path to file
:type file: FileIO | str | unicode
:return: Yaml data
:rtype: None | int | float | str | unicode | list | dict
:raises IOError: Failed to load | [
"Load",
"data",
"from",
"yaml",
"file"
] | 5954712776bb590107e5b2f4362d010bf74f77a1 | https://github.com/the01/python-flotils/blob/5954712776bb590107e5b2f4362d010bf74f77a1/flotils/loadable.py#L522-L537 | train |
the01/python-flotils | flotils/loadable.py | Loadable._save_yaml_file | def _save_yaml_file(self, file, val):
"""
Save data to yaml file
:param file: Writable object or path to file
:type file: FileIO | str | unicode
:param val: Value or struct to save
:type val: None | int | float | str | unicode | list | dict
:raises IOError: Faile... | python | def _save_yaml_file(self, file, val):
"""
Save data to yaml file
:param file: Writable object or path to file
:type file: FileIO | str | unicode
:param val: Value or struct to save
:type val: None | int | float | str | unicode | list | dict
:raises IOError: Faile... | [
"def",
"_save_yaml_file",
"(",
"self",
",",
"file",
",",
"val",
")",
":",
"try",
":",
"save_yaml_file",
"(",
"file",
",",
"val",
")",
"except",
":",
"self",
".",
"exception",
"(",
"\"Failed to save to {}\"",
".",
"format",
"(",
"file",
")",
")",
"raise",... | Save data to yaml file
:param file: Writable object or path to file
:type file: FileIO | str | unicode
:param val: Value or struct to save
:type val: None | int | float | str | unicode | list | dict
:raises IOError: Failed to save | [
"Save",
"data",
"to",
"yaml",
"file"
] | 5954712776bb590107e5b2f4362d010bf74f77a1 | https://github.com/the01/python-flotils/blob/5954712776bb590107e5b2f4362d010bf74f77a1/flotils/loadable.py#L539-L553 | train |
the01/python-flotils | flotils/loadable.py | Loadable.load_settings | def load_settings(self, path):
"""
Load settings dict
:param path: Path to settings file
:type path: str | unicode
:return: Loaded settings
:rtype: dict
:raises IOError: If file not found or error accessing file
:raises TypeError: Settings file does not c... | python | def load_settings(self, path):
"""
Load settings dict
:param path: Path to settings file
:type path: str | unicode
:return: Loaded settings
:rtype: dict
:raises IOError: If file not found or error accessing file
:raises TypeError: Settings file does not c... | [
"def",
"load_settings",
"(",
"self",
",",
"path",
")",
":",
"res",
"=",
"self",
".",
"load_file",
"(",
"path",
")",
"if",
"not",
"isinstance",
"(",
"res",
",",
"dict",
")",
":",
"raise",
"TypeError",
"(",
"\"Expected settings to be dict\"",
")",
"return",
... | Load settings dict
:param path: Path to settings file
:type path: str | unicode
:return: Loaded settings
:rtype: dict
:raises IOError: If file not found or error accessing file
:raises TypeError: Settings file does not contain dict | [
"Load",
"settings",
"dict"
] | 5954712776bb590107e5b2f4362d010bf74f77a1 | https://github.com/the01/python-flotils/blob/5954712776bb590107e5b2f4362d010bf74f77a1/flotils/loadable.py#L555-L569 | train |
the01/python-flotils | flotils/loadable.py | Loadable.save_settings | def save_settings(self, path, settings, readable=False):
"""
Save settings to file
:param path: File path to save
:type path: str | unicode
:param settings: Settings to save
:type settings: dict
:param readable: Format file to be human readable (default: False)
... | python | def save_settings(self, path, settings, readable=False):
"""
Save settings to file
:param path: File path to save
:type path: str | unicode
:param settings: Settings to save
:type settings: dict
:param readable: Format file to be human readable (default: False)
... | [
"def",
"save_settings",
"(",
"self",
",",
"path",
",",
"settings",
",",
"readable",
"=",
"False",
")",
":",
"if",
"not",
"isinstance",
"(",
"settings",
",",
"dict",
")",
":",
"raise",
"TypeError",
"(",
"\"Expected settings to be dict\"",
")",
"return",
"self... | Save settings to file
:param path: File path to save
:type path: str | unicode
:param settings: Settings to save
:type settings: dict
:param readable: Format file to be human readable (default: False)
:type readable: bool
:rtype: None
:raises IOError: If ... | [
"Save",
"settings",
"to",
"file"
] | 5954712776bb590107e5b2f4362d010bf74f77a1 | https://github.com/the01/python-flotils/blob/5954712776bb590107e5b2f4362d010bf74f77a1/flotils/loadable.py#L571-L587 | train |
the01/python-flotils | flotils/loadable.py | Loadable.load_file | def load_file(self, path):
"""
Load file
:param path: Path to file
:type path: str | unicode
:return: Loaded settings
:rtype: None | str | unicode | int | list | dict
:raises IOError: If file not found or error accessing file
"""
res = None
... | python | def load_file(self, path):
"""
Load file
:param path: Path to file
:type path: str | unicode
:return: Loaded settings
:rtype: None | str | unicode | int | list | dict
:raises IOError: If file not found or error accessing file
"""
res = None
... | [
"def",
"load_file",
"(",
"self",
",",
"path",
")",
":",
"res",
"=",
"None",
"if",
"not",
"path",
":",
"IOError",
"(",
"\"No path specified to save\"",
")",
"if",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"path",
")",
":",
"raise",
"IOError",
"(",
... | Load file
:param path: Path to file
:type path: str | unicode
:return: Loaded settings
:rtype: None | str | unicode | int | list | dict
:raises IOError: If file not found or error accessing file | [
"Load",
"file"
] | 5954712776bb590107e5b2f4362d010bf74f77a1 | https://github.com/the01/python-flotils/blob/5954712776bb590107e5b2f4362d010bf74f77a1/flotils/loadable.py#L589-L618 | train |
the01/python-flotils | flotils/loadable.py | Loadable.save_file | def save_file(self, path, data, readable=False):
"""
Save to file
:param path: File path to save
:type path: str | unicode
:param data: To save
:type data: None | str | unicode | int | list | dict
:param readable: Format file to be human readable (default: False)... | python | def save_file(self, path, data, readable=False):
"""
Save to file
:param path: File path to save
:type path: str | unicode
:param data: To save
:type data: None | str | unicode | int | list | dict
:param readable: Format file to be human readable (default: False)... | [
"def",
"save_file",
"(",
"self",
",",
"path",
",",
"data",
",",
"readable",
"=",
"False",
")",
":",
"if",
"not",
"path",
":",
"IOError",
"(",
"\"No path specified to save\"",
")",
"try",
":",
"with",
"io",
".",
"open",
"(",
"path",
",",
"\"w\"",
",",
... | Save to file
:param path: File path to save
:type path: str | unicode
:param data: To save
:type data: None | str | unicode | int | list | dict
:param readable: Format file to be human readable (default: False)
:type readable: bool
:rtype: None
:raises IO... | [
"Save",
"to",
"file"
] | 5954712776bb590107e5b2f4362d010bf74f77a1 | https://github.com/the01/python-flotils/blob/5954712776bb590107e5b2f4362d010bf74f77a1/flotils/loadable.py#L620-L652 | train |
the01/python-flotils | flotils/logable.py | Logable.name | def name(self):
"""
Get the module name
:return: Module name
:rtype: str | unicode
"""
res = type(self).__name__
if self._id:
res += ".{}".format(self._id)
return res | python | def name(self):
"""
Get the module name
:return: Module name
:rtype: str | unicode
"""
res = type(self).__name__
if self._id:
res += ".{}".format(self._id)
return res | [
"def",
"name",
"(",
"self",
")",
":",
"res",
"=",
"type",
"(",
"self",
")",
".",
"__name__",
"if",
"self",
".",
"_id",
":",
"res",
"+=",
"\".{}\"",
".",
"format",
"(",
"self",
".",
"_id",
")",
"return",
"res"
] | Get the module name
:return: Module name
:rtype: str | unicode | [
"Get",
"the",
"module",
"name"
] | 5954712776bb590107e5b2f4362d010bf74f77a1 | https://github.com/the01/python-flotils/blob/5954712776bb590107e5b2f4362d010bf74f77a1/flotils/logable.py#L67-L77 | train |
the01/python-flotils | flotils/logable.py | Logable._get_function_name | def _get_function_name(self):
"""
Get function name of calling method
:return: The name of the calling function
(expected to be called in self.error/debug/..)
:rtype: str | unicode
"""
fname = inspect.getframeinfo(inspect.stack()[2][0]).function
if fn... | python | def _get_function_name(self):
"""
Get function name of calling method
:return: The name of the calling function
(expected to be called in self.error/debug/..)
:rtype: str | unicode
"""
fname = inspect.getframeinfo(inspect.stack()[2][0]).function
if fn... | [
"def",
"_get_function_name",
"(",
"self",
")",
":",
"fname",
"=",
"inspect",
".",
"getframeinfo",
"(",
"inspect",
".",
"stack",
"(",
")",
"[",
"2",
"]",
"[",
"0",
"]",
")",
".",
"function",
"if",
"fname",
"==",
"\"<module>\"",
":",
"return",
"\"\"",
... | Get function name of calling method
:return: The name of the calling function
(expected to be called in self.error/debug/..)
:rtype: str | unicode | [
"Get",
"function",
"name",
"of",
"calling",
"method"
] | 5954712776bb590107e5b2f4362d010bf74f77a1 | https://github.com/the01/python-flotils/blob/5954712776bb590107e5b2f4362d010bf74f77a1/flotils/logable.py#L79-L91 | train |
the01/python-flotils | flotils/runable.py | StartStopable.start | def start(self, blocking=False):
"""
Start the interface
:param blocking: Should the call block until stop() is called
(default: False)
:type blocking: bool
:rtype: None
"""
super(StartStopable, self).start()
self._is_running = True
# ... | python | def start(self, blocking=False):
"""
Start the interface
:param blocking: Should the call block until stop() is called
(default: False)
:type blocking: bool
:rtype: None
"""
super(StartStopable, self).start()
self._is_running = True
# ... | [
"def",
"start",
"(",
"self",
",",
"blocking",
"=",
"False",
")",
":",
"super",
"(",
"StartStopable",
",",
"self",
")",
".",
"start",
"(",
")",
"self",
".",
"_is_running",
"=",
"True",
"# blocking",
"try",
":",
"while",
"blocking",
"and",
"self",
".",
... | Start the interface
:param blocking: Should the call block until stop() is called
(default: False)
:type blocking: bool
:rtype: None | [
"Start",
"the",
"interface"
] | 5954712776bb590107e5b2f4362d010bf74f77a1 | https://github.com/the01/python-flotils/blob/5954712776bb590107e5b2f4362d010bf74f77a1/flotils/runable.py#L118-L135 | train |
mandiant/ioc_writer | examples/openioc_to_yara/openioc_to_yara.py | YaraIOCManager.get_embedded_yara | def get_embedded_yara(self, iocid):
"""
Extract YARA signatures embedded in Yara/Yara indicatorItem nodes.
This is done regardless of logic structure in the OpenIOC.
"""
ioc_obj = self.iocs[iocid]
ids_to_process = set([])
signatures = ''
for elem in ioc_ob... | python | def get_embedded_yara(self, iocid):
"""
Extract YARA signatures embedded in Yara/Yara indicatorItem nodes.
This is done regardless of logic structure in the OpenIOC.
"""
ioc_obj = self.iocs[iocid]
ids_to_process = set([])
signatures = ''
for elem in ioc_ob... | [
"def",
"get_embedded_yara",
"(",
"self",
",",
"iocid",
")",
":",
"ioc_obj",
"=",
"self",
".",
"iocs",
"[",
"iocid",
"]",
"ids_to_process",
"=",
"set",
"(",
"[",
"]",
")",
"signatures",
"=",
"''",
"for",
"elem",
"in",
"ioc_obj",
".",
"top_level_indicator"... | Extract YARA signatures embedded in Yara/Yara indicatorItem nodes.
This is done regardless of logic structure in the OpenIOC. | [
"Extract",
"YARA",
"signatures",
"embedded",
"in",
"Yara",
"/",
"Yara",
"indicatorItem",
"nodes",
".",
"This",
"is",
"done",
"regardless",
"of",
"logic",
"structure",
"in",
"the",
"OpenIOC",
"."
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/examples/openioc_to_yara/openioc_to_yara.py#L122-L135 | train |
mandiant/ioc_writer | examples/openioc_to_yara/openioc_to_yara.py | YaraIOCManager.get_yara_condition_string | def get_yara_condition_string(self, indicator_node, parameters_node, ids_to_process, condition_string='',
joining_value='or'):
"""
get_yara_condition_string
input
indicator_node: this is the node we walk down
parameters_node: this contai... | python | def get_yara_condition_string(self, indicator_node, parameters_node, ids_to_process, condition_string='',
joining_value='or'):
"""
get_yara_condition_string
input
indicator_node: this is the node we walk down
parameters_node: this contai... | [
"def",
"get_yara_condition_string",
"(",
"self",
",",
"indicator_node",
",",
"parameters_node",
",",
"ids_to_process",
",",
"condition_string",
"=",
"''",
",",
"joining_value",
"=",
"'or'",
")",
":",
"indicator_node_id",
"=",
"str",
"(",
"indicator_node",
".",
"ge... | get_yara_condition_string
input
indicator_node: this is the node we walk down
parameters_node: this contains all the parameters in the ioc, so we
can look up parameters nodes as we walk them.
ids_to_process: set of ids to upgrade
condition_string:... | [
"get_yara_condition_string"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/examples/openioc_to_yara/openioc_to_yara.py#L174-L349 | train |
mandiant/ioc_writer | examples/openioc_to_yara/openioc_to_yara.py | YaraIOCManager.write_yara | def write_yara(self, output_file):
"""
Write out yara signatures to a file.
"""
fout = open(output_file, 'wb')
fout.write('\n')
for iocid in self.yara_signatures:
signature = self.yara_signatures[iocid]
fout.write(signature)
fout.write... | python | def write_yara(self, output_file):
"""
Write out yara signatures to a file.
"""
fout = open(output_file, 'wb')
fout.write('\n')
for iocid in self.yara_signatures:
signature = self.yara_signatures[iocid]
fout.write(signature)
fout.write... | [
"def",
"write_yara",
"(",
"self",
",",
"output_file",
")",
":",
"fout",
"=",
"open",
"(",
"output_file",
",",
"'wb'",
")",
"fout",
".",
"write",
"(",
"'\\n'",
")",
"for",
"iocid",
"in",
"self",
".",
"yara_signatures",
":",
"signature",
"=",
"self",
"."... | Write out yara signatures to a file. | [
"Write",
"out",
"yara",
"signatures",
"to",
"a",
"file",
"."
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/examples/openioc_to_yara/openioc_to_yara.py#L430-L443 | train |
mandiant/ioc_writer | ioc_writer/utils/__init__.py | safe_makedirs | def safe_makedirs(fdir):
"""
Make an arbitrary directory. This is safe to call for Python 2 users.
:param fdir: Directory path to make.
:return:
"""
if os.path.isdir(fdir):
pass
# print 'dir already exists: %s' % str(dir)
else:
try:
os.makedirs(fdir)
... | python | def safe_makedirs(fdir):
"""
Make an arbitrary directory. This is safe to call for Python 2 users.
:param fdir: Directory path to make.
:return:
"""
if os.path.isdir(fdir):
pass
# print 'dir already exists: %s' % str(dir)
else:
try:
os.makedirs(fdir)
... | [
"def",
"safe_makedirs",
"(",
"fdir",
")",
":",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"fdir",
")",
":",
"pass",
"# print 'dir already exists: %s' % str(dir)",
"else",
":",
"try",
":",
"os",
".",
"makedirs",
"(",
"fdir",
")",
"except",
"WindowsError",
... | Make an arbitrary directory. This is safe to call for Python 2 users.
:param fdir: Directory path to make.
:return: | [
"Make",
"an",
"arbitrary",
"directory",
".",
"This",
"is",
"safe",
"to",
"call",
"for",
"Python",
"2",
"users",
"."
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/utils/__init__.py#L23-L41 | train |
mandiant/ioc_writer | ioc_writer/managers/downgrade_11.py | DowngradeManager.convert_to_10 | def convert_to_10(self):
"""
converts the iocs in self.iocs from openioc 1.1 to openioc 1.0 format.
the converted iocs are stored in the dictionary self.iocs_10
:return: A list of iocid values which had errors downgrading.
"""
if len(self) < 1:
log.error('no i... | python | def convert_to_10(self):
"""
converts the iocs in self.iocs from openioc 1.1 to openioc 1.0 format.
the converted iocs are stored in the dictionary self.iocs_10
:return: A list of iocid values which had errors downgrading.
"""
if len(self) < 1:
log.error('no i... | [
"def",
"convert_to_10",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
")",
"<",
"1",
":",
"log",
".",
"error",
"(",
"'no iocs available to modify'",
")",
"return",
"False",
"log",
".",
"info",
"(",
"'Converting IOCs from 1.1 to 1.0.'",
")",
"errors",
"=",... | converts the iocs in self.iocs from openioc 1.1 to openioc 1.0 format.
the converted iocs are stored in the dictionary self.iocs_10
:return: A list of iocid values which had errors downgrading. | [
"converts",
"the",
"iocs",
"in",
"self",
".",
"iocs",
"from",
"openioc",
"1",
".",
"1",
"to",
"openioc",
"1",
".",
"0",
"format",
".",
"the",
"converted",
"iocs",
"are",
"stored",
"in",
"the",
"dictionary",
"self",
".",
"iocs_10",
":",
"return",
":",
... | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/managers/downgrade_11.py#L89-L226 | train |
mandiant/ioc_writer | ioc_writer/managers/downgrade_11.py | DowngradeManager.convert_branch | def convert_branch(self, old_node, new_node, ids_to_skip, comment_dict=None):
"""
Recursively walk a indicator logic tree, starting from a Indicator node.
Converts OpenIOC 1.1 Indicator/IndicatorItems to Openioc 1.0 and preserves order.
:param old_node: An Indicator node, which we walk... | python | def convert_branch(self, old_node, new_node, ids_to_skip, comment_dict=None):
"""
Recursively walk a indicator logic tree, starting from a Indicator node.
Converts OpenIOC 1.1 Indicator/IndicatorItems to Openioc 1.0 and preserves order.
:param old_node: An Indicator node, which we walk... | [
"def",
"convert_branch",
"(",
"self",
",",
"old_node",
",",
"new_node",
",",
"ids_to_skip",
",",
"comment_dict",
"=",
"None",
")",
":",
"expected_tag",
"=",
"'Indicator'",
"if",
"old_node",
".",
"tag",
"!=",
"expected_tag",
":",
"raise",
"DowngradeError",
"(",... | Recursively walk a indicator logic tree, starting from a Indicator node.
Converts OpenIOC 1.1 Indicator/IndicatorItems to Openioc 1.0 and preserves order.
:param old_node: An Indicator node, which we walk down to convert
:param new_node: An Indicator node, which we add new IndicatorItem and In... | [
"Recursively",
"walk",
"a",
"indicator",
"logic",
"tree",
"starting",
"from",
"a",
"Indicator",
"node",
".",
"Converts",
"OpenIOC",
"1",
".",
"1",
"Indicator",
"/",
"IndicatorItems",
"to",
"Openioc",
"1",
".",
"0",
"and",
"preserves",
"order",
"."
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/managers/downgrade_11.py#L228-L291 | train |
mandiant/ioc_writer | ioc_writer/managers/downgrade_11.py | DowngradeManager.write_iocs | def write_iocs(self, directory=None, source=None):
"""
Serializes IOCs to a directory.
:param directory: Directory to write IOCs to. If not provided, the current working directory is used.
:param source: Dictionary contianing iocid -> IOC mapping. Defaults to self.iocs_10. This is not... | python | def write_iocs(self, directory=None, source=None):
"""
Serializes IOCs to a directory.
:param directory: Directory to write IOCs to. If not provided, the current working directory is used.
:param source: Dictionary contianing iocid -> IOC mapping. Defaults to self.iocs_10. This is not... | [
"def",
"write_iocs",
"(",
"self",
",",
"directory",
"=",
"None",
",",
"source",
"=",
"None",
")",
":",
"\"\"\"\n\n\n if directory is None, write the iocs to the current working directory\n source: allows specifying a different dictionry of elmentTree ioc objects\n \"... | Serializes IOCs to a directory.
:param directory: Directory to write IOCs to. If not provided, the current working directory is used.
:param source: Dictionary contianing iocid -> IOC mapping. Defaults to self.iocs_10. This is not normally modifed by a user for this class.
:return: | [
"Serializes",
"IOCs",
"to",
"a",
"directory",
"."
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/managers/downgrade_11.py#L293-L330 | train |
mandiant/ioc_writer | ioc_writer/managers/downgrade_11.py | DowngradeManager.write_pruned_iocs | def write_pruned_iocs(self, directory=None, pruned_source=None):
"""
Writes IOCs to a directory that have been pruned of some or all IOCs.
:param directory: Directory to write IOCs to. If not provided, the current working directory is used.
:param pruned_source: Iterable containing a s... | python | def write_pruned_iocs(self, directory=None, pruned_source=None):
"""
Writes IOCs to a directory that have been pruned of some or all IOCs.
:param directory: Directory to write IOCs to. If not provided, the current working directory is used.
:param pruned_source: Iterable containing a s... | [
"def",
"write_pruned_iocs",
"(",
"self",
",",
"directory",
"=",
"None",
",",
"pruned_source",
"=",
"None",
")",
":",
"\"\"\"\n write_pruned_iocs to a directory\n\n if directory is None, write the iocs to the current working directory\n \"\"\"",
"if",
"pruned_sour... | Writes IOCs to a directory that have been pruned of some or all IOCs.
:param directory: Directory to write IOCs to. If not provided, the current working directory is used.
:param pruned_source: Iterable containing a set of iocids. Defaults to self.iocs_10.
:return: | [
"Writes",
"IOCs",
"to",
"a",
"directory",
"that",
"have",
"been",
"pruned",
"of",
"some",
"or",
"all",
"IOCs",
"."
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/managers/downgrade_11.py#L332-L361 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_dnsentryitem_recordname | def make_dnsentryitem_recordname(dns_name, condition='contains', negate=False, preserve_case=False):
"""
Create a node for DnsEntryItem/RecordName
:return: A IndicatorItem represented as an Element node
"""
document = 'DnsEntryItem'
search = 'DnsEntryItem/RecordName'
content_type = 'str... | python | def make_dnsentryitem_recordname(dns_name, condition='contains', negate=False, preserve_case=False):
"""
Create a node for DnsEntryItem/RecordName
:return: A IndicatorItem represented as an Element node
"""
document = 'DnsEntryItem'
search = 'DnsEntryItem/RecordName'
content_type = 'str... | [
"def",
"make_dnsentryitem_recordname",
"(",
"dns_name",
",",
"condition",
"=",
"'contains'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'DnsEntryItem'",
"search",
"=",
"'DnsEntryItem/RecordName'",
"content_type",
"="... | Create a node for DnsEntryItem/RecordName
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"DnsEntryItem",
"/",
"RecordName",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L29-L41 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_driveritem_deviceitem_devicename | def make_driveritem_deviceitem_devicename(device_name, condition='is', negate=False, preserve_case=False):
"""
Create a node for DriverItem/DeviceItem/DeviceName
:return: A IndicatorItem represented as an Element node
"""
document = 'DriverItem'
search = 'DriverItem/DeviceItem/DeviceName'
... | python | def make_driveritem_deviceitem_devicename(device_name, condition='is', negate=False, preserve_case=False):
"""
Create a node for DriverItem/DeviceItem/DeviceName
:return: A IndicatorItem represented as an Element node
"""
document = 'DriverItem'
search = 'DriverItem/DeviceItem/DeviceName'
... | [
"def",
"make_driveritem_deviceitem_devicename",
"(",
"device_name",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'DriverItem'",
"search",
"=",
"'DriverItem/DeviceItem/DeviceName'",
"content... | Create a node for DriverItem/DeviceItem/DeviceName
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"DriverItem",
"/",
"DeviceItem",
"/",
"DeviceName",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L45-L57 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_driveritem_drivername | def make_driveritem_drivername(driver_name, condition='contains', negate=False, preserve_case=False):
"""
Create a node for DriverItem/DriverName
:return: A IndicatorItem represented as an Element node
"""
document = 'DriverItem'
search = 'DriverItem/DriverName'
content_type = 'string'
... | python | def make_driveritem_drivername(driver_name, condition='contains', negate=False, preserve_case=False):
"""
Create a node for DriverItem/DriverName
:return: A IndicatorItem represented as an Element node
"""
document = 'DriverItem'
search = 'DriverItem/DriverName'
content_type = 'string'
... | [
"def",
"make_driveritem_drivername",
"(",
"driver_name",
",",
"condition",
"=",
"'contains'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'DriverItem'",
"search",
"=",
"'DriverItem/DriverName'",
"content_type",
"=",
... | Create a node for DriverItem/DriverName
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"DriverItem",
"/",
"DriverName",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L61-L73 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_eventlogitem_eid | def make_eventlogitem_eid(eid, condition='is', negate=False):
"""
Create a node for EventLogItem/EID
:return: A IndicatorItem represented as an Element node
"""
document = 'EventLogItem'
search = 'EventLogItem/EID'
content_type = 'int'
content = eid
ii_node = ioc_api.make_indica... | python | def make_eventlogitem_eid(eid, condition='is', negate=False):
"""
Create a node for EventLogItem/EID
:return: A IndicatorItem represented as an Element node
"""
document = 'EventLogItem'
search = 'EventLogItem/EID'
content_type = 'int'
content = eid
ii_node = ioc_api.make_indica... | [
"def",
"make_eventlogitem_eid",
"(",
"eid",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
")",
":",
"document",
"=",
"'EventLogItem'",
"search",
"=",
"'EventLogItem/EID'",
"content_type",
"=",
"'int'",
"content",
"=",
"eid",
"ii_node",
"=",
"ioc_... | Create a node for EventLogItem/EID
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"EventLogItem",
"/",
"EID",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L77-L89 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_eventlogitem_log | def make_eventlogitem_log(log, condition='is', negate=False, preserve_case=False):
"""
Create a node for EventLogItem/log
:return: A IndicatorItem represented as an Element node
"""
document = 'EventLogItem'
search = 'EventLogItem/log'
content_type = 'string'
content = log
ii_no... | python | def make_eventlogitem_log(log, condition='is', negate=False, preserve_case=False):
"""
Create a node for EventLogItem/log
:return: A IndicatorItem represented as an Element node
"""
document = 'EventLogItem'
search = 'EventLogItem/log'
content_type = 'string'
content = log
ii_no... | [
"def",
"make_eventlogitem_log",
"(",
"log",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'EventLogItem'",
"search",
"=",
"'EventLogItem/log'",
"content_type",
"=",
"'string'",
"conten... | Create a node for EventLogItem/log
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"EventLogItem",
"/",
"log",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L93-L105 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_eventlogitem_message | def make_eventlogitem_message(message, condition='contains', negate=False, preserve_case=False):
"""
Create a node for EventLogItem/message
:return: A IndicatorItem represented as an Element node
"""
document = 'EventLogItem'
search = 'EventLogItem/message'
content_type = 'string'
c... | python | def make_eventlogitem_message(message, condition='contains', negate=False, preserve_case=False):
"""
Create a node for EventLogItem/message
:return: A IndicatorItem represented as an Element node
"""
document = 'EventLogItem'
search = 'EventLogItem/message'
content_type = 'string'
c... | [
"def",
"make_eventlogitem_message",
"(",
"message",
",",
"condition",
"=",
"'contains'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'EventLogItem'",
"search",
"=",
"'EventLogItem/message'",
"content_type",
"=",
"'s... | Create a node for EventLogItem/message
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"EventLogItem",
"/",
"message",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L109-L121 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_fileitem_fileattributes | def make_fileitem_fileattributes(attributes, condition='contains', negate=False, preserve_case=False):
"""
Create a node for FileItem/FileAttributes
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/FileAttributes'
content_type = 'strin... | python | def make_fileitem_fileattributes(attributes, condition='contains', negate=False, preserve_case=False):
"""
Create a node for FileItem/FileAttributes
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/FileAttributes'
content_type = 'strin... | [
"def",
"make_fileitem_fileattributes",
"(",
"attributes",
",",
"condition",
"=",
"'contains'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'FileItem'",
"search",
"=",
"'FileItem/FileAttributes'",
"content_type",
"=",
... | Create a node for FileItem/FileAttributes
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"FileItem",
"/",
"FileAttributes",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L125-L137 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_fileitem_fileextension | def make_fileitem_fileextension(extension, condition='is', negate=False, preserve_case=False):
"""
Create a node for FileItem/FileExtension
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/FileExtension'
content_type = 'string'
con... | python | def make_fileitem_fileextension(extension, condition='is', negate=False, preserve_case=False):
"""
Create a node for FileItem/FileExtension
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/FileExtension'
content_type = 'string'
con... | [
"def",
"make_fileitem_fileextension",
"(",
"extension",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'FileItem'",
"search",
"=",
"'FileItem/FileExtension'",
"content_type",
"=",
"'strin... | Create a node for FileItem/FileExtension
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"FileItem",
"/",
"FileExtension",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L141-L153 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_fileitem_filename | def make_fileitem_filename(filename, condition='is', negate=False, preserve_case=False):
"""
Create a node for FileItem/FileName
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/FileName'
content_type = 'string'
content = filename
... | python | def make_fileitem_filename(filename, condition='is', negate=False, preserve_case=False):
"""
Create a node for FileItem/FileName
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/FileName'
content_type = 'string'
content = filename
... | [
"def",
"make_fileitem_filename",
"(",
"filename",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'FileItem'",
"search",
"=",
"'FileItem/FileName'",
"content_type",
"=",
"'string'",
"con... | Create a node for FileItem/FileName
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"FileItem",
"/",
"FileName",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L157-L169 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_fileitem_filepath | def make_fileitem_filepath(filepath, condition='contains', negate=False, preserve_case=False):
"""
Create a node for FileItem/FilePath
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/FilePath'
content_type = 'string'
content = fil... | python | def make_fileitem_filepath(filepath, condition='contains', negate=False, preserve_case=False):
"""
Create a node for FileItem/FilePath
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/FilePath'
content_type = 'string'
content = fil... | [
"def",
"make_fileitem_filepath",
"(",
"filepath",
",",
"condition",
"=",
"'contains'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'FileItem'",
"search",
"=",
"'FileItem/FilePath'",
"content_type",
"=",
"'string'",
... | Create a node for FileItem/FilePath
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"FileItem",
"/",
"FilePath",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L173-L185 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_fileitem_fullpath | def make_fileitem_fullpath(fullpath, condition='contains', negate=False, preserve_case=False):
"""
Create a node for FileItem/FullPath
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/FullPath'
content_type = 'string'
content = ful... | python | def make_fileitem_fullpath(fullpath, condition='contains', negate=False, preserve_case=False):
"""
Create a node for FileItem/FullPath
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/FullPath'
content_type = 'string'
content = ful... | [
"def",
"make_fileitem_fullpath",
"(",
"fullpath",
",",
"condition",
"=",
"'contains'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'FileItem'",
"search",
"=",
"'FileItem/FullPath'",
"content_type",
"=",
"'string'",
... | Create a node for FileItem/FullPath
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"FileItem",
"/",
"FullPath",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L189-L201 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_fileitem_md5sum | def make_fileitem_md5sum(md5, condition='is', negate=False):
"""
Create a node for FileItem/Md5sum
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/Md5sum'
content_type = 'md5'
content = md5
ii_node = ioc_api.make_indicatoritem... | python | def make_fileitem_md5sum(md5, condition='is', negate=False):
"""
Create a node for FileItem/Md5sum
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/Md5sum'
content_type = 'md5'
content = md5
ii_node = ioc_api.make_indicatoritem... | [
"def",
"make_fileitem_md5sum",
"(",
"md5",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
")",
":",
"document",
"=",
"'FileItem'",
"search",
"=",
"'FileItem/Md5sum'",
"content_type",
"=",
"'md5'",
"content",
"=",
"md5",
"ii_node",
"=",
"ioc_api",
... | Create a node for FileItem/Md5sum
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"FileItem",
"/",
"Md5sum",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L205-L217 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_fileitem_peinfo_detectedanomalies_string | def make_fileitem_peinfo_detectedanomalies_string(anomaly, condition='is', negate=False, preserve_case=False):
"""
Create a node for FileItem/PEInfo/DetectedAnomalies/string
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/PEInfo/DetectedA... | python | def make_fileitem_peinfo_detectedanomalies_string(anomaly, condition='is', negate=False, preserve_case=False):
"""
Create a node for FileItem/PEInfo/DetectedAnomalies/string
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/PEInfo/DetectedA... | [
"def",
"make_fileitem_peinfo_detectedanomalies_string",
"(",
"anomaly",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'FileItem'",
"search",
"=",
"'FileItem/PEInfo/DetectedAnomalies/string'",
... | Create a node for FileItem/PEInfo/DetectedAnomalies/string
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"FileItem",
"/",
"PEInfo",
"/",
"DetectedAnomalies",
"/",
"string",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L221-L233 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_fileitem_peinfo_detectedentrypointsignature_name | def make_fileitem_peinfo_detectedentrypointsignature_name(entrypoint_name, condition='is', negate=False,
preserve_case=False):
"""
Create a node for FileItem/PEInfo/DetectedEntryPointSignature/Name
:return: A IndicatorItem represented as an Elem... | python | def make_fileitem_peinfo_detectedentrypointsignature_name(entrypoint_name, condition='is', negate=False,
preserve_case=False):
"""
Create a node for FileItem/PEInfo/DetectedEntryPointSignature/Name
:return: A IndicatorItem represented as an Elem... | [
"def",
"make_fileitem_peinfo_detectedentrypointsignature_name",
"(",
"entrypoint_name",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'FileItem'",
"search",
"=",
"'FileItem/PEInfo/DetectedEntr... | Create a node for FileItem/PEInfo/DetectedEntryPointSignature/Name
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"FileItem",
"/",
"PEInfo",
"/",
"DetectedEntryPointSignature",
"/",
"Name",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L237-L250 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_fileitem_peinfo_digitalsignature_signatureexists | def make_fileitem_peinfo_digitalsignature_signatureexists(sig_exists, condition='is', negate=False):
"""
Create a node for FileItem/PEInfo/DigitalSignature/SignatureExists
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/PEInfo/DigitalSign... | python | def make_fileitem_peinfo_digitalsignature_signatureexists(sig_exists, condition='is', negate=False):
"""
Create a node for FileItem/PEInfo/DigitalSignature/SignatureExists
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/PEInfo/DigitalSign... | [
"def",
"make_fileitem_peinfo_digitalsignature_signatureexists",
"(",
"sig_exists",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
")",
":",
"document",
"=",
"'FileItem'",
"search",
"=",
"'FileItem/PEInfo/DigitalSignature/SignatureExists'",
"content_type",
"=",
... | Create a node for FileItem/PEInfo/DigitalSignature/SignatureExists
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"FileItem",
"/",
"PEInfo",
"/",
"DigitalSignature",
"/",
"SignatureExists",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L254-L266 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_fileitem_peinfo_digitalsignature_signatureverified | def make_fileitem_peinfo_digitalsignature_signatureverified(sig_verified, condition='is', negate=False):
"""
Create a node for FileItem/PEInfo/DigitalSignature/SignatureVerified
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/PEInfo/Digit... | python | def make_fileitem_peinfo_digitalsignature_signatureverified(sig_verified, condition='is', negate=False):
"""
Create a node for FileItem/PEInfo/DigitalSignature/SignatureVerified
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/PEInfo/Digit... | [
"def",
"make_fileitem_peinfo_digitalsignature_signatureverified",
"(",
"sig_verified",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
")",
":",
"document",
"=",
"'FileItem'",
"search",
"=",
"'FileItem/PEInfo/DigitalSignature/SignatureVerified'",
"content_type",
... | Create a node for FileItem/PEInfo/DigitalSignature/SignatureVerified
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"FileItem",
"/",
"PEInfo",
"/",
"DigitalSignature",
"/",
"SignatureVerified",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L270-L282 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_fileitem_peinfo_exports_dllname | def make_fileitem_peinfo_exports_dllname(dll_name, condition='is', negate=False, preserve_case=False):
"""
Create a node for FileItem/PEInfo/Exports/DllName
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/PEInfo/Exports/DllName'
conte... | python | def make_fileitem_peinfo_exports_dllname(dll_name, condition='is', negate=False, preserve_case=False):
"""
Create a node for FileItem/PEInfo/Exports/DllName
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/PEInfo/Exports/DllName'
conte... | [
"def",
"make_fileitem_peinfo_exports_dllname",
"(",
"dll_name",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'FileItem'",
"search",
"=",
"'FileItem/PEInfo/Exports/DllName'",
"content_type",... | Create a node for FileItem/PEInfo/Exports/DllName
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"FileItem",
"/",
"PEInfo",
"/",
"Exports",
"/",
"DllName",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L286-L298 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_fileitem_peinfo_exports_numberoffunctions | def make_fileitem_peinfo_exports_numberoffunctions(function_count, condition='is', negate=False):
"""
Create a node for FileItem/PEInfo/Exports/NumberOfFunctions
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/PEInfo/Exports/NumberOfFunct... | python | def make_fileitem_peinfo_exports_numberoffunctions(function_count, condition='is', negate=False):
"""
Create a node for FileItem/PEInfo/Exports/NumberOfFunctions
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/PEInfo/Exports/NumberOfFunct... | [
"def",
"make_fileitem_peinfo_exports_numberoffunctions",
"(",
"function_count",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
")",
":",
"document",
"=",
"'FileItem'",
"search",
"=",
"'FileItem/PEInfo/Exports/NumberOfFunctions'",
"content_type",
"=",
"'int'",... | Create a node for FileItem/PEInfo/Exports/NumberOfFunctions
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"FileItem",
"/",
"PEInfo",
"/",
"Exports",
"/",
"NumberOfFunctions",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L319-L331 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_fileitem_peinfo_importedmodules_module_importedfunctions_string | def make_fileitem_peinfo_importedmodules_module_importedfunctions_string(imported_function, condition='is',
negate=False, preserve_case=False):
"""
Create a node for FileItem/PEInfo/ImportedModules/Module/ImportedFunctions/string
... | python | def make_fileitem_peinfo_importedmodules_module_importedfunctions_string(imported_function, condition='is',
negate=False, preserve_case=False):
"""
Create a node for FileItem/PEInfo/ImportedModules/Module/ImportedFunctions/string
... | [
"def",
"make_fileitem_peinfo_importedmodules_module_importedfunctions_string",
"(",
"imported_function",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'FileItem'",
"search",
"=",
"'FileItem/PE... | Create a node for FileItem/PEInfo/ImportedModules/Module/ImportedFunctions/string
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"FileItem",
"/",
"PEInfo",
"/",
"ImportedModules",
"/",
"Module",
"/",
"ImportedFunctions",
"/",
"string",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L335-L348 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_fileitem_peinfo_importedmodules_module_name | def make_fileitem_peinfo_importedmodules_module_name(imported_module, condition='is', negate=False,
preserve_case=False):
"""
Create a node for FileItem/PEInfo/ImportedModules/Module/Name
:return: A IndicatorItem represented as an Element node
""... | python | def make_fileitem_peinfo_importedmodules_module_name(imported_module, condition='is', negate=False,
preserve_case=False):
"""
Create a node for FileItem/PEInfo/ImportedModules/Module/Name
:return: A IndicatorItem represented as an Element node
""... | [
"def",
"make_fileitem_peinfo_importedmodules_module_name",
"(",
"imported_module",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'FileItem'",
"search",
"=",
"'FileItem/PEInfo/ImportedModules/M... | Create a node for FileItem/PEInfo/ImportedModules/Module/Name
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"FileItem",
"/",
"PEInfo",
"/",
"ImportedModules",
"/",
"Module",
"/",
"Name",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L352-L365 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_fileitem_peinfo_petimestamp | def make_fileitem_peinfo_petimestamp(compile_time, condition='is', negate=False):
"""
Create a node for FileItem/PEInfo/PETimeStamp
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/PEInfo/PETimeStamp'
content_type = 'date'
content ... | python | def make_fileitem_peinfo_petimestamp(compile_time, condition='is', negate=False):
"""
Create a node for FileItem/PEInfo/PETimeStamp
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/PEInfo/PETimeStamp'
content_type = 'date'
content ... | [
"def",
"make_fileitem_peinfo_petimestamp",
"(",
"compile_time",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
")",
":",
"document",
"=",
"'FileItem'",
"search",
"=",
"'FileItem/PEInfo/PETimeStamp'",
"content_type",
"=",
"'date'",
"content",
"=",
"compi... | Create a node for FileItem/PEInfo/PETimeStamp
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"FileItem",
"/",
"PEInfo",
"/",
"PETimeStamp",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L369-L381 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_fileitem_peinfo_resourceinfolist_resourceinfoitem_name | def make_fileitem_peinfo_resourceinfolist_resourceinfoitem_name(resource_name, condition='is', negate=False,
preserve_case=False):
"""
Create a node for FileItem/PEInfo/ResourceInfoList/ResourceInfoItem/Name
:return: A IndicatorItem repres... | python | def make_fileitem_peinfo_resourceinfolist_resourceinfoitem_name(resource_name, condition='is', negate=False,
preserve_case=False):
"""
Create a node for FileItem/PEInfo/ResourceInfoList/ResourceInfoItem/Name
:return: A IndicatorItem repres... | [
"def",
"make_fileitem_peinfo_resourceinfolist_resourceinfoitem_name",
"(",
"resource_name",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'FileItem'",
"search",
"=",
"'FileItem/PEInfo/Resource... | Create a node for FileItem/PEInfo/ResourceInfoList/ResourceInfoItem/Name
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"FileItem",
"/",
"PEInfo",
"/",
"ResourceInfoList",
"/",
"ResourceInfoItem",
"/",
"Name",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L385-L398 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_fileitem_peinfo_type | def make_fileitem_peinfo_type(petype, condition='is', negate=False, preserve_case=False):
"""
Create a node for FileItem/PEInfo/Type
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/PEInfo/Type'
content_type = 'string'
content = pe... | python | def make_fileitem_peinfo_type(petype, condition='is', negate=False, preserve_case=False):
"""
Create a node for FileItem/PEInfo/Type
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/PEInfo/Type'
content_type = 'string'
content = pe... | [
"def",
"make_fileitem_peinfo_type",
"(",
"petype",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'FileItem'",
"search",
"=",
"'FileItem/PEInfo/Type'",
"content_type",
"=",
"'string'",
... | Create a node for FileItem/PEInfo/Type
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"FileItem",
"/",
"PEInfo",
"/",
"Type",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L418-L430 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_fileitem_sizeinbytes | def make_fileitem_sizeinbytes(filesize, condition='is', negate=False):
"""
Create a node for FileItem/SizeInBytes
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/SizeInBytes'
content_type = 'int'
content = filesize
ii_node = i... | python | def make_fileitem_sizeinbytes(filesize, condition='is', negate=False):
"""
Create a node for FileItem/SizeInBytes
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/SizeInBytes'
content_type = 'int'
content = filesize
ii_node = i... | [
"def",
"make_fileitem_sizeinbytes",
"(",
"filesize",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
")",
":",
"document",
"=",
"'FileItem'",
"search",
"=",
"'FileItem/SizeInBytes'",
"content_type",
"=",
"'int'",
"content",
"=",
"filesize",
"ii_node",
... | Create a node for FileItem/SizeInBytes
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"FileItem",
"/",
"SizeInBytes",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L434-L446 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_fileitem_streamlist_stream_name | def make_fileitem_streamlist_stream_name(stream_name, condition='is', negate=False, preserve_case=False):
"""
Create a node for FileItem/StreamList/Stream/Name
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/StreamList/Stream/Name'
co... | python | def make_fileitem_streamlist_stream_name(stream_name, condition='is', negate=False, preserve_case=False):
"""
Create a node for FileItem/StreamList/Stream/Name
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/StreamList/Stream/Name'
co... | [
"def",
"make_fileitem_streamlist_stream_name",
"(",
"stream_name",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'FileItem'",
"search",
"=",
"'FileItem/StreamList/Stream/Name'",
"content_typ... | Create a node for FileItem/StreamList/Stream/Name
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"FileItem",
"/",
"StreamList",
"/",
"Stream",
"/",
"Name",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L450-L462 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_fileitem_stringlist_string | def make_fileitem_stringlist_string(file_string, condition='contains', negate=False, preserve_case=False):
"""
Create a node for FileItem/StringList/string
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/StringList/string'
content_typ... | python | def make_fileitem_stringlist_string(file_string, condition='contains', negate=False, preserve_case=False):
"""
Create a node for FileItem/StringList/string
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/StringList/string'
content_typ... | [
"def",
"make_fileitem_stringlist_string",
"(",
"file_string",
",",
"condition",
"=",
"'contains'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'FileItem'",
"search",
"=",
"'FileItem/StringList/string'",
"content_type",
... | Create a node for FileItem/StringList/string
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"FileItem",
"/",
"StringList",
"/",
"string",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L466-L478 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_fileitem_username | def make_fileitem_username(file_owner, condition='is', negate=False, preserve_case=False):
"""
Create a node for FileItem/Username
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/Username'
content_type = 'string'
content = file_ow... | python | def make_fileitem_username(file_owner, condition='is', negate=False, preserve_case=False):
"""
Create a node for FileItem/Username
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/Username'
content_type = 'string'
content = file_ow... | [
"def",
"make_fileitem_username",
"(",
"file_owner",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'FileItem'",
"search",
"=",
"'FileItem/Username'",
"content_type",
"=",
"'string'",
"c... | Create a node for FileItem/Username
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"FileItem",
"/",
"Username",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L482-L494 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_hookitem_hookedfunction | def make_hookitem_hookedfunction(hooked_function, condition='is', negate=False, preserve_case=False):
"""
Create a node for HookItem/HookedFunction
:return: A IndicatorItem represented as an Element node
"""
document = 'HookItem'
search = 'HookItem/HookedFunction'
content_type = 'string... | python | def make_hookitem_hookedfunction(hooked_function, condition='is', negate=False, preserve_case=False):
"""
Create a node for HookItem/HookedFunction
:return: A IndicatorItem represented as an Element node
"""
document = 'HookItem'
search = 'HookItem/HookedFunction'
content_type = 'string... | [
"def",
"make_hookitem_hookedfunction",
"(",
"hooked_function",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'HookItem'",
"search",
"=",
"'HookItem/HookedFunction'",
"content_type",
"=",
... | Create a node for HookItem/HookedFunction
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"HookItem",
"/",
"HookedFunction",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L498-L510 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_hookitem_hookingmodule | def make_hookitem_hookingmodule(hooking_module, condition='contains', negate=False, preserve_case=False):
"""
Create a node for HookItem/HookingModule
:return: A IndicatorItem represented as an Element node
"""
document = 'HookItem'
search = 'HookItem/HookingModule'
content_type = 'stri... | python | def make_hookitem_hookingmodule(hooking_module, condition='contains', negate=False, preserve_case=False):
"""
Create a node for HookItem/HookingModule
:return: A IndicatorItem represented as an Element node
"""
document = 'HookItem'
search = 'HookItem/HookingModule'
content_type = 'stri... | [
"def",
"make_hookitem_hookingmodule",
"(",
"hooking_module",
",",
"condition",
"=",
"'contains'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'HookItem'",
"search",
"=",
"'HookItem/HookingModule'",
"content_type",
"="... | Create a node for HookItem/HookingModule
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"HookItem",
"/",
"HookingModule",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L514-L526 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_portitem_remoteport | def make_portitem_remoteport(remote_port, condition='is', negate=False):
"""
Create a node for PortItem/remotePort
:return: A IndicatorItem represented as an Element node
"""
document = 'PortItem'
search = 'PortItem/remotePort'
content_type = 'int'
content = remote_port
ii_node ... | python | def make_portitem_remoteport(remote_port, condition='is', negate=False):
"""
Create a node for PortItem/remotePort
:return: A IndicatorItem represented as an Element node
"""
document = 'PortItem'
search = 'PortItem/remotePort'
content_type = 'int'
content = remote_port
ii_node ... | [
"def",
"make_portitem_remoteport",
"(",
"remote_port",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
")",
":",
"document",
"=",
"'PortItem'",
"search",
"=",
"'PortItem/remotePort'",
"content_type",
"=",
"'int'",
"content",
"=",
"remote_port",
"ii_nod... | Create a node for PortItem/remotePort
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"PortItem",
"/",
"remotePort",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L546-L558 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_prefetchitem_accessedfilelist_accessedfile | def make_prefetchitem_accessedfilelist_accessedfile(accessed_file, condition='contains', negate=False,
preserve_case=False):
"""
Create a node for PrefetchItem/AccessedFileList/AccessedFile
:return: A IndicatorItem represented as an Element node
"... | python | def make_prefetchitem_accessedfilelist_accessedfile(accessed_file, condition='contains', negate=False,
preserve_case=False):
"""
Create a node for PrefetchItem/AccessedFileList/AccessedFile
:return: A IndicatorItem represented as an Element node
"... | [
"def",
"make_prefetchitem_accessedfilelist_accessedfile",
"(",
"accessed_file",
",",
"condition",
"=",
"'contains'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'PrefetchItem'",
"search",
"=",
"'PrefetchItem/AccessedFileL... | Create a node for PrefetchItem/AccessedFileList/AccessedFile
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"PrefetchItem",
"/",
"AccessedFileList",
"/",
"AccessedFile",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L562-L575 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_prefetchitem_applicationfilename | def make_prefetchitem_applicationfilename(application_filename, condition='is', negate=False, preserve_case=False):
"""
Create a node for PrefetchItem/ApplicationFileName
:return: A IndicatorItem represented as an Element node
"""
document = 'PrefetchItem'
search = 'PrefetchItem/Application... | python | def make_prefetchitem_applicationfilename(application_filename, condition='is', negate=False, preserve_case=False):
"""
Create a node for PrefetchItem/ApplicationFileName
:return: A IndicatorItem represented as an Element node
"""
document = 'PrefetchItem'
search = 'PrefetchItem/Application... | [
"def",
"make_prefetchitem_applicationfilename",
"(",
"application_filename",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'PrefetchItem'",
"search",
"=",
"'PrefetchItem/ApplicationFileName'",... | Create a node for PrefetchItem/ApplicationFileName
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"PrefetchItem",
"/",
"ApplicationFileName",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L579-L591 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_prefetchitem_applicationfullpath | def make_prefetchitem_applicationfullpath(application_fullpath, condition='contains', negate=False,
preserve_case=False):
"""
Create a node for PrefetchItem/ApplicationFullPath
:return: A IndicatorItem represented as an Element node
"""
document = 'Pref... | python | def make_prefetchitem_applicationfullpath(application_fullpath, condition='contains', negate=False,
preserve_case=False):
"""
Create a node for PrefetchItem/ApplicationFullPath
:return: A IndicatorItem represented as an Element node
"""
document = 'Pref... | [
"def",
"make_prefetchitem_applicationfullpath",
"(",
"application_fullpath",
",",
"condition",
"=",
"'contains'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'PrefetchItem'",
"search",
"=",
"'PrefetchItem/ApplicationFullP... | Create a node for PrefetchItem/ApplicationFullPath
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"PrefetchItem",
"/",
"ApplicationFullPath",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L595-L608 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_processitem_handlelist_handle_name | def make_processitem_handlelist_handle_name(handle_name, condition='contains', negate=False, preserve_case=False):
"""
Create a node for ProcessItem/HandleList/Handle/Name
:return: A IndicatorItem represented as an Element node
"""
document = 'ProcessItem'
search = 'ProcessItem/HandleList/H... | python | def make_processitem_handlelist_handle_name(handle_name, condition='contains', negate=False, preserve_case=False):
"""
Create a node for ProcessItem/HandleList/Handle/Name
:return: A IndicatorItem represented as an Element node
"""
document = 'ProcessItem'
search = 'ProcessItem/HandleList/H... | [
"def",
"make_processitem_handlelist_handle_name",
"(",
"handle_name",
",",
"condition",
"=",
"'contains'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'ProcessItem'",
"search",
"=",
"'ProcessItem/HandleList/Handle/Name'",... | Create a node for ProcessItem/HandleList/Handle/Name
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"ProcessItem",
"/",
"HandleList",
"/",
"Handle",
"/",
"Name",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L612-L624 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_processitem_portlist_portitem_remoteip | def make_processitem_portlist_portitem_remoteip(remote_ip, condition='is', negate=False):
"""
Create a node for ProcessItem/PortList/PortItem/remoteIP
:return: A IndicatorItem represented as an Element node
"""
document = 'ProcessItem'
search = 'ProcessItem/PortList/PortItem/remoteIP'
c... | python | def make_processitem_portlist_portitem_remoteip(remote_ip, condition='is', negate=False):
"""
Create a node for ProcessItem/PortList/PortItem/remoteIP
:return: A IndicatorItem represented as an Element node
"""
document = 'ProcessItem'
search = 'ProcessItem/PortList/PortItem/remoteIP'
c... | [
"def",
"make_processitem_portlist_portitem_remoteip",
"(",
"remote_ip",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
")",
":",
"document",
"=",
"'ProcessItem'",
"search",
"=",
"'ProcessItem/PortList/PortItem/remoteIP'",
"content_type",
"=",
"'IP'",
"conte... | Create a node for ProcessItem/PortList/PortItem/remoteIP
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"ProcessItem",
"/",
"PortList",
"/",
"PortItem",
"/",
"remoteIP",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L628-L640 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_processitem_sectionlist_memorysection_name | def make_processitem_sectionlist_memorysection_name(section_name, condition='contains', negate=False,
preserve_case=False):
"""
Create a node for ProcessItem/SectionList/MemorySection/Name
:return: A IndicatorItem represented as an Element node
""... | python | def make_processitem_sectionlist_memorysection_name(section_name, condition='contains', negate=False,
preserve_case=False):
"""
Create a node for ProcessItem/SectionList/MemorySection/Name
:return: A IndicatorItem represented as an Element node
""... | [
"def",
"make_processitem_sectionlist_memorysection_name",
"(",
"section_name",
",",
"condition",
"=",
"'contains'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'ProcessItem'",
"search",
"=",
"'ProcessItem/SectionList/Memo... | Create a node for ProcessItem/SectionList/MemorySection/Name
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"ProcessItem",
"/",
"SectionList",
"/",
"MemorySection",
"/",
"Name",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L644-L657 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_processitem_sectionlist_memorysection_peinfo_exports_exportedfunctions_string | def make_processitem_sectionlist_memorysection_peinfo_exports_exportedfunctions_string(export_function, condition='is',
negate=False,
preserve_cas... | python | def make_processitem_sectionlist_memorysection_peinfo_exports_exportedfunctions_string(export_function, condition='is',
negate=False,
preserve_cas... | [
"def",
"make_processitem_sectionlist_memorysection_peinfo_exports_exportedfunctions_string",
"(",
"export_function",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'ProcessItem'",
"search",
"=",
... | Create a node for ProcessItem/SectionList/MemorySection/PEInfo/Exports/ExportedFunctions/string
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"ProcessItem",
"/",
"SectionList",
"/",
"MemorySection",
"/",
"PEInfo",
"/",
"Exports",
"/",
"ExportedFunctions",
"/",
"string",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L661-L675 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_processitem_stringlist_string | def make_processitem_stringlist_string(string, condition='contains', negate=False, preserve_case=False):
"""
Create a node for ProcessItem/StringList/string
:return: A IndicatorItem represented as an Element node
"""
document = 'ProcessItem'
search = 'ProcessItem/StringList/string'
cont... | python | def make_processitem_stringlist_string(string, condition='contains', negate=False, preserve_case=False):
"""
Create a node for ProcessItem/StringList/string
:return: A IndicatorItem represented as an Element node
"""
document = 'ProcessItem'
search = 'ProcessItem/StringList/string'
cont... | [
"def",
"make_processitem_stringlist_string",
"(",
"string",
",",
"condition",
"=",
"'contains'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'ProcessItem'",
"search",
"=",
"'ProcessItem/StringList/string'",
"content_typ... | Create a node for ProcessItem/StringList/string
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"ProcessItem",
"/",
"StringList",
"/",
"string",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L679-L691 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_processitem_username | def make_processitem_username(username, condition='contains', negate=False, preserve_case=False):
"""
Create a node for ProcessItem/Username
:return: A IndicatorItem represented as an Element node
"""
document = 'ProcessItem'
search = 'ProcessItem/Username'
content_type = 'string'
c... | python | def make_processitem_username(username, condition='contains', negate=False, preserve_case=False):
"""
Create a node for ProcessItem/Username
:return: A IndicatorItem represented as an Element node
"""
document = 'ProcessItem'
search = 'ProcessItem/Username'
content_type = 'string'
c... | [
"def",
"make_processitem_username",
"(",
"username",
",",
"condition",
"=",
"'contains'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'ProcessItem'",
"search",
"=",
"'ProcessItem/Username'",
"content_type",
"=",
"'s... | Create a node for ProcessItem/Username
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"ProcessItem",
"/",
"Username",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L695-L707 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_processitem_arguments | def make_processitem_arguments(arguments, condition='contains', negate=False, preserve_case=False):
"""
Create a node for ProcessItem/arguments
:return: A IndicatorItem represented as an Element node
"""
document = 'ProcessItem'
search = 'ProcessItem/arguments'
content_type = 'string'
... | python | def make_processitem_arguments(arguments, condition='contains', negate=False, preserve_case=False):
"""
Create a node for ProcessItem/arguments
:return: A IndicatorItem represented as an Element node
"""
document = 'ProcessItem'
search = 'ProcessItem/arguments'
content_type = 'string'
... | [
"def",
"make_processitem_arguments",
"(",
"arguments",
",",
"condition",
"=",
"'contains'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'ProcessItem'",
"search",
"=",
"'ProcessItem/arguments'",
"content_type",
"=",
... | Create a node for ProcessItem/arguments
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"ProcessItem",
"/",
"arguments",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L711-L723 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_processitem_path | def make_processitem_path(path, condition='contains', negate=False, preserve_case=False):
"""
Create a node for ProcessItem/path
:return: A IndicatorItem represented as an Element node
"""
document = 'ProcessItem'
search = 'ProcessItem/path'
content_type = 'string'
content = path
... | python | def make_processitem_path(path, condition='contains', negate=False, preserve_case=False):
"""
Create a node for ProcessItem/path
:return: A IndicatorItem represented as an Element node
"""
document = 'ProcessItem'
search = 'ProcessItem/path'
content_type = 'string'
content = path
... | [
"def",
"make_processitem_path",
"(",
"path",
",",
"condition",
"=",
"'contains'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'ProcessItem'",
"search",
"=",
"'ProcessItem/path'",
"content_type",
"=",
"'string'",
"... | Create a node for ProcessItem/path
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"ProcessItem",
"/",
"path",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L743-L755 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_registryitem_keypath | def make_registryitem_keypath(keypath, condition='contains', negate=False, preserve_case=False):
"""
Create a node for RegistryItem/KeyPath
:return: A IndicatorItem represented as an Element node
"""
document = 'RegistryItem'
search = 'RegistryItem/KeyPath'
content_type = 'string'
c... | python | def make_registryitem_keypath(keypath, condition='contains', negate=False, preserve_case=False):
"""
Create a node for RegistryItem/KeyPath
:return: A IndicatorItem represented as an Element node
"""
document = 'RegistryItem'
search = 'RegistryItem/KeyPath'
content_type = 'string'
c... | [
"def",
"make_registryitem_keypath",
"(",
"keypath",
",",
"condition",
"=",
"'contains'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'RegistryItem'",
"search",
"=",
"'RegistryItem/KeyPath'",
"content_type",
"=",
"'s... | Create a node for RegistryItem/KeyPath
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"RegistryItem",
"/",
"KeyPath",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L759-L771 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_registryitem_text | def make_registryitem_text(text, condition='contains', negate=False, preserve_case=False):
"""
Create a node for RegistryItem/Text
:return: A IndicatorItem represented as an Element node
"""
document = 'RegistryItem'
search = 'RegistryItem/Text'
content_type = 'string'
content = tex... | python | def make_registryitem_text(text, condition='contains', negate=False, preserve_case=False):
"""
Create a node for RegistryItem/Text
:return: A IndicatorItem represented as an Element node
"""
document = 'RegistryItem'
search = 'RegistryItem/Text'
content_type = 'string'
content = tex... | [
"def",
"make_registryitem_text",
"(",
"text",
",",
"condition",
"=",
"'contains'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'RegistryItem'",
"search",
"=",
"'RegistryItem/Text'",
"content_type",
"=",
"'string'",
... | Create a node for RegistryItem/Text
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"RegistryItem",
"/",
"Text",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L791-L803 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_registryitem_valuename | def make_registryitem_valuename(valuename, condition='is', negate=False, preserve_case=False):
"""
Create a node for RegistryItem/ValueName
:return: A IndicatorItem represented as an Element node
"""
document = 'RegistryItem'
search = 'RegistryItem/ValueName'
content_type = 'string'
... | python | def make_registryitem_valuename(valuename, condition='is', negate=False, preserve_case=False):
"""
Create a node for RegistryItem/ValueName
:return: A IndicatorItem represented as an Element node
"""
document = 'RegistryItem'
search = 'RegistryItem/ValueName'
content_type = 'string'
... | [
"def",
"make_registryitem_valuename",
"(",
"valuename",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'RegistryItem'",
"search",
"=",
"'RegistryItem/ValueName'",
"content_type",
"=",
"'s... | Create a node for RegistryItem/ValueName
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"RegistryItem",
"/",
"ValueName",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L807-L819 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_serviceitem_description | def make_serviceitem_description(description, condition='contains', negate=False, preserve_case=False):
"""
Create a node for ServiceItem/description
:return: A IndicatorItem represented as an Element node
"""
document = 'ServiceItem'
search = 'ServiceItem/description'
content_type = 's... | python | def make_serviceitem_description(description, condition='contains', negate=False, preserve_case=False):
"""
Create a node for ServiceItem/description
:return: A IndicatorItem represented as an Element node
"""
document = 'ServiceItem'
search = 'ServiceItem/description'
content_type = 's... | [
"def",
"make_serviceitem_description",
"(",
"description",
",",
"condition",
"=",
"'contains'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'ServiceItem'",
"search",
"=",
"'ServiceItem/description'",
"content_type",
"... | Create a node for ServiceItem/description
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"ServiceItem",
"/",
"description",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L823-L835 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_serviceitem_descriptivename | def make_serviceitem_descriptivename(descriptive_name, condition='is', negate=False, preserve_case=False):
"""
Create a node for ServiceItem/descriptiveName
:return: A IndicatorItem represented as an Element node
"""
document = 'ServiceItem'
search = 'ServiceItem/descriptiveName'
conten... | python | def make_serviceitem_descriptivename(descriptive_name, condition='is', negate=False, preserve_case=False):
"""
Create a node for ServiceItem/descriptiveName
:return: A IndicatorItem represented as an Element node
"""
document = 'ServiceItem'
search = 'ServiceItem/descriptiveName'
conten... | [
"def",
"make_serviceitem_descriptivename",
"(",
"descriptive_name",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'ServiceItem'",
"search",
"=",
"'ServiceItem/descriptiveName'",
"content_typ... | Create a node for ServiceItem/descriptiveName
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"ServiceItem",
"/",
"descriptiveName",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L839-L851 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_serviceitem_name | def make_serviceitem_name(name, condition='is', negate=False, preserve_case=False):
"""
Create a node for ServiceItem/name
:return: A IndicatorItem represented as an Element node
"""
document = 'ServiceItem'
search = 'ServiceItem/name'
content_type = 'string'
content = name
ii_n... | python | def make_serviceitem_name(name, condition='is', negate=False, preserve_case=False):
"""
Create a node for ServiceItem/name
:return: A IndicatorItem represented as an Element node
"""
document = 'ServiceItem'
search = 'ServiceItem/name'
content_type = 'string'
content = name
ii_n... | [
"def",
"make_serviceitem_name",
"(",
"name",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'ServiceItem'",
"search",
"=",
"'ServiceItem/name'",
"content_type",
"=",
"'string'",
"conten... | Create a node for ServiceItem/name
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"ServiceItem",
"/",
"name",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L855-L867 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_serviceitem_pathmd5sum | def make_serviceitem_pathmd5sum(path_md5, condition='is', negate=False):
"""
Create a node for ServiceItem/pathmd5sum
:return: A IndicatorItem represented as an Element node
"""
document = 'ServiceItem'
search = 'ServiceItem/pathmd5sum'
content_type = 'md5'
content = path_md5
ii... | python | def make_serviceitem_pathmd5sum(path_md5, condition='is', negate=False):
"""
Create a node for ServiceItem/pathmd5sum
:return: A IndicatorItem represented as an Element node
"""
document = 'ServiceItem'
search = 'ServiceItem/pathmd5sum'
content_type = 'md5'
content = path_md5
ii... | [
"def",
"make_serviceitem_pathmd5sum",
"(",
"path_md5",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
")",
":",
"document",
"=",
"'ServiceItem'",
"search",
"=",
"'ServiceItem/pathmd5sum'",
"content_type",
"=",
"'md5'",
"content",
"=",
"path_md5",
"ii_... | Create a node for ServiceItem/pathmd5sum
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"ServiceItem",
"/",
"pathmd5sum",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L887-L899 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_serviceitem_servicedll | def make_serviceitem_servicedll(servicedll, condition='contains', negate=False, preserve_case=False):
"""
Create a node for ServiceItem/serviceDLL
:return: A IndicatorItem represented as an Element node
"""
document = 'ServiceItem'
search = 'ServiceItem/serviceDLL'
content_type = 'strin... | python | def make_serviceitem_servicedll(servicedll, condition='contains', negate=False, preserve_case=False):
"""
Create a node for ServiceItem/serviceDLL
:return: A IndicatorItem represented as an Element node
"""
document = 'ServiceItem'
search = 'ServiceItem/serviceDLL'
content_type = 'strin... | [
"def",
"make_serviceitem_servicedll",
"(",
"servicedll",
",",
"condition",
"=",
"'contains'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'ServiceItem'",
"search",
"=",
"'ServiceItem/serviceDLL'",
"content_type",
"=",... | Create a node for ServiceItem/serviceDLL
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"ServiceItem",
"/",
"serviceDLL",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L903-L915 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_serviceitem_servicedllsignatureexists | def make_serviceitem_servicedllsignatureexists(dll_sig_exists, condition='is', negate=False):
"""
Create a node for ServiceItem/serviceDLLSignatureExists
:return: A IndicatorItem represented as an Element node
"""
document = 'ServiceItem'
search = 'ServiceItem/serviceDLLSignatureExists'
... | python | def make_serviceitem_servicedllsignatureexists(dll_sig_exists, condition='is', negate=False):
"""
Create a node for ServiceItem/serviceDLLSignatureExists
:return: A IndicatorItem represented as an Element node
"""
document = 'ServiceItem'
search = 'ServiceItem/serviceDLLSignatureExists'
... | [
"def",
"make_serviceitem_servicedllsignatureexists",
"(",
"dll_sig_exists",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
")",
":",
"document",
"=",
"'ServiceItem'",
"search",
"=",
"'ServiceItem/serviceDLLSignatureExists'",
"content_type",
"=",
"'bool'",
"... | Create a node for ServiceItem/serviceDLLSignatureExists
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"ServiceItem",
"/",
"serviceDLLSignatureExists",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L919-L931 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_serviceitem_servicedllsignatureverified | def make_serviceitem_servicedllsignatureverified(dll_sig_verified, condition='is', negate=False):
"""
Create a node for ServiceItem/serviceDLLSignatureVerified
:return: A IndicatorItem represented as an Element node
"""
document = 'ServiceItem'
search = 'ServiceItem/serviceDLLSignatureVerif... | python | def make_serviceitem_servicedllsignatureverified(dll_sig_verified, condition='is', negate=False):
"""
Create a node for ServiceItem/serviceDLLSignatureVerified
:return: A IndicatorItem represented as an Element node
"""
document = 'ServiceItem'
search = 'ServiceItem/serviceDLLSignatureVerif... | [
"def",
"make_serviceitem_servicedllsignatureverified",
"(",
"dll_sig_verified",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
")",
":",
"document",
"=",
"'ServiceItem'",
"search",
"=",
"'ServiceItem/serviceDLLSignatureVerified'",
"content_type",
"=",
"'bool'... | Create a node for ServiceItem/serviceDLLSignatureVerified
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"ServiceItem",
"/",
"serviceDLLSignatureVerified",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L935-L947 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_serviceitem_servicedllmd5sum | def make_serviceitem_servicedllmd5sum(servicedll_md5, condition='is', negate=False):
"""
Create a node for ServiceItem/serviceDLLmd5sum
:return: A IndicatorItem represented as an Element node
"""
document = 'ServiceItem'
search = 'ServiceItem/serviceDLLmd5sum'
content_type = 'md5'
c... | python | def make_serviceitem_servicedllmd5sum(servicedll_md5, condition='is', negate=False):
"""
Create a node for ServiceItem/serviceDLLmd5sum
:return: A IndicatorItem represented as an Element node
"""
document = 'ServiceItem'
search = 'ServiceItem/serviceDLLmd5sum'
content_type = 'md5'
c... | [
"def",
"make_serviceitem_servicedllmd5sum",
"(",
"servicedll_md5",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
")",
":",
"document",
"=",
"'ServiceItem'",
"search",
"=",
"'ServiceItem/serviceDLLmd5sum'",
"content_type",
"=",
"'md5'",
"content",
"=",
... | Create a node for ServiceItem/serviceDLLmd5sum
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"ServiceItem",
"/",
"serviceDLLmd5sum",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L951-L963 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_systeminfoitem_hostname | def make_systeminfoitem_hostname(hostname, condition='contains', negate=False, preserve_case=False):
"""
Create a node for SystemInfoItem/hostname
:return: A IndicatorItem represented as an Element node
"""
document = 'SystemInfoItem'
search = 'SystemInfoItem/hostname'
content_type = 's... | python | def make_systeminfoitem_hostname(hostname, condition='contains', negate=False, preserve_case=False):
"""
Create a node for SystemInfoItem/hostname
:return: A IndicatorItem represented as an Element node
"""
document = 'SystemInfoItem'
search = 'SystemInfoItem/hostname'
content_type = 's... | [
"def",
"make_systeminfoitem_hostname",
"(",
"hostname",
",",
"condition",
"=",
"'contains'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'SystemInfoItem'",
"search",
"=",
"'SystemInfoItem/hostname'",
"content_type",
"... | Create a node for SystemInfoItem/hostname
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"SystemInfoItem",
"/",
"hostname",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L967-L979 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_systemrestoreitem_originalfilename | def make_systemrestoreitem_originalfilename(original_filename, condition='contains', negate=False, preserve_case=False):
"""
Create a node for SystemRestoreItem/OriginalFileName
:return: A IndicatorItem represented as an Element node
"""
document = 'SystemRestoreItem'
search = 'SystemRestor... | python | def make_systemrestoreitem_originalfilename(original_filename, condition='contains', negate=False, preserve_case=False):
"""
Create a node for SystemRestoreItem/OriginalFileName
:return: A IndicatorItem represented as an Element node
"""
document = 'SystemRestoreItem'
search = 'SystemRestor... | [
"def",
"make_systemrestoreitem_originalfilename",
"(",
"original_filename",
",",
"condition",
"=",
"'contains'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'SystemRestoreItem'",
"search",
"=",
"'SystemRestoreItem/Origina... | Create a node for SystemRestoreItem/OriginalFileName
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"SystemRestoreItem",
"/",
"OriginalFileName",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
"an",
"Element",
"node"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L983-L995 | train |
mandiant/ioc_writer | ioc_writer/ioc_common.py | make_fileitem_peinfo_versioninfoitem | def make_fileitem_peinfo_versioninfoitem(key, value, condition='is', negate=False, preserve_case=False):
"""
Create a node for FileItem/PEInfo/VersionInfoList/VersionInfoItem/ + key name
No validation of the key is performed.
:return: A IndicatorItem represented as an Element node
"""
... | python | def make_fileitem_peinfo_versioninfoitem(key, value, condition='is', negate=False, preserve_case=False):
"""
Create a node for FileItem/PEInfo/VersionInfoList/VersionInfoItem/ + key name
No validation of the key is performed.
:return: A IndicatorItem represented as an Element node
"""
... | [
"def",
"make_fileitem_peinfo_versioninfoitem",
"(",
"key",
",",
"value",
",",
"condition",
"=",
"'is'",
",",
"negate",
"=",
"False",
",",
"preserve_case",
"=",
"False",
")",
":",
"document",
"=",
"'FileItem'",
"search",
"=",
"'FileItem/PEInfo/VersionInfoList/Version... | Create a node for FileItem/PEInfo/VersionInfoList/VersionInfoItem/ + key name
No validation of the key is performed.
:return: A IndicatorItem represented as an Element node | [
"Create",
"a",
"node",
"for",
"FileItem",
"/",
"PEInfo",
"/",
"VersionInfoList",
"/",
"VersionInfoItem",
"/",
"+",
"key",
"name",
"No",
"validation",
"of",
"the",
"key",
"is",
"performed",
".",
":",
"return",
":",
"A",
"IndicatorItem",
"represented",
"as",
... | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_common.py#L1015-L1029 | train |
mandiant/ioc_writer | ioc_writer/ioc_api.py | fix_schema_node_ordering | def fix_schema_node_ordering(parent):
"""
Fix the ordering of children under the criteria node to ensure that IndicatorItem/Indicator order
is preserved, as per XML Schema.
:return:
"""
children = parent.getchildren()
i_nodes = [node for node in children if node.... | python | def fix_schema_node_ordering(parent):
"""
Fix the ordering of children under the criteria node to ensure that IndicatorItem/Indicator order
is preserved, as per XML Schema.
:return:
"""
children = parent.getchildren()
i_nodes = [node for node in children if node.... | [
"def",
"fix_schema_node_ordering",
"(",
"parent",
")",
":",
"children",
"=",
"parent",
".",
"getchildren",
"(",
")",
"i_nodes",
"=",
"[",
"node",
"for",
"node",
"in",
"children",
"if",
"node",
".",
"tag",
"==",
"'IndicatorItem'",
"]",
"ii_nodes",
"=",
"[",... | Fix the ordering of children under the criteria node to ensure that IndicatorItem/Indicator order
is preserved, as per XML Schema.
:return: | [
"Fix",
"the",
"ordering",
"of",
"children",
"under",
"the",
"criteria",
"node",
"to",
"ensure",
"that",
"IndicatorItem",
"/",
"Indicator",
"order",
"is",
"preserved",
"as",
"per",
"XML",
"Schema",
".",
":",
"return",
":"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_api.py#L756-L778 | train |
mandiant/ioc_writer | ioc_writer/ioc_api.py | make_indicator_node | def make_indicator_node(operator, nid=None):
"""
This makes a Indicator node element. These allow the construction of a logic tree within the IOC.
:param operator: String 'AND' or 'OR'. The constants ioc_api.OR and ioc_api.AND may be used as well.
:param nid: This is used to provide a GUID for the In... | python | def make_indicator_node(operator, nid=None):
"""
This makes a Indicator node element. These allow the construction of a logic tree within the IOC.
:param operator: String 'AND' or 'OR'. The constants ioc_api.OR and ioc_api.AND may be used as well.
:param nid: This is used to provide a GUID for the In... | [
"def",
"make_indicator_node",
"(",
"operator",
",",
"nid",
"=",
"None",
")",
":",
"if",
"operator",
".",
"upper",
"(",
")",
"not",
"in",
"VALID_INDICATOR_OPERATORS",
":",
"raise",
"ValueError",
"(",
"'Indicator operator must be in [{}].'",
".",
"format",
"(",
"V... | This makes a Indicator node element. These allow the construction of a logic tree within the IOC.
:param operator: String 'AND' or 'OR'. The constants ioc_api.OR and ioc_api.AND may be used as well.
:param nid: This is used to provide a GUID for the Indicator. The ID should NOT be specified under normal circ... | [
"This",
"makes",
"a",
"Indicator",
"node",
"element",
".",
"These",
"allow",
"the",
"construction",
"of",
"a",
"logic",
"tree",
"within",
"the",
"IOC",
"."
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_api.py#L781-L797 | train |
mandiant/ioc_writer | ioc_writer/ioc_api.py | make_indicatoritem_node | def make_indicatoritem_node(condition,
document,
search,
content_type,
content,
preserve_case=False,
negate=False,
context_t... | python | def make_indicatoritem_node(condition,
document,
search,
content_type,
content,
preserve_case=False,
negate=False,
context_t... | [
"def",
"make_indicatoritem_node",
"(",
"condition",
",",
"document",
",",
"search",
",",
"content_type",
",",
"content",
",",
"preserve_case",
"=",
"False",
",",
"negate",
"=",
"False",
",",
"context_type",
"=",
"'mir'",
",",
"nid",
"=",
"None",
")",
":",
... | This makes a IndicatorItem element. This contains the actual threat intelligence in the IOC.
:param condition: This is the condition of the item ('is', 'contains', 'matches', etc). The following contants in ioc_api may be used:
==================== =====================================================
Constant ... | [
"This",
"makes",
"a",
"IndicatorItem",
"element",
".",
"This",
"contains",
"the",
"actual",
"threat",
"intelligence",
"in",
"the",
"IOC",
"."
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_api.py#L800-L859 | train |
mandiant/ioc_writer | ioc_writer/ioc_api.py | get_top_level_indicator_node | def get_top_level_indicator_node(root_node):
"""
This returns the first top level Indicator node under the criteria node.
:param root_node: Root node of an etree.
:return: an elementTree Element item, or None if no item is found.
"""
if root_node.tag != 'OpenIOC':
raise IOCParseError('R... | python | def get_top_level_indicator_node(root_node):
"""
This returns the first top level Indicator node under the criteria node.
:param root_node: Root node of an etree.
:return: an elementTree Element item, or None if no item is found.
"""
if root_node.tag != 'OpenIOC':
raise IOCParseError('R... | [
"def",
"get_top_level_indicator_node",
"(",
"root_node",
")",
":",
"if",
"root_node",
".",
"tag",
"!=",
"'OpenIOC'",
":",
"raise",
"IOCParseError",
"(",
"'Root tag is not \"OpenIOC\" [{}].'",
".",
"format",
"(",
"root_node",
".",
"tag",
")",
")",
"elems",
"=",
"... | This returns the first top level Indicator node under the criteria node.
:param root_node: Root node of an etree.
:return: an elementTree Element item, or None if no item is found. | [
"This",
"returns",
"the",
"first",
"top",
"level",
"Indicator",
"node",
"under",
"the",
"criteria",
"node",
"."
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_api.py#L862-L882 | train |
mandiant/ioc_writer | ioc_writer/ioc_api.py | write_ioc | def write_ioc(root, output_dir=None, force=False):
"""
Serialize an IOC, as defined by a set of etree Elements, to a .IOC file.
:param root: etree Element to write out. Should have the tag 'OpenIOC'
:param output_dir: Directory to write the ioc out to. default is current working directory.
:param... | python | def write_ioc(root, output_dir=None, force=False):
"""
Serialize an IOC, as defined by a set of etree Elements, to a .IOC file.
:param root: etree Element to write out. Should have the tag 'OpenIOC'
:param output_dir: Directory to write the ioc out to. default is current working directory.
:param... | [
"def",
"write_ioc",
"(",
"root",
",",
"output_dir",
"=",
"None",
",",
"force",
"=",
"False",
")",
":",
"root_tag",
"=",
"'OpenIOC'",
"if",
"not",
"force",
"and",
"root",
".",
"tag",
"!=",
"root_tag",
":",
"raise",
"ValueError",
"(",
"'Root tag is not \"{}\... | Serialize an IOC, as defined by a set of etree Elements, to a .IOC file.
:param root: etree Element to write out. Should have the tag 'OpenIOC'
:param output_dir: Directory to write the ioc out to. default is current working directory.
:param force: If set, skip the root node tag check.
:return: True... | [
"Serialize",
"an",
"IOC",
"as",
"defined",
"by",
"a",
"set",
"of",
"etree",
"Elements",
"to",
"a",
".",
"IOC",
"file",
"."
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_api.py#L885-L919 | train |
mandiant/ioc_writer | ioc_writer/ioc_api.py | write_ioc_string | def write_ioc_string(root, force=False):
"""
Serialize an IOC, as defined by a set of etree Elements, to a String.
:param root: etree Element to serialize. Should have the tag 'OpenIOC'
:param force: Skip the root node tag check.
:return:
"""
root_tag = 'OpenIOC'
if not force and root.t... | python | def write_ioc_string(root, force=False):
"""
Serialize an IOC, as defined by a set of etree Elements, to a String.
:param root: etree Element to serialize. Should have the tag 'OpenIOC'
:param force: Skip the root node tag check.
:return:
"""
root_tag = 'OpenIOC'
if not force and root.t... | [
"def",
"write_ioc_string",
"(",
"root",
",",
"force",
"=",
"False",
")",
":",
"root_tag",
"=",
"'OpenIOC'",
"if",
"not",
"force",
"and",
"root",
".",
"tag",
"!=",
"root_tag",
":",
"raise",
"ValueError",
"(",
"'Root tag is not \"{}\".'",
".",
"format",
"(",
... | Serialize an IOC, as defined by a set of etree Elements, to a String.
:param root: etree Element to serialize. Should have the tag 'OpenIOC'
:param force: Skip the root node tag check.
:return: | [
"Serialize",
"an",
"IOC",
"as",
"defined",
"by",
"a",
"set",
"of",
"etree",
"Elements",
"to",
"a",
"String",
".",
":",
"param",
"root",
":",
"etree",
"Element",
"to",
"serialize",
".",
"Should",
"have",
"the",
"tag",
"OpenIOC",
":",
"param",
"force",
"... | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_api.py#L922-L940 | train |
mandiant/ioc_writer | ioc_writer/ioc_api.py | IOC.open_ioc | def open_ioc(fn):
"""
Opens an IOC file, or XML string. Returns the root element, top level
indicator element, and parameters element. If the IOC or string fails
to parse, an IOCParseError is raised.
This is a helper function used by __init__.
:param fn: This is a pat... | python | def open_ioc(fn):
"""
Opens an IOC file, or XML string. Returns the root element, top level
indicator element, and parameters element. If the IOC or string fails
to parse, an IOCParseError is raised.
This is a helper function used by __init__.
:param fn: This is a pat... | [
"def",
"open_ioc",
"(",
"fn",
")",
":",
"parsed_xml",
"=",
"xmlutils",
".",
"read_xml_no_ns",
"(",
"fn",
")",
"if",
"not",
"parsed_xml",
":",
"raise",
"IOCParseError",
"(",
"'Error occured parsing XML'",
")",
"root",
"=",
"parsed_xml",
".",
"getroot",
"(",
"... | Opens an IOC file, or XML string. Returns the root element, top level
indicator element, and parameters element. If the IOC or string fails
to parse, an IOCParseError is raised.
This is a helper function used by __init__.
:param fn: This is a path to a file to open, or a string conta... | [
"Opens",
"an",
"IOC",
"file",
"or",
"XML",
"string",
".",
"Returns",
"the",
"root",
"element",
"top",
"level",
"indicator",
"element",
"and",
"parameters",
"element",
".",
"If",
"the",
"IOC",
"or",
"string",
"fails",
"to",
"parse",
"an",
"IOCParseError",
"... | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_api.py#L108-L135 | train |
mandiant/ioc_writer | ioc_writer/ioc_api.py | IOC.make_ioc | def make_ioc(name=None,
description='Automatically generated IOC',
author='IOC_api',
links=None,
keywords=None,
iocid=None):
"""
This generates all parts of an IOC, but without any definition.
This is a helper ... | python | def make_ioc(name=None,
description='Automatically generated IOC',
author='IOC_api',
links=None,
keywords=None,
iocid=None):
"""
This generates all parts of an IOC, but without any definition.
This is a helper ... | [
"def",
"make_ioc",
"(",
"name",
"=",
"None",
",",
"description",
"=",
"'Automatically generated IOC'",
",",
"author",
"=",
"'IOC_api'",
",",
"links",
"=",
"None",
",",
"keywords",
"=",
"None",
",",
"iocid",
"=",
"None",
")",
":",
"root",
"=",
"ioc_et",
"... | This generates all parts of an IOC, but without any definition.
This is a helper function used by __init__.
:param name: string, Name of the ioc
:param description: string, description of the ioc
:param author: string, author name/email address
:param links: ist of tuples. Eac... | [
"This",
"generates",
"all",
"parts",
"of",
"an",
"IOC",
"but",
"without",
"any",
"definition",
"."
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_api.py#L138-L170 | train |
mandiant/ioc_writer | ioc_writer/ioc_api.py | IOC.set_lastmodified_date | def set_lastmodified_date(self, date=None):
"""
Set the last modified date of a IOC to the current date.
User may specify the date they want to set as well.
:param date: Date value to set the last modified date to. This should be in the xsdDate form.
This defaults to the curre... | python | def set_lastmodified_date(self, date=None):
"""
Set the last modified date of a IOC to the current date.
User may specify the date they want to set as well.
:param date: Date value to set the last modified date to. This should be in the xsdDate form.
This defaults to the curre... | [
"def",
"set_lastmodified_date",
"(",
"self",
",",
"date",
"=",
"None",
")",
":",
"if",
"date",
":",
"match",
"=",
"re",
".",
"match",
"(",
"DATE_REGEX",
",",
"date",
")",
"if",
"not",
"match",
":",
"raise",
"IOCParseError",
"(",
"'last-modified date is not... | Set the last modified date of a IOC to the current date.
User may specify the date they want to set as well.
:param date: Date value to set the last modified date to. This should be in the xsdDate form.
This defaults to the current date if it is not provided.
xsdDate Form: YYYY-MM-DD... | [
"Set",
"the",
"last",
"modified",
"date",
"of",
"a",
"IOC",
"to",
"the",
"current",
"date",
".",
"User",
"may",
"specify",
"the",
"date",
"they",
"want",
"to",
"set",
"as",
"well",
"."
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_api.py#L172-L188 | train |
mandiant/ioc_writer | ioc_writer/ioc_api.py | IOC.set_published_date | def set_published_date(self, date=None):
"""
Set the published date of a IOC to the current date.
User may specify the date they want to set as well.
:param date: Date value to set the published date to. This should be in the xsdDate form.
This defaults to the current date if ... | python | def set_published_date(self, date=None):
"""
Set the published date of a IOC to the current date.
User may specify the date they want to set as well.
:param date: Date value to set the published date to. This should be in the xsdDate form.
This defaults to the current date if ... | [
"def",
"set_published_date",
"(",
"self",
",",
"date",
"=",
"None",
")",
":",
"if",
"date",
":",
"match",
"=",
"re",
".",
"match",
"(",
"DATE_REGEX",
",",
"date",
")",
"if",
"not",
"match",
":",
"raise",
"IOCParseError",
"(",
"'Published date is not valid.... | Set the published date of a IOC to the current date.
User may specify the date they want to set as well.
:param date: Date value to set the published date to. This should be in the xsdDate form.
This defaults to the current date if it is not provided.
xsdDate Form: YYYY-MM-DDTHH:MM:S... | [
"Set",
"the",
"published",
"date",
"of",
"a",
"IOC",
"to",
"the",
"current",
"date",
".",
"User",
"may",
"specify",
"the",
"date",
"they",
"want",
"to",
"set",
"as",
"well",
"."
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_api.py#L190-L206 | train |
mandiant/ioc_writer | ioc_writer/ioc_api.py | IOC.set_created_date | def set_created_date(self, date=None):
"""
Set the created date of a IOC to the current date.
User may specify the date they want to set as well.
:param date: Date value to set the created date to. This should be in the xsdDate form.
This defaults to the current date if it is ... | python | def set_created_date(self, date=None):
"""
Set the created date of a IOC to the current date.
User may specify the date they want to set as well.
:param date: Date value to set the created date to. This should be in the xsdDate form.
This defaults to the current date if it is ... | [
"def",
"set_created_date",
"(",
"self",
",",
"date",
"=",
"None",
")",
":",
"if",
"date",
":",
"match",
"=",
"re",
".",
"match",
"(",
"DATE_REGEX",
",",
"date",
")",
"if",
"not",
"match",
":",
"raise",
"IOCParseError",
"(",
"'Created date is not valid. Mu... | Set the created date of a IOC to the current date.
User may specify the date they want to set as well.
:param date: Date value to set the created date to. This should be in the xsdDate form.
This defaults to the current date if it is not provided.
xsdDate form: YYYY-MM-DDTHH:MM:SS
... | [
"Set",
"the",
"created",
"date",
"of",
"a",
"IOC",
"to",
"the",
"current",
"date",
".",
"User",
"may",
"specify",
"the",
"date",
"they",
"want",
"to",
"set",
"as",
"well",
"."
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_api.py#L208-L225 | train |
mandiant/ioc_writer | ioc_writer/ioc_api.py | IOC.add_parameter | def add_parameter(self, indicator_id, content, name='comment', ptype='string'):
"""
Add a a parameter to the IOC.
:param indicator_id: The unique Indicator/IndicatorItem id the parameter is associated with.
:param content: The value of the parameter.
:param name: The name of the... | python | def add_parameter(self, indicator_id, content, name='comment', ptype='string'):
"""
Add a a parameter to the IOC.
:param indicator_id: The unique Indicator/IndicatorItem id the parameter is associated with.
:param content: The value of the parameter.
:param name: The name of the... | [
"def",
"add_parameter",
"(",
"self",
",",
"indicator_id",
",",
"content",
",",
"name",
"=",
"'comment'",
",",
"ptype",
"=",
"'string'",
")",
":",
"parameters_node",
"=",
"self",
".",
"parameters",
"criteria_node",
"=",
"self",
".",
"top_level_indicator",
".",
... | Add a a parameter to the IOC.
:param indicator_id: The unique Indicator/IndicatorItem id the parameter is associated with.
:param content: The value of the parameter.
:param name: The name of the parameter.
:param ptype: The type of the parameter content.
:return: True
:... | [
"Add",
"a",
"a",
"parameter",
"to",
"the",
"IOC",
"."
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_api.py#L227-L251 | train |
mandiant/ioc_writer | ioc_writer/ioc_api.py | IOC.add_link | def add_link(self, rel, value, href=None):
"""
Add a Link metadata element to the IOC.
:param rel: Type of the link.
:param value: Value of the link text.
:param href: A href value assigned to the link.
:return: True
"""
links_node = self.metadata.find('l... | python | def add_link(self, rel, value, href=None):
"""
Add a Link metadata element to the IOC.
:param rel: Type of the link.
:param value: Value of the link text.
:param href: A href value assigned to the link.
:return: True
"""
links_node = self.metadata.find('l... | [
"def",
"add_link",
"(",
"self",
",",
"rel",
",",
"value",
",",
"href",
"=",
"None",
")",
":",
"links_node",
"=",
"self",
".",
"metadata",
".",
"find",
"(",
"'links'",
")",
"if",
"links_node",
"is",
"None",
":",
"links_node",
"=",
"ioc_et",
".",
"make... | Add a Link metadata element to the IOC.
:param rel: Type of the link.
:param value: Value of the link text.
:param href: A href value assigned to the link.
:return: True | [
"Add",
"a",
"Link",
"metadata",
"element",
"to",
"the",
"IOC",
"."
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_api.py#L253-L268 | train |
mandiant/ioc_writer | ioc_writer/ioc_api.py | IOC.update_name | def update_name(self, name):
"""
Update the name (short description) of an IOC
This creates the short description node if it is not present.
:param name: Value to set the short description too
:return:
"""
short_desc_node = self.metadata.find('short_description'... | python | def update_name(self, name):
"""
Update the name (short description) of an IOC
This creates the short description node if it is not present.
:param name: Value to set the short description too
:return:
"""
short_desc_node = self.metadata.find('short_description'... | [
"def",
"update_name",
"(",
"self",
",",
"name",
")",
":",
"short_desc_node",
"=",
"self",
".",
"metadata",
".",
"find",
"(",
"'short_description'",
")",
"if",
"short_desc_node",
"is",
"None",
":",
"log",
".",
"debug",
"(",
"'Could not find short description node... | Update the name (short description) of an IOC
This creates the short description node if it is not present.
:param name: Value to set the short description too
:return: | [
"Update",
"the",
"name",
"(",
"short",
"description",
")",
"of",
"an",
"IOC"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_api.py#L270-L287 | train |
mandiant/ioc_writer | ioc_writer/ioc_api.py | IOC.update_description | def update_description(self, description):
"""
Update the description) of an IOC
This creates the description node if it is not present.
:param description: Value to set the description too
:return: True
"""
desc_node = self.metadata.find('description')
i... | python | def update_description(self, description):
"""
Update the description) of an IOC
This creates the description node if it is not present.
:param description: Value to set the description too
:return: True
"""
desc_node = self.metadata.find('description')
i... | [
"def",
"update_description",
"(",
"self",
",",
"description",
")",
":",
"desc_node",
"=",
"self",
".",
"metadata",
".",
"find",
"(",
"'description'",
")",
"if",
"desc_node",
"is",
"None",
":",
"log",
".",
"debug",
"(",
"'Could not find short description node for... | Update the description) of an IOC
This creates the description node if it is not present.
:param description: Value to set the description too
:return: True | [
"Update",
"the",
"description",
")",
"of",
"an",
"IOC"
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_api.py#L289-L311 | train |
mandiant/ioc_writer | ioc_writer/ioc_api.py | IOC.update_link_rel_based | def update_link_rel_based(self, old_rel, new_rel=None, new_text=None, single_link=False):
"""
Update link nodes, based on the existing link/@rel values.
This requires specifying a link/@rel value to update, and either a new
link/@rel value, or a new link/text() value for all links which... | python | def update_link_rel_based(self, old_rel, new_rel=None, new_text=None, single_link=False):
"""
Update link nodes, based on the existing link/@rel values.
This requires specifying a link/@rel value to update, and either a new
link/@rel value, or a new link/text() value for all links which... | [
"def",
"update_link_rel_based",
"(",
"self",
",",
"old_rel",
",",
"new_rel",
"=",
"None",
",",
"new_text",
"=",
"None",
",",
"single_link",
"=",
"False",
")",
":",
"links",
"=",
"self",
".",
"metadata",
".",
"xpath",
"(",
"'./links/link[@rel=\"{}\"]'",
".",
... | Update link nodes, based on the existing link/@rel values.
This requires specifying a link/@rel value to update, and either a new
link/@rel value, or a new link/text() value for all links which match
the link/@rel value. Optionally, only the first link which matches the
link/@rel value... | [
"Update",
"link",
"nodes",
"based",
"on",
"the",
"existing",
"link",
"/",
"@rel",
"values",
"."
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_api.py#L313-L350 | train |
mandiant/ioc_writer | ioc_writer/ioc_api.py | IOC.update_link_rewrite | def update_link_rewrite(self, old_rel, old_text, new_text, single_link=False):
"""
Rewrite the text() value of a link based on the link/@rel and link/text() value.
This is similar to update_link_rel_based but users link/@rel AND link/text() values
to determine which links have their lin... | python | def update_link_rewrite(self, old_rel, old_text, new_text, single_link=False):
"""
Rewrite the text() value of a link based on the link/@rel and link/text() value.
This is similar to update_link_rel_based but users link/@rel AND link/text() values
to determine which links have their lin... | [
"def",
"update_link_rewrite",
"(",
"self",
",",
"old_rel",
",",
"old_text",
",",
"new_text",
",",
"single_link",
"=",
"False",
")",
":",
"links",
"=",
"self",
".",
"metadata",
".",
"xpath",
"(",
"'./links/link[@rel=\"{}\" and text()=\"{}\"]'",
".",
"format",
"("... | Rewrite the text() value of a link based on the link/@rel and link/text() value.
This is similar to update_link_rel_based but users link/@rel AND link/text() values
to determine which links have their link/@text() values updated.
:param old_rel: The link/@rel value used to select link nodes to... | [
"Rewrite",
"the",
"text",
"()",
"value",
"of",
"a",
"link",
"based",
"on",
"the",
"link",
"/",
"@rel",
"and",
"link",
"/",
"text",
"()",
"value",
"."
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_api.py#L352-L373 | train |
mandiant/ioc_writer | ioc_writer/ioc_api.py | IOC.update_parameter | def update_parameter(self, parameter_id, content=None, name=None, param_type=None):
"""
Updates the parameter attached to an Indicator or IndicatorItem node.
All inputs must be strings or unicode objects.
:param parameter_id: The unique id of the parameter to modify
:param cont... | python | def update_parameter(self, parameter_id, content=None, name=None, param_type=None):
"""
Updates the parameter attached to an Indicator or IndicatorItem node.
All inputs must be strings or unicode objects.
:param parameter_id: The unique id of the parameter to modify
:param cont... | [
"def",
"update_parameter",
"(",
"self",
",",
"parameter_id",
",",
"content",
"=",
"None",
",",
"name",
"=",
"None",
",",
"param_type",
"=",
"None",
")",
":",
"if",
"not",
"(",
"content",
"or",
"name",
"or",
"param_type",
")",
":",
"log",
".",
"warning"... | Updates the parameter attached to an Indicator or IndicatorItem node.
All inputs must be strings or unicode objects.
:param parameter_id: The unique id of the parameter to modify
:param content: The value of the parameter.
:param name: The name of the parameter.
:param param_ty... | [
"Updates",
"the",
"parameter",
"attached",
"to",
"an",
"Indicator",
"or",
"IndicatorItem",
"node",
"."
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_api.py#L375-L413 | train |
mandiant/ioc_writer | ioc_writer/ioc_api.py | IOC.remove_link | def remove_link(self, rel, value=None, href=None):
"""
Removes link nodes based on the function arguments.
This can remove link nodes based on the following combinations of arguments:
link/@rel
link/@rel & link/text()
link/@rel & link/@href
link/@... | python | def remove_link(self, rel, value=None, href=None):
"""
Removes link nodes based on the function arguments.
This can remove link nodes based on the following combinations of arguments:
link/@rel
link/@rel & link/text()
link/@rel & link/@href
link/@... | [
"def",
"remove_link",
"(",
"self",
",",
"rel",
",",
"value",
"=",
"None",
",",
"href",
"=",
"None",
")",
":",
"links_node",
"=",
"self",
".",
"metadata",
".",
"find",
"(",
"'links'",
")",
"if",
"links_node",
"is",
"None",
":",
"log",
".",
"warning",
... | Removes link nodes based on the function arguments.
This can remove link nodes based on the following combinations of arguments:
link/@rel
link/@rel & link/text()
link/@rel & link/@href
link/@rel & link/text() & link/@href
:param rel: link/@rel value to ... | [
"Removes",
"link",
"nodes",
"based",
"on",
"the",
"function",
"arguments",
"."
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_api.py#L415-L452 | train |
mandiant/ioc_writer | ioc_writer/ioc_api.py | IOC.remove_indicator | def remove_indicator(self, nid, prune=False):
"""
Removes a Indicator or IndicatorItem node from the IOC. By default,
if nodes are removed, any children nodes are inherited by the removed
node. It has the ability to delete all children Indicator and
IndicatorItem nodes undernea... | python | def remove_indicator(self, nid, prune=False):
"""
Removes a Indicator or IndicatorItem node from the IOC. By default,
if nodes are removed, any children nodes are inherited by the removed
node. It has the ability to delete all children Indicator and
IndicatorItem nodes undernea... | [
"def",
"remove_indicator",
"(",
"self",
",",
"nid",
",",
"prune",
"=",
"False",
")",
":",
"try",
":",
"node_to_remove",
"=",
"self",
".",
"top_level_indicator",
".",
"xpath",
"(",
"'//IndicatorItem[@id=\"{}\"]|//Indicator[@id=\"{}\"]'",
".",
"format",
"(",
"str",
... | Removes a Indicator or IndicatorItem node from the IOC. By default,
if nodes are removed, any children nodes are inherited by the removed
node. It has the ability to delete all children Indicator and
IndicatorItem nodes underneath an Indicator node if the 'prune'
argument is set.
... | [
"Removes",
"a",
"Indicator",
"or",
"IndicatorItem",
"node",
"from",
"the",
"IOC",
".",
"By",
"default",
"if",
"nodes",
"are",
"removed",
"any",
"children",
"nodes",
"are",
"inherited",
"by",
"the",
"removed",
"node",
".",
"It",
"has",
"the",
"ability",
"to... | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_api.py#L454-L500 | train |
mandiant/ioc_writer | ioc_writer/ioc_api.py | IOC.remove_parameter | def remove_parameter(self, param_id=None, name=None, ref_id=None, ):
"""
Removes parameters based on function arguments.
This can remove parameters based on the following param values:
param/@id
param/@name
param/@ref_id
Each input is mutually exclus... | python | def remove_parameter(self, param_id=None, name=None, ref_id=None, ):
"""
Removes parameters based on function arguments.
This can remove parameters based on the following param values:
param/@id
param/@name
param/@ref_id
Each input is mutually exclus... | [
"def",
"remove_parameter",
"(",
"self",
",",
"param_id",
"=",
"None",
",",
"name",
"=",
"None",
",",
"ref_id",
"=",
"None",
",",
")",
":",
"l",
"=",
"[",
"]",
"if",
"param_id",
":",
"l",
".",
"append",
"(",
"'param_id'",
")",
"if",
"name",
":",
"... | Removes parameters based on function arguments.
This can remove parameters based on the following param values:
param/@id
param/@name
param/@ref_id
Each input is mutually exclusive. Calling this function with multiple values set will cause an IOCParseError
... | [
"Removes",
"parameters",
"based",
"on",
"function",
"arguments",
"."
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_api.py#L502-L549 | train |
mandiant/ioc_writer | ioc_writer/ioc_api.py | IOC.remove_name | def remove_name(self):
"""
Removes the name (short_description node) from the metadata node, if present.
:return: True if the node is removed. False is the node is node is not present.
"""
short_description_node = self.metadata.find('short_description')
if short_descrip... | python | def remove_name(self):
"""
Removes the name (short_description node) from the metadata node, if present.
:return: True if the node is removed. False is the node is node is not present.
"""
short_description_node = self.metadata.find('short_description')
if short_descrip... | [
"def",
"remove_name",
"(",
"self",
")",
":",
"short_description_node",
"=",
"self",
".",
"metadata",
".",
"find",
"(",
"'short_description'",
")",
"if",
"short_description_node",
"is",
"not",
"None",
":",
"self",
".",
"metadata",
".",
"remove",
"(",
"short_des... | Removes the name (short_description node) from the metadata node, if present.
:return: True if the node is removed. False is the node is node is not present. | [
"Removes",
"the",
"name",
"(",
"short_description",
"node",
")",
"from",
"the",
"metadata",
"node",
"if",
"present",
"."
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_api.py#L551-L561 | train |
mandiant/ioc_writer | ioc_writer/ioc_api.py | IOC.remove_description | def remove_description(self):
"""
Removes the description node from the metadata node, if present.
:return: Returns True if the description node is removed. Returns False if the node is not present.
"""
description_node = self.metadata.find('description')
if description_... | python | def remove_description(self):
"""
Removes the description node from the metadata node, if present.
:return: Returns True if the description node is removed. Returns False if the node is not present.
"""
description_node = self.metadata.find('description')
if description_... | [
"def",
"remove_description",
"(",
"self",
")",
":",
"description_node",
"=",
"self",
".",
"metadata",
".",
"find",
"(",
"'description'",
")",
"if",
"description_node",
"is",
"not",
"None",
":",
"self",
".",
"metadata",
".",
"remove",
"(",
"description_node",
... | Removes the description node from the metadata node, if present.
:return: Returns True if the description node is removed. Returns False if the node is not present. | [
"Removes",
"the",
"description",
"node",
"from",
"the",
"metadata",
"node",
"if",
"present",
"."
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_api.py#L563-L573 | train |
mandiant/ioc_writer | ioc_writer/ioc_api.py | IOC.write_ioc_to_file | def write_ioc_to_file(self, output_dir=None, force=False):
"""
Serialize the IOC to a .ioc file.
:param output_dir: Directory to write the ioc out to. default is the current working directory.
:param force: If specified, will not validate the root node of the IOC is 'OpenIOC'.
... | python | def write_ioc_to_file(self, output_dir=None, force=False):
"""
Serialize the IOC to a .ioc file.
:param output_dir: Directory to write the ioc out to. default is the current working directory.
:param force: If specified, will not validate the root node of the IOC is 'OpenIOC'.
... | [
"def",
"write_ioc_to_file",
"(",
"self",
",",
"output_dir",
"=",
"None",
",",
"force",
"=",
"False",
")",
":",
"return",
"write_ioc",
"(",
"self",
".",
"root",
",",
"output_dir",
",",
"force",
"=",
"force",
")"
] | Serialize the IOC to a .ioc file.
:param output_dir: Directory to write the ioc out to. default is the current working directory.
:param force: If specified, will not validate the root node of the IOC is 'OpenIOC'.
:return: | [
"Serialize",
"the",
"IOC",
"to",
"a",
".",
"ioc",
"file",
"."
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_api.py#L575-L583 | train |
mandiant/ioc_writer | ioc_writer/ioc_api.py | IOC.display_ioc | def display_ioc(self, width=120, sep=' ', params=False):
"""
Get a string representation of an IOC.
:param width: Width to print the description too.
:param sep: Separator used for displaying the contents of the criteria nodes.
:param params: Boolean, set to True in order to di... | python | def display_ioc(self, width=120, sep=' ', params=False):
"""
Get a string representation of an IOC.
:param width: Width to print the description too.
:param sep: Separator used for displaying the contents of the criteria nodes.
:param params: Boolean, set to True in order to di... | [
"def",
"display_ioc",
"(",
"self",
",",
"width",
"=",
"120",
",",
"sep",
"=",
"' '",
",",
"params",
"=",
"False",
")",
":",
"s",
"=",
"'Name: {}\\n'",
".",
"format",
"(",
"self",
".",
"metadata",
".",
"findtext",
"(",
"'short_description'",
",",
"defa... | Get a string representation of an IOC.
:param width: Width to print the description too.
:param sep: Separator used for displaying the contents of the criteria nodes.
:param params: Boolean, set to True in order to display node parameters.
:return: | [
"Get",
"a",
"string",
"representation",
"of",
"an",
"IOC",
"."
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_api.py#L594-L617 | train |
mandiant/ioc_writer | ioc_writer/ioc_api.py | IOC.link_text | def link_text(self):
"""
Get a text represention of the links node.
:return:
"""
s = ''
links_node = self.metadata.find('links')
if links_node is None:
return s
links = links_node.getchildren()
if links is None:
return s
... | python | def link_text(self):
"""
Get a text represention of the links node.
:return:
"""
s = ''
links_node = self.metadata.find('links')
if links_node is None:
return s
links = links_node.getchildren()
if links is None:
return s
... | [
"def",
"link_text",
"(",
"self",
")",
":",
"s",
"=",
"''",
"links_node",
"=",
"self",
".",
"metadata",
".",
"find",
"(",
"'links'",
")",
"if",
"links_node",
"is",
"None",
":",
"return",
"s",
"links",
"=",
"links_node",
".",
"getchildren",
"(",
")",
"... | Get a text represention of the links node.
:return: | [
"Get",
"a",
"text",
"represention",
"of",
"the",
"links",
"node",
"."
] | 712247f3a10bdc2584fa18ac909fc763f71df21a | https://github.com/mandiant/ioc_writer/blob/712247f3a10bdc2584fa18ac909fc763f71df21a/ioc_writer/ioc_api.py#L619-L641 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.