コード例 #1
0
def check_dep_pumpkin():
    # check hostapd
    hostapd = popen('which hostapd').read().split('\n')
    if not path.isfile(hostapd[0]): notinstall('hostapd')
    # checck source.tar.gz tamplate module
    if not path.isfile(C.TEMPLATES):
        system(C.EXTRACT_TEMP)

    # check if hostapd is found and save path
    settings = SettingsINI(C.CONFIG_INI)
    hostapd_path = settings.get_setting('accesspoint', 'hostapd_path')
    if not path.isfile(hostapd_path) and len(hostapd[0]) > 2:
        return settings.set_setting('accesspoint', 'hostapd_path', hostapd[0])
    elif not path.isfile(hostapd[0]):
        return settings.set_setting('accesspoint', 'hostapd_path', '0')
コード例 #2
0
def check_dep_pumpkin():
    # check hostapd
    hostapd = popen('which hostapd').read().split('\n')
    if not path.isfile(hostapd[0]): notinstall('hostapd')
    # checck source.tar.gz tamplate module
    if not path.isfile(C.TEMPLATES):
        system(C.EXTRACT_TEMP)

    # check if hostapd is found and save path
    settings = SettingsINI(C.CONFIG_INI)
    hostapd_path = settings.get_setting('accesspoint','hostapd_path')
    if not path.isfile(hostapd_path) and len(hostapd[0]) > 2:
        return settings.set_setting('accesspoint','hostapd_path',hostapd[0])
    elif not path.isfile(hostapd[0]):
        return settings.set_setting('accesspoint','hostapd_path','0')
コード例 #3
0
ファイル: depedences.py プロジェクト: cann0n/WiFi-Pumpkin
def check_dep_pumpkin():
    # check hostapd
    hostapd = popen('which hostapd').read().split('\n')
    if not path.isfile(hostapd[0]): notinstall('hostapd')
    # checck source.tar.gz tamplate module
    if not path.isfile(
            'templates/fakeupdate/Windows_Update/Settins_WinUpdate.html'):
        system('cd templates/ && tar -xf fakeupdate.tar.gz')

    # check if hostapd is found and save path
    settings = SettingsINI('core/config/app/config.ini')
    hostapd_path = settings.get_setting('accesspoint', 'hostapd_path')
    if not path.isfile(hostapd_path) and len(hostapd[0]) > 2:
        return settings.set_setting('accesspoint', 'hostapd_path', hostapd[0])
    elif not path.isfile(hostapd[0]):
        return settings.set_setting('accesspoint', 'hostapd_path', '0')
コード例 #4
0
ファイル: check_depen.py プロジェクト: P0cL4bs/WiFi-Pumpkin
def check_dep_pumpkin():
    # check hostapd
    hostapd = popen('which hostapd').read().split('\n')
    if not path.isfile(hostapd[0]): notinstall('hostapd')
    # checck source.tar.gz tamplate module
    if not path.isfile('templates/Update/Windows_Update/Settins_WinUpdate.html'):
        copy('settings/source.tar.gz','templates/')
        system('cd templates/ && tar -xf source.tar.gz')
        remove('templates/source.tar.gz')

    # check if hostapd is found and save path
    settings = SettingsINI('core/config/app/config.ini')
    hostapd_path = settings.get_setting('accesspoint','hostapd_path')
    if not path.isfile(hostapd_path) and len(hostapd[0]) > 2:
        return settings.set_setting('accesspoint','hostapd_path',hostapd[0])
    elif not path.isfile(hostapd[0]):
        return settings.set_setting('accesspoint','hostapd_path','0')
コード例 #5
0
ファイル: check_depen.py プロジェクト: qiyeboy/WiFi-Pumpkin
def check_dep_pumpkin():
    hostapd = popen('which hostapd').read().split('\n')
    dhcpd = popen('which dhcpd').read().split('\n')
    deps = []
    lista = [dhcpd[0], hostapd[0]]
    for i in lista:
        deps.append(path.isfile(i))
    for k, g in enumerate(deps):
        if deps[k] == False:
            if k == 0: notinstall('isc-dhcp-server')
            if k == 1: notinstall('hostapd')
    if not path.isfile(
            'templates/Update/Windows_Update/Settins_WinUpdate.html'):
        copy('settings/source.tar.gz', 'templates/')
        system('cd templates/ && tar -xf source.tar.gz')
        remove('templates/source.tar.gz')

    # check if hostapd is found and save path
    settings = SettingsINI('core/config/app/config.ini')
    hostapd_path = settings.get_setting('accesspoint', 'hostapd_path')
    if not path.isfile(hostapd_path) and len(hostapd[0]) > 2:
        return settings.set_setting('accesspoint', 'hostapd_path', hostapd[0])
    elif not path.isfile(hostapd[0]):
        return settings.set_setting('accesspoint', 'hostapd_path', '0')
コード例 #6
0
ファイル: handler.py プロジェクト: ihebski/WiFi-Pumpkin
class MasterHandler(flow.FlowMaster):
    def __init__(self,opts, server,state,session):
        flow.FlowMaster.__init__(self,opts, server,state)
        self.config  = SettingsINI('core/config/app/proxy.ini')
        self.session = session
        self.plugins = []
        self.initializePlugins()
        
    def run(self,send):
        self.sendMethod = send
        for plugin in self.plugins:
            plugin.send_output = self.sendMethod
        self.thread = ThreadController(self)
        self.thread.start()

    def disablePlugin(self,name, status):
        ''' disable plugin by name '''
        plugin_on = []
        if status:
            for plugin in self.plugins:
                plugin_on.append(plugin.Name)
            if name not in plugin_on:
                for p in self.plugin_classes:
                    pluginconf = p()
                    if  pluginconf.Name == name:
                        pluginconf.send_output = self.sendMethod
                        print('plugin:{0:17} status:On'.format(name))
                        self.plugins.append(pluginconf)
        else:
            for plugin in self.plugins:
                if plugin.Name == name:
                    print('plugin:{0:17} status:Off'.format(name))
                    self.plugins.remove(plugin)

    def initializePlugins(self):
        self.plugin_classes = plugin.PluginTemplate.__subclasses__()
        for p in self.plugin_classes:
            if self.config.get_setting('plugins',p().Name,format=bool):
                print('plugins::{0:17} status:On'.format(p().Name))
                self.plugins.append(p())
        # initialize logging in all plugins enable
        #for instance in self.plugins:
        #    instance.init_logger(self.session)

    @controller.handler
    def request(self, flow):
        '''
        print "-- request --"
        print flow.__dict__
        print flow.request.__dict__
        print flow.request.headers.__dict__
        print "--------------"
        print
        '''
        try:
            for p in self.plugins:
                p.request(flow)
        except Exception:
            pass

    @controller.handler
    def response(self, flow):

        '''
        print
        print "-- response --"
        print flow.__dict__
        print flow.response.__dict__
        print flow.response.headers.__dict__
        print "--------------"
        print
        '''
        try:
            for p in self.plugins:
                p.response(flow)
        except Exception:
            pass
コード例 #7
0
ファイル: intercept.py プロジェクト: njaldred/WiFi-Pumpkin
class ThreadSniffingPackets(QThread):
    output_plugins = pyqtSignal(object)

    def __init__(self, interface, session):
        QThread.__init__(self)
        self.interface = interface
        self.session = session
        self.stopped = False
        self.config = SettingsINI('core/config/app/tcpproxy.ini')

    def run(self):
        self.main()

    def sniffer(self, q):
        while not self.stopped:
            try:
                sniff(iface=self.interface,
                      filter="tcp and ( port 80 or port 8080 or port 10000)",
                      prn=lambda x: q.put(x),
                      store=0)
            except Exception:
                pass
            if self.stopped:
                break

    def disablePlugin(self, name, status):
        ''' disable plugin by name '''
        plugin_on = []
        if status:
            for plugin in self.plugins:
                plugin_on.append(self.plugins[plugin].Name)
            if name not in plugin_on:
                for p in self.plugin_classes:
                    pluginconf = p()
                    if pluginconf.Name == name:
                        self.plugins[name] = pluginconf
                        self.plugins[name].getInstance()._activated = True
                        print('TCPProxy::{0:17} status:On'.format(name))
        else:
            print('TCPProxy::{0:17} status:Off'.format(name))
            self.plugins.pop(self.plugins[name].Name)

    def main(self):
        self.plugins = {}
        self.plugin_classes = default.PSniffer.__subclasses__()
        for p in self.plugin_classes:
            plugin_load = p()
            self.plugins[plugin_load.Name] = plugin_load
            self.plugins[plugin_load.Name].output = self.output_plugins
            self.plugins[plugin_load.Name].session = self.session
        print '\n[*] TCPProxy running on port 80/8080:\n'
        for name in self.plugins.keys():
            if self.config.get_setting('plugins', name, format=bool):
                self.plugins[name].getInstance()._activated = True
                print('TCPProxy::{0:17} status:On'.format(name))
        print('\n')
        q = Queue.Queue()
        sniff = Thread(target=self.sniffer, args=(q, ))
        sniff.start()
        while (not self.stopped):
            try:
                pkt = q.get(timeout=0)
                for Active in self.plugins.keys():
                    if self.plugins[Active].getInstance()._activated:
                        try:
                            self.plugins[Active].filterPackets(pkt)
                        except Exception:
                            pass
            except Queue.Empty:
                pass

    def snifferParser(self, pkt):
        try:
            if pkt.haslayer(Ether) and pkt.haslayer(
                    Raw) and not pkt.haslayer(IP) and not pkt.haslayer(IPv6):
                return
            self.dport = pkt[TCP].dport
            self.sport = pkt[TCP].sport
            if pkt.haslayer(TCP) and pkt.haslayer(Raw) and pkt.haslayer(IP):
                self.src_ip_port = str(pkt[IP].src) + ':' + str(self.sport)
                self.dst_ip_port = str(pkt[IP].dst) + ':' + str(self.dport)

            if pkt.haslayer(Raw):
                self.load = pkt[Raw].load
                if self.load.startswith('GET'):
                    self.get_http_GET(self.src_ip_port, self.dst_ip_port,
                                      self.load)
                    self.searchBingGET(
                        self.load.split('\n', 1)[0].split('&')[0])
                elif self.load.startswith('POST'):
                    header, url = self.get_http_POST(self.load)
                    self.getCredentials_POST(
                        pkt.getlayer(Raw).load, url, header, self.dport,
                        self.sport)
        except:
            pass

    def searchBingGET(self, search):
        if 'search?q' in search:
            searched = search.split('search?q=', 1)[1]
            searched = searched.replace('+', ' ')
            print 'Search::BING { %s }' % (searched)

    def getCredentials_POST(self, payload, url, header, dport, sport):
        user_regex = '([Ee]mail|%5B[Ee]mail%5D|[Uu]ser|[Uu]sername|' \
        '[Nn]ame|[Ll]ogin|[Ll]og|[Ll]ogin[Ii][Dd])=([^&|;]*)'
        pw_regex = '([Pp]assword|[Pp]ass|[Pp]asswd|[Pp]wd|[Pp][Ss][Ww]|' \
        '[Pp]asswrd|[Pp]assw|%5B[Pp]assword%5D)=([^&|;]*)'
        username = re.findall(user_regex, payload)
        password = re.findall(pw_regex, payload)
        if not username == [] and not password == []:
            self.output_plugins.emit({
                'POSTCreds': {
                    'User': username[0][1],
                    'Pass': password[0][1],
                    'Url': url,
                    'destination': '{}/{}'.format(sport, dport)
                }
            })

    def get_http_POST(self, load):
        dict_head = {}
        try:
            headers, body = load.split("\r\n\r\n", 1)
            header_lines = headers.split('\r\n')
            for item in header_lines:
                try:
                    dict_head[item.split()[0]] = item.split()[1]
                except Exception:
                    pass
            if 'Referer:' in dict_head.keys():
                return dict_head, dict_head['Referer:']
        except ValueError:
            return None, None
        return dict_head, None

    def stop(self):
        self.stopped = True
        print 'Thread::[{}] successfully stopped.'.format(self.objectName())
