From 9cf4296bfecca858d5527c9b2bce90947a1bca3d Mon Sep 17 00:00:00 2001 From: mgeeky Date: Thu, 4 Nov 2021 16:36:01 +0100 Subject: [PATCH] updates --- phishing/phishing-HTML-linter.py | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/phishing/phishing-HTML-linter.py b/phishing/phishing-HTML-linter.py index 857b613..b6a1d3a 100644 --- a/phishing/phishing-HTML-linter.py +++ b/phishing/phishing-HTML-linter.py @@ -650,23 +650,29 @@ Therefore you will have better chances of delivering your phishing e-mail when y except: continue - text = link.getText() + text = link.getText().replace('\n', '').strip() params = dict(parse.parse_qsl(parse.urlsplit(href).query)) if len(params) > 0: num += 1 if num < 5: - context += PhishingMailParser.context(link) + '\n' - hr = href[:90] + context += PhishingMailParser.context(link) + '\n\n' + hr = href pos = hr.find('?') - hr = hr[:pos] + logger.colored(hr[pos:], 'yellow') + if pos != -1: + hr = hr[:pos] + logger.colored(hr[pos:], 'yellow') - context += f'\thref = "{hr}"\n' - context += f'\ttext = "{text[:90]}"\n\n' + hr = hr.replace('\n', '').strip() + context += f'\thref = "{hr}"\n\n' + f = '' + for k, v in params.items(): + f += f'{k}={v[:5]}..., ' + + context += f'\tparams = {f}\n\n' if num > 0: - result += f'- Found {num} tags with href="..." URLs containing GET params.\n' + result += f'- Found {logger.colored(num, "red")} tags with href="..." {logger.colored("URLs containing GET params", "yellow")}.\n' result += '\t Links with URLs that contain GET params might trigger anti-spam rule (Office365: 21615005)\n' if len(result) == 0: @@ -869,7 +875,8 @@ Therefore you will have better chances of delivering your phishing e-mail when y def testEmbeddedImages(self): images = self.soup('img') - desc = 'Embedded images can increase Spam Confidence Level (SCL) in Office365 by 4 points. Embedded images are those with . They should be avoided.' + x = '' + desc = f'Embedded images can increase Spam Confidence Level (SCL) in Office365. Embedded images are those with {logger.colored(x,"yellow")} . They should be avoided.' context = '' result = '' num = 0 @@ -903,8 +910,8 @@ Therefore you will have better chances of delivering your phishing e-mail when y context += ctx + '\n' if num > 0: - result += f'- Found {num} tags with embedded image ({embed}).\n' - result += '\t Embedded images increase Office365 SCL (Spam) level by 4 points!\n' + result += f'- Found {logger.colored(num, "red")} tags with embedded image ({logger.colored(embed, "yellow")}).\n' + result += '\t Embedded images increase Office365 SCL (Spam) level!\n' if len(result) == 0: return []