mirror of
https://github.com/Cronocide/wifipumpkin3.git
synced 2025-01-22 19:37:18 +00:00
added license header all files in core/packets and controls
This commit is contained in:
parent
635b893cb5
commit
0e6dcc3126
@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file.
|
||||
## [1.0.0] - 2020-04-02
|
||||
|
||||
### Added
|
||||
- added license header all files in core/packets and controls [mh4x0f]
|
||||
- added license header all files in core/common [mh4x0f]
|
||||
- added start tool with finish install on docker [mh4x0f]
|
||||
- added enable security WPA,WEP, WPA2 mode wireless [mh4x0f]
|
||||
|
@ -6,11 +6,27 @@ from multiprocessing import Process, Queue
|
||||
from subprocess import (Popen, STDOUT, PIPE)
|
||||
from PyQt5.QtCore import QThread, pyqtSignal, pyqtSlot, QProcess, QObject
|
||||
from wifipumpkin3.core.packets.dhcpserver import DHCPProtocol
|
||||
# from core.servers.proxy.http.controller.handler import MasterHandler
|
||||
from wifipumpkin3.core.utility.printer import display_messages,colors
|
||||
from wifipumpkin3.core.common.platforms import Linux as Refactor
|
||||
import wifipumpkin3.core.utility.constants as C
|
||||
|
||||
# This file is part of the wifipumpkin3 Open Source Project.
|
||||
# wifipumpkin3 is licensed under the Apache 2.0.
|
||||
|
||||
# Copyright 2020 P0cL4bs Team - Marcos Bomfim (mh4x0f)
|
||||
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
class DHCPServerProcess(QThread):
|
||||
_ProcssOutput = pyqtSignal(object)
|
||||
def __init__(self,cmd ,directory_exec=None):
|
||||
@ -46,8 +62,6 @@ class DHCPServerProcess(QThread):
|
||||
self.started = False
|
||||
self.queue.close()
|
||||
|
||||
|
||||
|
||||
class ProcessThread(QThread):
|
||||
_ProcssOutput = pyqtSignal(object)
|
||||
def __init__(self,cmd ,directory_exec=None):
|
||||
@ -55,7 +69,6 @@ class ProcessThread(QThread):
|
||||
self.directory_exec = directory_exec
|
||||
self.cmd = cmd
|
||||
|
||||
|
||||
@pyqtSlot()
|
||||
def getNameThread(self):
|
||||
return '[New Thread {} ({})]'.format(self.procThread.pid(),self.objectName())
|
||||
@ -88,8 +101,6 @@ class ProcessThread(QThread):
|
||||
self.procThread.waitForFinished()
|
||||
self.procThread.kill()
|
||||
|
||||
|
||||
|
||||
class DHCPServerProcess(QThread):
|
||||
_ProcssOutput = pyqtSignal(object)
|
||||
def __init__(self,cmd ,directory_exec=None):
|
||||
@ -117,7 +128,6 @@ class DHCPServerProcess(QThread):
|
||||
self.started = False
|
||||
self.queue.close()
|
||||
|
||||
|
||||
class ProcessHostapd(QObject):
|
||||
statusAP_connected = pyqtSignal(object)
|
||||
statusAPError = pyqtSignal(object)
|
||||
@ -147,47 +157,22 @@ class ProcessHostapd(QObject):
|
||||
del all_clients[client_mac]
|
||||
Refactor.writeFileDataToJson(C.CLIENTS_CONNECTED, all_clients)
|
||||
|
||||
|
||||
def read_OutputCommand(self):
|
||||
# for line in proc.stdout:
|
||||
# if 'AP-STA-DISCONNECTED' in line.rstrip() or 'inactivity (timer DEAUTH/REMOVE)' in line.rstrip():
|
||||
# q.put(line.split()[2])
|
||||
self.data = str(self.procHostapd.readAllStandardOutput(),encoding='ascii')
|
||||
if 'AP-STA-DISCONNECTED' in self.data.rstrip() or 'inactivity (timer DEAUTH/REMOVE)' in self.data.rstrip():
|
||||
self.removeInactivityClient(self.data.split()[2])
|
||||
self.statusAP_connected.emit(self.data.split()[2])
|
||||
#self.queue.put(self.data.split()[2])
|
||||
# #self.log_hostapd.info(self.data)
|
||||
# for error in self.errorAPDriver:
|
||||
# if self.data.find(error) != -1:
|
||||
# return self.statusAPError.emit(str(self.data))
|
||||
|
||||
def getHostapdResponse(self):
|
||||
while self.started:
|
||||
self.msg_inactivity.append(self.queue.get())
|
||||
|
||||
def start(self):
|
||||
self.makeLogger()
|
||||
self.procHostapd = QProcess(self)
|
||||
self.procHostapd.setProcessChannelMode(QProcess.MergedChannels)
|
||||
self.procHostapd.start(list(self.cmd.keys())[0],self.cmd[list(self.cmd.keys())[0]])
|
||||
self.procHostapd.readyReadStandardOutput.connect(self.read_OutputCommand)
|
||||
#print(display_messages('[New Thread {} ({})]'.format(self.procHostapd.pid(),self.objectName()),info=True))
|
||||
self.started = True
|
||||
# self.proc = Popen(self.cmd, bufsize=1, stdout=PIPE, stderr=STDOUT, universal_newlines=True)
|
||||
# self.procHostapd = Process(target=self.read_OutputCommand, args=(self.queue,self.proc))
|
||||
# self.procHostapd.start()
|
||||
print(display_messages('starting hostpad pid: [{}]'.format(self.procHostapd.pid()),sucess=True))
|
||||
|
||||
def makeLogger(self):
|
||||
#setup_logger('hostapd', C.LOG_HOSTAPD, self.session)
|
||||
#self.log_hostapd = logging.getLogger('hostapd')
|
||||
pass
|
||||
|
||||
def stop(self):
|
||||
print('Thread::[{}] successfully stopped.'.format(self.objectName()))
|
||||
if hasattr(self,'procHostapd'):
|
||||
self.started = False
|
||||
#self.proc.kill()
|
||||
#self.proc.terminate()
|
||||
self.procHostapd.terminate()
|
@ -8,6 +8,22 @@ log = logging.getLogger(__name__)
|
||||
from PyQt5.QtCore import QThread,pyqtSignal,pyqtSlot,QProcess,QObject
|
||||
from wifipumpkin3.core.config.globalimport import *
|
||||
|
||||
# This file is part of the wifipumpkin3 Open Source Project.
|
||||
# wifipumpkin3 is licensed under the Apache 2.0.
|
||||
|
||||
# Copyright 2020 P0cL4bs Team - Marcos Bomfim (mh4x0f)
|
||||
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
class IpAddressClass(object):
|
||||
''' class for generator ipaddress '''
|
||||
@ -37,8 +53,6 @@ class IpAddressClass(object):
|
||||
return self.ipaddres_list.pop(0)
|
||||
return None
|
||||
|
||||
|
||||
|
||||
class DHCPProtocol(QObject):
|
||||
_request = pyqtSignal(object)
|
||||
def __init__(self,DHCPConf):
|
||||
@ -53,10 +67,6 @@ class DHCPProtocol(QObject):
|
||||
def connection_made(self, transport):
|
||||
self.transport = transport
|
||||
|
||||
def get_DHCPServerResponse(self):
|
||||
while self.started:
|
||||
self.message.append(self.queue.get())
|
||||
|
||||
def datagram_received(self, data, addr):
|
||||
packet = DHCPPacket(data)
|
||||
log.debug('RECV from %s:\n%s\n', addr, packet)
|
||||
@ -118,7 +128,6 @@ class DHCPProtocol(QObject):
|
||||
def error_received(exc):
|
||||
log.error('ERROR', exc_info=exc)
|
||||
|
||||
|
||||
class DHCPThread(QThread):
|
||||
def __init__(self,iface,DHCPconf):
|
||||
QThread.__init__(self)
|
||||
|
@ -13,6 +13,22 @@ from dnslib.proxy import ProxyResolver
|
||||
from dnslib.server import DNSServer
|
||||
import binascii
|
||||
|
||||
# This file is part of the wifipumpkin3 Open Source Project.
|
||||
# wifipumpkin3 is licensed under the Apache 2.0.
|
||||
|
||||
# Copyright 2020 P0cL4bs Team - Marcos Bomfim (mh4x0f)
|
||||
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
TYPE_LOOKUP = {
|
||||
'A': (dns.A, QTYPE.A),
|
||||
@ -69,7 +85,6 @@ class Record:
|
||||
def __str__(self):
|
||||
return str(self.rr)
|
||||
|
||||
|
||||
class Resolver(ProxyResolver):
|
||||
|
||||
def __init__(self, upstream, zone_file, send_request):
|
||||
@ -134,8 +149,6 @@ class Resolver(ProxyResolver):
|
||||
self.output.emit('no local zone found, proxying %s[%s]' % (request.q.qname, type_name))
|
||||
return super().resolve(request, handler)
|
||||
|
||||
|
||||
|
||||
class LocalDNSLogger(object):
|
||||
|
||||
"""
|
||||
@ -217,8 +230,6 @@ class LocalDNSLogger(object):
|
||||
def log_data(self, dnsobj):
|
||||
self.logger.emit("\n" + dnsobj.toZone(" ") + "\n")
|
||||
|
||||
|
||||
|
||||
class DNSServerThread(QThread):
|
||||
''' Simple DNS server UDP resolver '''
|
||||
sendRequests = pyqtSignal(object) #I'll use this object in future feature
|
||||
@ -227,7 +238,6 @@ class DNSServerThread(QThread):
|
||||
self.resolver = None
|
||||
self.conf = conf
|
||||
|
||||
|
||||
def run(self):
|
||||
|
||||
port = int(os.getenv('PORT', 53))
|
||||
|
@ -5,40 +5,22 @@ logging.getLogger('scapy.runtime').setLevel(logging.ERROR)
|
||||
from scapy.all import *
|
||||
from netfilterqueue import NetfilterQueue
|
||||
|
||||
"""
|
||||
Description:
|
||||
This program is a module for wifi-pumpkin.py file which includes new implementation
|
||||
for Dns spoof Attack with NetfilterQueue and iptables.
|
||||
# This file is part of the wifipumpkin3 Open Source Project.
|
||||
# wifipumpkin3 is licensed under the Apache 2.0.
|
||||
|
||||
Copyright:
|
||||
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
|
||||
(at your option) any later version.
|
||||
# Copyright 2020 P0cL4bs Team - Marcos Bomfim (mh4x0f)
|
||||
|
||||
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.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
"""
|
||||
|
||||
'''http://stackoverflow.com/questions/17035077/python-logging-to-multiple-log-files-from-different-classes'''
|
||||
def setup_logger(logger_name, log_file, level=logging.INFO):
|
||||
l = logging.getLogger(logger_name)
|
||||
formatter = logging.Formatter('%(message)s')
|
||||
fileHandler = logging.FileHandler(log_file, mode='a')
|
||||
fileHandler.setFormatter(formatter)
|
||||
streamHandler = logging.StreamHandler()
|
||||
streamHandler.setFormatter(formatter)
|
||||
|
||||
l.setLevel(level)
|
||||
l.addHandler(fileHandler)
|
||||
l.addHandler(streamHandler)
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
class DnsSpoofNetFilter(object):
|
||||
def __init__(self):
|
||||
@ -51,9 +33,11 @@ class DnsSpoofNetFilter(object):
|
||||
self.args = parser.parse_args()
|
||||
|
||||
def logggingCreate(self):
|
||||
setup_logger('dnsspoofAP', './logs/AccessPoint/dnsspoof.log')
|
||||
self.logDNS = logging.getLogger('dnsspoofAP')
|
||||
self.logDNS.info('Dns Spoof: running...')
|
||||
#TODO: implement this function logger with new log implementated with json
|
||||
pass
|
||||
# setup_logger('dnsspoofAP', './logs/AccessPoint/dnsspoof.log')
|
||||
# self.logDNS = logging.getLogger('dnsspoofAP')
|
||||
# self.logDNS.info('Dns Spoof: running...')
|
||||
|
||||
def callback(self,packet):
|
||||
payload = packet.get_payload()
|
||||
|
@ -1,9 +1,24 @@
|
||||
from socket import *
|
||||
|
||||
import struct
|
||||
import base64
|
||||
import select
|
||||
|
||||
# This file is part of the wifipumpkin3 Open Source Project.
|
||||
# wifipumpkin3 is licensed under the Apache 2.0.
|
||||
|
||||
# Copyright 2020 P0cL4bs Team - Marcos Bomfim (mh4x0f)
|
||||
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# see https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol
|
||||
# section DHCP options
|
||||
@ -15,7 +30,6 @@ def inet_ntoaX(data):
|
||||
def inet_atonX(ips):
|
||||
return b''.join(map(inet_aton, ips))
|
||||
|
||||
|
||||
dhcp_message_types = {
|
||||
1: 'DHCPDISCOVER',
|
||||
2: 'DHCPOFFER',
|
||||
|
@ -6,26 +6,22 @@ from time import sleep
|
||||
from PyQt5.QtCore import QThread,SIGNAL,QObject,QProcess,pyqtSlot,pyqtSignal,pyqtSlot
|
||||
from datetime import datetime
|
||||
|
||||
"""
|
||||
Description:
|
||||
This program is a core for modules wifi-pumpkin.py. file which includes all Implementation
|
||||
for modules.
|
||||
# This file is part of the wifipumpkin3 Open Source Project.
|
||||
# wifipumpkin3 is licensed under the Apache 2.0.
|
||||
|
||||
Copyright:
|
||||
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
|
||||
(at your option) any later version.
|
||||
# Copyright 2020 P0cL4bs Team - Marcos Bomfim (mh4x0f)
|
||||
|
||||
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.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
"""
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
class ThreadAttackStar(QThread):
|
||||
def __init__(self,interface):
|
||||
@ -52,7 +48,6 @@ class ThreadAttackStar(QThread):
|
||||
print("Stop thread:" + self.objectName())
|
||||
self.process = False
|
||||
|
||||
|
||||
class ThARP_posion(QThread):
|
||||
def __init__(self,srcAddress,dstAddress,mac):
|
||||
QThread.__init__(self)
|
||||
@ -80,7 +75,6 @@ class ThARP_posion(QThread):
|
||||
print('Stop thread:' + self.objectName())
|
||||
self.emit(pyqtSignal('Activated( QString )'),'Ok')
|
||||
|
||||
|
||||
class ThreadDNSspoofNF(QObject):
|
||||
DnsReq = pyqtSignal(object)
|
||||
def __init__(self,domains,interface,redirect,APmode=True,parent=None):
|
||||
|
@ -5,26 +5,22 @@ from PyQt4.QtCore import QThread,SIGNAL
|
||||
from netaddr import EUI
|
||||
from netaddr.core import NotRegisteredError
|
||||
|
||||
"""
|
||||
Description:
|
||||
This program is a core for modules wifi-pumpkin.py. file which includes all Implementation
|
||||
for modules.
|
||||
# This file is part of the wifipumpkin3 Open Source Project.
|
||||
# wifipumpkin3 is licensed under the Apache 2.0.
|
||||
|
||||
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.
|
||||
# Copyright 2020 P0cL4bs Team - Marcos Bomfim (mh4x0f)
|
||||
|
||||
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.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
"""
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
class ThreadScannerAP(QThread):
|
||||
def __init__(self,interface):
|
||||
|
Loading…
Reference in New Issue
Block a user