def ProcessReadLogger(self): if path.exists('Logs/AccessPoint/injectionPage.log'): self.injectionThread = ThreadPopen(['tail','-f','Logs/AccessPoint/injectionPage.log']) self.connect(self.injectionThread,SIGNAL('Activated ( QString ) '), self.GetloggerInjection) self.injectionThread.setObjectName('Pump-Proxy::Capture') return self.injectionThread.start() QMessageBox.warning(self,'error proxy logger','Pump-Proxy::capture is not found')
def start_dift(self): if self.ConfigTwin['ProgCheck'][2]: if self.ConfigTwin['ProgCheck'][6]: if self.FSettings.Settings.get_setting('accesspoint','statusAP',format=bool): Thread_driftnet = ThreadPopen(['driftnet', '-i', self.ConfigTwin['AP_iface'],'-d','./Logs/Tools/Driftnet/',]) Thread_driftnet.setObjectName('Tool::Driftnet') self.Apthreads['RougeAP'].append(Thread_driftnet) return Thread_driftnet.start() return QMessageBox.information(self,'Accesspoint is not running', 'The access point is not configured, this option require AP is running...') return QMessageBox.information(self,'xterm','xterm is not installed.') return QMessageBox.information(self,'driftnet','driftnet is not found.')
def start_etter(self): if self.ConfigTwin['ProgCheck'][1]: if self.ConfigTwin['ProgCheck'][6]: if self.FSettings.Settings.get_setting('accesspoint','statusAP',format=bool): Thread_Ettercap = ThreadPopen(['sudo', 'xterm', '-geometry', '73x25-1+50', '-T', 'ettercap', '-s', '-sb', '-si', '+sk', '-sl', '5000', '-e', 'ettercap', '-p', '-u', '-T', '-q', '-w', 'Logs/Tools/ettercap.log', '-i', self.ConfigTwin['AP_iface']]) Thread_Ettercap.setObjectName('Tool::Ettercap') self.Apthreads['RougeAP'].append(Thread_Ettercap) return Thread_Ettercap.start() return QMessageBox.information(self,'Accesspoint is not running', 'The access point is not configured, this option require AP is running...') return QMessageBox.information(self,'xterm','xterm is not installed.') return QMessageBox.information(self,'ettercap','ettercap is not found.')
def ProcessReadLogger(self): if path.exists('Logs/AccessPoint/injectionPage.log'): with open('Logs/AccessPoint/injectionPage.log','w') as bufferlog: bufferlog.write(''), bufferlog.close() filelist = [ f for f in listdir('Logs/AccessPoint/.') if f.endswith('.log.offset') ] for f in filelist: system('rm Logs/AccessPoint/{}'.format(f)) self.injectionThread = ThreadPopen(['tail','-f','Logs/AccessPoint/injectionPage.log']) self.connect(self.injectionThread,SIGNAL('Activated ( QString ) '), self.GetloggerInjection) self.injectionThread.setObjectName('Pump-Proxy::Capture') return self.injectionThread.start() QMessageBox.warning(self,'error proxy logger','Pump-Proxy::capture is not found')
class PumpkinProxy(QVBoxLayout): ''' settings Transparent Proxy ''' sendError = pyqtSignal(str) _PluginsToLoader = {'Plugins': None,'Content':''} def __init__(self,popup,main_method,FsettingsUI=None,parent = None): super(PumpkinProxy, self).__init__(parent) self.main_method = main_method self.popup = popup self.urlinjected= [] self.FSettings = FsettingsUI self.mainLayout = QVBoxLayout() #scroll area self.scrollwidget = QWidget() self.scrollwidget.setLayout(self.mainLayout) self.scroll = QScrollArea() self.scroll.setWidgetResizable(True) self.scroll.setWidget(self.scrollwidget) # create widgets self.argsLabel = QLabel('') self.hBox = QHBoxLayout() self.hBoxargs = QHBoxLayout() self.btnLoader = QPushButton('Reload') self.btnEnable = QPushButton('Enable') self.btncancel = QPushButton('Cancel') self.btnbrownser= QPushButton('Browser') # size buttons self.btnLoader.setFixedWidth(100) self.btnEnable.setFixedWidth(100) self.btncancel.setFixedWidth(100) self.btnbrownser.setFixedWidth(100) self.comboxBox = QComboBox() self.log_inject = QListWidget() self.docScripts = QTextEdit() self.argsScripts= QLineEdit() self.btncancel.setIcon(QIcon('Icons/cancel.png')) self.btnLoader.setIcon(QIcon('Icons/search.png')) self.btnEnable.setIcon(QIcon('Icons/accept.png')) self.btnbrownser.setIcon(QIcon("Icons/open.png")) self.argsScripts.setEnabled(False) self.btnbrownser.setEnabled(False) # group settings self.GroupSettings = QGroupBox() self.GroupSettings.setTitle('Settings:') self.SettingsLayout = 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 = QGroupBox() self.GroupLogger.setTitle('Logger Injection:') self.LoggerLayout = QVBoxLayout() self.LoggerLayout.addWidget(self.log_inject) self.GroupLogger.setLayout(self.LoggerLayout) #self.GroupLogger.setFixedWidth(450) #group descriptions self.GroupDoc = QGroupBox() self.GroupDoc.setTitle('Description:') self.DocLayout = 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,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 = QHBoxLayout() self.layout.addWidget(self.scroll) self.addLayout(self.layout) def get_filenameToInjection(self): filename = QFileDialog.getOpenFileName(None, 'load File','','HTML (*.html);;js (*.js);;css (*.css)') if len(filename) > 0: self.argsScripts.setText(filename) QMessageBox.information(None, 'Scripts Loaders', 'file has been loaded with success.') def setPluginsActivated(self): item = str(self.comboxBox.currentText()) if self.popup.check_dns2proy.isChecked() or self.popup.check_sergioProxy.isChecked(): if self.plugins[str(item)]._requiresArgs: if len(self.argsScripts.text()) != 0: self._PluginsToLoader['Plugins'] = item self._PluginsToLoader['Content'] = str(self.argsScripts.text()) else: return self.sendError.emit('this module proxy requires {} args'.format(self.argsLabel.text())) else: self._PluginsToLoader['Plugins'] = item self.btnEnable.setEnabled(False) self.ProcessReadLogger() return self.main_method.set_proxy_scripts(True) self.sendError.emit('Plugins::Proxy is not enabled.' '\n\nthis module need a proxy server(sslstrip) to work,' '\nchoice the plugin options with sslstrip enabled.'.format(self.argsLabel.text())) def ProcessReadLogger(self): if path.exists('Logs/AccessPoint/injectionPage.log'): with open('Logs/AccessPoint/injectionPage.log','w') as bufferlog: bufferlog.write(''), bufferlog.close() self.injectionThread = ThreadPopen(['tail','-f','Logs/AccessPoint/injectionPage.log']) self.connect(self.injectionThread,SIGNAL('Activated ( QString ) '), self.GetloggerInjection) self.injectionThread.setObjectName('Pump-Proxy::Capture') return self.injectionThread.start() QMessageBox.warning(self,'error proxy logger','Pump-Proxy::capture is not found') def GetloggerInjection(self,data): if Refactor.getSize('Logs/AccessPoint/injectionPage.log') > 255790: with open('Logs/AccessPoint/injectionPage.log','w') as bufferlog: bufferlog.write(''), bufferlog.close() if data not in self.urlinjected: self.log_inject.addItem(data) self.urlinjected.append(data) self.log_inject.scrollToBottom() def readDocScripts(self,item): try: self.docScripts.setText(self.plugins[str(item)].__doc__) if self.plugins[str(item)]._requiresArgs: if 'FilePath' in self.plugins[str(item)]._argsname: self.btnbrownser.setEnabled(True) else: self.btnbrownser.setEnabled(False) self.argsScripts.setEnabled(True) self.argsLabel.setText(self.plugins[str(item)]._argsname) else: self.argsScripts.setEnabled(False) self.btnbrownser.setEnabled(False) self.argsLabel.setText('') except Exception: pass def unsetPluginsConf(self): if hasattr(self,'injectionThread'): self.injectionThread.stop() self._PluginsToLoader = {'Plugins': None,'args':''} self.btnEnable.setEnabled(True) self.main_method.set_proxy_scripts(False) self.argsScripts.clear() self.log_inject.clear() self.urlinjected = [] def SearchProxyPlugins(self): self.comboxBox.clear() self.plugin_classes = Plugin.PluginProxy.__subclasses__() self.plugins = {} for p in self.plugin_classes: self.plugins[p._name] = p() self.comboxBox.addItems(self.plugins.keys())
class PumpkinProxy(QVBoxLayout): ''' settings Transparent Proxy ''' sendError = pyqtSignal(str) _PluginsToLoader = {'Plugins': None,'Content':''} def __init__(self,popup,parent = None): super(PumpkinProxy, self).__init__(parent) self.popup = popup self.urlinjected= [] self.FSettings = frm_Settings() self.Home = QFormLayout() self.statusbar = QStatusBar() self.lname = QLabel('Proxy::scripts::') self.lstatus = QLabel('') self.argsLabel = QLabel('') self.hBox = QHBoxLayout() self.hBoxargs = QHBoxLayout() self.btnLoader = QPushButton('Reload') self.btnEnable = QPushButton('Enable') self.btncancel = QPushButton('Cancel') self.btnbrownser= QPushButton('Browser') self.comboxBox = QComboBox() self.log_inject = QListWidget() self.docScripts = QTextEdit() self.argsScripts= QLineEdit() self.btncancel.setIcon(QIcon('Icons/cancel.png')) self.btnLoader.setIcon(QIcon('Icons/search.png')) self.btnEnable.setIcon(QIcon('Icons/accept.png')) self.btnbrownser.setIcon(QIcon("Icons/open.png")) self.statusbar.addWidget(self.lname) self.statusbar.addWidget(self.lstatus) self.docScripts.setFixedHeight(40) self.statusInjection(False) self.argsScripts.setEnabled(False) self.btnbrownser.setEnabled(False) # group settings self.GroupSettings = QGroupBox() self.GroupSettings.setTitle('Settings:') self.SettingsLayout = 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) #group logger self.GroupLogger = QGroupBox() self.GroupLogger.setTitle('Logger Injection:') self.LoggerLayout = QFormLayout() self.LoggerLayout.addRow(self.log_inject) self.GroupLogger.setLayout(self.LoggerLayout) #group descriptions self.GroupDoc = QGroupBox() self.GroupDoc.setTitle('Description:') self.DocLayout = QFormLayout() self.DocLayout.addRow(self.docScripts) self.GroupDoc.setLayout(self.DocLayout) #connections self.SearchProxyPlugins() self.readDocScripts('html_injector') self.btnLoader.clicked.connect(self.SearchProxyPlugins) self.connect(self.comboxBox,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.Home.addRow(self.GroupSettings) self.Home.addRow(self.GroupDoc) self.Home.addRow(self.GroupLogger) self.Home.addRow(self.statusbar) self.addLayout(self.Home) def get_filenameToInjection(self): filename = QFileDialog.getOpenFileName(None, 'load File','','HTML (*.html);;js (*.js);;css (*.css)') if len(filename) > 0: self.argsScripts.setText(filename) QMessageBox.information(None, 'Scripts Loaders', 'file has been loaded with success.') def setPluginsActivated(self): if self.popup.check_sslstrip.isChecked(): item = str(self.comboxBox.currentText()) if self.plugins[str(item)]._requiresArgs: if len(self.argsScripts.text()) != 0: self._PluginsToLoader['Plugins'] = item self._PluginsToLoader['Content'] = str(self.argsScripts.text()) else: return self.sendError.emit('this module proxy requires {} args'.format(self.argsLabel.text())) else: self._PluginsToLoader['Plugins'] = item self.btnEnable.setEnabled(False) self.ProcessReadLogger() return self.statusInjection(True) self.sendError.emit('sslstrip is not enabled.'.format(self.argsLabel.text())) def ProcessReadLogger(self): if path.exists('Logs/AccessPoint/injectionPage.log'): self.injectionThread = ThreadPopen(['tail','-f','Logs/AccessPoint/injectionPage.log']) self.connect(self.injectionThread,SIGNAL('Activated ( QString ) '), self.GetloggerInjection) self.injectionThread.setObjectName('Pump-Proxy::Capture') return self.injectionThread.start() QMessageBox.warning(self,'error proxy logger','Pump-Proxy::capture is not found') def GetloggerInjection(self,data): if data not in self.urlinjected: self.log_inject.addItem(data) self.urlinjected.append(data) self.log_inject.scrollToBottom() def statusInjection(self,server): if server: self.lstatus.setText('[ ON ]') self.lstatus.setStyleSheet('QLabel { color : green; }') else: self.lstatus.setText('[ OFF ]') self.lstatus.setStyleSheet('QLabel { color : red; }') def readDocScripts(self,item): try: self.docScripts.setText(self.plugins[str(item)].__doc__) if self.plugins[str(item)]._requiresArgs: if 'FilePath' in self.plugins[str(item)]._argsname: self.btnbrownser.setEnabled(True) else: self.btnbrownser.setEnabled(False) self.argsScripts.setEnabled(True) self.argsLabel.setText(self.plugins[str(item)]._argsname) else: self.argsScripts.setEnabled(False) self.btnbrownser.setEnabled(False) self.argsLabel.setText('') except Exception: pass def unsetPluginsConf(self): if hasattr(self,'injectionThread'): self.injectionThread.stop() self._PluginsToLoader = {'Plugins': None,'args':''} self.btnEnable.setEnabled(True) self.statusInjection(False) self.argsScripts.clear() self.log_inject.clear() self.urlinjected = [] def SearchProxyPlugins(self): self.comboxBox.clear() self.plugin_classes = Plugin.PluginProxy.__subclasses__() self.plugins = {} for p in self.plugin_classes: self.plugins[p._name] = p() self.comboxBox.addItems(self.plugins.keys())