Skip to content

Commit

Permalink
Create sha1.py
Browse files Browse the repository at this point in the history
  • Loading branch information
4xx404 authored Jun 24, 2021
1 parent 603899b commit 25b07b4
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions modules/crackers/sha1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys, os, time
from urllib.request import urlopen, hashlib
from modules.stylesheet.Styling import bc, sd
banner, sBan, eBan, iBan = sd.banner.logo, sd.sBan, sd.eBan, sd.iBan

class sha1_hash:
def __init__(self, sha1_hash):
self.sha1 = sha1_hash

def crack(self, option):
self.wopt = option
if(self.wopt == 1):
wordlist = str(input(bc.BC + ' Online Wordlist: ' + bc.GC))
if(wordlist != '' or wordlist != ' '):
try:
passwords = str(urlopen(wordlist).read(), 'utf-8')
except Exception:
os.system('clear')
print(banner)
print(eBan + bc.RC + ' ERROR: ' + bc.BC + 'Failed to open ' + bc.RC + wordlist)
from brutoNova import brutoNova
brutoNova()
else:
os.system('clear')
print(banner)
print(eBan + bc.RC + ' ERROR: ' + bc.BC + 'Wordlist value cannot be empty\n')
from brutoNova import brutoNova
brutoNova()
else:
wordlist = str(input(bc.BC + ' Local Wordlist: ' + bc.GC))
if(wordlist != '' or wordlist != ' '):
try:
passwords = open(wordlist).read()
except Exception:
os.system('clear')
print(banner)
print(eBan + bc.RC + ' ERROR: ' + bc.BC + 'Failed to open ' + bc.RC + wordlist)
from brutoNova import brutoNova
brutoNova()
else:
os.system('clear')
print(banner)
print(eBan + bc.RC + ' ERROR: ' + bc.BC + 'Wordlist value cannot be empty\n')
from brutoNova import brutoNova
brutoNova()

os.system('clear')
print(banner)
print(bc.BC + ' SHA1: ' + bc.GC + self.sha1)
print(bc.BC + ' Wordlist: ' + bc.GC + wordlist + '\n')
match = ''
for passwd in passwords.split('\n'):
if(passwd != ''):
pw = hashlib.sha1(bytes(passwd, 'utf-8')).hexdigest()
if(self.sha1 == pw):
print(sBan + ' Found a Match: ' + bc.GC + passwd)
input(bc.BC + '\n Press Enter to Continue...')
os.system('clear')
print(banner)
from brutoNova import brutoNova
brutoNova()
elif(self.sha1 != pw):
print(eBan + ' No Match: ' + bc.RC + passwd)
else:
continue

input(bc.BC + '\n Press Enter to Continue...')
os.system('clear')
print(banner)
from brutoNova import brutoNova
brutoNova()

0 comments on commit 25b07b4

Please sign in to comment.