コード例 #8
0
ファイル: settings.py プロジェクト: heyitsgaurav/Wifi-Pumpkin
class frm_Settings(QDialog):
    def __init__(self, parent=None):
        super(frm_Settings, self).__init__(parent)
        self.setWindowTitle('WiFi-Pompkin - Settings')
        self.Settings = SettingsINI(C.CONFIG_INI)
        self.loadtheme(self.get_theme_qss())
        self.setGeometry(0, 0, 420, 440)
        self.center()
        self.Qui()

    def loadtheme(self, theme):
        ''' load theme widgets '''
        sshFile = ("core/%s.qss" % (theme))
        with open(sshFile, "r") as fh:
            self.setStyleSheet(fh.read())

    def get_theme_qss(self):
        ''' get theme selected path'''
        return self.Settings.get_setting('settings', 'themes')

    def center(self):
        ''' set center widgets '''
        frameGm = self.frameGeometry()
        centerPoint = QDesktopWidget().availableGeometry().center()
        frameGm.moveCenter(centerPoint)
        self.move(frameGm.topLeft())

    def save_settings(self):
        self.Settings.set_setting('settings', 'scapy_deauth',
                                  self.pageTab1.d_scapy.isChecked())
        self.Settings.set_setting('settings', 'mdk3_deauth',
                                  self.pageTab1.d_mdk.isChecked())
        self.Settings.set_setting('settings', 'scan_scapy',
                                  self.pageTab1.scan_scapy.isChecked())
        self.Settings.set_setting('settings', 'scan_airodump',
                                  self.pageTab1.scan_airodump.isChecked())
        self.Settings.set_setting('accesspoint', 'dhcpd_server',
                                  self.pageTab1.dhcpdserver.isChecked())
        self.Settings.set_setting('accesspoint', 'pydhcp_server',
                                  self.pageTab1.pydhcpserver.isChecked())
        self.Settings.set_setting('accesspoint', 'pydns_server',
                                  self.pageTab1.ch_pyDNS_server.isChecked())
        self.Settings.set_setting('accesspoint', 'dnsproxy_server',
                                  self.pageTab1.ch_DNSproxy_server.isChecked())
        if self.pageTab1.theme1.isChecked():
            self.Settings.set_setting('settings', 'themes',
                                      str(self.pageTab1.theme1.objectName()))
        elif self.pageTab1.theme2.isChecked():
            self.Settings.set_setting('settings', 'themes',
                                      str(self.pageTab1.theme2.objectName()))
        elif self.pageTab1.theme3.isChecked():
            self.Settings.set_setting('settings', 'themes',
                                      str(self.pageTab1.theme3.objectName()))
        if self.pageTab1.AP_0.isChecked():
            self.Settings.set_setting('accesspoint', 'hostapd_custom', False)
        elif self.pageTab1.AP_1.isChecked():
            self.Settings.set_setting('accesspoint', 'hostapd_custom', True)

        self.Settings.set_setting('settings', 'mdk3',
                                  str(self.txt_arguments.text()))
        self.Settings.set_setting('settings', 'scanner_rangeIP',
                                  str(self.txt_ranger.text()))
        self.Settings.set_setting('accesspoint', 'ssid',
                                  str(self.pageTab1.Apname.text()))
        self.Settings.set_setting('accesspoint', 'channel',
                                  str(self.pageTab1.channel.value()))
        self.Settings.set_setting('accesspoint', 'persistNetwokManager',
                                  self.pageTab1.network_manager.isChecked())
        self.Settings.set_setting(
            'accesspoint', 'checkConnectionWifi',
            self.pageTab1.checkConnectionWifi.isChecked())
        self.Settings.set_setting('accesspoint', 'check_support_ap_mode',
                                  self.check_interface_mode_AP.isChecked())
        self.Settings.set_setting('settings', 'redirect_port',
                                  str(self.redirectport.text()))
        if not path.isfile(self.pageTab1.edit_hostapd_path.text()):
            return QMessageBox.warning(self, 'Path Hostapd Error',
                                       'hostapd binary path is not found')
        self.Settings.set_setting('accesspoint', 'hostapd_path',
                                  self.pageTab1.edit_hostapd_path.text())
        with open(C.HOSTAPDCONF_PATH2, 'w') as apconf:
            apconf.write(self.ListHostapd.toPlainText())
        self.close()

    def listItemclicked(self, pos):
        ''' add,remove and edit rules iptables from WIFi-Pumpkin'''
        item = self.ListRules.selectedItems()
        self.listMenu = QMenu()
        menu = QMenu()
        additem = menu.addAction('Add')
        editem = menu.addAction('Edit')
        removeitem = menu.addAction('Remove ')
        clearitem = menu.addAction('clear')
        action = menu.exec_(self.ListRules.viewport().mapToGlobal(pos))
        if action == removeitem:
            if item != []:
                self.ListRules.takeItem(self.ListRules.currentRow())
        elif action == additem:
            text, resp = QInputDialog.getText(self, 'Add rules iptables',
                                              'Enter the rules iptables:')
            if resp:
                try:
                    itemsexits = []
                    for index in xrange(self.ListRules.count()):
                        itemsexits.append(
                            str(self.ListRules.item(index).text()))
                    for i in itemsexits:
                        if search(str(text), i):
                            return QMessageBox.information(
                                self, 'Rules exist',
                                'this rules already exist!')
                    item = QListWidgetItem()
                    item.setText(text)
                    item.setSizeHint(QSize(30, 30))
                    self.ListRules.addItem(item)
                except Exception as e:
                    return QMessageBox.information(self, 'error', str(e))
        elif action == editem:
            text, resp = QInputDialog.getText(
                self,
                'Add rules for iptables',
                'Enter the rules iptables:',
                text=self.ListRules.item(self.ListRules.currentRow()).text())
            if resp:
                try:
                    itemsexits = []
                    for index in xrange(self.ListRules.count()):
                        itemsexits.append(
                            str(self.ListRules.item(index).text()))
                    for i in itemsexits:
                        if search(str(text), i):
                            return QMessageBox.information(
                                self, 'Rules exist',
                                'this rules already exist!')
                    item = QListWidgetItem()
                    item.setText(text)
                    item.setSizeHint(QSize(30, 30))
                    self.ListRules.insertItem(self.ListRules.currentRow(),
                                              item)
                except Exception as e:
                    return QMessageBox.information(self, 'error', str(e))
        elif action == clearitem:
            self.ListRules.clear()

    def Qui(self):
        self.Main = QVBoxLayout()
        self.formGroupAd = QFormLayout()
        self.form = QFormLayout()
        self.tabcontrol = QTabWidget()

        # tabs
        self.tab1 = QWidget()
        self.tab2 = QWidget()
        self.tab3 = QWidget()
        self.tab4 = QWidget()

        self.page_1 = QVBoxLayout(self.tab1)
        self.page_2 = QFormLayout(self.tab2)
        self.page_3 = QFormLayout(self.tab3)
        self.page_4 = QFormLayout(self.tab4)

        self.tabcontrol.addTab(self.tab1, 'General')
        self.tabcontrol.addTab(self.tab2, 'Advanced')
        self.tabcontrol.addTab(self.tab3, 'Iptables')
        self.tabcontrol.addTab(self.tab4, 'Hostpad')

        self.pageTab1 = SettingsTabGeneral(self.Settings)
        self.page_1.addLayout(self.pageTab1)

        self.groupAdvanced = QGroupBox()
        self.groupAdvanced.setTitle('Advanced Settings:')
        self.groupAdvanced.setLayout(self.formGroupAd)

        self.btn_save = QPushButton('Save')
        self.btn_save.clicked.connect(self.save_settings)
        self.btn_save.setFixedWidth(80)
        self.btn_save.setIcon(QIcon('icons/Save.png'))

        #page Adavanced
        self.txt_ranger = QLineEdit(self)
        self.txt_arguments = QLineEdit(self)
        self.scan1 = QRadioButton('Ping Scan:: Very fast IP scan')
        self.scan2 = QRadioButton('Python-Nmap:: Get hostname from IP')
        self.redirectport = QLineEdit(self)
        self.check_interface_mode_AP = QCheckBox(
            'Check if interface supports AP/Mode')
        self.check_interface_mode_AP.setChecked(
            self.Settings.get_setting('accesspoint',
                                      'check_support_ap_mode',
                                      format=bool))
        self.check_interface_mode_AP.setToolTip(
            'if you disable this options in next time, the interface is not should '
            'checked if has support AP mode.')

        # page Iptables
        self.ListRules = QListWidget(self)
        self.ListRules.setFixedHeight(300)
        self.ListRules.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
        self.ListRules.setContextMenuPolicy(Qt.CustomContextMenu)
        self.ListRules.connect(self.ListRules,
                               SIGNAL('customContextMenuRequested(QPoint)'),
                               self.listItemclicked)
        for ech in self.Settings.get_all_childname('iptables'):
            item = QListWidgetItem()
            item.setText(
                str(self.Settings.get_setting('iptables', ech, format=str)))
            item.setSizeHint(QSize(30, 30))
            self.ListRules.addItem(item)

        # page hostpad
        self.ListHostapd = QTextEdit(self)
        self.ListHostapd.setFixedHeight(300)
        with open(C.HOSTAPDCONF_PATH2, 'r') as apconf:
            self.ListHostapd.setText(apconf.read())

        # grup page 2
        self.gruButtonPag2 = QButtonGroup()
        self.gruButtonPag2.addButton(self.scan1)
        self.gruButtonPag2.addButton(self.scan2)

        self.txt_ranger.setText(
            self.Settings.get_setting('settings', 'scanner_rangeIP'))
        self.txt_arguments.setText(
            self.Settings.get_setting('settings', 'mdk3'))
        self.scan2.setEnabled(False)
        self.scan1.setChecked(True)
        #settings tab Advanced
        self.redirectport.setText(
            self.Settings.get_setting('settings', 'redirect_port'))

        #add tab Advanced
        self.formGroupAd.addRow(QLabel('Thread Scan IP-Address:'))
        self.formGroupAd.addRow(self.scan1)
        self.formGroupAd.addRow(self.scan2)
        self.formGroupAd.addRow(self.check_interface_mode_AP)
        self.formGroupAd.addRow('Port sslstrip:', self.redirectport)
        self.formGroupAd.addRow(QLabel('mdk3 Args:'), self.txt_arguments)
        self.formGroupAd.addRow(QLabel('Range Scanner:'), self.txt_ranger)
        self.page_2.addRow(self.groupAdvanced)

        #add tab iptables
        self.page_3.addWidget(QLabel('Iptables:'))
        self.page_3.addRow(self.ListRules)

        #add tab hostpad
        self.page_4.addWidget(QLabel('settings hostapd:'))
        self.page_4.addRow(self.ListHostapd)

        self.form.addRow(self.tabcontrol)
        self.form.addRow(self.btn_save)
        self.Main.addLayout(self.form)
        self.setLayout(self.Main)
