aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/cheat/pass
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2019-09-05 07:05:07 +0200
committerneodarz <neodarz@neodarz.net>2019-09-05 07:05:07 +0200
commite0c0d4b38cde20e2300e86b69414dd9851b47456 (patch)
tree5df65243447352a9637d1f783247bfd5ccff2ef4 /dotfiles/cheat/pass
parentdc45bf89a66ec6c8cd25cf5605deb853f6984705 (diff)
downloaddotfiles_dotdrop-e0c0d4b38cde20e2300e86b69414dd9851b47456.tar.xz
dotfiles_dotdrop-e0c0d4b38cde20e2300e86b69414dd9851b47456.zip
ooo
Diffstat (limited to '')
-rw-r--r--dotfiles/cheat/pass43
1 files changed, 43 insertions, 0 deletions
diff --git a/dotfiles/cheat/pass b/dotfiles/cheat/pass
new file mode 100644
index 0000000..b45b586
--- /dev/null
+++ b/dotfiles/cheat/pass
@@ -0,0 +1,43 @@
+# Autotype:
+autotype: user :tab pass :enter
+
+# check if pawned
+
+Python de Dropper:
+```
+import urllib2
+import hashlib
+
+CLEAN = 0
+PWNED = 1
+ERROR = -1
+
+def check_password(password):
+ m = hashlib.sha1()
+ m.update(password.encode('utf-8'))
+ hx = m.hexdigest().upper()
+
+ headers = {
+ 'User-Agent': 'pass-check',
+ 'api-version' : '2'
+ }
+
+ try:
+ req = urllib2.Request('https://api.pwnedpasswords.com/range/' + hx[:5], headers=headers)
+ response = urllib2.urlopen(req)
+ for line in response.read().splitlines():
+ if hx[5:] == line.split(":")[0]:
+ return PWNED
+ return CLEAN
+
+ except:
+ return ERROR
+
+if __name__ == '__main__':
+ if check_password("Password1") == PWNED:
+ print("PWNED !")
+ else:
+ print("MAYBE")
+```
+
+https://gitlab.com/darnir/pass-audit