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

  • 相关阅读:
    联赛前第五阶段总结
    陶陶摘苹果 —— 线段树维护单调栈
    联赛前第三阶段总结
    联赛前第四阶段总结
    [NOIP
    超级跳马 —— 矩阵快速幂优化DP
    我的博客园美化
    Wedding —— 2-SAT
    C++运算符优先级
    water——小根堆+BFS
  • 原文地址:https://www.cnblogs.com/haq5201314/p/8328772.html
Copyright © 2011-2022 走看看