コード例 #9
0
ファイル: settings.py プロジェクト: P0cL4bs/WiFi-Pumpkin
class frm_Settings(QDialog):
    def __init__(self, parent = None):
        super(frm_Settings, self).__init__(parent)
        self.setWindowTitle('settings WiFi-Pompkin')
        self.Settings = SettingsINI('core/config/app/config.ini')
        self.bdfproxyConf  = SettingsINI(self.Settings.get_setting('plugins','bdfproxy_config'))
        self.loadtheme(self.XmlThemeSelected())
        self.setGeometry(0, 0, 420, 440)
        self.center()
        self.Qui()

    def loadtheme(self,theme):
        ''' load theme widgets '''
        sshFile=("core/%s.qss"%(theme))
        with open(sshFile,"r") as fh:
            self.setStyleSheet(fh.read())

    def XmlThemeSelected(self):
        ''' get theme selected path'''
        return self.Settings.get_setting('settings','themes')

    def center(self):
        ''' set center widgets '''
        frameGm = self.frameGeometry()
        centerPoint = QDesktopWidget().availableGeometry().center()
        frameGm.moveCenter(centerPoint)
        self.move(frameGm.topLeft())

    def save_settings(self):
        self.Settings.set_setting('settings','scapy_deauth',self.pageTab1.d_scapy.isChecked())
        self.Settings.set_setting('settings','mdk3_deauth',self.pageTab1.d_mdk.isChecked())
        self.Settings.set_setting('settings','scan_scapy',self.pageTab1.scan_scapy.isChecked())
        self.Settings.set_setting('settings','scan_airodump',self.pageTab1.scan_airodump.isChecked())
        self.Settings.set_setting('accesspoint','dhcpd_server',self.pageTab1.dhcpdserver.isChecked())
        self.Settings.set_setting('accesspoint','pydhcp_server',self.pageTab1.pydhcpserver.isChecked())
        if self.pageTab1.theme1.isChecked():
            self.Settings.set_setting('settings','themes',str(self.pageTab1.theme1.objectName()))
        elif self.pageTab1.theme2.isChecked():
            self.Settings.set_setting('settings','themes',str(self.pageTab1.theme2.objectName()))
        elif self.pageTab1.theme3.isChecked():
            self.Settings.set_setting('settings','themes',str(self.pageTab1.theme3.objectName()))
        if self.pageTab1.AP_0.isChecked():
            self.Settings.set_setting('accesspoint','hostapd_custom',False)
        elif self.pageTab1.AP_1.isChecked():
            self.Settings.set_setting('accesspoint','hostapd_custom',True)

        self.Settings.set_setting('settings','mdk3',str(self.txt_arguments.text()))
        self.Settings.set_setting('settings','scanner_rangeIP',str(self.txt_ranger.text()))
        self.Settings.set_setting('accesspoint','ssid', str(self.pageTab1.Apname.text()))
        self.Settings.set_setting('accesspoint','channel', str(self.pageTab1.channel.value()))
        self.Settings.set_setting('accesspoint','persistNetwokManager',self.pageTab1.network_manager.isChecked())
        self.Settings.set_setting('accesspoint','check_support_ap_mode',self.check_interface_mode_AP.isChecked())
        self.Settings.set_setting('settings','redirect_port', str(self.redirectport.text()))
        if not path.isfile(self.pageTab1.edit_hostapd_path.text()):
            return QMessageBox.warning(self,'Path Hostapd Error','hostapd binary path is not found')
        self.Settings.set_setting('accesspoint','hostapd_path',self.pageTab1.edit_hostapd_path.text())
        with open('core/config/hostapd/hostapd+.conf','w') as apconf:
            apconf.write(self.ListHostapd.toPlainText())
        self.close()


    def listItemclicked(self,pos):
        ''' add,remove and edit rules iptables from WIFi-Pumpkin'''
        item = self.ListRules.selectedItems()
        self.listMenu= QMenu()
        menu = QMenu()
        additem = menu.addAction('Add')
        editem = menu.addAction('Edit')
        removeitem = menu.addAction('Remove ')
        clearitem = menu.addAction('clear')
        action = menu.exec_(self.ListRules.viewport().mapToGlobal(pos))
        if action == removeitem:
            if item != []:
                self.ListRules.takeItem(self.ListRules.currentRow())
        elif action == additem:
            text, resp = QInputDialog.getText(self, 'Add rules iptables',
            'Enter the rules iptables:')
            if resp:
                try:
                    itemsexits = []
                    for index in xrange(self.ListRules.count()):
                        itemsexits.append(str(self.ListRules.item(index).text()))
                    for i in itemsexits:
                        if search(str(text),i):
                            return QMessageBox.information(self,'Rules exist','this rules already exist!')
                    item = QListWidgetItem()
                    item.setText(text)
                    item.setSizeHint(QSize(30,30))
                    self.ListRules.addItem(item)
                except Exception as e:
                    return QMessageBox.information(self,'error',str(e))
        elif action == editem:
            text, resp = QInputDialog.getText(self, 'Add rules iptables',
            'Enter the rules iptables:',text=self.ListRules.item(self.ListRules.currentRow()).text())
            if resp:
                try:
                    itemsexits = []
                    for index in xrange(self.ListRules.count()):
                        itemsexits.append(str(self.ListRules.item(index).text()))
                    for i in itemsexits:
                        if search(str(text),i):
                            return QMessageBox.information(self,'Rules exist','this rules already exist!')
                    item = QListWidgetItem()
                    item.setText(text)
                    item.setSizeHint(QSize(30,30))
                    self.ListRules.insertItem(self.ListRules.currentRow(),item)
                except Exception as e:
                    return QMessageBox.information(self,'error',str(e))
        elif action == clearitem:
            self.ListRules.clear()

    def Qui(self):
        self.Main = QVBoxLayout()
        self.formGroupAd  = QFormLayout()
        self.form = QFormLayout()
        self.tabcontrol = QTabWidget()

        # tabs
        self.tab1 = QWidget()
        self.tab2 = QWidget()
        self.tab3 = QWidget()
        self.tab4 = QWidget()

        self.page_1 = QVBoxLayout(self.tab1)
        self.page_2 = QFormLayout(self.tab2)
        self.page_3 = QFormLayout(self.tab3)
        self.page_4 = QFormLayout(self.tab4)

        self.tabcontrol.addTab(self.tab1, 'General')
        self.tabcontrol.addTab(self.tab2, 'Advanced')
        self.tabcontrol.addTab(self.tab3,'Iptables')
        self.tabcontrol.addTab(self.tab4,'hostpad')

        self.pageTab1 = SettingsTabGeneral(self.Settings)
        self.page_1.addLayout(self.pageTab1)

        self.groupAdvanced = QGroupBox()
        self.groupAdvanced.setTitle('Advanced settings:')
        self.groupAdvanced.setLayout(self.formGroupAd)

        self.btn_save = QPushButton('Save')
        self.btn_save.clicked.connect(self.save_settings)
        self.btn_save.setFixedWidth(80)
        self.btn_save.setIcon(QIcon('icons/Save.png'))


        #page Adavanced
        self.bdfProxy_port = QSpinBox()
        self.bdfProxy_port.setMaximum(10000)
        self.txt_ranger = QLineEdit(self)
        self.txt_arguments = QLineEdit(self)
        self.scan1 = QRadioButton('Ping Scan:: Very fast scan IP')
        self.scan2 = QRadioButton('Python-Nmap:: Get hostname from IP')
        self.redirectport = QLineEdit(self)
        self.check_interface_mode_AP = QCheckBox('Check if interface has been support AP/Mode')
        self.check_interface_mode_AP.setChecked(self.Settings.get_setting('accesspoint','check_support_ap_mode',format=bool))
        self.check_interface_mode_AP.setToolTip('if you disable this options in next time, the interface is not should '
        'checked if has support AP mode.')

        # page Iptables
        self.ListRules = QListWidget(self)
        self.ListRules.setFixedHeight(300)
        self.ListRules.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
        self.ListRules.setContextMenuPolicy(Qt.CustomContextMenu)
        self.ListRules.connect(self.ListRules,
        SIGNAL('customContextMenuRequested(QPoint)'),
        self.listItemclicked)
        for ech in self.Settings.get_all_childname('iptables'):
            item = QListWidgetItem()
            item.setText(str(self.Settings.get_setting('iptables',ech,format=str)))
            item.setSizeHint(QSize(30,30))
            self.ListRules.addItem(item)

        # page hostpad
        self.ListHostapd = QTextEdit(self)
        self.ListHostapd.setFixedHeight(300)
        with open('core/config/hostapd/hostapd+.conf','r') as apconf:
            self.ListHostapd.setText(apconf.read())

        # grup page 2
        self.gruButtonPag2 = QButtonGroup()
        self.gruButtonPag2.addButton(self.scan1)
        self.gruButtonPag2.addButton(self.scan2)

        self.txt_ranger.setText(self.Settings.get_setting('settings','scanner_rangeIP'))
        self.txt_arguments.setText(self.Settings.get_setting('settings','mdk3'))
        self.bdfProxy_port.setValue(int(self.bdfproxyConf.get_setting('Overall','proxyPort')))
        self.bdfProxy_port.setEnabled(False)
        self.scan2.setEnabled(False)
        self.scan1.setChecked(True)
        #settings tab Advanced
        self.redirectport.setText(self.Settings.get_setting('settings','redirect_port'))

        #add tab Advanced
        self.formGroupAd.addRow(QLabel('Thread Scan IP-Address:'))
        self.formGroupAd.addRow(self.scan1)
        self.formGroupAd.addRow(self.scan2)
        self.formGroupAd.addRow(self.check_interface_mode_AP)
        self.formGroupAd.addRow('Port BDFProxy-ng',self.bdfProxy_port)
        self.formGroupAd.addRow('Port sslstrip:',self.redirectport)
        self.formGroupAd.addRow(QLabel('mdk3 Args:'),self.txt_arguments)
        self.formGroupAd.addRow(QLabel('Range Scanner:'),self.txt_ranger)
        self.page_2.addRow(self.groupAdvanced)

        #add tab iptables
        self.page_3.addWidget(QLabel('Iptables:'))
        self.page_3.addRow(self.ListRules)

        #add tab hostpad
        self.page_4.addWidget(QLabel('settings hostapd:'))
        self.page_4.addRow(self.ListHostapd)

        self.form.addRow(self.tabcontrol)
        self.form.addRow(self.btn_save)
        self.Main.addLayout(self.form)
        self.setLayout(self.Main)
コード例 #10
0
ファイル: wifi-pumpkin.py プロジェクト: mh4x0f/WiFi-Pumpkin
        exit('[{}!{}] WiFi-Pumpkin must be run as root.'.format(C.RED, C.ENDC))

    app = ApplicationLoop(argv)
    if app.isRunning():
        QtGui.QMessageBox.warning(None, 'Already Running',
                                  'the wifi-pumpkin is already running')
        exit('WiFi-Pumpkin Already Running.')

    print('Loading GUI...')
    main = Initialize()
    main.passSettings()
    main.setWindowIcon(QtGui.QIcon('icons/icon.png'))
    main.center()
    # check if Wireless connection
    conf = SettingsINI(C.CONFIG_INI)
    if conf.get_setting('accesspoint', 'checkConnectionWifi', format=bool):
        networkcontrol = CLI_NetworkManager(
        )  # add all interface avaliable for exclude
        main.networkcontrol = networkcontrol
        if networkcontrol.run():
            if networkcontrol.isWiFiConnected() and len(
                    networkcontrol.ifaceAvaliable) > 0:
                settings = UI_NetworkManager(main)
                settings.setWindowIcon(QtGui.QIcon('icons/icon.png'))
                settings.show()
                exit(app.exec_())
    main.show()

    print('WiFi-Pumpkin Running!')
    exit(app.exec_())
