def __init__(self, parent, **kwargs): super(SergioProxySSLstrip, self).__init__(parent) self.main_method = parent self.urlinjected = [] self.FSettings = SuperSettings.getInstance() self.mainLayout = QtGui.QVBoxLayout() self.dockwidget = ProxySSLstripDock(None, title=self.Name) self.dockwidget.setWindowTitle(self.Name) self.search[ self.Name] = str('iptables -t nat -A PREROUTING -p tcp' + ' --destination-port 80 -j REDIRECT --to-port ' + self.FSettings.redirectport.text()) #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 widgets self.argsLabel = QtGui.QLabel('') self.hBox = QtGui.QHBoxLayout() self.hBoxargs = QtGui.QHBoxLayout() self.btnLoader = QtGui.QPushButton('Reload') self.btnEnable = QtGui.QPushButton('Enable') self.btncancel = QtGui.QPushButton('Cancel') self.btnbrownser = QtGui.QPushButton('Browser') # size buttons self.btnLoader.setFixedWidth(100) self.btnEnable.setFixedWidth(100) self.btncancel.setFixedWidth(100) self.btnbrownser.setFixedWidth(100) self.comboxBox = QtGui.QComboBox() self.log_inject = QtGui.QListWidget() self.docScripts = QtGui.QTextEdit() self.argsScripts = QtGui.QLineEdit() self.btncancel.setIcon(QtGui.QIcon('icons/cancel.png')) self.btnLoader.setIcon(QtGui.QIcon('icons/search.png')) self.btnEnable.setIcon(QtGui.QIcon('icons/accept.png')) self.btnbrownser.setIcon(QtGui.QIcon("icons/open.png")) self.argsScripts.setEnabled(False) self.btnbrownser.setEnabled(False) # group settings self.GroupSettings = QtGui.QGroupBox() self.GroupSettings.setTitle('settings:') self.SettingsLayout = QtGui.QFormLayout() self.hBox.addWidget(self.comboxBox) self.hBox.addWidget(self.btnLoader) self.hBox.addWidget(self.btnEnable) self.hBox.addWidget(self.btncancel) self.hBoxargs.addWidget(self.argsLabel) self.hBoxargs.addWidget(self.argsScripts) self.hBoxargs.addWidget(self.btnbrownser) self.SettingsLayout.addRow(self.hBox) self.SettingsLayout.addRow(self.hBoxargs) self.GroupSettings.setLayout(self.SettingsLayout) #self.GroupSettings.setFixedWidth(450) #group logger self.GroupLogger = QtGui.QGroupBox() self.GroupLogger.setTitle('Logger Injection:') self.LoggerLayout = QtGui.QVBoxLayout() self.LoggerLayout.addWidget(self.log_inject) self.GroupLogger.setLayout(self.LoggerLayout) #self.GroupLogger.setFixedWidth(450) #group descriptions self.GroupDoc = QtGui.QGroupBox() self.GroupDoc.setTitle('Description:') self.DocLayout = QtGui.QFormLayout() self.DocLayout.addRow(self.docScripts) self.GroupDoc.setLayout(self.DocLayout) self.GroupDoc.setFixedHeight(100) #connections self.SearchProxyPlugins() self.readDocScripts('html_injector') self.btnLoader.clicked.connect(self.SearchProxyPlugins) self.connect(self.comboxBox, QtCore.SIGNAL('currentIndexChanged(QString)'), self.readDocScripts) self.btnEnable.clicked.connect(self.setPluginsActivated) self.btncancel.clicked.connect(self.unsetPluginsConf) self.btnbrownser.clicked.connect(self.get_filenameToInjection) # add widgets self.mainLayout.addWidget(self.GroupSettings) self.mainLayout.addWidget(self.GroupDoc) self.mainLayout.addWidget(self.GroupLogger) self.layout = QtGui.QHBoxLayout() self.layout.addWidget(self.scroll) self.setLayout(self.layout)
def center(self): frameGm = self.frameGeometry() centerPoint = QtGui.QDesktopWidget().availableGeometry().center() frameGm.moveCenter(centerPoint) self.move(frameGm.topLeft())
def __init__(self, parent=None, widgets=None): super(PumpkinSettings, self).__init__(parent) self.SettingsAp = widgets['SettingsAP'] self.Tab_Dock = widgets['Tab_dock'] self.dockInfo = widgets['DockInfo'] self.FSettings = widgets['Settings'] self.NetworkGroup = widgets['Network'] self.mainLayout = QtGui.QFormLayout() self.SettingsDHCP = {} #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.GroupDHCP = QtGui.QGroupBox() self.GroupArea = QtGui.QGroupBox() self.layoutDHCP = QtGui.QFormLayout() self.layoutArea = QtGui.QFormLayout() self.layoutbuttons = QtGui.QHBoxLayout() self.btnDefault = QtGui.QPushButton('Default') self.btnSave = QtGui.QPushButton('save settings') self.btnSave.setIcon(QtGui.QIcon('icons/export.png')) self.btnDefault.setIcon(QtGui.QIcon('icons/settings.png')) self.dhcpClassIP = QtGui.QComboBox() # dhcp class self.classtypes = [ 'Class-A-Address', 'Class-B-Address', 'Class-C-Address', 'Class-Custom-Address' ] for types in self.classtypes: if 'Class-{}-Address'.format( self.FSettings.Settings.get_setting('dhcp', 'classtype')) in types: self.classtypes.remove(types), self.classtypes.insert(0, types) self.dhcpClassIP.addItems(self.classtypes) self.leaseTime_def = QtGui.QLineEdit( self.FSettings.Settings.get_setting('dhcp', 'leasetimeDef')) self.leaseTime_Max = QtGui.QLineEdit( self.FSettings.Settings.get_setting('dhcp', 'leasetimeMax')) self.netmask = QtGui.QLineEdit( self.FSettings.Settings.get_setting('dhcp', 'netmask')) self.range_dhcp = QtGui.QLineEdit( self.FSettings.Settings.get_setting('dhcp', 'range')) self.route = QtGui.QLineEdit( self.FSettings.Settings.get_setting('dhcp', 'router')) self.subnet = QtGui.QLineEdit( self.FSettings.Settings.get_setting('dhcp', 'subnet')) self.broadcast = QtGui.QLineEdit( self.FSettings.Settings.get_setting('dhcp', 'broadcast')) self.dhcpClassIP.currentIndexChanged.connect(self.dhcpClassIPClicked) self.GroupDHCP.setTitle('DHCP-Settings') self.GroupDHCP.setLayout(self.layoutDHCP) self.layoutDHCP.addRow('Class Ranges', self.dhcpClassIP) self.layoutDHCP.addRow('default-lease-time', self.leaseTime_def) self.layoutDHCP.addRow('max-lease-time', self.leaseTime_Max) self.layoutDHCP.addRow('subnet', self.subnet) self.layoutDHCP.addRow('router', self.route) self.layoutDHCP.addRow('netmask', self.netmask) self.layoutDHCP.addRow('broadcast-address', self.broadcast) self.layoutDHCP.addRow('range-dhcp', self.range_dhcp) self.GroupDHCP.setFixedWidth(350) # layout add self.layoutbuttons.addWidget(self.btnSave) self.layoutbuttons.addWidget(self.btnDefault) self.layoutDHCP.addRow(self.layoutbuttons) # Area Group self.gridArea = QtGui.QGridLayout() self.CB_ActiveMode = QtGui.QCheckBox( '::Advanced Mode:: Monitor MITM Attack') self.CB_ActiveMode.setHidden(True) self.CB_Cread = QtGui.QCheckBox('HTTP-Authentication') self.CB_monitorURL = QtGui.QCheckBox('HTTP-Requests') self.CB_bdfproxy = QtGui.QCheckBox('BDFProxy-ng') self.CB_dns2proxy = QtGui.QCheckBox('Dns2Proxy') self.CB_responder = QtGui.QCheckBox('Responder') self.CB_pumpkinPro = QtGui.QCheckBox('Pumpkin-Proxy') self.CB_ActiveMode.setChecked( self.FSettings.Settings.get_setting('dockarea', 'advanced', format=bool)) self.CB_Cread.setChecked( self.FSettings.Settings.get_setting('dockarea', 'dock_credencials', format=bool)) self.CB_monitorURL.setChecked( self.FSettings.Settings.get_setting('dockarea', 'dock_urlmonitor', format=bool)) self.CB_bdfproxy.setChecked( self.FSettings.Settings.get_setting('dockarea', 'dock_bdfproxy', format=bool)) self.CB_dns2proxy.setChecked( self.FSettings.Settings.get_setting('dockarea', 'dock_dns2proxy', format=bool)) self.CB_responder.setChecked( self.FSettings.Settings.get_setting('dockarea', 'dock_responder', format=bool)) self.CB_pumpkinPro.setChecked( self.FSettings.Settings.get_setting('dockarea', 'dock_PumpkinProxy', format=bool)) #connect self.doCheckAdvanced() self.CB_ActiveMode.clicked.connect(self.doCheckAdvanced) self.CB_monitorURL.clicked.connect(self.doCheckAdvanced) self.CB_Cread.clicked.connect(self.doCheckAdvanced) self.CB_bdfproxy.clicked.connect(self.doCheckAdvanced) self.CB_dns2proxy.clicked.connect(self.doCheckAdvanced) self.CB_responder.clicked.connect(self.doCheckAdvanced) self.CB_pumpkinPro.clicked.connect(self.doCheckAdvanced) # group self.layoutArea.addRow(self.CB_ActiveMode) self.gridArea.addWidget( self.CB_monitorURL, 0, 0, ) self.gridArea.addWidget(self.CB_Cread, 0, 1) self.gridArea.addWidget(self.CB_responder, 0, 2) self.gridArea.addWidget(self.CB_bdfproxy, 1, 0) self.gridArea.addWidget(self.CB_bdfproxy, 1, 0) self.gridArea.addWidget(self.CB_dns2proxy, 1, 1) #self.gridArea.addWidget(self.CB_pumpkinPro,0,2) disable tab plugin self.layoutArea.addRow(self.gridArea) self.GroupArea.setTitle('Activity Monitor settings') self.GroupArea.setLayout(self.layoutArea) # connects self.btnDefault.clicked.connect(self.setdefaultSettings) self.btnSave.clicked.connect(self.savesettingsDHCP) self.mainLayout.addRow(self.SettingsAp) self.mainLayout.addRow(self.NetworkGroup) self.mainLayout.addRow(self.GroupArea) self.mainLayout.addRow(self.GroupDHCP) self.layout = QtGui.QHBoxLayout() self.layout.addWidget(self.scroll) self.addLayout(self.layout)
def __init__(self, parent=0, title="", infor={}): super(ProxySSLstripDock, self).__init__(parent) self.setWindowTitle(self.title) self.maindockwidget = QtGui.QListWidget() self.setWidget(self.maindockwidget)
def __init__(self, popup, main_method, FsettingsUI=None, parent=None): super(ProxySSLstrip, self).__init__(parent) self.main_method = main_method self.popup = popup self.urlinjected = [] self.FSettings = FsettingsUI self.mainLayout = QtGui.QVBoxLayout() #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 widgets self.argsLabel = QtGui.QLabel('') self.hBox = QtGui.QHBoxLayout() self.hBoxargs = QtGui.QHBoxLayout() self.btnLoader = QtGui.QPushButton('Reload') self.btnEnable = QtGui.QPushButton('Enable') self.btncancel = QtGui.QPushButton('Cancel') self.btnbrownser = QtGui.QPushButton('Browser') # size buttons self.btnLoader.setFixedWidth(100) self.btnEnable.setFixedWidth(100) self.btncancel.setFixedWidth(100) self.btnbrownser.setFixedWidth(100) self.comboxBox = QtGui.QComboBox() self.log_inject = QtGui.QListWidget() self.docScripts = QtGui.QTextEdit() self.argsScripts = QtGui.QLineEdit() self.btncancel.setIcon(QtGui.QIcon('icons/cancel.png')) self.btnLoader.setIcon(QtGui.QIcon('icons/search.png')) self.btnEnable.setIcon(QtGui.QIcon('icons/accept.png')) self.btnbrownser.setIcon(QtGui.QIcon("icons/open.png")) self.argsScripts.setEnabled(False) self.btnbrownser.setEnabled(False) # group settings self.GroupSettings = QtGui.QGroupBox() self.GroupSettings.setTitle('settings:') self.SettingsLayout = QtGui.QFormLayout() self.hBox.addWidget(self.comboxBox) self.hBox.addWidget(self.btnLoader) self.hBox.addWidget(self.btnEnable) self.hBox.addWidget(self.btncancel) self.hBoxargs.addWidget(self.argsLabel) self.hBoxargs.addWidget(self.argsScripts) self.hBoxargs.addWidget(self.btnbrownser) self.SettingsLayout.addRow(self.hBox) self.SettingsLayout.addRow(self.hBoxargs) self.GroupSettings.setLayout(self.SettingsLayout) #self.GroupSettings.setFixedWidth(450) #group logger self.GroupLogger = QtGui.QGroupBox() self.GroupLogger.setTitle('Logger Injection:') self.LoggerLayout = QtGui.QVBoxLayout() self.LoggerLayout.addWidget(self.log_inject) self.GroupLogger.setLayout(self.LoggerLayout) #self.GroupLogger.setFixedWidth(450) #group descriptions self.GroupDoc = QtGui.QGroupBox() self.GroupDoc.setTitle('Description:') self.DocLayout = QtGui.QFormLayout() self.DocLayout.addRow(self.docScripts) self.GroupDoc.setLayout(self.DocLayout) self.GroupDoc.setFixedHeight(100) #connections self.SearchProxyPlugins() self.readDocScripts('html_injector') self.btnLoader.clicked.connect(self.SearchProxyPlugins) self.connect(self.comboxBox, QtCore.SIGNAL('currentIndexChanged(QString)'), self.readDocScripts) self.btnEnable.clicked.connect(self.setPluginsActivated) self.btncancel.clicked.connect(self.unsetPluginsConf) self.btnbrownser.clicked.connect(self.get_filenameToInjection) # add widgets self.mainLayout.addWidget(self.GroupSettings) self.mainLayout.addWidget(self.GroupDoc) self.mainLayout.addWidget(self.GroupLogger) self.layout = QtGui.QHBoxLayout() self.layout.addWidget(self.scroll) self.addLayout(self.layout)
def addRequests(self, macddress, user, status): if status: ParentMaster = QtGui.QStandardItem('Connected:: {} at {}'.format( macddress, datetime.now().strftime("%H:%M"))) ParentMaster.setIcon(QtGui.QIcon('icons/connected.png')) ParentMaster.setSizeHint(QtCore.QSize(30, 30)) info1 = QtGui.QStandardItem('{}'.format(user['device'])) info2 = QtGui.QStandardItem('{}'.format(user['IP'])) info3 = QtGui.QStandardItem('{}'.format( datetime.now().strftime("%Y-%m-%d %H:%M"))) ParentMaster.appendRow([QtGui.QStandardItem('Device::'), info1]) ParentMaster.appendRow([QtGui.QStandardItem('IPAddr::'), info2]) ParentMaster.appendRow( [QtGui.QStandardItem('Current date::'), info3]) self.model.appendRow(ParentMaster) return self.MonitorTreeView.setFirstColumnSpanned( ParentMaster.row(), self.MonitorTreeView.rootIndex(), True) ParentMaster = QtGui.QStandardItem('Disconnected:: {} at {}'.format( macddress, datetime.now().strftime("%H:%M"))) ParentMaster.setIcon(QtGui.QIcon('icons/disconnected.png')) ParentMaster.setSizeHint(QtCore.QSize(30, 30)) info1 = QtGui.QStandardItem('{}'.format(user['device'])) info2 = QtGui.QStandardItem('{}'.format(user['IP'])) info3 = QtGui.QStandardItem('{}'.format( datetime.now().strftime("%Y-%m-%d %H:%M"))) ParentMaster.appendRow([QtGui.QStandardItem('Device::'), info1]) ParentMaster.appendRow([QtGui.QStandardItem('IPAddr::'), info2]) ParentMaster.appendRow([QtGui.QStandardItem('Current date::'), info3]) self.model.appendRow(ParentMaster) self.MonitorTreeView.setFirstColumnSpanned( ParentMaster.row(), self.MonitorTreeView.rootIndex(), True)
def __init__(self, mainWindow): QtGui.QVBoxLayout.__init__(self) self.mainLayout = QtGui.QFormLayout() self.main_method = mainWindow self.scrollwidget = QtGui.QWidget() self.scrollwidget.setLayout(self.mainLayout) self.scroll = QtGui.QScrollArea() self.scroll.setWidgetResizable(True) self.scroll.setWidget(self.scrollwidget) self.split_window = QtGui.QHBoxLayout() guageWindow = QtGui.QGridLayout() self.currentThreadLabel = QtGui.QLabel('0') currentthread = self.create_info_box('CURRENT THREADS', 'infor', self.currentThreadLabel) self.sectionTimeLabel = QtGui.QLabel('00:00') currentTime = self.create_info_box('UPTIME', 'infor', self.sectionTimeLabel) guageWindow.addLayout(currentthread, 1, 1) guageWindow.addLayout(currentTime, 0, 1) self.AP_name = QtGui.QLabel(self.main_method.EditApName.text()) self.AP_BSSID = QtGui.QLabel(self.main_method.EditBSSID.text()) self.AP_Channel = QtGui.QLabel(self.main_method.EditChannel.text()) self.AP_NetworkApdater = QtGui.QLabel( self.main_method.selectCard.currentText()) self.AP_ROUTER = QtGui.QLabel(self.main_method.DHCP['router']) self.AP_DHCP_range = QtGui.QLabel(self.main_method.DHCP['range']) self.AP_Security = QtGui.QLabel('') self.update_security_label( self.main_method.GroupApPassphrase.isChecked()) self.group_AccessPoint = QtGui.QGroupBox() self.form_window = AutoGridLayout() self.form_window.setSpacing(10) self.group_AccessPoint.setTitle('Access Point') self.form_window.addNextWidget(QtGui.QLabel('AP Name:')) self.form_window.addNextWidget(self.AP_name) self.form_window.addNextWidget(QtGui.QLabel('BSSID:')) self.form_window.addNextWidget(self.AP_BSSID) self.form_window.addNextWidget(QtGui.QLabel('Channel:')) self.form_window.addNextWidget(self.AP_Channel) self.form_window.addNextWidget(QtGui.QLabel('Network Adapter:')) self.form_window.addNextWidget(self.AP_NetworkApdater) self.form_window.addNextWidget(QtGui.QLabel('Router:')) self.form_window.addNextWidget(self.AP_ROUTER) self.form_window.addNextWidget(QtGui.QLabel('DHCP:')) self.form_window.addNextWidget(self.AP_DHCP_range) self.form_window.addNextWidget(QtGui.QLabel('Security Password:')) self.form_window.addNextWidget(self.AP_Security) self.form_window.addItem( QtGui.QSpacerItem(40, 10, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)) self.group_AccessPoint.setLayout(self.form_window) self.split_window.addWidget(self.group_AccessPoint) self.split_window.addLayout(guageWindow) self.mainLayout.addRow(self.split_window) self.layout = QtGui.QHBoxLayout() self.layout.addWidget(self.scroll) self.addLayout(self.layout)
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 __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 UI(self): self.widget = QtGui.QWidget() self.statusBar = QtGui.QStatusBar() self.layout = QtGui.QVBoxLayout(self.widget) self.statusLabel = QtGui.QLabel() self.statusInetrnet(False) self.statusBar.setFixedHeight(20) self.statusBar.addWidget(QtGui.QLabel('Status Connection::')) self.statusBar.addWidget(self.statusLabel) self.groupBoxIface = QtGui.QGroupBox() self.components = QtGui.QHBoxLayout() self.compostart = QtGui.QHBoxLayout() self.checkboxlayout = QtGui.QFormLayout() self.btn_refrash = QtGui.QPushButton('Refresh') self.btn_start = QtGui.QPushButton('Start GUI..') self.cb_ifaces = QtGui.QComboBox() self.check_no_internet = QtGui.QCheckBox('Start without connection.') self.check_no_internet.clicked.connect(self.getstatus_checkbox) self.btn_refrash.clicked.connect(self.get_interfaceConnected) self.btn_start.clicked.connect(self.startGUI) self.groupBoxIface.setTitle('Interface/Wireless') self.btn_refrash.setIcon(QtGui.QIcon('icons/refresh.png')) self.btn_start.setIcon(QtGui.QIcon('icons/start.png')) self.btn_start.setEnabled(False) self.compostart.addStretch(1) self.compostart.addWidget(self.btn_start) self.groupBoxIface.setLayout(self.components) self.components.addWidget(self.cb_ifaces) self.components.addWidget(self.btn_refrash) self.checkboxlayout.addWidget(self.check_no_internet) self.infor = ServiceNotify( 'Click the "Refresh" for try detect your connection.', title='Attention', link=None, timeout=30000) self.layout.addWidget(self.infor) self.layout.addWidget(self.groupBoxIface) self.layout.addLayout(self.checkboxlayout) self.layout.addLayout(self.compostart) self.layout.addWidget(self.statusBar) self.Main.addWidget(self.widget) self.setLayout(self.Main)
def UI(self): self.statusBar = QtGui.QStatusBar() self.statusLabel = QtGui.QLabel('') self.statusBar.addWidget(QtGui.QLabel('Status HTTP Server::')) self.StatusServer(False) self.statusBar.addWidget(self.statusLabel) # left page self.frmHtml = QtGui.QFormLayout() self.frmOutput = QtGui.QFormLayout() # right page self.frmSettings = QtGui.QFormLayout() self.frmCheckBox = QtGui.QFormLayout() self.frmClone = QtGui.QFormLayout() self.frmButtons = QtGui.QFormLayout() self.frmright = QtGui.QFormLayout() self.frmleft = QtGui.QFormLayout() #group checkbox self.check_custom = QtGui.QRadioButton('index.html ') self.check_server = QtGui.QRadioButton('Set Directory') self.check_beef = QtGui.QCheckBox('Enable Beef') self.check_clone = QtGui.QRadioButton('Website clone') self.check_custom.setChecked(True) # group clone site self.cloneLineEdit = QtGui.QLineEdit(self) self.cloneLineEdit.setText('example.com/login') self.cloneLineEdit.setEnabled(False) # group settings self.EditBeef = QtGui.QLineEdit(self) self.EditDirectory = QtGui.QLineEdit('/var/www') self.txt_redirect = QtGui.QLineEdit(self) self.BoxPort = QtGui.QSpinBox(self) self.EditBeef.setEnabled(False) self.EditDirectory.setEnabled(False) self.BoxPort.setMaximum(65535) self.BoxPort.setValue(80) # group left self.Group_Html = QtGui.QGroupBox(self) self.Group_List = QtGui.QGroupBox(self) self.Group_Html.setTitle('index.html:') self.Group_List.setTitle('Requests:') self.txt_html = QtGui.QTextEdit(self) self.ListOutputWid = QtGui.QListWidget(self) self.txt_html.setFixedWidth(450) self.frmHtml.addRow(self.txt_html) self.frmOutput.addRow(self.ListOutputWid) # button stop,start self.btn_start_template = QtGui.QPushButton('Start Server') self.btn_stop_template = QtGui.QPushButton('Stop Server') self.btn_start_template.setIcon(QtGui.QIcon('icons/start.png')) self.btn_stop_template.setIcon(QtGui.QIcon('icons/Stop.png')) self.btn_stop_template.setEnabled(False) self.btn_start_template.setFixedWidth(110) self.btn_stop_template.setFixedWidth(110) self.btn_start_template.clicked.connect(self.start_server) # group create self.GroupSettings = QtGui.QGroupBox(self) self.GroupCheckBox = QtGui.QGroupBox(self) self.GroupCloneSite = QtGui.QGroupBox(self) self.GroupSettings.setTitle('settings:') self.GroupCheckBox.setTitle('Options:') self.GroupCloneSite.setTitle('clone:') # left layout self.txt_html.setPlainText( '<html>\n<head>\n<title>WiFi-Pumpkin Phishing </title>' '\n</head>\n<body>\n' '\n<h3 align=\'center\'>WiFi-Pumpkin Framework</h3>\n' '\n<p align=\'center\'>this is demo Attack Redirect.</p>\n' '\n</body>\n</html>') # connect checkbox self.check_beef.clicked.connect(self.check_options) self.check_custom.clicked.connect(self.check_options) self.check_server.clicked.connect(self.check_options) self.check_clone.clicked.connect(self.check_options) # connect buttons self.btn_stop_template.clicked.connect(self.killThread) # checkboxs self.frmCheckBox.addRow(self.check_custom, self.check_server) self.frmCheckBox.addRow(self.check_beef, self.check_clone) self.frmCheckBox.addRow(self.GroupSettings) # settings self.frmSettings.addRow('IP Address:', self.txt_redirect) self.frmSettings.addRow('Port:', self.BoxPort) self.frmSettings.addRow("Beef Hook URL:", self.EditBeef) self.frmSettings.addRow("SetEnv PATH :", self.EditDirectory) # buttons self.frmButtons.addRow(self.btn_start_template, self.btn_stop_template) # clone self.frmClone.addRow(self.cloneLineEdit) # page right self.GroupCheckBox.setLayout(self.frmCheckBox) self.GroupSettings.setLayout(self.frmSettings) self.GroupCloneSite.setLayout(self.frmClone) self.frmright.addRow(self.GroupCheckBox) self.frmright.addRow(self.GroupCloneSite) self.frmright.addRow(self.GroupSettings) self.frmright.addRow(self.frmButtons) # page left self.Group_Html.setLayout(self.frmHtml) self.Group_List.setLayout(self.frmOutput) self.frmleft.addRow(self.Group_Html) self.frmleft.addRow(self.Group_List) layout = QtGui.QHBoxLayout() layout.addLayout(self.frmleft) layout.addLayout(self.frmright) self.Main.addLayout(layout) self.Main.addWidget(self.statusBar) self.setLayout(self.Main)