added license header all files in core/common

This commit is contained in:
mh4x0f 2020-04-06 21:22:37 -03:00
parent 506b84ca31
commit 7ff1e39919
4 changed files with 50 additions and 36 deletions

View File

@ -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/common [mh4x0f]
- added start tool with finish install on docker [mh4x0f]
- added enable security WPA,WEP, WPA2 mode wireless [mh4x0f]
- added parser wireless mode options [mh4x0f]

View File

@ -17,23 +17,22 @@ from glob import glob
import warnings, json
from uuid import uuid1
# This file is part of the wifipumpkin3 Open Source Project.
# wifipumpkin3 is licensed under the Apache 2.0.
loggers = {}
'''http://stackoverflow.com/questions/17035077/python-logging-to-multiple-log-files-from-different-classes'''
def setup_logger(logger_name, log_file,key=str(), level=logging.INFO):
global loggers
if loggers.get(logger_name):
return loggers.get(logger_name)
else:
logger = logging.getLogger(logger_name)
logger.propagate = False
formatter = logging.Formatter('SessionID[{}] %(asctime)s : %(message)s'.format(key))
fileHandler = logging.FileHandler(log_file, mode='a')
fileHandler.setFormatter(formatter)
logger.setLevel(logging.INFO)
logger.addHandler(fileHandler)
return logger
# 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 Linux(QtCore.QObject):

View File

@ -6,6 +6,23 @@ from os import popen
import sys
from wifipumpkin3.core.common.platforms import Linux
# 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 ConsoleUI(Cmd):
''' shell console UI '''
def __init__(self,parse_args=None):
@ -39,10 +56,6 @@ class ConsoleUI(Cmd):
def set_prompt(self):
self.prompt = '{} > '.format(setcolor('wp3',color='blue',underline=True))
# def do_modules(self,args):
# """ show modules available"""
# pass
def do_search(self,args):
""" search modules by name"""
pass
@ -51,10 +64,6 @@ class ConsoleUI(Cmd):
""" load module on session"""
pass
# def do_back(self,args):
# """ unload module on session"""
# pass
## Override methods in Cmd object ##
def preloop(self):
"""Initialization before prompting user for commands.
@ -65,7 +74,6 @@ class ConsoleUI(Cmd):
self._locals = {} ## Initialize execution namespace for user
self._globals = {}
def do_help(self,args):
""" show this help """
names = self.get_names()
@ -97,7 +105,6 @@ class ConsoleUI(Cmd):
if (len(output) > 0):
print(output)
def loadPulpFiles(self, file, data=None):
''' load and execute all commands in file pulp separate for \n '''
print('\n'+display_messages('mode: {}'.format(setcolor('script', 'ciano', True)),info=True))
@ -139,9 +146,6 @@ class ConsoleUI(Cmd):
print('Quitting.')
raise SystemExit
class ModuleUI(Cmd):
''' shell console UI '''
_name_module = None
@ -215,7 +219,6 @@ class ModuleUI(Cmd):
else:
cmds_doc.append((cmd, ""))
#self.stdout.write('%s\n'%str(self.doc_header))
self.stdout.write(' {} {}\n'.format('Commands', 'Description'))
self.stdout.write(' {} {}\n'.format('--------', '-----------'))
for command,doc in cmds_doc:
@ -223,7 +226,6 @@ class ModuleUI(Cmd):
self.stdout.write(' {:<10} {}\n'.format(command, doc))
print('\n')
def loadPulpFiles(self, file, data=None):
''' load and execute all commands in file pulp separate for \n '''
if os.path.isfile(file):
@ -235,6 +237,7 @@ class ModuleUI(Cmd):
sys.exit(1)
def default(self, args=str):
''' run commands system allow by tool '''
for goodArgs in C.SYSTEMCOMMAND:
if (args.startswith(goodArgs)):
output = popen(args).read()

View File

@ -4,6 +4,23 @@ import wifipumpkin3.core.utility.constants as C
from wifipumpkin3.core.utility.collection import SettingsINI
from wifipumpkin3.core.common.platforms import Linux
# 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 CoreSettings(Linux):
Name = "General"
@ -14,7 +31,6 @@ class CoreSettings(Linux):
__subitem=False
conf={}
def __init__(self,parent=0,FSettings=None):
super(CoreSettings,self).__init__()
self.parent = parent
@ -31,8 +47,6 @@ class CoreSettings(Linux):
def osWalkCallback(self,arg,directory,files):
pass
class TabsWidget(Qt.QObject):
Name="Generic"
ID = "Generic"
@ -41,7 +55,6 @@ class TabsWidget(Qt.QObject):
def __init__(self,parent=0,FSettings=None):
super(TabsWidget,self).__init__()
self.setObjectName(self.Name)
#self.setTitle("{}".format(self.Name))
self.conf = SuperSettings.getInstance()
self.parent = parent
@ -49,8 +62,6 @@ class TabsWidget(Qt.QObject):
def isSubitem(self):
return self.__subitem
class PluginsUI(Qt.QObject):
Name = "Default"
Caption = "Default"