コード例 #11
0
class CaptivePortal(ProxyMode):
    ''' settings  Captive Portal Proxy '''
    Name = "Captive Portal"
    Author = "Pumpkin-Dev"
    Description = "Captive-Portal allow the Attacker block Internet access for users until they open the page login page where a password is required before being allowed to browse the web."
    Icon = "icons/captive_portal.png"
    ModSettings = True
    Hidden = False
    ModType = "proxy"  # proxy or server
    _cmd_array = []
    sendError = QtCore.pyqtSignal(str)

    def __init__(self, parent, **kwargs):
        super(CaptivePortal, self).__init__(parent)
        self.mainLayout = QtGui.QVBoxLayout()
        self.config = SettingsINI(C.CAPTIVEPORTAL_INI)
        self.plugins = []
        self.plugin_activated = None
        self.main_method = parent
        self.bt_SettingsDict = {}
        self.check_PluginDict = {}
        self.ClientsLogged = {}
        self.btn_previewSettings = {}
        self.search_all_ProxyPlugins()
        #scroll area
        self.scrollwidget = QtGui.QWidget()
        self.scrollwidget.setLayout(self.mainLayout)
        self.scroll = QtGui.QScrollArea()
        self.scroll.setWidgetResizable(True)
        self.scroll.setWidget(self.scrollwidget)
        self.dockwidget = CaptivePortalDock(None, title=self.Name)

        # create for add dock logging
        self.tabcontrol = QtGui.QTabWidget()
        self.tab1 = QtGui.QWidget()
        self.tab2 = QtGui.QWidget()
        self.page_1 = QtGui.QVBoxLayout(self.tab1)
        self.page_2 = QtGui.QVBoxLayout(self.tab2)

        self.tabcontrol.addTab(self.tab1, 'Plugins')
        self.tabcontrol.addTab(self.tab2, 'Manager')
        self.TabCtrlClients = QtGui.QTableWidget()
        self.TabCtrlClients.setColumnCount(3)
        #self.TabCtrlClients.setRowCount(len(self.plugins))
        self.TabCtrlClients.resizeRowsToContents()
        self.TabCtrlClients.setSizePolicy(QtGui.QSizePolicy.Preferred,
                                          QtGui.QSizePolicy.Preferred)
        self.TabCtrlClients.horizontalHeader().setStretchLastSection(True)
        self.TabCtrlClients.setSelectionBehavior(
            QtGui.QAbstractItemView.SelectRows)
        self.TabCtrlClients.setEditTriggers(
            QtGui.QAbstractItemView.NoEditTriggers)
        self.TabCtrlClients.verticalHeader().setVisible(False)
        self.TabCtrlClients.verticalHeader().setDefaultSectionSize(27)
        self.TabCtrlClients.setSortingEnabled(True)
        self.THeadersCtrlClients = OrderedDict([('IpAddress', []),
                                                ('MacAddress', []),
                                                ('Status Internet', [])])
        self.TabCtrlClients.setHorizontalHeaderLabels(
            self.THeadersCtrlClients.keys())

        self.mainLayout_settings = QtGui.QVBoxLayout()
        #scroll area
        self.scrollwidget_settings = QtGui.QWidget()
        self.scrollwidget_settings.setLayout(self.mainLayout_settings)
        self.scroll_settings = QtGui.QScrollArea()
        self.scroll_settings.setWidgetResizable(True)
        self.scroll_settings.setWidget(self.scrollwidget_settings)

        # create widgets
        self.argsLabel = QtGui.QLabel('')
        self.hBox = QtGui.QHBoxLayout()
        self.btnEnable = QtGui.QPushButton('Allow')
        self.btncancel = QtGui.QPushButton('Deny')

        # size buttons
        self.btnEnable.setFixedWidth(100)
        self.btncancel.setFixedWidth(100)

        self.comboxBoxIPAddress = QtGui.QComboBox()
        self.btncancel.setIcon(QtGui.QIcon('icons/cancel.png'))
        self.btnEnable.setIcon(QtGui.QIcon('icons/accept.png'))

        # group settings
        self.GroupSettings = QtGui.QGroupBox()
        self.GroupSettings.setTitle('Manage clients access:')
        self.SettingsLayout = QtGui.QFormLayout()
        self.hBox.addWidget(self.comboxBoxIPAddress)
        self.hBox.addWidget(self.btnEnable)
        self.hBox.addWidget(self.btncancel)
        self.SettingsLayout.addRow(self.hBox)
        self.GroupSettings.setLayout(self.SettingsLayout)
        #self.GroupSettings.setFixedWidth(450)

        #group logger
        self.GroupLogger = QtGui.QGroupBox()
        self.logger_portal = QtGui.QListWidget()
        self.GroupLogger.setTitle('Logger events:')
        self.LoggerLayout = QtGui.QVBoxLayout()
        self.LoggerLayout.addWidget(self.logger_portal)
        self.GroupLogger.setLayout(self.LoggerLayout)
        #self.GroupLogger.setFixedWidth(450)

        #connections
        # self.btnLoader.clicked.connect(self.SearchProxyPlugins)
        self.connect(self.comboxBoxIPAddress,
                     QtCore.SIGNAL('currentIndexChanged(QString)'),
                     self.checkStatusClient)
        self.btnEnable.clicked.connect(self.enableInternetConnection)
        self.btncancel.clicked.connect(self.disableInternetConnection)
        # self.btnbrownser.clicked.connect(self.get_filenameToInjection)
        # add widgets
        self.mainLayout_settings.addWidget(self.GroupSettings)
        self.mainLayout_settings.addWidget(self.GroupLogger)

        self.TabPlugins = QtGui.QTableWidget()
        self.TabPlugins.setColumnCount(5)
        self.TabPlugins.setRowCount(len(self.plugins))
        self.TabPlugins.resizeRowsToContents()
        self.TabPlugins.setSizePolicy(QtGui.QSizePolicy.Preferred,
                                      QtGui.QSizePolicy.Preferred)
        self.TabPlugins.horizontalHeader().setStretchLastSection(True)
        self.TabPlugins.setSelectionBehavior(
            QtGui.QAbstractItemView.SelectRows)
        self.TabPlugins.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers)
        self.TabPlugins.verticalHeader().setVisible(False)
        self.TabPlugins.verticalHeader().setDefaultSectionSize(27)
        self.TabPlugins.setSortingEnabled(True)
        self.THeaders = OrderedDict([('Captive Name', []), ('Preview', []),
                                     ('Author', []), ('Settings', []),
                                     ('Description', [])])
        self.TabPlugins.setHorizontalHeaderLabels(self.THeaders.keys())
        self.TabPlugins.horizontalHeader().resizeSection(0, 158)
        self.TabPlugins.horizontalHeader().resizeSection(1, 80)

        # add on tab
        self.page_1.addWidget(self.TabPlugins)
        self.page_2.addWidget(self.scroll_settings)

        # get all plugins and add into TabWidget
        Headers = []
        for plugin in self.plugins:
            if plugin.ConfigParser:
                self.bt_SettingsDict[plugin.Name] = QtGui.QPushButton(
                    'Settings')
                self.bt_SettingsDict[plugin.Name].clicked.connect(
                    partial(self.setSettingsPlgins, plugin.Name))
            else:
                self.bt_SettingsDict[plugin.Name] = QtGui.QPushButton('None')

            if (path.isfile(plugin.Preview)):
                self.btn_previewSettings[plugin.Name] = QtGui.QPushButton(
                    'Preview')
                self.btn_previewSettings[plugin.Name].setObjectName(
                    plugin.Preview)
                self.btn_previewSettings[plugin.Name].clicked.connect(
                    partial(self.showPreviewCaptivePortal, plugin.Name))
            else:
                self.btn_previewSettings[plugin.Name] = QtGui.QPushButton(
                    'Not found')

            self.check_PluginDict[plugin.Name] = QtGui.QRadioButton(
                plugin.Name)
            self.check_PluginDict[plugin.Name].setObjectName(plugin.Name)
            self.check_PluginDict[plugin.Name].clicked.connect(
                partial(self.setPluginOption, plugin.Name))
            self.THeaders['Captive Name'].append(
                self.check_PluginDict[plugin.Name])
            self.THeaders['Preview'].append(
                self.btn_previewSettings[plugin.Name])
            self.THeaders['Author'].append(plugin.Author)
            self.THeaders['Settings'].append({'name': plugin.Name})
            self.THeaders['Description'].append(plugin.Description)
        for n, key in enumerate(self.THeaders.keys()):
            Headers.append(key)
            for m, item in enumerate(self.THeaders[key]):
                if type(item) == type(QtGui.QRadioButton()):
                    self.TabPlugins.setCellWidget(m, n, item)
                elif type(item) == type(dict()):
                    self.TabPlugins.setCellWidget(
                        m, n, self.bt_SettingsDict[item['name']])
                elif type(item) == type(QtGui.QPushButton()):
                    self.TabPlugins.setCellWidget(m, n, item)
                else:
                    item = QtGui.QTableWidgetItem(item)
                    self.TabPlugins.setItem(m, n, item)
        self.TabPlugins.setHorizontalHeaderLabels(self.THeaders.keys())

        # check status all checkbox plugins
        for box in self.check_PluginDict.keys():
            self.check_PluginDict[box].setChecked(
                self.config.get_setting('plugins', box, format=bool))

        self.btn_updateCaptive = QtGui.QPushButton("Update")
        self.btn_updateCaptive.setIcon(QtGui.QIcon('icons/updates_.png'))
        self.btn_updateCaptive.setFixedWidth(130)
        self.btn_updateCaptive.clicked.connect(self.disableBtnForUpdates)

        self.mainLayout.addWidget(self.tabcontrol)
        self.mainLayout.addWidget(self.btn_updateCaptive)
        self.layout = QtGui.QHBoxLayout()
        self.layout.addWidget(self.scroll)
        self.setLayout(self.layout)

    def disableBtnForUpdates(self):
        ''' update captive portals from github '''
        self.btn_updateCaptive.setEnabled(False)
        self.btn_updateCaptive.setText('Downloading...')
        QtCore.QTimer.singleShot(3000, lambda: self.downloadCaptiveportals())

    def downloadCaptiveportals(self):
        ''' check interfaces on background '''
        try:
            data_file = urlopen(C.EXTRACAPTIVETHEMES)
            with open(C.CAPTIVETHEMESZIP, 'wb') as output:
                output.write(data_file.read())
        except Exception as e:
            self.btn_updateCaptive.setEnabled(True)
            self.btn_updateCaptive.setText('Update')
            return QtGui.QMessageBox.information(self, 'Error: Download data ',
                                                 str(e))

        zip_ref = ZipFile(C.CAPTIVETHEMESZIP, 'r')
        zip_ref.extractall(C.TEMPPATH)
        zip_ref.close()

        source_path_templates = C.CAPTIVEPATH_TMP_TEMPLATES
        source_path_plugins = C.CAPTIVEPATH_TMP_PLUGINS
        config_captive = SettingsINI(C.PATHCAPTIVEFINI)

        for plugin in config_captive.get_all_childname('plugins'):
            if (not plugin in self.config.get_all_childname('plugins')):

                system('cp -r {src} {dst}'.format(
                    src=source_path_templates + plugin,
                    dst=C.CAPTIVE_PATH_TEMPLATES))
                self.config.set_setting('plugins', plugin, False)

                for subplugin in config_captive.get_all_childname(
                        'set_{}'.format(plugin)):
                    if subplugin != 'Default':
                        self.config.set_setting('set_{}'.format(plugin),
                                                subplugin, False)
                    else:
                        self.config.set_setting('set_{}'.format(plugin),
                                                subplugin, True)

                system('cp {src} {dst}'.format(src='{}{}.py'.format(
                    source_path_plugins, plugin),
                                               dst=C.CAPTIVE_PATH_PLUGINS))

        self.btn_updateCaptive.setEnabled(True)
        self.btn_updateCaptive.setText('Update')
        QtGui.QMessageBox.information(
            self, 'Update Captive-Portals',
            "Already up-to-date. Please restart WiFi-Pumpkin to apply this update."
        )

    def enableInternetConnection(self):
        ipaddress = str(self.comboxBoxIPAddress.currentText())
        exec_bash('iptables -D FORWARD -s {ip} -j REJECT'.format(ip=ipaddress))
        exec_bash('iptables -I FORWARD -s {ip} -j ACCEPT'.format(ip=ipaddress))
        self.btnEnable.setEnabled(False)
        self.btncancel.setEnabled(True)
        self.ClientsLogged[ipaddress]['Status'] = True
        self.logger_portal.addItem(
            'Allow access the internet to {}'.format(ipaddress))

    def disableInternetConnection(self):
        ipaddress = str(self.comboxBoxIPAddress.currentText())
        exec_bash('iptables -D FORWARD -s {ip} -j ACCEPT'.format(ip=ipaddress))
        exec_bash('iptables -I FORWARD -s {ip} -j REJECT'.format(ip=ipaddress))
        self.btnEnable.setEnabled(True)
        self.btncancel.setEnabled(False)
        self.ClientsLogged[ipaddress]['Status'] = False
        self.logger_portal.addItem(
            'Deny access the internet to {}'.format(ipaddress))

    def checkStatusClient(self):
        if (str(self.comboxBoxIPAddress.currentText()) != ''):
            if (self.ClientsLogged[str(
                    self.comboxBoxIPAddress.currentText())]['Status']):
                self.btnEnable.setEnabled(False)
                self.btncancel.setEnabled(True)
                return None
            self.btnEnable.setEnabled(True)
            self.btncancel.setEnabled(False)

    def showPreviewCaptivePortal(self, plugin, status):
        self.preview_form = CaptivePortalPreviewImage(
            plugin, self.btn_previewSettings[plugin].objectName())
        self.preview_form.show()

    def search_all_ProxyPlugins(self):
        ''' load all plugins function '''
        plugin_classes = plugin.CaptiveTemplatePlugin.__subclasses__()
        for p in plugin_classes:
            self.plugins.append(p())

    def setSettingsPlgins(self, plugin):
        ''' open settings options for each plugins'''
        key = 'set_{}'.format(plugin)
        self.widget = CaptivePortalSettings(key,
                                            self.config.get_all_childname(key))
        self.widget.show()

    def getPluginActivated(self):
        for plugin in self.plugins:
            if (self.config.get_setting('plugins', plugin.Name, format=bool)):
                self.plugin_activated = plugin
        self.plugin_activated.initialize()  # change language if exist
        return self.plugin_activated

    def shutdown(self):
        self.logger_portal.clear()
        self.comboxBoxIPAddress.clear()
        self.ClearRules()
        self.ClientsLogged = {}

    def boot(self):

        # self.reactor = ThreadCaptivePortalHTTPServer('0.0.0.0',80,plugin_activated,self.parent.currentSessionID)
        # self.reactor.requestCredentails.connect(self.LogOutput)
        # self.reactor.requestLogin.connect(self.allowAccessLogin)
        # self.reactor.setObjectName(self.Name)

        self.reactor = ProcessThread(
            {
                'python': [
                    "server.py", '-t',
                    self.getPluginActivated().TemplatePath, '-r',
                    self.parent.SessionConfig.DHCP.conf['router'], '-s',
                    self.getPluginActivated().StaticPath
                ]
            }, "plugins/captivePortal/")
        self.reactor._ProcssOutput.connect(self.LogOutput)
        self.reactor.setObjectName(self.Name)

        # settings iptables for add support captive portal
        IFACE = self.parent.SessionConfig.Wireless.WLANCard.currentText()
        IP_ADDRESS = self.parent.SessionConfig.DHCP.conf['router']
        PORT = 80

        print('[*] Settings for captive portal:')
        print(" -> Allow FORWARD UDP DNS")
        self.search[self.Name + "_forward"] = str(
            'iptables -A FORWARD -i {iface} -p tcp --dport 53 -j ACCEPT'.
            format(iface=IFACE))
        print(" -> Allow traffic to captive portal")
        self.search[self.Name + "_allow"] = str(
            'iptables -A FORWARD -i {iface} -p tcp --dport {port} -d {ip} -j ACCEPT'
            .format(iface=IFACE, port=PORT, ip=IP_ADDRESS))
        print(" -> Block all other traffic in access point")
        self.search[self.Name + "_block"] = str(
            'iptables -A FORWARD -i {iface} -j DROP '.format(iface=IFACE))
        print(" -> Redirecting HTTP traffic to captive portal")
        self.search[self.Name + "redirect"] = str(
            'iptables -t nat -A PREROUTING -i {iface} -p tcp --dport 80 -j DNAT --to-destination {ip}:{port}'
            .format(iface=IFACE, ip=IP_ADDRESS, port=PORT))

        self.SetRules(self.Name + "_forward")
        self.SetRules(self.Name + "_allow")
        self.SetRules(self.Name + "_block")
        self.SetRules(self.Name + "redirect")

        # print('[*] Settings for captive portal:')
        # print(" -> Allow FORWARD UDP DNS")
        # call(["iptables", "-A", "FORWARD", "-i", IFACE, "-p", "udp", "--dport", "53", "-j" ,"ACCEPT"])
        # print(" -> Allow traffic to captive portal")
        # call(["iptables", "-A", "FORWARD", "-i", IFACE, "-p", "tcp", "--dport", str(PORT),"-d", IP_ADDRESS, "-j" ,"ACCEPT"])
        # print(" -> Block all other traffic in access point")
        # call(["iptables", "-A", "FORWARD", "-i", IFACE, "-j" ,"DROP"])
        # print(" -> Redirecting HTTP traffic to captive portal")
        # call(["iptables", "-t", "nat", "-A", "PREROUTING", "-i", IFACE, "-p", "tcp", "--dport", "80", "-j" ,"DNAT", "--to-destination", "{}:{}".format(IP_ADDRESS, PORT)])

    def addClientCtrlManager(self, IPADDRESS):
        ''' get data output and add on QtableWidgets'''
        #for name in self.pluginsName:
        clientsTabHome = self.parent.Home.DHCP.ClientTable.APclients
        self.ClientsLogged[IPADDRESS] = {'MAC': 'unknow', 'Status': True}
        for mac_address in clientsTabHome.keys():
            if (clientsTabHome[mac_address]['IP'] == IPADDRESS):
                self.ClientsLogged[IPADDRESS]['MAC'] = clientsTabHome[
                    mac_address]['MAC']

        self.comboxBoxIPAddress.addItems([IPADDRESS])
        self.logger_portal.addItem(
            'Authorized user: [ IP: {} MAC: {} ]'.format(
                IPADDRESS, self.ClientsLogged[IPADDRESS]['MAC']))

    def LogOutput(self, data):
        if self.FSettings.Settings.get_setting('accesspoint',
                                               'statusAP',
                                               format=bool):
            self.dockwidget.writeModeData(data, self.plugin_activated.Name)
            self.logger.info(data)

            try:
                dict_data = literal_eval(data)
                self.addClientCtrlManager(dict_data.keys()[0])
            except Exception:
                pass

    def setPluginOption(self, name, status):
        ''' get each plugins status'''
        self.config.set_setting('plugins', name, status)
        for plugin in self.plugins:
            if (plugin.Name != name):
                self.config.set_setting('plugins', plugin.Name, False)

    def Serve(self, on=True):
        pass

    def onProxyEnabled(self):
        self.SetRules(self.Name)
