dockers icon indicating copy to clipboard operation
dockers copied to clipboard

Issue with attachments - TypeError: expected str, bytes or os.PathLike object, not list

Open glwallum opened this issue 3 years ago • 1 comments

Hello,

I am experiencing an issue with the attachment import feature. Output of imap2thehive.py is below. It looks like thehive4py is looking for a different object type for the attachment file. Any ideas?

[WARNING]: Both case template and tasks are defined. Template (thehive_template) will be used. [INFO]: Processing REDACTEDEMAIL [INFO]: Connected to IMAP server. [INFO]: 1 unread messages to process [INFO]: From: REDACTEDEMAIL Subject: er [INFO]: Found attachment: file.docx (application/vnd.openxmlformats-officedocument.wordprocessingml.document) [DEBUG]: Searching for \S*(ALERT|VTMIS)\S* in 'er' [INFO]: Created case 38 Traceback (most recent call last): File "./imap2thehive.py", line 557, in main() File "./imap2thehive.py", line 553, in main readMail(mailConnect()) File "./imap2thehive.py", line 426, in readMail if submitTheHive(message) == True: File "./imap2thehive.py", line 365, in submitTheHive message = 'Found as email attachment' File "/usr/local/lib/python3.6/site-packages/thehive4py/models.py", line 591, in init file_object = open(filename, 'rb') TypeError: expected str, bytes or os.PathLike object, not list

glwallum avatar Jun 09 '21 18:06 glwallum

Around line 360 : Change : data = [path], -> data = path,

Jo-code-blue avatar May 05 '22 09:05 Jo-code-blue