11#-----------Welcome to DeAdSeC Python Codex----------#
22#-------Made By DeAdSeC-------#
3- #---Version 2.2.0 ---#
3+ #---Version 2.2.1 ---#
44
55#!/usr/bin/env python3
66# -*- coding: utf-8 -*-
@@ -956,6 +956,26 @@ def InputEditor(HPath, WLPath, Attack):
956956 return Bruteforce .DicMD5 (HPath , WLPath )
957957 if Attack == 'DS' :
958958 return Bruteforce .DicSHA256 (HPath , WLPath )
959+ def WrongWordListDirectoryWPA ():
960+ print ('WordList path is wrong please try again!' )
961+ input (f'Press { O } ENTER{ W } to continue' )
962+ return Menus .OFFLINE_DECRYPT_WPA ()
963+ def WrongHandShakeDirectory ():
964+ print ('HandShake path is wrong please try again!' )
965+ input (f'Press { O } ENTER{ W } to continue' )
966+ return Menus .OFFLINE_DECRYPT_WPA ()
967+ def WrongWordListDirectoryHash ():
968+ print (f"{ R } WordList file path isn't correct!{ W } " )
969+ input (f'Press { O } ENTER{ W } to continue' )
970+ return Menus .OFFLINE_DECRYPT ()
971+ def WrongHashDirectory ():
972+ print (f"{ R } Hash file path isn't correct!{ W } " )
973+ input (f'Press { O } ENTER{ W } to continue' )
974+ return Menus .OFFLINE_DECRYPT ()
975+ def HashCatFormatError ():
976+ print (f'{ R } HashCat only supports .hccapx format!{ W } ' )
977+ input (f'Press { O } ENTER{ W } to continue' )
978+ return Menus .OFFLINE_DECRYPT ()
959979
960980 def DicAircrack (HP , WL ):
961981 if HP == 'NONE' or WL == 'NONE' :
@@ -976,13 +996,9 @@ def DicAircrack(HP, WL):
976996 input (f'Press { O } ENTER{ W } to continue' )
977997 return Menus .OFFLINE_DECRYPT ()
978998 else :
979- print ('WordList path is wrong please try again!' )
980- input (f'Press { O } ENTER{ W } to continue' )
981- return Menus .OFFLINE_DECRYPT ()
999+ return Bruteforce .WrongWordListDirectoryWPA ()
9821000 else :
983- print ('HandShake path is wrong please try again!' )
984- input (f'Press { O } ENTER{ W } to continue' )
985- return Menus .OFFLINE_DECRYPT ()
1001+ return Bruteforce .WrongHandShakeDirectory ()
9861002 def BruteAircrack (HP ):
9871003
9881004 global NetWorkName
@@ -1008,11 +1024,9 @@ def BruteAircrack(HP):
10081024 os .system (f'sudo crunch { MinPassLength } { MaxPassLength } abcdefghijklmnopqrstuvwxyz0123456789 | aircrack-ng -e { NetWorkName } -w - { handshakePath } ' )
10091025 print (f'{ R } Brutefoce attack finished ...{ W } ' )
10101026 input (f'Press { O } ENTER{ W } to continue' )
1011- return Menus .OFFLINE_DECRYPT ()
1027+ return Menus .OFFLINE_DECRYPT_WPA ()
10121028 else :
1013- print ('HandShake path is wrong please try again!' )
1014- input (f'Press { O } ENTER{ W } to continue' )
1015- return Menus .OFFLINE_DECRYPT ()
1029+ return WrongHandShakeDirectory ()
10161030 def DicHashcat (HP , WL ):
10171031 if HP == 'NONE' or WL == 'NONE' :
10181032 print (f'Please enter full path for handshake file { O } [.hccapx]{ W } : ' )
@@ -1033,17 +1047,11 @@ def DicHashcat(HP, WL):
10331047 input (f'Press { O } ENTER{ W } to continue' )
10341048 return Menus .OFFLINE_DECRYPT ()
10351049 else :
1036- print (f'{ R } HashCat only supports .hccapx format!{ W } ' )
1037- input (f'Press { O } ENTER{ W } to continue' )
1038- return Menus .OFFLINE_DECRYPT ()
1050+ return Brutforce .HashCatFormatError ()
10391051 else :
1040- print ('WordList path is wrong please try again!' )
1041- input (f'Press { O } ENTER{ W } to continue' )
1042- return Menus .OFFLINE_DECRYPT ()
1052+ return Bruteforce .WrongWordListDirectoryWPA ()
10431053 else :
1044- print ('HandShake path is wrong please try again!' )
1045- input (f'Press { O } ENTER{ W } to continue' )
1046- return Menus .OFFLINE_DECRYPT ()
1054+ return Bruteforce .WrongHandShakeDirectory ()
10471055 def BruteHashcat (HP ):
10481056
10491057 global NetWorkName
@@ -1073,84 +1081,70 @@ def BruteHashcat(HP):
10731081 input (f'Press { O } ENTER{ W } to continue' )
10741082 return Menus .OFFLINE_DECRYPT ()
10751083 else :
1076- print (f'{ R } HashCat only supports .hccapx format!{ W } ' )
1077- input (f'Press { O } ENTER{ W } to continue' )
1078- return Menus .OFFLINE_DECRYPT ()
1084+ return Brutforce .HashCatFormatError ()
10791085 else :
1080- print ('HandShake path is wrong please try again!' )
1081- input (f'Press { O } ENTER{ W } to continue' )
1082- return Menus .OFFLINE_DECRYPT ()
1086+ return Bruteforce .WrongWordListDirectoryWPA ()
10831087 def RuleHashcat (HP , WL ):
10841088 if HP == 'NONE' or WL == 'NONE' :
1085- print (f'Please enter full path for handshake file { O } [.hccapx]{ W } : ' )
1086- HPath = str (input ())
1087- print ('Please enter full path for your wordlist: ' )
1088- WLPath = str (input ())
1089- Bruteforce .InputEditor (HPath , WLPath , 'DM' )
1089+ print (f'Please enter full path for handshake file { O } [.hccapx]{ W } : ' )
1090+ HPath = str (input ())
1091+ print ('Please enter full path for your wordlist: ' )
1092+ WLPath = str (input ())
1093+ Bruteforce .InputEditor (HPath , WLPath , 'DM' )
1094+ else :
1095+ print ('Please enter full path for your rule file: ' )
1096+ rulePath = str (input ())
1097+ CheckAspasRP = rulePath [:1 ]
1098+ if CheckAspasRP == "'" :
1099+ rulePathNo = rulePath [1 :- 2 ]
1100+ RPVerify = os .path .isfile (f'{ rulePathNo } ' )
10901101 else :
1091- print ('Please enter full path for your rule file: ' )
1092- rulePath = str (input ())
1093- CheckAspasRP = rulePath [:1 ]
1094- if CheckAspasRP == "'" :
1095- rulePathNo = rulePath [1 :- 2 ]
1096- RPVerify = os .path .isfile (f'{ rulePathNo } ' )
1097- else :
10981102 RPVerify = os .path .isfile (f'{ rulePath } ' )
1099- HSPVerify = os .path .isfile (f'{ HP } ' )
1100- WLPVerify = os .path .isfile (f'{ WL } ' )
1101- if HSPVerify == True :
1102- if WLPVerify == True :
1103- if HSPFormat == '.hccapx' :
1104- if RPVerify == True :
1105- print (f'Starting rule attack ... { O } [CTRL-C to exit]{ W } ' )
1106- time .sleep (2 )
1107- os .system (f'sudo hashcat -m 2500 -r { rulePath } { HP } { WL } --force' )
1108- print (f'{ R } Dictionary attack finished ...{ W } ' )
1109- input (f'Press { O } ENTER{ W } to continue' )
1110- return Menus .OFFLINE_DECRYPT ()
1111- else :
1112- print ('Rule path is wrong please try again!' )
1113- input (f'Press { O } ENTER{ W } to continue' )
1114- return Menus .OFFLINE_DECRYPT ()
1103+ HSPVerify = os .path .isfile (f'{ HP } ' )
1104+ WLPVerify = os .path .isfile (f'{ WL } ' )
1105+ if HSPVerify == True :
1106+ if WLPVerify == True :
1107+ if HSPFormat == '.hccapx' :
1108+ if RPVerify == True :
1109+ print (f'Starting rule attack ... { O } [CTRL-C to exit]{ W } ' )
1110+ time .sleep (2 )
1111+ os .system (f'sudo hashcat -m 2500 -r { rulePath } { HP } { WL } --force' )
1112+ print (f'{ R } Dictionary attack finished ...{ W } ' )
1113+ input (f'Press { O } ENTER{ W } to continue' )
1114+ return Menus .OFFLINE_DECRYPT ()
11151115 else :
1116- print (f' { R } HashCat only supports .hccapx format! { W } ' )
1116+ print ('Rule path is wrong please try again! ' )
11171117 input (f'Press { O } ENTER{ W } to continue' )
11181118 return Menus .OFFLINE_DECRYPT ()
11191119 else :
1120- print (f"{ R } WordList file path isn't correct!{ W } " )
1121- input (f'Press { O } ENTER{ W } to continue' )
1122- return Menus .OFFLINE_DECRYPT ()
1120+ return Bruteforce .HashCatFormatError ()
11231121 else :
1124- print ( f" { R } Hash file path isn't correct! { W } " )
1125- input ( f'Press { O } ENTER { W } to continue' )
1126- return Menus . OFFLINE_DECRYPT ()
1122+ return Bruteforce . WrongWordListDirectoryWPA ( )
1123+ else :
1124+ return Bruteforce . WrongHandShakeDirectory ()
11271125 def DicMD5 (HP , WL ):
11281126 if HP == 'NONE' or WL == 'NONE' :
1129- print (f'Please enter full path for the MD5 hashes file: ' )
1130- HPath = str (input ())
1131- print ('Please enter full path for your wordlist: ' )
1132- WLPath = str (input ())
1133- Bruteforce .InputEditor (HPath , WLPath , 'DM' )
1134- else :
1135- HSPVerify = os .path .isfile (f'{ HP } ' )
1136- WLPVerify = os .path .isfile (f'{ WL } ' )
1137- if HSPVerify == True :
1138- if WLPVerify == True :
1139- print (f'Starting dictionary attack ... { O } [CTRL-C to exit]{ W } ' )
1140- time .sleep (2 )
1141- os .system (f'sudo hashcat -m 0 -a 0 -o Data/FoundHashes/MD5-{ RR } .txt --remove { HP } { WL } --force' )
1142- print (f'{ R } Dictionary attack finished ...{ W } ' )
1143- print (f'{ R } Cracked hashes saved to { O } Data/FoundHashes{ W } file{ W } ' )
1144- input (f'Press { O } ENTER{ W } to continue' )
1145- return Menus .OFFLINE_DECRYPT ()
1146- else :
1147- print (f"{ R } WordList file path isn't correct!{ W } " )
1148- input (f'Press { O } ENTER{ W } to continue' )
1149- return Menus .OFFLINE_DECRYPT ()
1150- else :
1151- print (f"{ R } Hash file path isn't correct!{ W } " )
1127+ print (f'Please enter full path for the MD5 hashes file: ' )
1128+ HPath = str (input ())
1129+ print ('Please enter full path for your wordlist: ' )
1130+ WLPath = str (input ())
1131+ Bruteforce .InputEditor (HPath , WLPath , 'DM' )
1132+ else :
1133+ HSPVerify = os .path .isfile (f'{ HP } ' )
1134+ WLPVerify = os .path .isfile (f'{ WL } ' )
1135+ if HSPVerify == True :
1136+ if WLPVerify == True :
1137+ print (f'Starting dictionary attack ... { O } [CTRL-C to exit]{ W } ' )
1138+ time .sleep (2 )
1139+ os .system (f'sudo hashcat -m 0 -a 0 -o Data/FoundHashes/MD5-{ RR } .txt --remove { HP } { WL } --force' )
1140+ print (f'{ R } Dictionary attack finished ...{ W } ' )
1141+ print (f'{ R } Cracked hashes saved to { O } Data/FoundHashes{ W } file{ W } ' )
11521142 input (f'Press { O } ENTER{ W } to continue' )
11531143 return Menus .OFFLINE_DECRYPT ()
1144+ else :
1145+ return Bruteforce .WrongWordListDirectoryHash ()
1146+ else :
1147+ return Bruteforce .WrongHashDirectory ()
11541148 def BruteMD5 (HP ):
11551149 if HP == 'NONE' :
11561150 print (f'Please enter full path for the MD5 hashes file: ' )
@@ -1168,9 +1162,7 @@ def BruteMD5(HP):
11681162 input (f'Press { O } ENTER{ W } to continue' )
11691163 return Menus .OFFLINE_DECRYPT ()
11701164 else :
1171- print (f"{ R } Hash file path isn't correct!{ W } " )
1172- input (f'Press { O } ENTER{ W } to continue' )
1173- return Menus .OFFLINE_DECRYPT ()
1165+ return Bruteforce .WrongHashDirectory ()
11741166 def DicSHA256 (HP , WL ):
11751167 if HP == 'NONE' or WL == 'NONE' :
11761168 print (f'Please enter full path for the SHA256 hashes file: ' )
@@ -1191,13 +1183,9 @@ def DicSHA256(HP, WL):
11911183 input (f'Press { O } ENTER{ W } to continue' )
11921184 return Menus .OFFLINE_DECRYPT ()
11931185 else :
1194- print (f"{ R } WordList file path isn't correct!{ W } " )
1195- input (f'Press { O } ENTER{ W } to continue' )
1196- return Menus .OFFLINE_DECRYPT ()
1186+ return Bruteforce .WrongWordListDirectoryHash ()
11971187 else :
1198- print (f"{ R } Hash file path isn't correct!{ W } " )
1199- input (f'Press { O } ENTER{ W } to continue' )
1200- return Menus .OFFLINE_DECRYPT ()
1188+ return Bruteforce .WrongHashDirectory ()
12011189 def BruteSHA256 (HP ):
12021190 if HP == 'NONE' :
12031191 print (f'Please enter full path for the SHA256 hashes file: ' )
@@ -1215,9 +1203,7 @@ def BruteSHA256(HP):
12151203 input (f'Press { O } ENTER{ W } to continue' )
12161204 return Menus .OFFLINE_DECRYPT ()
12171205 else :
1218- print (f"{ R } Hash file path isn't correct!{ W } " )
1219- input (f'Press { O } ENTER{ W } to continue' )
1220- return Menus .OFFLINE_DECRYPT ()
1206+ return WrongHashDirectory ()
12211207
12221208#Class for namp-scanner
12231209class NMAPScan ():
0 commit comments