コード例 #12
0
class frm_Settings(QDialog):
    def __init__(self, parent = None):
        super(frm_Settings, self).__init__(parent)
        self.setWindowTitle('settings WiFi-Pompkin')
        self.Settings = SettingsINI('core/config/app/config.ini')
        self.bdfproxyConf  = SettingsINI(self.Settings.get_setting('plugins','bdfproxy_patch_config'))
        self.loadtheme(self.XmlThemeSelected())
        self.setGeometry(0, 0, 420, 440)
        self.center()
        self.Qui()

    def loadtheme(self,theme):
        sshFile=("core/%s.qss"%(theme))
        with open(sshFile,"r") as fh:
            self.setStyleSheet(fh.read())

    def XmlThemeSelected(self):
        return self.Settings.get_setting('settings','themes')

    def center(self):
        frameGm = self.frameGeometry()
        centerPoint = QDesktopWidget().availableGeometry().center()
        frameGm.moveCenter(centerPoint)
        self.move(frameGm.topLeft())

    def save_settings(self):
        if self.pageTab1.d_scapy.isChecked():
            self.Settings.set_setting('settings','deauth','packets_scapy')
        elif self.pageTab1.d_mdk.isChecked():
            self.Settings.set_setting('settings','deauth','packets_mdk3')
        if self.pageTab1.scan_scapy.isChecked():
            self.Settings.set_setting('settings','scanner_AP','scan_scapy')
        elif self.pageTab1.scan_airodump.isChecked():
            self.Settings.set_setting('settings','scanner_AP','scan_airodump')
        if self.pageTab1.dhcp1.isChecked():
            self.Settings.set_setting('accesspoint','dhcp_server','iscdhcpserver')
        if self.pageTab1.theme1.isChecked():
            self.Settings.set_setting('settings','themes',str(self.pageTab1.theme1.objectName()))
        elif self.pageTab1.theme2.isChecked():
            self.Settings.set_setting('settings','themes',str(self.pageTab1.theme2.objectName()))
        elif self.pageTab1.theme3.isChecked():
            self.Settings.set_setting('settings','themes',str(self.pageTab1.theme3.objectName()))
        if self.scan1.isChecked():
            self.Settings.set_setting('settings','Function_scan','Ping')
        elif self.scan2.isChecked():
            self.Settings.set_setting('settings','Function_scan','Nmap')

        self.Settings.set_setting('settings','mdk3',str(self.txt_arguments.text()))
        self.Settings.set_setting('settings','scanner_rangeIP',str(self.txt_ranger.text()))
        self.Settings.set_setting('accesspoint','APname', str(self.pageTab1.Apname.text()))
        self.Settings.set_setting('accesspoint','channel', str(self.pageTab1.channel.value()))
        self.Settings.set_setting('accesspoint','persistNetwokManager',self.pageTab1.network_manager.isChecked())
        self.Settings.set_setting('settings','redirect_port', str(self.redirectport.text()))
        with open('core/config/hostapd/hostapd+.conf','w') as apconf:
            apconf.write(self.ListHostapd.toPlainText())
        self.close()


    def listItemclicked(self,pos):
        item = self.ListRules.selectedItems()
        self.listMenu= QMenu()
        menu = QMenu()
        additem = menu.addAction('Add')
        editem = menu.addAction('Edit')
        removeitem = menu.addAction('Remove ')
        clearitem = menu.addAction('clear')
        action = menu.exec_(self.ListRules.viewport().mapToGlobal(pos))
        if action == removeitem:
            if item != []:
                self.ListRules.takeItem(self.ListRules.currentRow())
        elif action == additem:
            text, resp = QInputDialog.getText(self, 'Add rules iptables',
            'Enter the rules iptables:')
            if resp:
                try:
                    itemsexits = []
                    for index in xrange(self.ListRules.count()):
                        itemsexits.append(str(self.ListRules.item(index).text()))
                    for i in itemsexits:
                        if search(str(text),i):
                            QMessageBox.information(self,'Rules exist','this rules already exist!')
                            return
                    item = QListWidgetItem()
                    item.setText(text)
                    item.setSizeHint(QSize(30,30))
                    self.ListRules.addItem(item)
                except Exception as e:
                    QMessageBox.information(self,'error',str(e))
                    return
        elif action == editem:
            text, resp = QInputDialog.getText(self, 'Add rules iptables',
            'Enter the rules iptables:',text=self.ListRules.item(self.ListRules.currentRow()).text())
            if resp:
                try:
                    itemsexits = []
                    for index in xrange(self.ListRules.count()):
                        itemsexits.append(str(self.ListRules.item(index).text()))
                    for i in itemsexits:
                        if search(str(text),i):
                            QMessageBox.information(self,'Rules exist','this rules already exist!')
                            return
                    item = QListWidgetItem()
                    item.setText(text)
                    item.setSizeHint(QSize(30,30))
                    self.ListRules.insertItem(self.ListRules.currentRow(),item)
                except Exception as e:
                    QMessageBox.information(self,'error',str(e))
                    return
        elif action == clearitem:
            self.ListRules.clear()

    def redirectAP(self):
        item = QListWidgetItem()
        if self.check_redirect.isChecked():
            item.setText('iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 10.0.0.1:80')
            item.setSizeHint(QSize(30,30))
            self.ListRules.addItem(item)
            return
        rules = []
        for index in xrange(self.ListRules.count()):
            rules.append(str(self.ListRules.item(index).text()))
        for i,j in enumerate(rules):
            if search('--to-destination 10.0.0.1:80',j):
                self.ListRules.takeItem(i)
    def Qui(self):
        self.Main = QVBoxLayout()
        self.formGroupAd  = QFormLayout()
        self.form = QFormLayout()
        self.tabcontrol = QTabWidget()

        # tabs
        self.tab1 = QWidget()
        self.tab2 = QWidget()
        self.tab3 = QWidget()
        self.tab4 = QWidget()

        self.page_1 = QVBoxLayout(self.tab1)
        self.page_2 = QFormLayout(self.tab2)
        self.page_3 = QFormLayout(self.tab3)
        self.page_4 = QFormLayout(self.tab4)

        self.tabcontrol.addTab(self.tab1, 'General')
        self.tabcontrol.addTab(self.tab2, 'Advanced')
        self.tabcontrol.addTab(self.tab3,'Iptables')
        self.tabcontrol.addTab(self.tab4,'hostpad')

        self.pageTab1 = SettingsTabGeneral(self.Settings)
        self.page_1.addLayout(self.pageTab1)

        self.groupAdvanced = QGroupBox()
        self.groupAdvanced.setTitle('Advanced settings:')
        self.groupAdvanced.setLayout(self.formGroupAd)

        self.btn_save = QPushButton('Save')
        self.btn_save.clicked.connect(self.save_settings)
        self.btn_save.setFixedWidth(80)
        self.btn_save.setIcon(QIcon('icons/Save.png'))


        #page Adavanced
        self.bdfProxy_port = QSpinBox()
        self.bdfProxy_port.setMaximum(10000)
        self.txt_ranger = QLineEdit(self)
        self.txt_arguments = QLineEdit(self)
        self.scan1 = QRadioButton('Ping Scan:: Very fast scan IP')
        self.scan2 = QRadioButton('Python-Nmap:: Get hostname from IP')
        self.redirectport = QLineEdit(self)

        # page Iptables
        self.ListRules = QListWidget(self)
        self.ListRules.setFixedHeight(300)
        self.ListRules.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
        self.ListRules.setContextMenuPolicy(Qt.CustomContextMenu)
        self.ListRules.connect(self.ListRules,
        SIGNAL('customContextMenuRequested(QPoint)'),
        self.listItemclicked)
        for ech in self.Settings.get_all_childname('iptables'):
            item = QListWidgetItem()
            item.setText(str(self.Settings.get_setting('iptables',ech,format=str)))
            item.setSizeHint(QSize(30,30))
            self.ListRules.addItem(item)

        # page hostpad
        self.ListHostapd = QTextEdit(self)
        self.ListHostapd.setFixedHeight(300)
        with open('core/config/hostapd/hostapd+.conf','r') as apconf:
            self.ListHostapd.setText(apconf.read())

        # grup page 2
        self.gruButtonPag2 = QButtonGroup()
        self.gruButtonPag2.addButton(self.scan1)
        self.gruButtonPag2.addButton(self.scan2)

        self.txt_ranger.setText(self.Settings.get_setting('settings','scanner_rangeIP'))
        self.txt_arguments.setText(self.Settings.get_setting('settings','mdk3'))
        self.scanIP_selected  = self.Settings.get_setting('settings','Function_scan')
        self.bdfProxy_port.setValue(int(self.bdfproxyConf.get_setting('Overall','proxyPort')))
        self.bdfProxy_port.setEnabled(False)
        if self.scanIP_selected == 'Ping': self.scan1.setChecked(True)
        self.scan2.setEnabled(False)
        #settings tab Advanced
        self.redirectport.setText(self.Settings.get_setting('settings','redirect_port'))

        #add tab Advanced
        self.formGroupAd.addRow(QLabel('Thread Scan IP-Address:'))
        self.formGroupAd.addRow(self.scan1)
        self.formGroupAd.addRow(self.scan2)
        self.formGroupAd.addRow('Port BDFProxy-ng',self.bdfProxy_port)
        self.formGroupAd.addRow('Port sslstrip:',self.redirectport)
        self.formGroupAd.addRow(QLabel('mdk3 Args:'),self.txt_arguments)
        self.formGroupAd.addRow(QLabel('Range Scanner:'),self.txt_ranger)
        self.page_2.addRow(self.groupAdvanced)

        #add tab iptables
        self.page_3.addWidget(QLabel('Iptables:'))
        self.page_3.addRow(self.ListRules)

        #add tab hostpad
        self.page_4.addWidget(QLabel('settings hostapd:'))
        self.page_4.addRow(self.ListHostapd)

        self.form.addRow(self.tabcontrol)
        self.form.addRow(self.btn_save)
        self.Main.addLayout(self.form)
        self.setLayout(self.Main)
