<commit_before>from PyQt4.QtGui import *
from PyQt4.QtCore import *
from os import getcwd,popen,chdir,walk,path,remove,stat,getuid
from Modules.DHCPstarvation import frm_dhcp_Attack,conf_etter
from platform import linux_distribution
from Core.Settings import frm_Settings
from re import search
import threading
from shutil import copyfile
class frm_update_attack(QMainWindow):
    def __init__(self, parent=None):
        super(frm_update_attack, self).__init__(parent)
        self.form_widget = frm_WinSoftUp(self)
        self.setCentralWidget(self.form_widget)
        self.setWindowTitle("Windows Update Attack Generator ")
        self.setWindowIcon(QIcon('rsc/icon.ico'))
        self.config = frm_Settings()
        self.loadtheme(self.config.XmlThemeSelected())

    def loadtheme(self,theme):
        if theme != "theme2":
            sshFile=("Core/%s.css"%(theme))
            with open(sshFile,"r") as fh:
                self.setStyleSheet(fh.read())
        else:
            sshFile=("Core/%s.css"%(theme))
            with open(sshFile,"r") as fh:
                self.setStyleSheet(fh.read())

class frm_WinSoftUp(QWidget):
    def __init__(self, parent=None):
        super(frm_WinSoftUp, self).__init__(parent)

        self.Main = QVBoxLayout()
        self.control = None
        self.module2 = frm_dhcp_Attack()
        self.path_file = None
        self.owd = getcwd()
        self.GUI()
    def GUI(self):
        self.form = QFormLayout(self)
        self.grid = QGridLayout(self)
        self.grid1 = QGridLayout(self)
        self.path = QLineEdit(self)
        self.logBox = QListWidget(self)
        self.path.setFixedWidth(400)
        #combobox
        self.cb_interface = QComboBox(self)
        self.refresh_interface(self.cb_interface)

        #label
        self.lb_interface = QLabel("Network Adapter:")
        # buttons
        self.btn_open = QPushButton("...")
        self.btn_stop = QPushButton("Stop",self)
        self.btn_reload = QPushButton("refresh",self)
        self.btn_start_server = QPushButton("Start Server",self)
        # size
        self.btn_open.setMaximumWidth(90)
        self.btn_stop.setFixedHeight(50)
        self.btn_start_server.setFixedHeight(50)
        #icons
        self.btn_open.setIcon(QIcon("rsc/open.png"))
        self.btn_stop.setIcon(QIcon("rsc/Stop.png"))
        self.btn_reload.setIcon(QIcon("rsc/refresh.png"))
        self.btn_start_server.setIcon(QIcon("rsc/server.png"))

        # connect buttons
        self.btn_open.clicked.connect(self.getpath)
        self.btn_reload.clicked.connect(self.inter_get)
        self.btn_start_server.clicked.connect(self.server_start)
        self.btn_stop.clicked.connect(self.stop_attack)


        # radionButton
        self.rb_windows = QRadioButton("Windows Update",self)
        self.rb_windows.setIcon(QIcon("rsc/winUp.png"))
        self.rb_adobe = QRadioButton("Adobe Update", self)
        self.rb_adobe.setIcon(QIcon("rsc/adobe.png"))
        self.rb_java = QRadioButton("Java Update", self)
        self.rb_java.setIcon(QIcon("rsc/java.png"))
        self.grid.addWidget(self.rb_windows, 0,1)
        self.grid.addWidget(self.rb_adobe, 0,2)
        self.grid.addWidget(self.rb_java, 0,3)
        # check interface
        self.grid.addWidget(self.lb_interface,1,1)
        self.grid.addWidget(self.cb_interface,1,2)
        self.grid.addWidget(self.btn_reload, 1,3)

        #grid 2
        self.grid1.addWidget(self.btn_start_server,0,2)
        self.grid1.addWidget(self.btn_stop,0,4)

        #form add layout
        self.form.addRow(self.path,self.btn_open)
        self.form.addRow(self.grid)
        self.form.addRow(self.grid1)
        self.form.addRow(self.logBox)
        self.Main.addLayout(self.form)
        self.setLayout(self.Main)

    def stop_attack(self):
        popen("killall xterm")
        self.alt_etter("")
        if path.isfile("Modules/Win-Explo/Windows_Update/index.html"):
            remove("Modules/Win-Explo/Windows_Update/index.html")
        if path.isfile("Modules/Win-Explo/Windows_Update/windows-update.exe"):
            remove("Modules/Win-Explo/Windows_Update/windows-update.exe")
        QMessageBox.information(self,"Clear Setting", "log cLear success ")

    def inter_get(self):
        self.refresh_interface(self.cb_interface)

    def refresh_interface(self,cb):
        self.module2 = frm_dhcp_Attack()
        cb.clear()
        n = self.module2.placa()
        for i,j in enumerate(n):
            if  self.module2.get_ip_local(n[i]) != None:<commit_msg>Update AttackUp_arp.py<commit_after>from PyQt4.QtGui import *
