zoukankan      html  css  js  c++  java
  • python写一个邮箱伪造脚本

    前言:

    原本打算学php MVC的思路然后写一个项目。但是贼恶心,

    写不出来。然后就还是用python写了个邮箱伪造。

    0x01

    第一步先去搜狐注册一个邮箱

    然后,点开设置,开启SMTP服务。

    当然你也可以用其他的邮箱,

    1开启SMTP服务

    0x02

    代码分析

    import smtplib
    from email.mime.text import MIMEText
    from email.header import Header
    zhengwen=input('请输入正文:')
    fajianr=input('请输入发件人:')
    shoujianr=input('请输入收件人:')
    zhuti=input('主题:')
    messeng=MIMEText(zhengwen,'plain','utf-8')#正文
    messeng['From']=Header(fajianr,'utf-8')#发件人
    messeng['TO']=Header(shoujianr,'utf-8')#收件人
    subject=zhuti#主题
    messeng['Subject']=Header(subject,'utf-8')
    def yxwz():
      try:
        smtp=smtplib.SMTP()
        smtp.connect('smtp.sohu.com','25')
        smtp.login('你的搜狐邮箱','你搜狐的密码')
      smtp.sendmail('你的搜狐邮箱'['目标邮箱'],messeng.as_string())
        smtp.quit()
        print('[*]邮件发送成功')
      except Exception as e:
          print('[-]发送失败,报错原因:',e)
    yxwz()
    

      运行截图

     github地址:https://github.com/422926799/python

  • 相关阅读:
    用python3实现linux的sed功能
    查找列表中指定的所有元素的位置
    Django分页
    python3中字典的copy
    Python中is和==的区别的
    python3的文件读写模式
    使用python3简单完成购物过程
    python3中str的函数
    第一篇
    《笑傲江湖》传剑摘录 有感而发
  • 原文地址:https://www.cnblogs.com/haq5201314/p/8328772.html
Copyright © 2011-2022 走看看