コード例 #13
0
    check_dep_pumpkin()
    from os import getuid
    if not getuid() == 0:
        exit('[{}!{}] WiFi-Pumpkin must be run as root.'.format(C.RED,C.ENDC))

    app = ApplicationLoop(argv)
    if app.isRunning():
        QtGui.QMessageBox.warning(None,'Already Running','the wifi-pumpkin is already running')
        exit('WiFi-Pumpkin Already Running.')

    print('Loading GUI...')
    main = Initialize()
    main.setWindowIcon(QtGui.QIcon('icons/icon.png'))
    main.center()
    # check if Wireless connection
    conf = SettingsINI(C.CONFIG_INI)
    if  conf.get_setting('accesspoint','checkConnectionWifi',format=bool):
        networkcontrol = CLI_NetworkManager() # add all interface avaliable for exclude
        main.networkcontrol = networkcontrol
        if networkcontrol.run():
            if  networkcontrol.isWiFiConnected() and len(networkcontrol.ifaceAvaliable) > 0:
                settings = UI_NetworkManager(main)
                settings.setWindowIcon(QtGui.QIcon('icons/icon.png'))
                settings.show()
                exit(app.exec_())
    main.show()

    print('WiFi-Pumpkin Running!')
    exit(app.exec_())
コード例 #14
0
class ThreadSniffingPackets(QThread):
    output_plugins = pyqtSignal(object)
    def __init__(self,interface,session):
        QThread.__init__(self)
        self.interface  = interface
        self.session    = session
        self.stopped    = False
        self.config     = SettingsINI(C.TCPPROXY_INI)

    def run(self):
        self.main()

    def sniffer(self,q):
        while not self.stopped:
            try:
                sniff(iface=self.interface,
                      filter="tcp and ( port 80 or port 8080 or port 10000)",
                      prn =lambda x : q.put(x), store=0)
            except Exception:pass
            if self.stopped:
                break

    def disablePlugin(self,name, status):
        ''' disable plugin by name '''
        plugin_on = []
        if status:
            for plugin in self.plugins:
                plugin_on.append(self.plugins[plugin].Name)
            if name not in plugin_on:
                for p in self.plugin_classes:
                    pluginconf = p()
                    if  pluginconf.Name == name:
                        self.plugins[name] = pluginconf
                        self.plugins[name].getInstance()._activated = True
                        print('TCPProxy::{0:17} status:On'.format(name))
        else:
            print('TCPProxy::{0:17} status:Off'.format(name))
            self.plugins.pop(self.plugins[name].Name)

    def main(self):
        self.plugins = {}
        self.plugin_classes = default.PSniffer.__subclasses__()
        for p in self.plugin_classes:
            plugin_load = p()
            self.plugins[plugin_load.Name] = plugin_load
            self.plugins[plugin_load.Name].output = self.output_plugins
            self.plugins[plugin_load.Name].session = self.session
        print '\n[*] TCPProxy running on port 80/8080:\n'
        for name in self.plugins.keys():
            if self.config.get_setting('plugins', name, format=bool):
                self.plugins[name].getInstance()._activated = True
                print('TCPProxy::{0:17} status:On'.format(name))
        print('\n')
        q = queue.Queue()
        sniff = Thread(target =self.sniffer, args = (q,))
        sniff.start()
        while (not self.stopped):
            try:
                pkt = q.get(timeout = 0)
                for Active in self.plugins.keys():
                    if self.plugins[Active].getInstance()._activated:
                        try:
                            self.plugins[Active].filterPackets(pkt)
                        except Exception: pass
            except queue.Empty:
              pass

    def snifferParser(self,pkt):
        try:
            if pkt.haslayer(Ether) and pkt.haslayer(Raw) and not pkt.haslayer(IP) and not pkt.haslayer(IPv6):
                return
            self.dport = pkt[TCP].dport
            self.sport = pkt[TCP].sport
            if pkt.haslayer(TCP) and pkt.haslayer(Raw) and pkt.haslayer(IP):
                self.src_ip_port = str(pkt[IP].src)+':'+str(self.sport)
                self.dst_ip_port = str(pkt[IP].dst)+':'+str(self.dport)

            if pkt.haslayer(Raw):
                self.load = pkt[Raw].load
                if self.load.startswith('GET'):
                    self.get_http_GET(self.src_ip_port,self.dst_ip_port,self.load)
                    self.searchBingGET(self.load.split('\n', 1)[0].split('&')[0])
                elif self.load.startswith('POST'):
                    header,url = self.get_http_POST(self.load)
                    self.getCredentials_POST(pkt.getlayer(Raw).load,url,header,self.dport,self.sport)
        except:
            pass

    def searchBingGET(self,search):
        if 'search?q' in search :
            searched = search.split('search?q=',1)[1]
            searched = searched.replace('+',' ')
            print 'Search::BING { %s }'%(searched)

    def getCredentials_POST(self,payload,url,header,dport,sport):
        user_regex = '([Ee]mail|%5B[Ee]mail%5D|[Uu]ser|[Uu]sername|' \
        '[Nn]ame|[Ll]ogin|[Ll]og|[Ll]ogin[Ii][Dd])=([^&|;]*)'
        pw_regex = '([Pp]assword|[Pp]ass|[Pp]asswd|[Pp]wd|[Pp][Ss][Ww]|' \
        '[Pp]asswrd|[Pp]assw|%5B[Pp]assword%5D)=([^&|;]*)'
        username = re.findall(user_regex, payload)
        password = re.findall(pw_regex, payload)
        if not username ==[] and not password == []:
            self.output_plugins.emit({'POSTCreds':{'User':username[0][1],
            'Pass': password[0][1],'Url':url,'destination':'{}/{}'.format(sport,dport)}})

    def get_http_POST(self,load):
        dict_head = {}
        try:
            headers, body = load.split("\r\n\r\n", 1)
            header_lines = headers.split('\r\n')
            for item in header_lines:
                try:
                    dict_head[item.split()[0]] = item.split()[1]
                except Exception:
                    pass
            if 'Referer:' in dict_head.keys():
                return dict_head ,dict_head['Referer:']
        except ValueError:
            return None,None
        return dict_head, None

    def stop(self):
        self.stopped = True
        print 'Thread::[{}] successfully stopped.'.format(self.objectName())
コード例 #15
0
ファイル: PumpkinProxy.py プロジェクト: mh4x0f/WiFi-Pumpkin
class PumpkinMitmproxy(ProxyMode):
    ''' settings  Transparent Proxy '''
    Name = "Pumpkin Proxy"
    Author = "Pumpkin-Dev"
    Description = "Intercepting HTTP data, this proxy server that allows to intercept requests and response on the fly"
    Icon = "icons/pumpkinproxy.png"
    ModSettings = True
    Hidden = False
    ModType = "proxy"  # proxy or server
    _cmd_array = []
    sendError = QtCore.pyqtSignal(str)

    def __init__(self, parent, **kwargs):
        super(PumpkinMitmproxy, self).__init__(parent)
        self.mainLayout = QtGui.QVBoxLayout()
        self.config = SettingsINI(C.PUMPPROXY_INI)
        self.plugins = []
        self.main_method = parent
        self.bt_SettingsDict = {}
        self.check_PluginDict = {}
        self.search_all_ProxyPlugins()
        #scroll area
        self.scrollwidget = QtGui.QWidget()
        self.scrollwidget.setLayout(self.mainLayout)
        self.scroll = QtGui.QScrollArea()
        self.scroll.setWidgetResizable(True)
        self.scroll.setWidget(self.scrollwidget)
        self.dockwidget = PumpkinProxyDock(None, title=self.Name)
        self.search[self.Name] = str(
            'iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 8080'
        )

        # create for add dock logging
        self.tabcontrol = QtGui.QTabWidget()
        self.tab1 = QtGui.QWidget()
        self.tab2 = QtGui.QWidget()
        self.page_1 = QtGui.QVBoxLayout(self.tab1)
        self.page_2 = QtGui.QVBoxLayout(self.tab2)
        self.tableLogging = dockPumpkinProxy()

        self.tabcontrol.addTab(self.tab1, 'Plugins')
        #self.tabcontrol.addTab(self.tab2, 'Logging')

        self.TabPlugins = QtGui.QTableWidget()
        self.TabPlugins.setColumnCount(3)
        self.TabPlugins.setRowCount(len(self.plugins))
        self.TabPlugins.resizeRowsToContents()
        self.TabPlugins.setSizePolicy(QtGui.QSizePolicy.Preferred,
                                      QtGui.QSizePolicy.Preferred)
        self.TabPlugins.horizontalHeader().setStretchLastSection(True)
        self.TabPlugins.setSelectionBehavior(
            QtGui.QAbstractItemView.SelectRows)
        self.TabPlugins.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers)
        self.TabPlugins.verticalHeader().setVisible(False)
        self.TabPlugins.verticalHeader().setDefaultSectionSize(27)
        self.TabPlugins.setSortingEnabled(True)
        self.THeaders = OrderedDict([('Plugins', []), ('Settings', []),
                                     ('Description', [])])
        self.TabPlugins.setHorizontalHeaderLabels(list(self.THeaders.keys()))
        self.TabPlugins.horizontalHeader().resizeSection(0, 158)
        self.TabPlugins.horizontalHeader().resizeSection(1, 80)

        # add on tab
        self.page_1.addWidget(self.TabPlugins)
        self.page_2.addWidget(self.tableLogging)

        # get all plugins and add into TabWidget
        Headers = []
        for plugin in self.plugins:
            if plugin.ConfigParser:
                self.bt_SettingsDict[plugin.Name] = QtGui.QPushButton(
                    'Settings')
                self.bt_SettingsDict[plugin.Name].clicked.connect(
                    partial(self.setSettingsPlgins, plugin.Name))
            else:
                self.bt_SettingsDict[plugin.Name] = QtGui.QPushButton('None')
            self.check_PluginDict[plugin.Name] = QtGui.QCheckBox(plugin.Name)
            self.check_PluginDict[plugin.Name].setObjectName(plugin.Name)
            self.check_PluginDict[plugin.Name].clicked.connect(
                partial(self.setPluginOption, plugin.Name))
            self.THeaders['Plugins'].append(self.check_PluginDict[plugin.Name])
            self.THeaders['Settings'].append({'name': plugin.Name})
            self.THeaders['Description'].append(plugin.Description)
        for n, key in enumerate(self.THeaders.keys()):
            Headers.append(key)
            for m, item in enumerate(self.THeaders[key]):
                if type(item) == type(QtGui.QCheckBox()):
                    self.TabPlugins.setCellWidget(m, n, item)
                elif type(item) == type(dict()):
                    self.TabPlugins.setCellWidget(
                        m, n, self.bt_SettingsDict[item['name']])
                else:
                    item = QtGui.QTableWidgetItem(item)
                    self.TabPlugins.setItem(m, n, item)
        self.TabPlugins.setHorizontalHeaderLabels(list(self.THeaders.keys()))

        # check status all checkbox plugins
        for box in self.check_PluginDict.keys():
            self.check_PluginDict[box].setChecked(
                self.config.get_setting('plugins', box, format=bool))

        self.mainLayout.addWidget(self.tabcontrol)
        self.layout = QtGui.QHBoxLayout()
        self.layout.addWidget(self.scroll)
        self.setLayout(self.layout)

    def setPluginOption(self, name, status):
        ''' get each plugins status'''
        # enable realtime disable and enable plugin
        if self.FSettings.Settings.get_setting('accesspoint',
                                               'statusAP',
                                               format=bool):
            self.reactor.ThreadPumpkinProxy.m.disablePlugin(name, status)
        self.config.set_setting('plugins', name, status)

    def setSettingsPlgins(self, plugin):
        ''' open settings options for each plugins'''
        key = 'set_{}'.format(plugin)
        self.widget = PumpkinProxySettings(key,
                                           self.config.get_all_childname(key))
        self.widget.show()

    def search_all_ProxyPlugins(self):
        ''' load all plugins function '''
        try:
            plugin_classes = plugin.PluginTemplate.__subclasses__()
            for p in plugin_classes:
                self.plugins.append(p())
        except NameError:
            infoLabel = ServiceNotify(C.PUMPKINPROXY_notify,
                                      title='Package Requirement')
            self.mainLayout.addWidget(infoLabel)

    def boot(self):
        self.reactor = ThreadPumpkinProxy(self.parent.currentSessionID)
        self.reactor.send.connect(self.LogOutput)
        self.reactor.setObjectName(self.Name)
        self.SetRules("PumpkinProxy")

    def LogOutput(self, data):
        if self.FSettings.Settings.get_setting('accesspoint',
                                               'statusAP',
                                               format=bool):
            self.dockwidget.writeModeData(data)
            self.logger.info(data)

    def Serve(self, on=True):
        if on:
            self.tableLogging.clearContents()
            plugin_classes = plugin.PluginTemplate.__subclasses__()
            for p in plugin_classes:
                self.plugins.append(p())
        # pumpkinproxy not use reactor twistted
        #self.server.start()
    def onProxyEnabled(self):
        self.SetRules(self.Name)