from PyQt4.QtCore import *
from os import getcwd,popen,chdir,walk,path,remove,stat,getuid
from Modules.DHCPstarvation import frm_dhcp_Attack,conf_etter
from platform import linux_distribution
from Core.Settings import frm_Settings
from re import search
import threading
from shutil import copyfile
class frm_update_attack(QMainWindow):
    def __init__(self, parent=None):
        super(frm_update_attack, self).__init__(parent)
        self.form_widget = frm_WinSoftUp(self)
        self.setCentralWidget(self.form_widget)
        self.setWindowTitle("Windows Update Attack Generator ")
        self.setWindowIcon(QIcon('rsc/icon.png'))
        self.config = frm_Settings()
        self.loadtheme(self.config.XmlThemeSelected())

    def loadtheme(self,theme):
        if theme != "theme2":
            sshFile=("Core/%s.css"%(theme))
            with open(sshFile,"r") as fh:
                self.setStyleSheet(fh.read())
        else:
            sshFile=("Core/%s.css"%(theme))
            with open(sshFile,"r") as fh:
                self.setStyleSheet(fh.read())

class frm_WinSoftUp(QWidget):
    def __init__(self, parent=None):
        super(frm_WinSoftUp, self).__init__(parent)

        self.Main = QVBoxLayout()
        self.control = None
        self.module2 = frm_dhcp_Attack()
        self.path_file = None
        self.owd = getcwd()
        self.GUI()
    def GUI(self):
        self.form = QFormLayout(self)
        self.grid = QGridLayout(self)
        self.grid1 = QGridLayout(self)
        self.path = QLineEdit(self)
        self.logBox = QListWidget(self)
        self.path.setFixedWidth(400)


        #combobox
        self.cb_interface = QComboBox(self)
        self.refresh_interface(self.cb_interface)

        #label
        self.lb_interface = QLabel("Network Adapter:")
        # buttons
        self.btn_open = QPushButton("...")
        self.btn_stop = QPushButton("Stop",self)
        self.btn_reload = QPushButton("refresh",self)
        self.btn_start_server = QPushButton("Start Server",self)
        # size
        self.btn_open.setMaximumWidth(90)
        self.btn_stop.setFixedHeight(50)
        self.btn_start_server.setFixedHeight(50)
        #icons
        self.btn_open.setIcon(QIcon("rsc/open.png"))
        self.btn_stop.setIcon(QIcon("rsc/Stop.png"))
        self.btn_reload.setIcon(QIcon("rsc/refresh.png"))
        self.btn_start_server.setIcon(QIcon("rsc/server.png"))

        # connect buttons
        self.btn_open.clicked.connect(self.getpath)
        self.btn_reload.clicked.connect(self.inter_get)
        self.btn_start_server.clicked.connect(self.server_start)
        self.btn_stop.clicked.connect(self.stop_attack)


        # radionButton
        self.rb_windows = QRadioButton("Windows Update",self)
        self.rb_windows.setIcon(QIcon("rsc/winUp.png"))
        self.rb_adobe = QRadioButton("Adobe Update", self)
        self.rb_adobe.setIcon(QIcon("rsc/adobe.png"))
        self.rb_java = QRadioButton("Java Update", self)
        self.rb_java.setIcon(QIcon("rsc/java.png"))
        self.grid.addWidget(self.rb_windows, 0,1)
        self.grid.addWidget(self.rb_adobe, 0,2)
        self.grid.addWidget(self.rb_java, 0,3)
        # check interface
        self.grid.addWidget(self.lb_interface,1,1)
        self.grid.addWidget(self.cb_interface,1,2)
        self.grid.addWidget(self.btn_reload, 1,3)

        #grid 2
        self.grid1.addWidget(self.btn_start_server,0,2)
        self.grid1.addWidget(self.btn_stop,0,4)

        #form add layout
        self.form.addRow(self.path,self.btn_open)
        self.form.addRow(self.grid)
        self.form.addRow(self.grid1)
        self.form.addRow(self.logBox)
        self.Main.addLayout(self.form)
        self.setLayout(self.Main)

        self.logo = QPixmap(getcwd() + "/rsc/peh2.jpg")
        self.label_imagem = QLabel()
        self.label_imagem.setPixmap(self.logo)
        self.form.addRow(self.label_imagem)


    def stop_attack(self):
        popen("killall xterm")
        self.alt_etter("")
        if path.isfile("Modules/Win-Explo/Windows_Update/index.html"):
            remove("Modules/Win-Explo/Windows_Update/index.html")
        if path.isfile("Modules/Win-Explo/Windows_Update/windows-update.exe"):
            remove("Modules/Win-Explo/Windows_Update/windows-update.exe")
        QMessageBox.information(self,"Clear Setting", "log cLear success ")

    def inter_get(self):
        self.refresh_interface(self.cb_interface)

    def refresh_interface(self,cb):
        self.module2 = frm_dhcp_Attack()
        cb.clear()
        n = self.module2.placa()
        for i,j in enumerate(n):
            if  self.module2.get_ip_local(n[i]) != None:
{'fraction_non_alphanumeric': 0.12094776521270867, 'fraction_numerical': 0.008077544426494346, 'mean_word_length': 2.735317779565567, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3358265', 'n_tokens_mistral': 3154, 'n_tokens_neox': 3060, 'n_words': 417}