Comments (6)
Hello, this is problem with encoding email header From:
You can fix it:
Change file list_emails.py to this:
msg = email.message_from_bytes(message)
decode = email.header.decode_header(msg['From'])
from_field = ""
for decode_item in decode:
if decode_item[1] is not None:
from_field += decode_item[0].decode(decode_item[1])
else:
if isinstance(decode_item[0], bytes): from_field += decode_item[0].decode()
else:
from_field += str(decode_item[0])
Change file case_from_email.py to this:
msg = email.message_from_bytes(message)
decode = email.header.decode_header(msg['From'])
external_from_field = ""
for decode_item in decode:
if decode_item[1] is not None:
external_from_field += decode_item[0].decode(decode_item[1])
else:
if (isinstance(decode_item[0], bytes)): external_from_field += decode_item[0].decode()
else:
external_from_field += str(decode_item[0])
parsed_from_field = email.utils.parseaddr(external_from_field)
if len(parsed_from_field) > 1:
external_from_field = parsed_from_field[1]
@emalderson Can you please update this files?
from thephish.
Hello, sorry for the late reply but i'm very busy lately.
Anyway, thank you for providing the code to fix the bug that you encountered, but the problem with that part of code is that when you "fix" one thing, you can easily break 100 other things. What I mean is that if I blindly added your fix to the code, I may break the parsing logic for many other emails in which the from field has different properties. I need to test the change on all the emails that I have and then I'll consider adding your code and mention you for the contribution.
from thephish.
Does anyone have a working image of ThePhish in .OVF? I am not able to install by Docker and Docker compose.
from thephish.
Hello, is there an update for this issue?
Or can anybody provide a solution on how to implement the suggested code from @majo053? I don't understand which lines to replace exactly.
Thanks in advance!
from thephish.
Hi, is there still no working solution that can be implemented? @emalderson
from thephish.
Hello. Unfortunately, errors like these need a thorough testing process. Those are infact related to the absurdly big number of ways in which an email can be encoded into the MIME multipart format. I managed to cover the most widespread use cases, but I cannot predict how every email client encodes the emails. This means that the fields that ThePhish needs to extract are not located in any of the fields that I search in programmatically, so the code breaks. Plus, there may also be some issues with chinese or japanese characters.
This same error is also mentioned in issue #40.
Moreover, the code provided by majo053 does not fix the problem, since the problem highlighted here is related to the encoding and decoding of the HTML part in the email.
from thephish.
Related Issues (20)
- [ERROR]: Error while trying to create the case HOT 4
- [Error] Imap connection
- TheHive5 analysis in alert HOT 3
- ERROR: Version in "./docker-compose.yml" is unsupported HOT 2
- [Question] HOT 1
- [Question]CaseTemplate not found HOT 1
- [BUG] TheHive, Cortex and MISP instances are not reachable on thephish HOT 1
- AttributeError: 'NoneType' object has no attribute 'span' HOT 3
- How to change the email message that thephish sends. HOT 1
- [BUG] - Docker compose - java.lang.IllegalArgumentException: Could not instantiate implementation: org.janusgraph.diskstorage.cql.CQLStoreManager HOT 1
- Ciao non riesco nell'installazione [Question] HOT 1
- [BUG] - Crowdsec_Analyzer_1_0: Job AobGi4wB0KV4xh-jmuSh has be updated (JsDefined("Failure")) HOT 1
- There are no e-mails to read HOT 8
- [ERROR]: Error during the analysis task - Why does this happen? HOT 1
- [Question] authentication/login page for ThePhish HOT 1
- Do you have a working ISO Image for the Phish ? HOT 1
- ModuleNotFoundError: No module named 'flask' HOT 1
- Issue regarding configuration HOT 2
- [Problème de réception d'email au niveau de la BAL ThePhish] HOT 1
- Come è possibiole modificare la pagina iniziale e le risposte dell'email HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thephish.