コード例 #16
0
ファイル: tabmodels.py プロジェクト: viafreekab/WiFi-Pumpkin
class PumpkinMitmproxy(QtGui.QVBoxLayout):
    ''' settings  Transparent Proxy '''
    sendError = QtCore.pyqtSignal(str)

    def __init__(self, mainWindow):
        QtGui.QVBoxLayout.__init__(self)
        self.mainLayout = QtGui.QVBoxLayout()
        self.config = SettingsINI(C.PUMPPROXY_INI)
        self.plugins = []
        self.main_method = mainWindow
        self.bt_SettingsDict = {}
        self.check_PluginDict = {}
        self.search_all_ProxyPlugins()
        #scroll area
        self.scrollwidget = QtGui.QWidget()
        self.scrollwidget.setLayout(self.mainLayout)
        self.scroll = QtGui.QScrollArea()
        self.scroll.setWidgetResizable(True)
        self.scroll.setWidget(self.scrollwidget)

        # create for add dock logging
        self.tabcontrol = QtGui.QTabWidget()
        self.tab1 = QtGui.QWidget()
        self.tab2 = QtGui.QWidget()
        self.page_1 = QtGui.QVBoxLayout(self.tab1)
        self.page_2 = QtGui.QVBoxLayout(self.tab2)
        self.tableLogging = dockPumpkinProxy()

        self.tabcontrol.addTab(self.tab1, 'Plugins')
        self.tabcontrol.addTab(self.tab2, 'Logging')

        self.TabPlugins = QtGui.QTableWidget()
        self.TabPlugins.setColumnCount(3)
        self.TabPlugins.setRowCount(len(self.plugins))
        self.TabPlugins.resizeRowsToContents()
        self.TabPlugins.setSizePolicy(QtGui.QSizePolicy.Preferred,
                                      QtGui.QSizePolicy.Preferred)
        self.TabPlugins.horizontalHeader().setStretchLastSection(True)
        self.TabPlugins.setSelectionBehavior(
            QtGui.QAbstractItemView.SelectRows)
        self.TabPlugins.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers)
        self.TabPlugins.verticalHeader().setVisible(False)
        self.TabPlugins.verticalHeader().setDefaultSectionSize(27)
        self.TabPlugins.setSortingEnabled(True)
        self.THeaders = OrderedDict([('Plugins', []), ('Settings', []),
                                     ('Description', [])])
        self.TabPlugins.setHorizontalHeaderLabels(self.THeaders.keys())
        self.TabPlugins.horizontalHeader().resizeSection(0, 158)
        self.TabPlugins.horizontalHeader().resizeSection(1, 80)

        # add on tab
        self.page_1.addWidget(self.TabPlugins)
        self.page_2.addWidget(self.tableLogging)

        # get all plugins and add into TabWidget
        Headers = []
        for plugin in self.plugins:
            if plugin.ConfigParser:
                self.bt_SettingsDict[plugin.Name] = QtGui.QPushButton(
                    'Settings')
                self.bt_SettingsDict[plugin.Name].clicked.connect(
                    partial(self.setSettingsPlgins, plugin.Name))
            else:
                self.bt_SettingsDict[plugin.Name] = QtGui.QPushButton('None')
            self.check_PluginDict[plugin.Name] = QtGui.QCheckBox(plugin.Name)
            self.check_PluginDict[plugin.Name].setObjectName(plugin.Name)
            self.check_PluginDict[plugin.Name].clicked.connect(
                partial(self.setPluginOption, plugin.Name))
            self.THeaders['Plugins'].append(self.check_PluginDict[plugin.Name])
            self.THeaders['Settings'].append({'name': plugin.Name})
            self.THeaders['Description'].append(plugin.Description)
        for n, key in enumerate(self.THeaders.keys()):
            Headers.append(key)
            for m, item in enumerate(self.THeaders[key]):
                if type(item) == type(QtGui.QCheckBox()):
                    self.TabPlugins.setCellWidget(m, n, item)
                elif type(item) == type(dict()):
                    self.TabPlugins.setCellWidget(
                        m, n, self.bt_SettingsDict[item['name']])
                else:
                    item = QtGui.QTableWidgetItem(item)
                    self.TabPlugins.setItem(m, n, item)
        self.TabPlugins.setHorizontalHeaderLabels(self.THeaders.keys())

        # check status all checkbox plugins
        for box in self.check_PluginDict.keys():
            self.check_PluginDict[box].setChecked(
                self.config.get_setting('plugins', box, format=bool))

        self.mainLayout.addWidget(self.tabcontrol)
        self.layout = QtGui.QHBoxLayout()
        self.layout.addWidget(self.scroll)
        self.addLayout(self.layout)

    def setPluginOption(self, name, status):
        ''' get each plugins status'''
        # enable realtime disable and enable plugin
        if self.main_method.PopUpPlugins.check_pumpkinProxy.isChecked() and \
            self.main_method.FSettings.Settings.get_setting('accesspoint','statusAP',format=bool):
            self.main_method.Thread_PumpkinProxy.m.disablePlugin(name, status)
        self.config.set_setting('plugins', name, status)

    def setSettingsPlgins(self, plugin):
        ''' open settings options for each plugins'''
        key = 'set_{}'.format(plugin)
        self.widget = PumpkinProxySettings(key,
                                           self.config.get_all_childname(key))
        self.widget.show()

    def search_all_ProxyPlugins(self):
        ''' load all plugins function '''
        plugin_classes = plugin.PluginTemplate.__subclasses__()
        for p in plugin_classes:
            self.plugins.append(p())
コード例 #17
0
class PacketsSniffer(QVBoxLayout):
    ''' settings  Transparent Proxy '''
    sendError = pyqtSignal(str)
    def __init__(self,main_method,parent = None):
        super(PacketsSniffer, self).__init__(parent)
        self.mainLayout     = QVBoxLayout()
        self.config         = SettingsINI(C.TCPPROXY_INI)
        self.plugins        = []
        self.main_method    = main_method
        self.bt_SettingsDict    = {}
        self.check_PluginDict   = {}
        self.search_all_ProxyPlugins()
        #scroll area
        self.scrollwidget = QWidget()
        self.scrollwidget.setLayout(self.mainLayout)
        self.scroll = QScrollArea()
        self.scroll.setWidgetResizable(True)
        self.scroll.setWidget(self.scrollwidget)

        self.tabcontrol = QTabWidget()
        self.tab1 = QWidget()
        self.tab2 = QWidget()
        self.page_1 = QVBoxLayout(self.tab1)
        self.page_2 = QVBoxLayout(self.tab2)
        self.tableLogging  = dockTCPproxy()

        self.tabcontrol.addTab(self.tab1, 'Plugins')
        self.tabcontrol.addTab(self.tab2, 'Logging')

        self.TabPlugins = QTableWidget()
        self.TabPlugins.setColumnCount(3)
        self.TabPlugins.setRowCount(len(self.plugins))
        self.TabPlugins.resizeRowsToContents()
        self.TabPlugins.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
        self.TabPlugins.horizontalHeader().setStretchLastSection(True)
        self.TabPlugins.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.TabPlugins.setEditTriggers(QAbstractItemView.NoEditTriggers)
        self.TabPlugins.verticalHeader().setVisible(False)
        self.TabPlugins.verticalHeader().setDefaultSectionSize(27)
        self.TabPlugins.setSortingEnabled(True)
        self.THeaders  = OrderedDict([ ('Plugins',[]),('Author',[]),('Description',[])])
        self.TabPlugins.setHorizontalHeaderLabels(self.THeaders.keys())
        self.TabPlugins.horizontalHeader().resizeSection(0,158)
        self.TabPlugins.horizontalHeader().resizeSection(1,120)

        self.page_1.addWidget(self.TabPlugins)
        self.page_2.addWidget(self.tableLogging)
        # get all plugins and add into TabWidget
        Headers = []
        for plugin in self.plugins:
            self.bt_SettingsDict[plugin.Name] = QPushButton(plugin.Author)
            self.check_PluginDict[plugin.Name] = QCheckBox(plugin.Name)
            self.check_PluginDict[plugin.Name].setObjectName(plugin.Name)
            self.check_PluginDict[plugin.Name].clicked.connect(partial(self.setPluginOption,plugin.Name))
            self.THeaders['Plugins'].append(self.check_PluginDict[plugin.Name])
            self.THeaders['Author'].append({'name': plugin.Name})
            self.THeaders['Description'].append(plugin.Description)
        for n, key in enumerate(self.THeaders.keys()):
            Headers.append(key)
            for m, item in enumerate(self.THeaders[key]):
                if type(item) == type(QCheckBox()):
                    self.TabPlugins.setCellWidget(m,n,item)
                elif type(item) == type(dict()):
                    self.TabPlugins.setCellWidget(m,n,self.bt_SettingsDict[item['name']])
                else:
                    item = QTableWidgetItem(item)
                    self.TabPlugins.setItem(m, n, item)
        self.TabPlugins.setHorizontalHeaderLabels(self.THeaders.keys())

        # check status all checkbox plugins
        for box in self.check_PluginDict.keys():
            self.check_PluginDict[box].setChecked(self.config.get_setting('plugins',box,format=bool))

        self.mainLayout.addWidget(self.tabcontrol)
        self.layout = QHBoxLayout()
        self.layout.addWidget(self.scroll)
        self.addLayout(self.layout)

    def setPluginOption(self, name,status):
        ''' get each plugins status'''
        # enable realtime disable and enable plugin
        if self.main_method.FSettings.Settings.get_setting('accesspoint','statusAP',format=bool):
            self.main_method.Thread_TCPproxy.disablePlugin(name, status)
        self.config.set_setting('plugins',name,status)

    def search_all_ProxyPlugins(self):
        ''' load all plugins function '''
        plugin_classes = default.PSniffer.__subclasses__()
        for p in plugin_classes:
            if p().Name != 'httpCap':
                self.plugins.append(p())
