-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fa6f782
commit b0f72c3
Showing
17 changed files
with
170 additions
and
266 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,8 @@ | ||
import sys | ||
from setup import init | ||
from spoofer import conf | ||
|
||
init() # Add packages to PYTHONPATH | ||
def main(): | ||
args = conf.parser.parse_args() | ||
args.func(args) | ||
|
||
from args import config | ||
from commands import cli, wizard | ||
|
||
if __name__ == '__main__': | ||
arg_length = len(sys.argv) | ||
if arg_length == 1: | ||
config.parser.print_help() # Print help | ||
exit(1) | ||
elif arg_length == 2: | ||
if 'wizard' in sys.argv: | ||
wizard.run() # Run wizard | ||
elif 'cli' in sys.argv: | ||
config.cli.print_help() # Print CLI help | ||
exit(1) | ||
else: | ||
config.parser.parse_args() # Generate parser warning messages | ||
else: | ||
args = config.parser.parse_args() | ||
cli.run(args) # Run CLI | ||
sys.exit(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
from colorama import Fore | ||
from getpass import getpass | ||
from ..utils import logger, appdescription | ||
from ..utils.userinput import prompt, get_required, get_optional, get_yes_no | ||
from ..models.smtpconnection import SMTPConnection | ||
|
||
|
||
def run(args): | ||
appdescription.print_description() | ||
|
||
host = get_required('SMTP host: ') | ||
port = None; | ||
|
||
while not port: | ||
try: | ||
port = int(get_required('SMTP port: ')) | ||
if port < 0 or port > 65535: | ||
logger.error('SMTP port is out-of-range (0-65535)') | ||
port = None | ||
except ValueError: | ||
logger.error('SMTP port must be a number') | ||
port = None | ||
|
||
# Connect to SMTP over TLS | ||
connection = SMTPConnection(host, str(port)) | ||
|
||
# Attempt login | ||
if not get_yes_no("Disable authentication (Y/N)?: ", 'n'): | ||
success = False | ||
while not success: | ||
success = connection.login( | ||
get_required('Username: '), | ||
getpass() | ||
) | ||
logger.success('Authentication successful') | ||
|
||
sender = get_required('Sender address: ') | ||
sender_name = get_required('Sender name: '); | ||
|
||
recipients = [get_required('Recipient address: ')] | ||
if get_yes_no('Enter additional recipients (Y/N)?: ', 'n'): | ||
while recipient: | ||
recipient = get_optional('Recipient address: ', None) | ||
if recipient: | ||
recipients.append(recipient) | ||
|
||
subject = get_required('Subject line: ') | ||
|
||
html = '' | ||
if get_yes_no('Load message body from file (Y/N)?: ', 'n'): | ||
filename = get_required('Filename: ') | ||
with open(filename) as f: | ||
html = f.read() | ||
else: | ||
logger.info('Enter HTML line by line') | ||
logger.info('To finish, press CTRL+D (*nix) or CTRL-Z (win) on an *empty* line') | ||
while True: | ||
try: | ||
line = prompt('>| ', Fore.LIGHTBLACK_EX) | ||
html += line + '\n' | ||
except EOFError: | ||
logger.success('Captured HTML body') | ||
break | ||
|
||
# Compose MIME message | ||
message = connection.compose_message( | ||
sender, | ||
sender_name, | ||
recipients, | ||
subject, | ||
html | ||
) | ||
|
||
if get_yes_no('Send message (Y/N)?: ', None): | ||
connection.send_mail(message) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from . import logger | ||
|
||
description = """ email-spoofer-py v0.0.3 (CLI wizard) | ||
Python 3.x based email spoofer | ||
https://github.com/mikechabot/email-spoofer-py""" | ||
|
||
def print_description(): | ||
logger.bright('\n{0}'.format('='*50)) | ||
logger.header(description) | ||
logger.bright('{0}\n'.format('='*50)) | ||
|
||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
from colorama import Fore, Style | ||
from . import logger | ||
|
||
|
||
def prompt(text, color): | ||
try: | ||
print(color, end='') | ||
return input(text).strip() | ||
except KeyboardInterrupt: | ||
logger.error('\nInterrupt received. Exiting...') | ||
exit(1) | ||
finally: | ||
print(Style.RESET_ALL, end='') | ||
|
||
|
||
def get_required(text): | ||
var = None | ||
while not var: | ||
var = prompt(text, Fore.WHITE) | ||
return var | ||
|
||
|
||
def get_optional(text, default_value): | ||
var = prompt(text, Fore.WHITE) | ||
if var: | ||
return var | ||
else: | ||
return default_value | ||
|
||
|
||
def get_yes_no(text, default_value): | ||
if not default_value: | ||
val = get_required(text) | ||
else: | ||
val = get_optional(text, default_value) | ||
return _convert_answer_to_int(val) | ||
|
||
|
||
def _convert_answer_to_int(answer): | ||
if answer.lower() in {'y', 'ye', 'yes'}: | ||
return 1 | ||
return 0 | ||
|
||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
b0f72c3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its not working, tried so manything but always get these traceback errors
...
b0f72c3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rome138 What's the command you're running? Are you able to reproduce using the wizard?