rsmusllp / king-phisher

Phishing Campaign Toolkit
BSD 3-Clause "New" or "Revised" License
2.21k stars 536 forks source link

issue to send email with googgle #359

Closed FoxSca closed 5 years ago

FoxSca commented 5 years ago

I apologize for my ignorance

I'm following step by step the guide for using King but when I try to send the email with gmail gives me the following error Error Type: builtins.AttributeError Error Details: AttributeError ("'SSHException' object has no attribute 'message'") Error UID: b3b077c6-7cd9-4d91-9f4e-7d360f7958f4 RPC Error: N / A (Not an RPC error) King Phisher Version: 1.13.0-beta3 (rev: 0fb812ed5dfd) Platform Version: Linux: Kali kali-rolling kali-rolling Python Version: 3.7.2 Gtk Version: 3.24.5 Timezone: America / Toronto

Thread Information:

=> MainThread (alive = True daemon = False) Thread-1 (alive = True daemon = True)

Stack Trace:

Traceback (most recent call last): File "/opt/king-phisher/.venv/lib/python3.7/site-packages/paramiko/transport.py", line 2138, in _check_banner buf = self.packetizer.readline (timeout) File "/opt/king-phisher/.venv/lib/python3.7/site-packages/paramiko/packet.py", line 367, in readline buf + = self._read_timeout (timeout) File "/opt/king-phisher/.venv/lib/python3.7/site-packages/paramiko/packet.py", line 576, in _read_timeout raise socket.timeout () socket.timeout

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/king-phisher/king_phisher/client/mailer.py", line 481, in server_ssh_connect missing_host_key_policy = ssh_host_key.MissingHostKeyPolicy (self.application) File "/opt/king-phisher/king_phisher/ssh_forward.py", line 160, in init self . try_connect (password = password, look_for_keys = True, raise_error = True) File "/opt/king-phisher/king_phisher/ssh_forward.py", line 229, in try_connect self.client.connect (self.server [0], self.server [1], username = self.username, allow_agent = False, timeout = 12.0, * args, ** kwargs) File "/opt/king-phisher/.venv/lib/python3.7/site-packages/paramiko/client.py", line 397, in connect t.start_client (timeout = timeout) File "/opt/king-phisher/.venv/lib/python3.7/site-packages/paramiko/transport.py", line 587, in start_client raise e File "/opt/king-phisher/.venv/lib/python3.7/site-packages/paramiko/transport.py", line 1966, in run self._check_banner () File "/opt/king-phisher/.venv/lib/python3.7/site-packages/paramiko/transport.py", line 2143, in _check_banner "Error reading SSH protocol banner" + str (e) paramiko.ssh_exception.SSHException: Error reading SSH protocol banner

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/king-phisher/king_phisher/client/tabs/mail.py", line 344, in signal_button_clicked_sender_start connection_status = self.sender_thread.server_ssh_connect () File "/opt/king-phisher/king_phisher/client/mailer.py", line 490, in server_ssh_connect self.logger.warning ("failed with ssh exception '{0}'". format (error.message)) AttributeError: 'SSHException' object has no attribute 'message' SSHserver = smtp.gmail.com: 587 SSH user=email@gmail.com what am I doing wrong ?

zeroSteiner commented 5 years ago

Did you use the settings in the Public SMTP Servers wiki page?

FoxSca commented 5 years ago

yes but i do not if I need change some in server_config.yml because it not work for all smtp Screenshot from 2019-03-16 18-54-56 Screenshot from 2019-03-16 18-55-20

Screenshot from 2019-03-16 18-58-43

zeroSteiner commented 5 years ago

Well it looks like your username and password are wrong. If your account uses two-factor authentication, then you need to setup and use an "application password". Either way, the original stack trace looks nothing like an SMTP authentication error.

FoxSca commented 5 years ago

It's very strange because no two factors and same error with 6 different smtp

On Sun, Mar 17, 2019, 11:27 Spencer McIntyre, notifications@github.com wrote:

