forked from themycode/python-2
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathshibie.py
221 lines (200 loc) · 6.2 KB
/
shibie.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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
import os
import optparse
import re
def main():
parser=optparse.OptionParser()
parser.add_option('-j',dest='jiance',help='-j[file] Check all')
parser.add_option('-7',dest='windows7',help='-7[file] inspect windows7')
parser.add_option('-8',dest='windowsserver2008',help='-8 [file] inspect windows server 2008')
parser.add_option('-2',dest='windowserver2012',help='-2 [file] inspect windows server 2012')
parser.add_option('-3',dest='windowsserver2003',help='-3 [file] inspect windows server 2003')
parser.add_option('-x',dest='windowsXP',help='-x [file] inspect windows XP')
parser.add_option('-0',dest='windows10',help='0 [file] inspect windows 10')
(options,args)=parser.parse_args()
if options.jiance:
file=options.jiance
jiance(file)
elif options.windows7:
file2=options.windows7
windows7(file2)
elif options.windowsserver2008:
file3=options.windowsserver2008
windowsserver2008(file3)
elif options.windowserver2012:
file4=options.windowserver2012
windowsserver2012(file4)
elif options.windowsserver2003:
file5=options.windowsserver2003
windowsserver2003(file5)
elif options.windowsXP:
file6=options.windowsXP
windowsxp(file6)
elif options.windows10:
file7=options.windows10
windows10(file7)
else:
parser.print_help()
exit()
def jiance(file):
pd=os.path.exists(file)
if pd == True:
print('[*]{}existence'.format(file))
else:
print('[-]Sorry{}not existence'.format(file))
exit()
pd2=os.path.exists('list.txt')
if pd2==True:
print('[*]list.txt existence')
else:
print('[-]not existence list.txt')
exit()
lists=open('list.txt','r').read()
fg=open('{}'.format(file),'r').read()
pow="{}".format(fg)
lgw=re.findall('KB\d+',lists)
print('[*]There are no patched patches')
for v in lgw:
if v in str(pow):
pass
else:
print("[*]",v)
def windows7(file2):
pd = os.path.exists(file2)
if pd == True:
print('[*]{}existence'.format(file2))
else:
print('[-]Sorry{}not existence'.format(file2))
exit()
pd2 = os.path.exists('windows7.txt')
if pd2 == True:
print('[*]windows 7.txt existence')
else:
print('[-]not existence windows 7.txt')
exit()
lists = open('windows7.txt', 'r').read()
fg = open('{}'.format(file2), 'r').read()
pow = "{}".format(fg)
lgw = re.findall('KB\d+', lists)
print('[*]There are no patched patches')
for v in lgw:
if v in str(pow):
pass
else:
print("[*]", v)
def windowsserver2008(file3):
pd = os.path.exists(file3)
if pd == True:
print('[*]{}existence'.format(file3))
else:
print('[-]Sorry{}not existence'.format(file3))
exit()
pd2 = os.path.exists('windows server 2008.txt')
if pd2 == True:
print('[*]windows server 2008.txt existence')
else:
print('[-]not existence windows server 2008.txt')
exit()
lists = open('windows server 2008.txt', 'r').read()
fg = open('{}'.format(file3), 'r').read()
pow = "{}".format(fg)
lgw = re.findall('KB\d+', lists)
print('[*]There are no patched patches')
for v in lgw:
if v in str(pow):
pass
else:
print("[*]", v)
def windowsserver2012(file4):
pd = os.path.exists(file4)
if pd == True:
print('[*]{}existence'.format(file4))
else:
print('[-]Sorry{}not existence'.format(file4))
exit()
pd2 = os.path.exists('windows server 2012.txt')
if pd2 == True:
print('[*]windows server 2012.txt existence')
else:
print('[-]not existence windows server 2012.txt')
exit()
lists = open('windows server 2012.txt', 'r').read()
fg = open('{}'.format(file4), 'r').read()
pow = "{}".format(fg)
lgw = re.findall('KB\d+', lists)
print('[*]There are no patched patches')
for v in lgw:
if v in str(pow):
pass
else:
print("[*]", v)
def windowsserver2003(file5):
pd = os.path.exists(file5)
if pd == True:
print('[*]{}existence'.format(file5))
else:
print('[-]Sorry{}not existence'.format(file5))
exit()
pd2 = os.path.exists('windows server 2003.txt')
if pd2 == True:
print('[*]windows server 2003.txt existence')
else:
print('[-]not existence windows server 2003.txt')
exit()
lists = open('windows server 2003.txt', 'r').read()
fg = open('{}'.format(file5), 'r').read()
pow = "{}".format(fg)
lgw = re.findall('KB\d+', lists)
print('[*]There are no patched patches')
for v in lgw:
if v in str(pow):
pass
else:
print("[*]", v)
def windowsxp(file6):
pd = os.path.exists(file6)
if pd == True:
print('[*]{}existence'.format(file6))
else:
print('[-]Sorry{}not existence'.format(file6))
exit()
pd2 = os.path.exists('windows XP.txt')
if pd2 == True:
print('[*]windows XP.txt existence')
else:
print('[-]not existence windows XP.txt')
exit()
lists = open('windows XP.txt', 'r').read()
fg = open('{}'.format(file6), 'r').read()
pow = "{}".format(fg)
lgw = re.findall('KB\d+', lists)
print('[*]There are no patched patches')
for v in lgw:
if v in str(pow):
pass
else:
print("[*]", v)
def windows10(file7):
pd = os.path.exists(file7)
if pd == True:
print('[*]{}existence'.format(file7))
else:
print('[-]Sorry{}not existence'.format(file7))
exit()
pd2 = os.path.exists('windows 10.txt')
if pd2 == True:
print('[*]windows 10.txt existence')
else:
print('[-]not existence windows 10.txt')
exit()
lists = open('windows 10.txt', 'r').read()
fg = open('{}'.format(file7), 'r').read()
pow = "{}".format(fg)
lgw = re.findall('KB\d+', lists)
print('[*]There are no patched patches')
for v in lgw:
if v in str(pow):
pass
else:
print("[*]", v)
if __name__ == '__main__':
main()