From 66954cfa567ba90ac1c38baafbbc9decd5fd7aa0 Mon Sep 17 00:00:00 2001 From: mh4x0f Date: Sat, 16 Jul 2016 20:01:33 -0300 Subject: [PATCH] WiFi-Pumpkin v0.7.8 Release --- CHANGELOG | 7 ++ Core/Main.py | 82 ++++++++++++----------- Core/Utils.py | 8 ++- Core/config/app/config.ini | 4 +- Core/config/commits/Lcommits.cfg | 9 +++ Core/helpers/update.py | 5 +- Core/loaders/Stealth/PackagesUI.py | 2 +- Core/utility/threads.py | 78 +++++++++++++++------- Core/widgets/PopupModels.py | 100 ++++++++++++++++------------- Core/widgets/TabModels.py | 7 +- Modules/poisoners/ArpPosion.py | 54 +++++----------- Modules/poisoners/DnsSpoof.py | 54 +++++----------- installer.sh | 2 +- 13 files changed, 213 insertions(+), 199 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 895df95..fd33c89 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,10 @@ +Version 0.7.8 +------------- +- moved progressBar to statusBar +- fixed thread scanner IP in Modules::DNS,ARP spoof +- changed plugins options to sslstrip+/dns2proxy, sslstrip/sergio-proxy +- added option run AP without Proxy + Version 0.7.5 ------------- - fixed size QTableWidget on modules diff --git a/Core/Main.py b/Core/Main.py index 9963b0a..83a7ddf 100644 --- a/Core/Main.py +++ b/Core/Main.py @@ -73,8 +73,8 @@ author = 'Marcos Nesster (@mh4x0f) P0cl4bs Team' emails = ['mh4root@gmail.com','p0cl4bs@gmail.com'] license = ' GNU GPL 3' -version = '0.7.5' -update = '07/05/2016' # This is Brasil :D +version = '0.7.8' +update = '16/07/2016' # This is Brasil :D desc = ['Framework for Rogue Wi-Fi Access Point Attacks'] class Initialize(QMainWindow): @@ -83,7 +83,7 @@ def __init__(self, parent=None): super(Initialize, self).__init__(parent) self.FSettings = frm_Settings() self.form_widget = WifiPumpkin(self,self,self.FSettings) - self.form_widget.setFixedHeight(540) + self.form_widget.setFixedHeight(520) self.form_widget.setFixedWidth(370) dock = QDockWidget() dock.setTitleBarWidget(QWidget()) @@ -214,7 +214,7 @@ def SettingsTABContent(self): self.ContentTabsettings.addLayout(self.PumpSettingsTAB) def DefaultTABContent(self): - self.StatusBar = QStatusBar() + self.StatusBar = QStatusBar(self) self.StatusBar.setFixedHeight(15) self.StatusBar.addWidget(QLabel("::Access|Point::")) self.StatusDhcp = QLabel("") @@ -222,7 +222,9 @@ def DefaultTABContent(self): self.StatusDhcp = QLabel('') self.StatusBar.addWidget(self.StatusDhcp) self.Started(False) - self.StatusBar.addWidget(QLabel(''),20) + self.progress = ProgressBarWid(total=101) + self.progress.setFixedHeight(30) + self.StatusBar.addWidget(self.progress,20) self.StatusBar.addWidget(QLabel("::Clients::")) self.connectedCount.setText("0") self.connectedCount.setStyleSheet("QLabel { color : yellow; }") @@ -307,9 +309,6 @@ def DefaultTABContent(self): self.slipt.addWidget(self.GroupAP) self.slipt.addWidget(self.GroupAdapter) - self.progress = ProgressBarWid(total=101) - self.progress.setFixedHeight(20) - self.FormGroup2.addRow(self.progress) self.FormGroup2.addRow(hBox) self.FormGroup2.addRow(self.TabInfoAP) self.FormGroup2.addRow(self.StatusBar) @@ -509,18 +508,17 @@ def logdns2proxy(self): self.Fdns2proxy.show() def checkPlugins(self): - if self.FSettings.Settings.get_setting('plugins','sslstrip_plugin',format=bool): - self.PopUpPlugins.check_sslstrip.setChecked(True) - self.PopUpPlugins.set_sslStripRule() if self.FSettings.Settings.get_setting('plugins','netcreds_plugin',format=bool): self.PopUpPlugins.check_netcreds.setChecked(True) if self.FSettings.Settings.get_setting('plugins','dns2proxy_plugin',format=bool): self.PopUpPlugins.check_dns2proy.setChecked(True) - self.PopUpPlugins.set_Dns2proxyRule() - if self.FSettings.Settings.get_setting('plugins','sergioproxy_plugin',format=bool): + self.PopUpPlugins.checkGeneralOptions() + elif self.FSettings.Settings.get_setting('plugins','sergioproxy_plugin',format=bool): self.PopUpPlugins.check_sergioProxy.setChecked(True) - if not self.FSettings.Settings.get_setting('plugins','sslstrip_plugin',format=bool): - self.PopUpPlugins.set_sslStripRule() + self.PopUpPlugins.checkGeneralOptions() + elif self.FSettings.Settings.get_setting('plugins','noproxy',format=bool): + self.PopUpPlugins.check_noproxy.setChecked(True) + self.PopUpPlugins.checkGeneralOptions() def Started(self,bool): if bool: @@ -560,7 +558,7 @@ def GetDHCPRequests(self,data): hostname = item[data[4]] except: hostname = 'unknown' - if hostname == None:hostname = 'unknown' + if hostname == None or len(hostname) == 0:hostname = 'unknown' self.APclients[data[4]] = {'IP': data[2],'device': hostname, 'in_tables': False,} self.StatusDHCPRequests(data[4],self.APclients[data[4]]) @@ -616,7 +614,7 @@ def mConfigure(self): for i in lista:self.ConfigTwin['ProgCheck'].append(path.isfile(i)) def exportHTML(self): - contents = Refactor.exportHtml() + contents = Refactor.exportHtml(remove_dns2proxy=True) filename = QFileDialog.getSaveFileNameAndFilter(self, 'Save File Logger HTML','report.html','HTML (*.html)') if len(filename) != 0: @@ -633,6 +631,7 @@ def refrash_interface(self): def kill(self): if self.Apthreads['RougeAP'] == []: return + print('-------------------------------') self.ProxyPluginsTAB.GroupSettings.setEnabled(True) self.FSettings.Settings.set_setting('accesspoint','statusAP',False) if hasattr(self,'dockAreaList'): @@ -816,9 +815,10 @@ def StartApFake(self): 'now you have choose the Class range different of your network.') self.btn_start_attack.setDisabled(True) popen('ulimit -n 64000') - + print('\n[*] Loading debugging mode') self.APactived = self.FSettings.Settings.get_setting('accesspoint','using') if self.APactived == 'hostapd': + print('[*] Configuring hostapd...') self.ConfigTwin['AP_iface'] = str(self.selectCard.currentText()) if str(self.interfacesLink['activated']).startswith('eth') or \ str(self.interfacesLink['activated']).startswith('enp'): @@ -860,6 +860,7 @@ def StartApFake(self): self.Apthreads['RougeAP'].append(self.Thread_hostapd) # thread dhcp + print('[*] Configuring dhcpd...') popen('ifconfig {} up'.format(str(self.selectCard.currentText()))) selected_dhcp = self.FSettings.Settings.get_setting('accesspoint','dhcp_server') if selected_dhcp == 'iscdhcpserver': @@ -882,33 +883,12 @@ def StartApFake(self): self.FSettings.Settings.set_setting('accesspoint','interfaceAP',str(self.selectCard.currentText())) - if self.PopUpPlugins.check_sslstrip.isChecked() or not self.PopUpPlugins.check_dns2proy.isChecked(): - popen('iptables -t nat -A PREROUTING -p udp -j DNAT --to {}'.format(str(self.EditGateway.text()))) # load ProxyPLugins self.plugin_classes = Plugin.PluginProxy.__subclasses__() self.plugins = {} for p in self.plugin_classes: self.plugins[p._name] = p() - # thread plugins - if self.PopUpPlugins.check_sslstrip.isChecked() and not self.PopUpPlugins.check_sergioProxy.isChecked(): - self.Threadsslstrip = Thread_sslstrip(self.ConfigTwin['PortRedirect'], - self.plugins,self.ProxyPluginsTAB._PluginsToLoader) - self.Threadsslstrip.setObjectName("sslstrip") - self.Apthreads['RougeAP'].append(self.Threadsslstrip) - - elif not self.PopUpPlugins.check_sslstrip.isChecked() and self.PopUpPlugins.check_sergioProxy.isChecked(): - self.Threadsslstrip = Thread_sergioProxy(self.ConfigTwin['PortRedirect'], - self.plugins,self.ProxyPluginsTAB._PluginsToLoader) - self.Threadsslstrip.setObjectName("sslstrip") - self.Apthreads['RougeAP'].append(self.Threadsslstrip) - - elif self.PopUpPlugins.check_sergioProxy.isChecked() and self.PopUpPlugins.check_sergioProxy.isChecked(): - self.Threadsslstrip = Thread_sergioProxy(self.ConfigTwin['PortRedirect'], - self.plugins,self.ProxyPluginsTAB._PluginsToLoader) - self.Threadsslstrip.setObjectName("sslstrip") - self.Apthreads['RougeAP'].append(self.Threadsslstrip) - if self.PopUpPlugins.check_netcreds.isChecked(): self.Thread_netcreds = ProcessThread({'python':['Plugins/net-creds/net-creds.py','-i', str(self.selectCard.currentText())]}) @@ -921,6 +901,20 @@ def StartApFake(self): self.Thread_dns2proxy.setObjectName('Dns2Proxy') self.Apthreads['RougeAP'].append(self.Thread_dns2proxy) + # thread plugins + if self.PopUpPlugins.check_dns2proy.isChecked(): + self.Threadsslstrip = Thread_sslstrip(self.ConfigTwin['PortRedirect'], + self.plugins,self.ProxyPluginsTAB._PluginsToLoader) + self.Threadsslstrip.setObjectName("sslstrip2") + self.Apthreads['RougeAP'].append(self.Threadsslstrip) + + elif self.PopUpPlugins.check_sergioProxy.isChecked(): + self.Threadsslstrip = Thread_sergioProxy(self.ConfigTwin['PortRedirect'], + self.plugins,self.ProxyPluginsTAB._PluginsToLoader) + self.Threadsslstrip.setObjectName("sslstrip") + self.Apthreads['RougeAP'].append(self.Threadsslstrip) + + iptables = [] for index in xrange(self.FSettings.ListRules.count()): iptables.append(str(self.FSettings.ListRules.item(index).text())) @@ -934,12 +928,11 @@ def StartApFake(self): #self.PumpSettingsTAB.GroupArea.setEnabled(False) self.progress.change_color('#FFA500') for thread in self.Apthreads['RougeAP']: - thread.start() - self.progress.setText(thread.getNameThread()) self.progress.update_bar_simple(20) QThread.sleep(3) + thread.start() self.progress.setValue(100) - self.progress.change_color('grey') + self.progress.change_color('#FFA500') self.progress.setText('') if self.FSettings.Settings.get_setting('dockarea','advanced',format=bool): QThread.sleep(3) @@ -950,6 +943,11 @@ def StartApFake(self): for f in filelist: system('rm Logs/AccessPoint/{}'.format(f)) for dock in self.dockAreaList.keys(): self.dockAreaList[dock].RunThread() + if self.PopUpPlugins.check_noproxy.isChecked() or self.PopUpPlugins.check_sergioProxy.isChecked(): + popen('iptables -t nat -A PREROUTING -p udp -j DNAT --to {}'.format(str(self.EditGateway.text()))) + print('AP::[{}] Running...'.format(self.EditApName.text())) + print('AP::BSSID::[{}] CH {}'.format(Refactor.get_interface_mac( + self.selectCard.currentText()),self.EditChannel.text())) def create_sys_tray(self): self.sysTray = QSystemTrayIcon(self) diff --git a/Core/Utils.py b/Core/Utils.py index 93b66e2..52823c1 100644 --- a/Core/Utils.py +++ b/Core/Utils.py @@ -115,15 +115,17 @@ def htmlContent(title): } return html @staticmethod - def exportHtml(): + def exportHtml(remove_dns2proxy=False,remove_inject=False): readFile = { 'dhcp': {'Logs/AccessPoint/dhcp.log':[]}, 'urls': {'Logs/AccessPoint/urls.log':[]}, 'credentials': {'Logs/AccessPoint/credentials.log':[]}, 'requestAP': {'Logs/AccessPoint/requestAP.log':[]}, - #'dns2proxy': {'Logs/AccessPoint/dns2proxy.log':[]}, - #'injectionPage': {'Logs/AccessPoint/injectionPage.log':[]}, + 'dns2proxy': {'Logs/AccessPoint/dns2proxy.log':[]}, + 'injectionPage': {'Logs/AccessPoint/injectionPage.log':[]}, 'phishing': {'Logs/Phishing/Webclone.log':[]},} + if remove_dns2proxy: readFile.pop('dns2proxy') + elif remove_inject: readFile.pop('injectionPage') for i in readFile.keys(): for j in readFile[i]: with open(j,'r') as file: diff --git a/Core/config/app/config.ini b/Core/config/app/config.ini index 29de6c7..d9df406 100644 --- a/Core/config/app/config.ini +++ b/Core/config/app/config.ini @@ -69,10 +69,10 @@ dock_credencials=true dock_urlmonitor=true [plugins] -sslstrip_plugin=true +noproxy=false netcreds_plugin=true dns2proxy_plugin=true -sergioproxy_plugin=true +sergioproxy_plugin=false [iptables] iptables_accept=iptables -P FORWARD ACCEPT diff --git a/Core/config/commits/Lcommits.cfg b/Core/config/commits/Lcommits.cfg index 774a04b..227f384 100644 --- a/Core/config/commits/Lcommits.cfg +++ b/Core/config/commits/Lcommits.cfg @@ -1,4 +1,13 @@ master: +[ + { Version: '0.7.8'} + { changelog : 'moved ProgressBar to StatusBar' }, + { changelog : 'fixed thread scanner IP in Modules::DNS,ARP spoof' }, + { changelog : 'changed plugins options to sslstrip/dns2proxy, sslstrip/sergio-proxy' }, + { changelog : 'added option run AP without Proxy' }, +] + +WiFiPumpkin: [ { Version: '0.7.5'} { changelog : 'fixed size QTableWidget on modules' }, diff --git a/Core/helpers/update.py b/Core/helpers/update.py index e85fd00..9358040 100644 --- a/Core/helpers/update.py +++ b/Core/helpers/update.py @@ -150,6 +150,9 @@ def __init__(self, parent=None, total=0): super(ProgressBarWid, self).__init__() self.setMinimum(1) self.setMaximum(total) + font=QFont('White Rabbit') + font.setPointSize(5) + self.setFont(font) self._active = False self.setAlignment(Qt.AlignCenter) self._text = None @@ -165,8 +168,6 @@ def text(self): def update_bar_simple(self, add): value = self.value() + add self.setValue(value) - if value > 50: - self.change_color("green") def update_bar(self, add): while True: diff --git a/Core/loaders/Stealth/PackagesUI.py b/Core/loaders/Stealth/PackagesUI.py index 0f5af15..0aebb25 100644 --- a/Core/loaders/Stealth/PackagesUI.py +++ b/Core/loaders/Stealth/PackagesUI.py @@ -4,7 +4,7 @@ from subprocess import Popen,PIPE from Core.utility.settings import frm_Settings from Modules.servers.PhishingManager import frm_PhishingManager -from Core.utility.threads import ThreadPopen,ThreadScan,ProcessThread +from Core.utility.threads import ThreadPopen,ThreadScan,ProcessThread,ThreadFastScanIP from Core.packets.network import ThARP_posion,ThSpoofAttack class PumpkinModule(QWidget): ''' this is Qwidget Module base ''' diff --git a/Core/utility/threads.py b/Core/utility/threads.py index 027abd6..1166b82 100644 --- a/Core/utility/threads.py +++ b/Core/utility/threads.py @@ -4,13 +4,14 @@ import threading from sys import stdout from time import asctime -from os import path,stat,getpgid,setsid,killpg +from os import path,stat,getpgid,setsid,killpg,devnull from twisted.web import http from twisted.internet import reactor -from Core.Utils import setup_logger +from Core.Utils import setup_logger,Refactor from subprocess import (Popen,PIPE,STDOUT) from PyQt4.QtCore import QThread,pyqtSignal,SIGNAL,pyqtSlot,QProcess,QObject,SLOT from Plugins.sergio_proxy.plugins import * +from multiprocessing import Process,Manager try: from nmap import PortScanner except ImportError: @@ -23,10 +24,10 @@ def __init__(self,cmd): self.process = None def getNameThread(self): - return 'Starting Thread:' + self.objectName() + return '[New Thread {} ({})]'.format(self.currentThreadId(),self.objectName()) def run(self): - print 'Starting Thread:' + self.objectName() + print '[New Thread {} ({})]'.format(self.currentThreadId(),self.objectName()) self.process = Popen(self.cmd,stdout=PIPE,stderr=STDOUT,close_fds=True) for line in iter(self.process.stdout.readline, b''): self.emit(SIGNAL('Activated( QString )'),line.rstrip()) @@ -46,10 +47,10 @@ def __init__(self,args): self.process = None def getNameThread(self): - return 'Starting Thread:' + self.objectName() + return '[New Thread {} ({})]'.format(self.currentThreadId(),self.objectName()) def run(self): - print 'Starting Thread:' + self.objectName() + print '[New Thread {} ({})]'.format(self.currentThreadId(),self.objectName()) self.process = Popen(self.args, stdout=PIPE,stderr=STDOUT,preexec_fn=setsid) setup_logger('dhcp', './Logs/AccessPoint/dhcp.log') @@ -63,7 +64,7 @@ def run(self): loggerDhcp.info(data.rstrip()) def stop(self): - print 'Stop thread:' + self.objectName() + print 'Thread::[{}] successfully stopped.'.format(self.objectName()) if self.process is not None: killpg(getpgid(self.process.pid), signal.SIGTERM) @@ -94,6 +95,38 @@ def run(self): except NameError: QMessageBox.information(self,'error module','the module Python-nmap not installed') +class ThreadFastScanIP(QThread): + sendDictResultscan = pyqtSignal(object) + def __init__(self,gateway,iprange,parent=None): + super(ThreadFastScanIP, self).__init__(parent) + self.ip_range = str(iprange).split('-') + self.workingThread = True + self.gatewayNT = gateway[:len(gateway)-len(gateway.split('.').pop())] + + def run(self): + self.jobs = [] + manager = Manager() + on_ips = manager.dict() + for n in xrange(int(self.ip_range[0]),int(self.ip_range[1])): + ip='%s{0}'.format(n)%(self.gatewayNT) + if not self.workingThread: break + p = Process(target=self.working,args=(ip,on_ips)) + self.jobs.append(p) + p.start() + for proc in self.jobs: proc.join() + self.sendDictResultscan.emit(on_ips) + + def working(self,ip,lista): + with open(devnull, 'wb') as limbo: + result=Popen(['ping', '-c', '1', '-n', '-W', '1', ip], + stdout=limbo, stderr=limbo).wait() + if not result: + if Refactor.get_mac(ip) == None: + lista[ip] = ip + '|' + 'not found' + else: + lista[ip] = ip + '|' + Refactor.get_mac(ip) + def stop(self): + self.workingThread = False class ProcessThread(QObject): @@ -102,21 +135,21 @@ def __init__(self,cmd,): self.cmd = cmd def getNameThread(self): - return 'Starting Thread:' + self.objectName() + return '[New Thread {} ({})]'.format(self.procThread.pid(),self.objectName()) @pyqtSlot() def readProcessOutput(self): self.data = str(self.procThread.readAllStandardOutput()) def start(self): - print 'Starting Thread:' + self.objectName() self.procThread = QProcess(self) self.procThread.setProcessChannelMode(QProcess.MergedChannels) QObject.connect(self.procThread, SIGNAL('readyReadStandardOutput()'), self, SLOT('readProcessOutput()')) self.procThread.start(self.cmd.keys()[0],self.cmd[self.cmd.keys()[0]]) + print '[New Thread {} ({})]'.format(self.procThread.pid(),self.objectName()) def stop(self): - print 'Stop thread:' + self.objectName() + print 'Thread::[{}] successfully stopped.'.format(self.objectName()) if hasattr(self,'procThread'): self.procThread.terminate() self.procThread.waitForFinished() @@ -130,7 +163,7 @@ def __init__(self,cmd): self.cmd = cmd def getNameThread(self): - return 'Starting Thread:' + self.objectName() + return '[New Thread {} ({})]'.format(self.procHostapd.pid(),self.objectName()) @pyqtSlot() def read_OutputCommand(self): @@ -139,19 +172,19 @@ def read_OutputCommand(self): self.statusAP_connected.emit(self.data.split()[2]) def start(self): - print 'Starting Thread:' + self.objectName() self.makeLogger() self.procHostapd = QProcess(self) self.procHostapd.setProcessChannelMode(QProcess.MergedChannels) QObject.connect(self.procHostapd, SIGNAL('readyReadStandardOutput()'), self, SLOT('read_OutputCommand()')); self.procHostapd.start(self.cmd.keys()[0],self.cmd[self.cmd.keys()[0]]) + print '[New Thread {} ({})]'.format(self.procHostapd.pid(),self.objectName()) def makeLogger(self): setup_logger('hostapd', './Logs/AccessPoint/requestAP.log') self.log_hostapd = logging.getLogger('hostapd') def stop(self): - print 'Stop thread:' + self.objectName() + print 'Thread::[{}] successfully stopped.'.format(self.objectName()) if hasattr(self,'procHostapd'): self.procHostapd.terminate() self.procHostapd.waitForFinished() @@ -166,18 +199,16 @@ def __init__(self,port,plugins={},data= {}): self.loaderPlugins = data def getNameThread(self): - return 'Starting Thread:' + self.objectName() + return '[New Thread {} ({})]'.format(self.currentThreadId(),self.objectName()) def run(self): + print 'SSLstrip v0.9 + POC by Leonardo Nve' killSessions = True spoofFavicon = False listenPort = self.port from Plugins.sslstrip.StrippingProxy import StrippingProxy from Plugins.sslstrip.URLMonitor import URLMonitor from Plugins.sslstrip.CookieCleaner import CookieCleaner - print 'Starting Thread:' + self.objectName() - print 'SSLstrip v0.9 by Moxie Marlinspike (@xtr4nge v0.9.2)::Online' - print "+ POC by Leonardo Nve" if self.loaderPlugins['Plugins'] != None: self.plugins[self.loaderPlugins['Plugins']].getInstance()._activated = True self.plugins[self.loaderPlugins['Plugins']].getInstance().setInjectionCode( @@ -193,8 +224,8 @@ def run(self): except Exception: pass def stop(self): - print 'Stop thread:' + self.objectName() - + print 'Thread::[{}] successfully stopped.'.format(self.objectName()) + reactor.callFromThread(reactor.stop) class Thread_sergioProxy(QThread): @@ -206,7 +237,7 @@ def __init__(self,port,plugins={},options= {}): self.loaderPlugins = options def getNameThread(self): - return 'Starting Thread:' + self.objectName() + return '[New Thread {} ({})]'.format(self.currentThreadId(),self.objectName()) def run(self): killSessions = True @@ -315,9 +346,7 @@ def run(self): CookieCleaner.getInstance().setEnabled(killSessions) strippingFactory = http.HTTPFactory(timeout=10) strippingFactory.protocol = StrippingProxy - print 'Starting Thread:' + self.objectName() - print "\nsslstrip " + sslstrip_version + " by Moxie Marlinspike running..." - print "sergio-proxy v%s online" % sergio_version + print 'sslstrip {} + sergio-proxy v{} online'.format(sslstrip_version,sergio_version) if not reactor.running: self.connector = reactor.listenTCP(int(listenPort), strippingFactory) try: @@ -326,4 +355,5 @@ def run(self): pass def stop(self): - print 'Stop thread:' + self.objectName() + print 'Thread::[{}] successfully stopped.'.format(self.objectName()) + reactor.callFromThread(reactor.stop) diff --git a/Core/widgets/PopupModels.py b/Core/widgets/PopupModels.py index b15c10e..40da3b8 100644 --- a/Core/widgets/PopupModels.py +++ b/Core/widgets/PopupModels.py @@ -31,69 +31,84 @@ def __init__(self,FSettings): self.FSettings = FSettings self.layout = QVBoxLayout() self.layoutform = QFormLayout() + self.layoutproxy = QFormLayout() self.GroupPlugins = QGroupBox() - self.GroupPlugins.setTitle('::Plugins::') + self.GroupPluginsProxy = QGroupBox() + self.GroupPlugins.setTitle(':: Plugins ::') + self.GroupPluginsProxy.setTitle(':: Proxy ::') + self.GroupPluginsProxy.setLayout(self.layoutproxy) self.GroupPlugins.setLayout(self.layoutform) - self.check_sslstrip = QCheckBox('::ssLstrip') - self.check_netcreds = QCheckBox('::net-creds') - self.check_dns2proy = QCheckBox('::dns2proxy') - self.check_sergioProxy = QCheckBox('::sergio-proxy') - self.check_dns2proy.clicked.connect(self.checkBoxDns2proxy) - self.check_sslstrip.clicked.connect(self.checkBoxSslstrip) + self.check_netcreds = QCheckBox('net-creds ') + self.check_dns2proy = QRadioButton('sslstrip+/dns2proxy') + self.check_sergioProxy = QRadioButton('sslstrip/sergio-proxy') + self.check_noproxy = QRadioButton('No Proxy') + self.proxyGroup = QButtonGroup() + self.proxyGroup.addButton(self.check_dns2proy) + self.proxyGroup.addButton(self.check_sergioProxy) + self.proxyGroup.addButton(self.check_noproxy) + self.check_dns2proy.clicked.connect(self.checkGeneralOptions) self.check_netcreds.clicked.connect(self.checkBoxNecreds) - self.check_sergioProxy.clicked.connect(self.checkBoxSergioProxy) - self.layoutform.addRow(self.check_sslstrip) + self.check_sergioProxy.clicked.connect(self.checkGeneralOptions) + self.check_noproxy.clicked.connect(self.checkGeneralOptions) self.layoutform.addRow(self.check_netcreds) - self.layoutform.addRow(self.check_dns2proy) - self.layoutform.addRow(self.check_sergioProxy) + self.layoutproxy.addRow(self.check_dns2proy) + self.layoutproxy.addRow(self.check_sergioProxy) + self.layoutproxy.addRow(self.check_noproxy) self.layout.addWidget(self.GroupPlugins) + self.layout.addWidget(self.GroupPluginsProxy) self.setLayout(self.layout) + # control checkbox plugins - def checkBoxSslstrip(self): - if not self.check_sslstrip.isChecked(): - if not self.check_sergioProxy.isChecked(): - self.unset_Rules('sslstrip') - self.FSettings.Settings.set_setting('plugins','sslstrip_plugin',False) - elif self.check_sslstrip.isChecked(): - if not self.check_sergioProxy.isChecked(): - self.set_sslStripRule() - self.FSettings.Settings.set_setting('plugins','sslstrip_plugin',True) - - def checkBoxSergioProxy(self): + def checkGeneralOptions(self): + self.unset_Rules('dns2proxy') + self.unset_Rules('sslstrip') if self.check_sergioProxy.isChecked(): - if not self.check_sslstrip.isChecked(): - self.set_sslStripRule() self.FSettings.Settings.set_setting('plugins','sergioproxy_plugin',True) - elif not self.check_sergioProxy.isChecked(): - if not self.check_sslstrip.isChecked(): - self.unset_Rules('sslstrip') - self.FSettings.Settings.set_setting('plugins','sergioproxy_plugin',False) - - def checkBoxDns2proxy(self): - if not self.check_dns2proy.isChecked(): - self.unset_Rules('dns2proxy') self.FSettings.Settings.set_setting('plugins','dns2proxy_plugin',False) + self.FSettings.Settings.set_setting('plugins','noproxy',False) + self.set_sslStripRule() elif self.check_dns2proy.isChecked(): - self.set_Dns2proxyRule() self.FSettings.Settings.set_setting('plugins','dns2proxy_plugin',True) + self.FSettings.Settings.set_setting('plugins','sergioproxy_plugin',False) + self.FSettings.Settings.set_setting('plugins','noproxy',False) + self.set_sslStripRule() + self.set_Dns2proxyRule() + elif self.check_noproxy.isChecked(): + self.FSettings.Settings.set_setting('plugins','dns2proxy_plugin',False) + self.FSettings.Settings.set_setting('plugins','sergioproxy_plugin',False) + self.FSettings.Settings.set_setting('plugins','noproxy',True) + self.unset_Rules('dns2proxy') + self.unset_Rules('sslstrip') + def checkBoxNecreds(self): if self.check_netcreds.isChecked(): self.FSettings.Settings.set_setting('plugins','netcreds_plugin',True) else: self.FSettings.Settings.set_setting('plugins','netcreds_plugin',False) + def optionsRules(self,type): + search = {'sslstrip': str('iptables -t nat -A PREROUTING -p tcp'+ + ' --destination-port 80 -j REDIRECT --to-port '+self.FSettings.redirectport.text()), + 'dns2proxy':str('iptables -t nat -A PREROUTING -p '+ + 'udp --destination-port 53 -j REDIRECT --to-port 53')} + return search[type] + # set rules to sslstrip def set_sslStripRule(self): + items = [] + for index in xrange(self.FSettings.ListRules.count()): + items.append(str(self.FSettings.ListRules.item(index).text())) + if self.optionsRules('sslstrip') in items: + return item = QListWidgetItem() - item.setText('iptables -t nat -A PREROUTING -p '+ - 'tcp --destination-port 80 -j REDIRECT --to-port '+self.FSettings.redirectport.text()) + item.setText(self.optionsRules('sslstrip')) item.setSizeHint(QSize(30,30)) self.FSettings.ListRules.addItem(item) + # set redirect port rules dns2proy def set_Dns2proxyRule(self): item = QListWidgetItem() - item.setText('iptables -t nat -A PREROUTING -p '+ - 'udp --destination-port 53 -j REDIRECT --to-port 53') + item.setText(self.optionsRules('dns2proxy')) item.setSizeHint(QSize(30,30)) self.FSettings.ListRules.addItem(item) @@ -101,14 +116,9 @@ def unset_Rules(self,type): items = [] for index in xrange(self.FSettings.ListRules.count()): items.append(str(self.FSettings.ListRules.item(index).text())) - for i,j in enumerate(items): - if type == 'sslstrip': - if search(str('tcp --destination-port 80 -j REDIRECT --to-port '+ - self.FSettings.redirectport.text()),j): - self.FSettings.ListRules.takeItem(i) - elif type =='dns2proxy': - if search('udp --destination-port 53 -j REDIRECT --to-port 53',j): - self.FSettings.ListRules.takeItem(i) + for position,line in enumerate(items): + if self.optionsRules(type) == line: + self.FSettings.ListRules.takeItem(position) class PopUpServer(QWidget): diff --git a/Core/widgets/TabModels.py b/Core/widgets/TabModels.py index bd96e3c..e5014e4 100644 --- a/Core/widgets/TabModels.py +++ b/Core/widgets/TabModels.py @@ -116,8 +116,8 @@ def get_filenameToInjection(self): 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()) + 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 @@ -129,7 +129,8 @@ def setPluginsActivated(self): self.btnEnable.setEnabled(False) self.ProcessReadLogger() return self.statusInjection(True) - self.sendError.emit('sslstrip is not enabled.'.format(self.argsLabel.text())) + self.sendError.emit('Plugins::Proxy is not enabled.' + '\n\nthis module need a proxy server to work'.format(self.argsLabel.text())) def ProcessReadLogger(self): if path.exists('Logs/AccessPoint/injectionPage.log'): diff --git a/Modules/poisoners/ArpPosion.py b/Modules/poisoners/ArpPosion.py index bfd4ce3..df96716 100644 --- a/Modules/poisoners/ArpPosion.py +++ b/Modules/poisoners/ArpPosion.py @@ -325,48 +325,25 @@ def Start_scan(self): elif threadscan_check == 'Ping': if self.txt_gateway.text() != '': - config = str(self.txt_gateway.text()) - t = threading.Thread(target=self.scanner_network,args=(config,)) - t.daemon = True - t.start(),t.join() - self.StatusMonitor(False,'stas_scan') + self.thread_ScanIP = ThreadFastScanIP(str(self.txt_gateway.text()),self.ip_range.text()) + self.thread_ScanIP.sendDictResultscan.connect(self.get_result_scanner_ip) + self.StatusMonitor(True,'stas_scan') + self.thread_ScanIP.start() + Headers = [] + for key in reversed(self.data.keys()): + Headers.append(key) + self.tables.setHorizontalHeaderLabels(Headers) else: QMessageBox.information(self,'Error in gateway','gateway not found.') else: QMessageBox.information(self,'Error on select thread Scan','thread scan not selected.') - def working(self,ip,lista): - with open(devnull, 'wb') as limbo: - result=Popen(['ping', '-c', '1', '-n', '-W', '1', ip], - stdout=limbo, stderr=limbo).wait() - if not result: - if Refactor.get_mac(ip) == None: - lista[ip] = ip + '|' + 'not found' - else: - lista[ip] = ip + '|' + Refactor.get_mac(ip) - - def scanner_network(self,gateway): - scan = '' - config_gateway = gateway.split('.') - del config_gateway[-1] - for i in config_gateway: - scan += str(i) + '.' - gateway = scan - ranger = str(self.ip_range.text()).split('-') - jobs = [] - manager = Manager() - on_ips = manager.dict() - for n in xrange(int(ranger[0]),int(ranger[1])): - ip='%s{0}'.format(n)%(gateway) - p = Process(target=self.working,args=(ip,on_ips)) - jobs.append(p) - p.start() - for i in jobs: i.join() - for i in on_ips.values(): - Headers = [] - n = i.split('|') - self.data['IPaddress'].append(n[0]) - self.data['MacAddress'].append(n[1]) + def get_result_scanner_ip(self,data): + Headers = [] + for items in data.values(): + dataIP = items.split('|') + self.data['IPaddress'].append(dataIP[0]) + self.data['MacAddress'].append(dataIP[1]) self.data['Hostname'].append('') for n, key in enumerate(reversed(self.data.keys())): Headers.append(key) @@ -378,9 +355,10 @@ def scanner_network(self,gateway): for key in reversed(self.data.keys()): Headers.append(key) self.tables.setHorizontalHeaderLabels(Headers) + self.StatusMonitor(False,'stas_scan') def Stop_scan(self): - self.ThreadScanner.terminate() + self.thread_ScanIP.stop() self.StatusMonitor(False,'stas_scan') Headers = [] for key in reversed(self.data.keys()): diff --git a/Modules/poisoners/DnsSpoof.py b/Modules/poisoners/DnsSpoof.py index 17505c4..dee99e8 100644 --- a/Modules/poisoners/DnsSpoof.py +++ b/Modules/poisoners/DnsSpoof.py @@ -395,48 +395,25 @@ def Start_scan(self): elif threadscan_check == 'Ping': if self.txt_gateway.text() != '': - config = str(self.txt_gateway.text()) - t = threading.Thread(target=self.scanner_network,args=(config,)) - t.daemon = True - t.start(),t.join() - self.StatusMonitor(False,'stas_scan') + self.thread_ScanIP = ThreadFastScanIP(str(self.txt_gateway.text()),self.ip_range.text()) + self.thread_ScanIP.sendDictResultscan.connect(self.get_result_scanner_ip) + self.StatusMonitor(True,'stas_scan') + self.thread_ScanIP.start() + Headers = [] + for key in reversed(self.data.keys()): + Headers.append(key) + self.tables.setHorizontalHeaderLabels(Headers) else: QMessageBox.information(self,'Error in gateway','gateway not found.') else: QMessageBox.information(self,'Error on select thread Scan','thread scan not selected.') - def working(self,ip,lista): - with open(devnull, 'wb') as limbo: - result=Popen(['ping', '-c', '1', '-n', '-W', '1', ip], - stdout=limbo, stderr=limbo).wait() - if not result: - if Refactor.get_mac(ip) == None: - lista[ip] = ip + '|' + 'not found' - else: - lista[ip] = ip + '|' + Refactor.get_mac(ip) - - def scanner_network(self,gateway): - scan = '' - config_gateway = gateway.split('.') - del config_gateway[-1] - for i in config_gateway: - scan += str(i) + '.' - gateway = scan - ranger = str(self.ip_range.text()).split('-') - jobs = [] - manager = Manager() - on_ips = manager.dict() - for n in xrange(int(ranger[0]),int(ranger[1])): - ip='%s{0}'.format(n)%(gateway) - p = Process(target=self.working,args=(ip,on_ips)) - jobs.append(p) - p.start() - for i in jobs: i.join() - for i in on_ips.values(): - Headers = [] - n = i.split('|') - self.data['IPaddress'].append(n[0]) - self.data['MacAddress'].append(n[1]) + def get_result_scanner_ip(self,data): + Headers = [] + for items in data.values(): + dataIP = items.split('|') + self.data['IPaddress'].append(dataIP[0]) + self.data['MacAddress'].append(dataIP[1]) self.data['Hostname'].append('') for n, key in enumerate(reversed(self.data.keys())): Headers.append(key) @@ -448,9 +425,10 @@ def scanner_network(self,gateway): for key in reversed(self.data.keys()): Headers.append(key) self.tables.setHorizontalHeaderLabels(Headers) + self.StatusMonitor(False,'stas_scan') def Stop_scan(self): - self.ThreadScanner.terminate() + self.thread_ScanIP.stop() self.StatusMonitor(False,'stas_scan') Headers = [] for key in reversed(self.data.keys()): diff --git a/installer.sh b/installer.sh index 82dcff1..863f440 100755 --- a/installer.sh +++ b/installer.sh @@ -16,7 +16,7 @@ func_Banner(){ echo ' =============================' echo " |$bldblu wifi-pumpkin Installer$txtrst|" echo ' =============================' - echo " Version: $(tput setaf 5)0.7.5 $txtrst" + echo " Version: $(tput setaf 5)0.7.8 $txtrst" echo "usage: ./installer.sh --install | --uninstall" }