-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbetterDecipher.src
More file actions
136 lines (102 loc) · 2.81 KB
/
betterDecipher.src
File metadata and controls
136 lines (102 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
_dictionaryGet = function ()
c = get_shell.host_computer;
dictionaryFile = c.File(home_dir + "/dictionary.txt");
if not dictionaryFile then
o = c.touch(home_dir, "dictionary.txt");
end if;
dictionaryFile = c.File(home_dir + "/dictionary.txt");
if not dictionaryFile then
exit("No Permission To Create Dictionary File");
end if;
return dictionaryFile;
end function;
_dictionaryWrite = function (md5, password)
dictionaryFile = _dictionaryGet();
dictionaryFile.set_content(dictionaryFile.get_content + md5 + ":" + password + "\n");
end function;
_dictionaryLookup = function (md5)
dictionaryContent = _dictionaryGet().get_content.split("\n");
entries = {};
for entry in dictionaryContent
e = entry.split(":");
if e.len == 2 then
hash = e[0];
pass = e[1];
entries.push(hash);
entries[hash] = pass;
end if;
end for;
hashes = entries.indexes;
exists = hashes.indexOf(md5);
if exists != null then
return entries[md5];
end if;
return null;
end function;
_loadLib = function (lib)
tempLib = include_lib("/lib/" + lib);
if not tempLib then
tempLib = include_lib(current_path + "/" + lib);
end if;
if not tempLib then
exit("Library " + lib + " is not available in /lib or the current path.");
end if;
return tempLib;
end function;
c = get_shell.host_computer;
curPath = current_path;
targetFile = params[0];
if not targetFile[0] == "/" then
targetFile = curPath + "/" + targetFile;
end if;
crypt = _loadLib("crypto.so");
file = c.File(targetFile);
if not file then
exit("Couldn't open " + targetFile);
end if;
targetContent = file.get_content;
rows = targetContent.split("\n");
cleanRows = [];
targetSelect = "ID USERNAME PASSWORD\n";
i = 0;
for row in rows
entry = row.split(":");
if entry.len == 2 then
cleanRows.push(row);
password = _dictionaryLookup(entry[1]);
if password == null then
password = "UNKNOWN";
end if;
targetSelect = targetSelect + i + " " + entry[0] + " " + password + "\n";
i = i + 1;
end if;
end for;
print("// DECIPHERING " + targetFile + " \\");
print("Total Users: " + cleanRows.len);
print("");
print(format_columns(targetSelect));
getIdInput = function ()
input = user_input("Select a User ID (e.g., 0): ", false);
output = input.to_int
if typeof(output) == "number" then
if output > -1 then
if output < cleanRows.len then
return output;
end if
end if
end if;
print("Input must be a valid ID from the above list.");
return getIdInput();
end function
userId = getIdInput();
targetEntry = cleanRows[userId].split(":");
username = targetEntry[0];
hash = targetEntry[1];
print("// CRACKING PASSWORD FOR: " + username + " \\");
password = _dictionaryLookup(hash);
if not password then
password = crypt.decipher(hash);
_dictionaryWrite(hash, password);
end if;
print("Password: " + password);
print("// COMPLETE \\");