code
stringlengths
3
6.57k
parser.add_argument("-u", "--url", help="URL of YETI instance.", type=str)
parser.add_argument("-k", "--key", help="API key for YETI.", type=str)
parser.parse_args()
not (args.config or args.url)
parse_config_file(args.config)
outf.lower()
outf.lower()
print("Unsupported output format. Using default", file=sys.stderr)
parse_config_file(file)
configparser.ConfigParser()
config.read_file(file)
config.get("DEFAULT", "url")
config.get("DEFAULT", "api_key")
config.get("DEFAULT", "output_format")
Config(url, key, output)
check_log_file(file, url, key, **kwargs)
os.path.splitext(file)
print("reading file", file=sys.stderr)
__read_evtx_file(file)
__read_text_file(file)
print("parsing file", file=sys.stderr)
parse_log_file(log)
print("looking in database", file=sys.stderr)
kwargs.get("all", False)
pyeti.YetiApi(url, api_key=key)
values.items()
api.observable_search(value=val)
get("tags", [])
get("created", "")
get("sources", [])
results.append(result)
print("writing results", file=sys.stderr)
kwargs.get("ret", False)
kwargs.get("output", None)
kwargs.get("json", False)
json.dump(results, output, indent=4, sort_keys=True)
__flatten(map(__unpack_logs, map(__csv_row, results)
csv.DictWriter(output, fieldnames=fields, quoting=csv.QUOTE_ALL)
writer.writeheader()
writer.writerows(results)
kwargs.get("output", None)
outfh.close()
print("finished", file=sys.stderr)
parse_log_file(log, **kwargs)
re.compile("(?:[0-9]{1,3}\.)
ffff(?::0{1,4})
re.compile("(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])
re.compile("[0-9a-fA-F]{64}|[0-9a-fA-F]{40}|[0-9a-fA-F]{32}")
kwargs.get("address", False)
kwargs.get("domain", False)
kwargs.get("hash", False)
if (not flags)
addr_pattern.findall(line)
values.setdefault(match, [])
append(line)
ipv6_pattern.findall(line)
values.setdefault(match.lower()
append(line)
if (not flags)
domain_pattern.findall(line)
values.setdefault(match.lower()
append(line)
if (not flags)
hash_pattern.findall(line)
values.setdefault(match.lower()
append(line)
values.pop("schemas.microsoft.com", None)
__read_evtx_file(file)
evtx.Evtx(file)
list(map(evtx.Record.xml, f.records()
__read_text_file(file)
open(file)
f.read()
splitlines()
__dict_to_string(d)
join(["{}:{}".format(key, val)
d.items()
__list_to_string(li)
join(li)
__csv_row(d)
__list_to_string([__dict_to_string(tag)
__list_to_string(d["sources"])
__unpack_logs(d)
d.copy()
result.append(new)
__flatten(li)
main()
Copyright (c)
Plugin(Enum)
plugins (grids/charts)
PerspectiveWidget(data, plugin=Plugin.TREEMAP)
options()
list(c.value for c in Plugin)
digitSum(n)
str(n)
int (ele)
digitSum(i)
print(newList)
zero_padding(x1, x2)
x1.size()