-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathtk.py
More file actions
78 lines (58 loc) · 1.97 KB
/
tk.py
File metadata and controls
78 lines (58 loc) · 1.97 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
#!encoding:utf-8
from Tkinter import *
import tkMessageBox as tb
import subprocess, sys, pexpect,os
import thread
def func(child, text, root):
for line in child:
print line
text.insert(END,line)
text.see(END)
root.update_idletasks()
def terminate(child):
child.close()
text.insert(END,"terminated\n\n")
text.see(END)
root.update_idletasks()
def handle(filename,menu,lb):
if os.system("cp %s config.py"%filename) == 0:
text.insert(END, "Configure finished\n")
text.see(END)
else:
raise Exception("Configure Error!")
child = pexpect.spawn('python wind.py')
thread.start_new(func, (child,text,root))
if menu.type(menu.index(100)) == "command":
print menu.delete(sslmenu.index(100))
menu.add_command(label=lb,command=lambda:terminate(child))
def sslPassive():
handle("sslpassivecfg",sslmenu,"SSLPassiveStop")
def sslRepCert():
handle("sslrepcertcfg",sslmenu,"SSLRepCertStop")
def sslFreak():
handle("sslfreakcfg",sslmenu,"SSLFreakStop")
def ovpnPassive():
handle("ovpnpassivecfg",ovpnmenu,"OvpnPassiveStop")
root=Tk()
root.title("The Wind")
root.geometry("1024x960")
menubar=Menu(root)
sslmenu=Menu(menubar,tearoff=0)
sslmenu.add_command(label='SSLPassive',command=sslPassive)
sslmenu.add_command(label='SSLReplaceCert',command=sslRepCert)
sslmenu.add_command(label='SSLFreak',command=sslFreak)
sslmenu.add_separator()
menubar.add_cascade(label='SSL', menu=sslmenu)
ovpnmenu=Menu(menubar,tearoff=0)
ovpnmenu.add_command(label='OvpnPassive',command=ovpnPassive)
ovpnmenu.add_separator()
menubar.add_cascade(label='OPENVPN', menu=ovpnmenu)
menubar.add_command(label='EXIT', command=root.quit)
root.config(menu=menubar)
text=Text(root, width=1024,bg='black',fg='green')
text.pack(side="left",fill='both',expand=True)
scroll=Scrollbar(root)
scroll.pack(side="right",fill='y',expand=False)
scroll.config(command=text.yview)
text.config(yscrollcommand=scroll.set)
root.mainloop()