Hello I tried to print the dll_loaded list
"behavior": {
"generic": [
{
"process_path": "C:\\Windows\\System32\\wscript.exe",
"summary": {
"dll_loaded": [
"C:\\Windows\\system32\\wshext.dll",
"C:\\Windows\\system32\\advapi32.dll",
]
}
}
but it always give me this error TypeError: string indices must be integers
I tried to print it using the following
for sys in json_data["behavior"]["generic"]:
for sys1 in sys["summary"]:
for sys2 in sys1["dll_loaded"]:
print(sys2)
I tried to print the type of sys1 and it gives me <class 'str'>
, shouldn't be a list?
then tried to treat sys1 as a string and print using range and len but that only returned the characters one by one!
but I am not sure where I am going wrong, could someone help please? I am using Python 3.7
EDIT
I tried John P answer and it worked but now I am facing another problem such as dll_loaded is not the first element in the list
"behavior": {
"generic": [
{
"process_path": "C:\\Windows\\System32\\wscript.exe",
"summary": {
"file_created": [
"C:\\Users\\Administrator\\AppData\\Roaming\\WinRAR\\version.dat"
],
"file_recreated": [
"\\Device\\DfsClient"
],
"directory_created": [
"C:\\Users\\Administrator\\AppData\\Roaming\\WinRAR"
],
"dll_loaded": [
"C:\\Windows\\system32\\wshext.dll",
"C:\\Windows\\system32\\advapi32.dll",
]
}
}
Sorry but I am still a beginner at Python