-
Notifications
You must be signed in to change notification settings - Fork 1
/
tds_decrypt.py
153 lines (142 loc) · 3.12 KB
/
tds_decrypt.py
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# TDS7 Password Decryptor
# Copyright (c) Jan Rude (https://github.com/whoot)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see [http://www.gnu.org/licenses/](http://www.gnu.org/licenses/)
#-------------------------------------------------------------------------------
# Version information
__version__ = "1.0"
__program__ = "tds_decrypt v" + __version__
__description__ = "TDS Login Password Decrypter"
__author__ = 'https://github.com/whoot'
__licence__ = "BSD Licence"
__status__ = "Final"
import argparse
encoding = {'b3':'a',
'83':'b',
'93':'c',
'e3':'d',
'f3':'e',
'c3':'f',
'd3':'g',
'23':'h',
'33':'i',
'03':'j',
'13':'k',
'63':'l',
'73':'m',
'43':'n',
'53':'o',
'a2':'p',
'b2':'q',
'82':'r',
'92':'s',
'e2':'t',
'f2':'u',
'c2':'v',
'd2':'w',
'22':'x',
'32':'y',
'02':'z',
'b1':'A',
'81':'B',
'91':'C',
'e1':'D',
'f1':'E',
'c1':'F',
'd1':'G',
'21':'H',
'31':'I',
'01':'J',
'11':'K',
'61':'L',
'71':'M',
'41':'N',
'51':'O',
'a0':'P',
'b0':'Q',
'80':'R',
'90':'S',
'e0':'T',
'f0':'U',
'c0':'V',
'd0':'W',
'20':'X',
'30':'Y',
'00':'Z',
'b6':'1',
'86':'2',
'96':'3',
'e6':'4',
'f6':'5',
'c6':'6',
'd6':'7',
'26':'8',
'36':'9',
'a6':'0',
'a7':' ',
'b7':'!',
'87':'"',
'd7':'\'',
'df':'§',
'e7':'$',
'f7':'%',
'c7':'&',
'57':'/',
'60':'\\',
'27':'(',
'37':')',
'76':'=',
'56':'?',
'77':'-',
'50':'_',
'17':'+',
'a1':'@',
'06':':',
'16':';',
'67':',',
'47':'.'
}
# Main
def main(argv):
parser = argparse.ArgumentParser()
parser.add_argument('-p', dest='password', type=str, help='Passwordhash to crack.')
args = parser.parse_args()
try:
if args.password:
# get rid of delimiter
password = args.password.replace('a5', '')
# add to list and remove space
chars = password.split(' ')
chars = [x for x in chars if x != '']
# start decoding
decoded = ''
for char in chars:
decoded += encoding[char]
print '\nPassword is: %s\n' %decoded
except Exception, e:
import traceback
print ('generic exception: ', traceback.format_exc())
if __name__ == "__main__":
import sys
print('\n' + 50*'*')
print('\t' + __program__ )
print('\t' + __description__ )
print('\t' + __author__)
print('\t' + 'Status:\t' + __status__)
print('\t' + 'For legal purposes only!')
print(50*'*')
sys.exit( not main( sys.argv ) )