phin3has / mailoney

An SMTP Honeypot
248 stars 71 forks source link

postfix_creds pipe is broken #13

Open MxRay opened 4 years ago

MxRay commented 4 years ago

Hi, I've been testing this honeypot and postfix_creds mode has two errors that makes this mode unusable. Steps taken to reproduce:

  1. clone the repo
  2. $ python mailoney.py -s hnpt -t postfix_creds Output:
    
    ****************************************************************                                                                                                                                                                                                  
        Mailoney - A Simple SMTP Honeypot - Version: 0.1                                                                                                                                                                                                              
    ****************************************************************                                                                                                                                                                                                  

Traceback (most recent call last):
File "mailoney.py", line 74, in
modules.postfix_creds.pfserver()
File "/root/monsherko/modules/postfix_creds.py", line 17, in pfserver
print mailoney.banner
AttributeError: 'module' object has no attribute 'banner'

3. comment line 17 in postfix_creds.py
4. try again `$ python mailoney.py -s hnpt -t postfix_creds`
5. test with swaks: `$ swaks --to somebody.external@gmail.com    --from=steve@example.org    --auth    --auth-user=steve    --auth-password=hell-no    --server 127.0.0.1`
Swaks output:

=== Trying 127.0.0.1:25...
=== Connected to 127.0.0.1.
<- 220 hnpt ESMTP Postfix
-> EHLO kali
<- 250 hnpt
* Host did not advertise authentication
-> QUIT
<
250-PIPELINING
< 250-SIZE 10240000
<
250-VRFY
< 250-ETRN
<
250-STARTTLS
< 250-AUTH LOGIN PLAIN
<
250 8BITMIME
<** 502 5.5.2 Error: command not recognized
=== Connection closed with remote host.


Results:
****************************************************************                                                                                                                                                                                                  
    Mailoney - A Simple SMTP Honeypot - Version: 0.1                                                                                                                                                                                                              
****************************************************************                                                                                                                                                                                                  

[] SMTP Server listening on 0.0.0.0:25 [] Accepted connection from 127.0.0.1:51494 Traceback (most recent call last): File "mailoney.py", line 74, in modules.postfix_creds.pfserver() File "/root/monsherko/modules/postfix_creds.py", line 101, in pfserver client_handler = threading.Thread(target=handle_client(client,)) File "/root/monsherko/modules/postfix_creds.py", line 82, in handle_client client_socket.send('502 5.5.2 Error: command not recognized\n') socket.error: [Errno 32] Broken pipe

phin3has commented 4 years ago

Thanks! I've been slowly (very slowly) working on a Python3 Rewrite. With some new features. I'll be on the lookout for this issue in that version.