Well it looks like your username and password are wrong. If your account uses two-factor authentication, then you need to setup and use an "application password". Either way, the original stack trace looks nothing like an SMTP authentication error.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/securestate/king-phisher/issues/359#issuecomment-473676236, or mute the thread https://github.com/notifications/unsubscribe-auth/AVbNgdCVyankus7F74LKJSukJWNnIA6wks5vXl7ggaJpZM4b4Ejq .

zeroSteiner commented 5 years ago

Try including the full output of the verbose logs. They can be quite large so feel free to place them on pastebin. See the FAQ for how to generate verbose output. When you do this and you also get the authentication error, include that screenshot as well and that's where you can cut the logs.

FoxSca commented 5 years ago

sudo ./KingPhisherServer -f -L DEBUG server_config.yml DEBUG target diretory: /opt/king-phisher INFO checking for the pipenv environment DEBUG pipenv path: '/usr/local/bin/pipenv' DEBUG pipenv Pipfile: /opt/king-phisher/Pipfile Loading .env environment variables… DEBUG king phisher version: 1.13.0-beta3 (rev: 0fb812ed5dfd) python version: 3.7.2 DEBUG plugin dependency path: /root/.local/lib/king-phisher/python3.7/site-packages INFO listening on 0.0.0.0:80 INFO serving files has been enabled INFO initializing database connection with driver postgresql DEBUG postgresql-setup was not found DEBUG postgresql service is already running via systemctl DEBUG current database schema version: 9 (latest) DEBUG connected to postgresql database: king_phisher INFO restored 0 valid sessions and skipped 0 expired sessions from the database DEBUG use pam service 'sshd' for authentication DEBUG forked an authenticating process with pid: 15972 INFO the job manager has been started INFO adding new job with id: 91f61389-fab3-42a2-b308-7afebf3c7dfa and callback function: _maintenance INFO adding new job with id: 55d509a0-a2ef-4030-b295-ddd101509b4f and callback function: ping_all DEBUG web socket manager worker running in tid: 0x7f4b5fcc2700 DEBUG initialized the table api dataset (schema version: 8) INFO including 4 custom http headers INFO server running in process: 15932 main tid: 0x7f4b63f5b740 INFO dropped privileges to the nobody account DEBUG executing job with id: 91f61389-fab3-42a2-b308-7afebf3c7dfa and callback function: _maintenance DEBUG running periodic maintenance tasks DEBUG executing job with id: 55d509a0-a2ef-4030-b295-ddd101509b4f and callback function: pingall DEBUG 127.0.0.1:40116 tid: 0x7f4b5f4c1700 running http request handler WARNING 127.0.0.1:40116 request authorization failed (RPC session id is invalid) INFO 127.0.0.1 "GET //ws/events/json HTTP/1.1" 401 - DEBUG executing job with id: 55d509a0-a2ef-4030-b295-ddd101509b4f and callback function: ping_all DEBUG 127.0.0.1:40120 tid: 0x7f4b5f4c1700 running http request handler WARNING 127.0.0.1:40120 request authorization failed (RPC session id is invalid) INFO 127.0.0.1 "RPC /logout HTTP/1.1" 401 - DEBUG 127.0.0.1:40124 tid: 0x7f4b5f4c1700 running http request handler DEBUG calling RPC method rpcversion() INFO 127.0.0.1 "RPC /version HTTP/1.1" 200 - DEBUG 127.0.0.1:40128 tid: 0x7f4b5f4c1700 running http request handler DEBUG sent request with sequence number 0 and action 'authenticate' DEBUG received request with sequence number 0 and action 'authenticate' DEBUG pam returned code: 0 reason: 'Success' for user root after 0.03 seconds DEBUG sent response with sequence number 0 DEBUG received response with sequence number 0 INFO user root has successfully authenticated INFO successful login request from 127.0.0.1 for user root INFO 127.0.0.1 "RPC /login HTTP/1.1" 200 - DEBUG 127.0.0.1:40132 tid: 0x7f4b5f4c1700 running http request handler INFO 127.0.0.1 "GET //ws/events/json HTTP/1.1" 101 - INFO web socket has been connected DEBUG 127.0.0.1:40136 tid: 0x7f4b5ecc0700 running http request handler INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 - DEBUG 127.0.0.1:40140 tid: 0x7f4b5ecc0700 running http request handler INFO 127.0.0.1 "RPC /config/get HTTP/1.1" 200 - DEBUG 127.0.0.1:40144 tid: 0x7f4b5ecc0700 running http request handler INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 - DEBUG 127.0.0.1:40148 tid: 0x7f4b5ecc0700 running http request handler INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 - DEBUG 127.0.0.1:40152 tid: 0x7f4b5ecc0700 running http request handler DEBUG calling RPC method rpc_events_subscribe('db-messages', attributes=['id', 'campaign_id'], event_types=['deleted', 'inserted', 'updated']) INFO 127.0.0.1 "RPC /events/subscribe HTTP/1.1" 200 - DEBUG 127.0.0.1:40156 tid: 0x7f4b5ecc0700 running http request handler INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 - DEBUG 127.0.0.1:40160 tid: 0x7f4b5ecc0700 running http request handler DEBUG calling RPC method rpc_events_subscribe('db-visits', attributes=['id', 'campaign_id'], event_types=['deleted', 'inserted', 'updated']) INFO 127.0.0.1 "RPC /events/subscribe HTTP/1.1" 200 - DEBUG 127.0.0.1:40164 tid: 0x7f4b5ecc0700 running http request handler DEBUG calling RPC method rpc_events_subscribe('db-credentials', attributes=['id', 'campaign_id'], event_types=['deleted', 'inserted', 'updated']) INFO 127.0.0.1 "RPC /events/subscribe HTTP/1.1" 200 - DEBUG 127.0.0.1:40168 tid: 0x7f4b5ecc0700 running http request handler INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 - DEBUG 127.0.0.1:40172 tid: 0x7f4b5ecc0700 running http request handler INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 - DEBUG 127.0.0.1:40176 tid: 0x7f4b5ecc0700 running http request handler INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 - DEBUG 127.0.0.1:40180 tid: 0x7f4b5ecc0700 running http request handler INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 - DEBUG executing job with id: 55d509a0-a2ef-4030-b295-ddd101509b4f and callback function: ping_all DEBUG received message (len: 16 opcode: 0x0a fin: True) DEBUG processing pong (opcode: 0x0a) message DEBUG executing job with id: 55d509a0-a2ef-4030-b295-ddd101509b4f and callback function: ping_all DEBUG received message (len: 16 opcode: 0x0a fin: True) DEBUG processing pong (opcode: 0x0a) message DEBUG executing job with id: 55d509a0-a2ef-4030-b295-ddd101509b4f and callback function: ping_all DEBUG received message (len: 16 opcode: 0x0a fin: True) DEBUG processing pong (opcode: 0x0a) message DEBUG executing job with id: 55d509a0-a2ef-4030-b295-ddd101509b4f and callback function: ping_all DEBUG received message (len: 16 opcode: 0x0a fin: True) DEBUG processing pong (opcode: 0x0a) message DEBUG executing job with id: 55d509a0-a2ef-4030-b295-ddd101509b4f and callback function: ping_all DEBUG received message (len: 16 opcode: 0x0a fin: True) DEBUG processing pong (opcode: 0x0a) message DEBUG executing job with id: 55d509a0-a2ef-4030-b295-ddd101509b4f and callback function: ping_all DEBUG received message (len: 16 opcode: 0x0a fin: True) DEBUG processing pong (opcode: 0x0a) message DEBUG executing job with id: 55d509a0-a2ef-4030-b295-ddd101509b4f and callback function: ping_all DEBUG received message (len: 16 opcode: 0x0a fin: True) DEBUG processing pong (opcode: 0x0a) message DEBUG executing job with id: 55d509a0-a2ef-4030-b295-ddd101509b4f and callback function: ping_all DEBUG received message (len: 16 opcode: 0x0a fin: True) DEBUG processing pong (opcode: 0x0a) message DEBUG 127.0.0.1:40374 tid: 0x7f4b5ecc0700 running http request handler INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 - DEBUG executing job with id: 55d509a0-a2ef-4030-b295-ddd101509b4f and callback function: ping_all DEBUG received message (len: 16 opcode: 0x0a fin: True) DEBUG processing pong (opcode: 0x0a) message DEBUG executing job with id: 55d509a0-a2ef-4030-b295-ddd101509b4f and callback function: ping_all DEBUG received message (len: 16 opcode: 0x0a fin: True) DEBUG processing pong (opcode: 0x0a) message ^[[1;2B^[[1;2BDEBUG 127.0.0.1:40382 tid: 0x7f4b5ecc0700 running http request handler INFO 127.0.0.1 "RPC /config/get HTTP/1.1" 200 - DEBUG 127.0.0.1:40386 tid: 0x7f4b5ecc0700 running http request handler DEBUG calling RPC method rpc_campaign_alerts_is_subscribed('2') INFO 127.0.0.1 "RPC /campaign/alerts/is_subscribed HTTP/1.1" 200 - DEBUG 127.0.0.1:40390 tid: 0x7f4b5ecc0700 running http request handler INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 - DEBUG 127.0.0.1:40394 tid: 0x7f4b5ecc0700 running http request handler INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 - DEBUG 127.0.0.1:40398 tid: 0x7f4b5ecc0700 running http request handler INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 - DEBUG 127.0.0.1:40402 tid: 0x7f4b5ecc0700 running http request handler INFO 127.0.0.1 "RPC /db/table/set HTTP/1.1" 200 - DEBUG 127.0.0.1:40406 tid: 0x7f4b5ecc0700 running http request handler INFO 127.0.0.1 "RPC /config/set HTTP/1.1" 200 - DEBUG 127.0.0.1:40410 tid: 0x7f4b5ecc0700 running http request handler INFO 127.0.0.1 "RPC /graphql HTTP/1.1" 200 - DEBUG 127.0.0.1:40418 tid: 0x7f4b5ecc0700 running http request handler DEBUG calling RPC method rpc_ping() INFO 127.0.0.1 "RPC /ping HTTP/1.1" 200 - DEBUG executing job with id: 55d509a0-a2ef-4030-b295-ddd101509b4f and callback function: ping_all DEBUG received message (len: 16 opcode: 0x0a fin: True) DEBUG processing pong (opcode: 0x0a) message

Screenshot from 2019-03-17 19-17-03

WARNING failed to load plugin 'alerts_email_via_smtp', Plugin class is invalid WARNING failed to load plugin 'alerts_email_via_smtp2go', Plugin class is invalid WARNING failed to load plugin 'alerts_sms_via_clockwork', Plugin class is invalid WARNING failed to load plugin 'alerts_sms_via_email', Plugin class is invalid WARNING failed to load plugin 'ifttt_on_campaign_success', Plugin class is invalid WARNING failed to load plugin 'pushbullet_notifications', Plugin class is invalid WARNING failed to load plugin 'request_redirect', Plugin class is invalid WARNING failed to load plugin 'xmpp_notifications', Plugin class is invalid WARNING /opt/king-phisher/king_phisher/client/main.py:101: PyGIDeprecationWarning: Since version 3.11, calling threads_init is no longer needed. See: https://wiki.gnome.org/PyGObject/Threading GObject.threads_init()

WARNING received an SMTPAuthenticationError while authenticating to the SMTP server WARNING /opt/king-phisher/king_phisher/client/gui_utilities.py:665: Warning: g_value_type_transformable: assertion 'G_TYPE_IS_VALUE (src_type)' failed builder.add_objects_from_file(which_glade(), top_level_dependencies)

(main.py:16704): Gtk-WARNING **: 19:30:25.517: ../../../../gtk/gtkliststore.c:836: Unable to convert from (null) to gchararray WARNING received an SMTPAuthenticationError while authenticating to the SMTP server WARNING received an SMTPAuthenticationError while authenticating to the SMTP server

thank you @zeroSteiner i founded the issue Gmail