コード例 #18
0
ファイル: TCP-Proxy.py プロジェクト: yudevan/WiFi-Pumpkin
class TCPProxy(ProxyMode):
    Name = "TCP Proxy"
    Author = "Pumpkin-Dev"
    Description = "Sniff for intercept network traffic on UDP,TCP protocol get password,hash,image,etc..."
    Icon = "icons/tcpproxy.png"
    Hidden = False
    LogFile = C.LOG_TCPPROXY
    _cmd_array = []
    ModSettings = True
    ModType = "proxy"  # proxy or server
    TypePlugin = 2  # 1 != for  checkbox

    def __init__(self, parent=None, **kwargs):
        super(TCPProxy, self).__init__(parent)
        self.mainLayout = QtGui.QVBoxLayout()
        self.config = SettingsINI(C.TCPPROXY_INI)
        self.plugins = []
        self.parent = parent
        self.bt_SettingsDict = {}
        self.check_PluginDict = {}
        self.search_all_ProxyPlugins()
        # scroll area
        self.scrollwidget = QtGui.QWidget()
        self.scrollwidget.setLayout(self.mainLayout)
        self.scroll = QtGui.QScrollArea()
        self.scroll.setWidgetResizable(True)
        self.scroll.setWidget(self.scrollwidget)

        setup_logger("NetCreds", C.LOG_CREDSCAPTURE, "CapturedCreds")
        self.LogCredsMonitor = logging.getLogger("NetCreds")

        self.tabcontrol = QtGui.QTabWidget()
        self.tab1 = QtGui.QWidget()
        self.tab2 = QtGui.QWidget()
        self.page_1 = QtGui.QVBoxLayout(self.tab1)
        self.page_2 = QtGui.QVBoxLayout(self.tab2)
        self.tableLogging = dockTCPproxy()

        self.tabcontrol.addTab(self.tab1, 'Plugins')
        self.tabcontrol.addTab(self.tab2, 'Logging')

        self.TabPlugins = QtGui.QTableWidget()
        self.TabPlugins.setColumnCount(3)
        self.TabPlugins.setRowCount(len(self.plugins))
        self.TabPlugins.resizeRowsToContents()
        self.TabPlugins.setSizePolicy(QtGui.QSizePolicy.Preferred,
                                      QtGui.QSizePolicy.Preferred)
        self.TabPlugins.horizontalHeader().setStretchLastSection(True)
        self.TabPlugins.setSelectionBehavior(
            QtGui.QAbstractItemView.SelectRows)
        self.TabPlugins.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers)
        self.TabPlugins.verticalHeader().setVisible(False)
        self.TabPlugins.verticalHeader().setDefaultSectionSize(27)
        self.TabPlugins.setSortingEnabled(True)
        self.THeaders = OrderedDict([('Plugins', []), ('Author', []),
                                     ('Description', [])])
        self.TabPlugins.setHorizontalHeaderLabels(self.THeaders.keys())
        self.TabPlugins.horizontalHeader().resizeSection(0, 158)
        self.TabPlugins.horizontalHeader().resizeSection(1, 120)

        self.dockwidget = TCPProxyDock(None, title=self.Name)

        self.page_1.addWidget(self.TabPlugins)
        self.page_2.addWidget(self.tableLogging)
        # get all plugins and add into TabWidget
        Headers = []
        for plugin in self.plugins:
            self.bt_SettingsDict[plugin.Name] = QtGui.QPushButton(
                plugin.Author)
            self.check_PluginDict[plugin.Name] = QtGui.QCheckBox(plugin.Name)
            self.check_PluginDict[plugin.Name].setObjectName(plugin.Name)
            self.check_PluginDict[plugin.Name].clicked.connect(
                partial(self.setPluginOption, plugin.Name))
            self.THeaders['Plugins'].append(self.check_PluginDict[plugin.Name])
            self.THeaders['Author'].append({'name': plugin.Name})
            self.THeaders['Description'].append(plugin.Description)
        for n, key in enumerate(self.THeaders.keys()):
            Headers.append(key)
            for m, item in enumerate(self.THeaders[key]):
                if type(item) == type(QtGui.QCheckBox()):
                    self.TabPlugins.setCellWidget(m, n, item)
                elif type(item) == type(dict()):
                    self.TabPlugins.setCellWidget(
                        m, n, self.bt_SettingsDict[item['name']])
                else:
                    item = QtGui.QTableWidgetItem(item)
                    self.TabPlugins.setItem(m, n, item)
        self.TabPlugins.setHorizontalHeaderLabels(self.THeaders.keys())

        # check status all checkbox plugins
        for box in self.check_PluginDict.keys():
            self.check_PluginDict[box].setChecked(
                self.config.get_setting('plugins', box, format=bool))

        self.mainLayout.addWidget(self.tabcontrol)
        self.layout = QtGui.QHBoxLayout()
        self.layout.addWidget(self.scroll)
        self.setLayout(self.layout)

    def onProxyDisabled(self):
        self.handler = self.parent.Plugins.MITM
        self.handler.CredMonitor.controlui.setChecked(False)
        self.handler.URLMonitor.controlui.setChecked(False)

    def onProxyEnabled(self):
        self.handler = self.parent.Plugins.MITM
        self.handler.CredMonitor.controlui.setChecked(True)
        self.handler.URLMonitor.controlui.setChecked(True)

    def setPluginOption(self, name, status):
        ''' get each plugins status'''
        # enable realtime disable and enable plugin
        if self.FSettings.Settings.get_setting('accesspoint',
                                               'statusAP',
                                               format=bool):
            self.reactor.disablePlugin(name, status)
        self.config.set_setting('plugins', name, status)

    def search_all_ProxyPlugins(self):
        ''' load all plugins function '''
        plugin_classes = default.PSniffer.__subclasses__()
        for p in plugin_classes:
            if p().Name != 'httpCap':
                self.plugins.append(p())

    def boot(self):
        self.handler = self.parent.Plugins.MITM
        self.reactor = TCPProxyCore(str(self.Wireless.WLANCard.currentText()),
                                    self.parent.currentSessionID)
        self.reactor.setObjectName(self.Name)
        self.reactor._ProcssOutput.connect(self.LogOutput)

    def LogOutput(self, data):
        if self.FSettings.Settings.get_setting('accesspoint',
                                               'statusAP',
                                               format=bool):
            if data.keys()[0] == 'urlsCap':
                self.handler.URLMonitor.dockwidget.writeModeData(data)
                self.logger.info(
                    '[ {0[src]} > {0[dst]} ] {1[Method]} {1[Host]}{1[Path]}'.
                    format(data['urlsCap']['IP'], data['urlsCap']['Headers']))
            elif data.keys()[0] == 'POSTCreds':
                self.handler.CredMonitor.dockwidget.writeModeData(data)
                self.LogCredsMonitor.info('URL: {}'.format(
                    data['POSTCreds']['Url']))
                self.LogCredsMonitor.info('UserName: {}'.format(
                    data['POSTCreds']['User']))
                self.LogCredsMonitor.info('UserName: {}'.format(
                    data['POSTCreds']['Pass']))
                self.LogCredsMonitor.info('Packets: {}'.format(
                    data['POSTCreds']['Destination']))
            elif data.keys()[0] == 'image':
                self.handler.ImageCapture.SendImageTableWidgets(data['image'])
            else:
                self.tableLogging.writeModeData(data)
                self.LogTcpproxy.info('[{}] {}'.format(data.keys()[0],
                                                       data[data.keys()[0]]))
コード例 #19
0
ファイル: handler.py プロジェクト: reo12345/reo
class MasterHandler(flow.FlowMaster):
    def __init__(self, opts, server, state, session):
        flow.FlowMaster.__init__(self, opts, server, state)
        self.config = SettingsINI('core/config/app/proxy.ini')
        self.session = session
        self.plugins = []
        self.initializePlugins()

    def run(self, send):
        self.sendMethod = send
        for plugin in self.plugins:
            plugin.send_output = self.sendMethod
        self.thread = ThreadController(self)
        self.thread.start()

    def disablePlugin(self, name, status):
        ''' disable plugin by name '''
        plugin_on = []
        if status:
            for plugin in self.plugins:
                plugin_on.append(plugin.Name)
            if name not in plugin_on:
                for p in self.plugin_classes:
                    pluginconf = p()
                    if pluginconf.Name == name:
                        pluginconf.send_output = self.sendMethod
                        print('PumpkinProxy::{0:17} status:On'.format(name))
                        self.plugins.append(pluginconf)
        else:
            for plugin in self.plugins:
                if plugin.Name == name:
                    print('PumpkinProxy::{0:17} status:Off'.format(name))
                    self.plugins.remove(plugin)

    def initializePlugins(self):
        self.plugin_classes = plugin.PluginTemplate.__subclasses__()
        for p in self.plugin_classes:
            if self.config.get_setting('plugins', p().Name, format=bool):
                print('PumpkinProxy::{0:17} status:On'.format(p().Name))
                self.plugins.append(p())
        # initialize logging in all plugins enable
        #for instance in self.plugins:
        #    instance.init_logger(self.session)

    @controller.handler
    def request(self, flow):
        '''
        print "-- request --"
        print flow.__dict__
        print flow.request.__dict__
        print flow.request.headers.__dict__
        print "--------------"
        print
        '''
        try:
            for p in self.plugins:
                p.request(flow)
        except Exception:
            pass

    @controller.handler
    def response(self, flow):
        '''
        print
        print "-- response --"
        print flow.__dict__
        print flow.response.__dict__
        print flow.response.headers.__dict__
        print "--------------"
        print
        '''
        try:
            for p in self.plugins:
                p.response(flow)
        except Exception:
            pass
コード例 #20
0
ファイル: tabmodels.py プロジェクト: ihebski/WiFi-Pumpkin
class PumpkinMitmproxy(QVBoxLayout):
    ''' settings  Transparent Proxy '''
    sendError = pyqtSignal(str)
    def __init__(self,main_method,parent = None):
        super(PumpkinMitmproxy, self).__init__(parent)
        self.mainLayout     = QVBoxLayout()
        self.config         = SettingsINI('core/config/app/proxy.ini')
        self.plugins        = []
        self.main_method    = main_method
        self.bt_SettingsDict    = {}
        self.check_PluginDict   = {}
        self.search_all_ProxyPlugins()
        #scroll area
        self.scrollwidget = QWidget()
        self.scrollwidget.setLayout(self.mainLayout)
        self.scroll = QScrollArea()
        self.scroll.setWidgetResizable(True)
        self.scroll.setWidget(self.scrollwidget)

        self.TabPlugins = QTableWidget()
        self.TabPlugins.setColumnCount(3)
        self.TabPlugins.setRowCount(len(self.plugins))
        self.TabPlugins.resizeRowsToContents()
        self.TabPlugins.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
        self.TabPlugins.horizontalHeader().setStretchLastSection(True)
        self.TabPlugins.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.TabPlugins.setEditTriggers(QAbstractItemView.NoEditTriggers)
        self.TabPlugins.verticalHeader().setVisible(False)
        self.TabPlugins.verticalHeader().setDefaultSectionSize(27)
        self.TabPlugins.setSortingEnabled(True)
        self.THeaders  = OrderedDict([ ('Plugins',[]),('Settings',[]),('Description',[])])
        self.TabPlugins.setHorizontalHeaderLabels(self.THeaders.keys())
        self.TabPlugins.horizontalHeader().resizeSection(0,158)
        self.TabPlugins.horizontalHeader().resizeSection(1,80)

        # get all plugins and add into TabWidget
        Headers = []
        for plugin in self.plugins:
            if plugin.ConfigParser:
                self.bt_SettingsDict[plugin.Name] = QPushButton('Settings')
                self.bt_SettingsDict[plugin.Name].clicked.connect(partial(self.setSettingsPlgins,plugin.Name))
            else:
                self.bt_SettingsDict[plugin.Name] = QPushButton('None')
            self.check_PluginDict[plugin.Name] = QCheckBox(plugin.Name)
            self.check_PluginDict[plugin.Name].setObjectName(plugin.Name)
            self.check_PluginDict[plugin.Name].clicked.connect(partial(self.setPluginOption,plugin.Name))
            self.THeaders['Plugins'].append(self.check_PluginDict[plugin.Name])
            self.THeaders['Settings'].append({'name': plugin.Name})
            self.THeaders['Description'].append(plugin.Description)
        for n, key in enumerate(self.THeaders.keys()):
            Headers.append(key)
            for m, item in enumerate(self.THeaders[key]):
                if type(item) == type(QCheckBox()):
                    self.TabPlugins.setCellWidget(m,n,item)
                elif type(item) == type(dict()):
                    self.TabPlugins.setCellWidget(m,n,self.bt_SettingsDict[item['name']])
                else:
                    item = QTableWidgetItem(item)
                    self.TabPlugins.setItem(m, n, item)
        self.TabPlugins.setHorizontalHeaderLabels(self.THeaders.keys())

        # check status all checkbox plugins
        for box in self.check_PluginDict.keys():
            self.check_PluginDict[box].setChecked(self.config.get_setting('plugins',box,format=bool))

        self.mainLayout.addWidget(self.TabPlugins)
        self.layout = QHBoxLayout()
        self.layout.addWidget(self.scroll)
        self.addLayout(self.layout)

    def setPluginOption(self, name,status):
        ''' get each plugins status'''
        # enable realtime disable and enable plugin
        if self.main_method.PopUpPlugins.check_pumpkinProxy.isChecked() and \
            self.main_method.FSettings.Settings.get_setting('accesspoint','statusAP',format=bool):
                self.main_method.Thread_PumpkinProxy.m.disablePlugin(name, status)
        self.config.set_setting('plugins',name,status)

    def setSettingsPlgins(self,plugin):
        ''' open settings options for each plugins'''
        key = 'set_{}'.format(plugin)
        self.widget = PumpkinProxySettings(key,self.config.get_all_childname(key))
        self.widget.show()

    def search_all_ProxyPlugins(self):
        ''' load all plugins function '''
        plugin_classes = plugin.PluginTemplate.__subclasses__()
        for p in plugin_classes:
            self.plugins.append(p())