removed support to Rest API controller temporally

This commit is contained in:
mh4x0f 2021-05-13 15:35:59 -03:00
parent 6368a0091e
commit 1d02e4a725
5 changed files with 69 additions and 64 deletions

View File

@ -17,6 +17,7 @@ All notable changes to this project will be documented in this file.
### Deprecated
### Removed
- removed support to Rest API controller temporally
### Fixed
- fixed cli error when resquest restAPI plugins and proxies

View File

@ -20,7 +20,7 @@ requests>=2.18.4
beautifulsoup4>=4.9.1
black
coverage==5.1
jwt>=1.0.0
Flask-RESTful==0.3.7
Werkzeug==1.0.1
# jwt>=1.0.0
# Flask-RESTful==0.3.7
# Werkzeug==1.0.1

View File

@ -18,6 +18,6 @@ Flask==1.1.1
requests>=2.18.4
beautifulsoup4>=4.9.1
asn1crypto>=1.0.0
jwt>=1.0.0
Flask-RESTful==0.3.7
Werkzeug==1.0.1
#jwt>=1.0.0
#Flask-RESTful==0.3.7
#Werkzeug==1.0.1

View File

@ -18,7 +18,8 @@ from wifipumpkin3._author import __author__
import wifipumpkin3.core.utility.constants as C
from os import getuid
from wifipumpkin3.core.servers.rest.application import RestControllerAPI
# disable RestAPI
# from wifipumpkin3.core.servers.rest.application import RestControllerAPI
import threading
@ -37,27 +38,27 @@ def parser_args_func(parse_args, config):
info=True,
)
)
if parse_args.restmode:
if not (parse_args.password):
print(
display_messages(
"{} \n rest mode require a valid password.".format(
setcolor("password invalid", color="red")
),
info=True,
)
)
exit(0)
# if parse_args.restmode:
# if not (parse_args.password):
# print(
# display_messages(
# "{} \n rest mode require a valid password.".format(
# setcolor("password invalid", color="red")
# ),
# info=True,
# )
# )
# exit(0)
set_nocolors()
config.set_one("ap_mode", "restapi", True)
config.set("rest_api_settings", "PASSWORD", parse_args.password)
config.set("rest_api_settings", "USERNAME", parse_args.username)
config.set("rest_api_settings", "port", parse_args.restport)
server_restapi = RestControllerAPI("wp3API", config)
thead = threading.Thread(target=server_restapi.run)
thead.setDaemon(True)
thead.start()
# set_nocolors()
# config.set_one("ap_mode", "restapi", True)
# config.set("rest_api_settings", "PASSWORD", parse_args.password)
# config.set("rest_api_settings", "USERNAME", parse_args.username)
# config.set("rest_api_settings", "port", parse_args.restport)
# server_restapi = RestControllerAPI("wp3API", config)
# thead = threading.Thread(target=server_restapi.run)
# thead.setDaemon(True)
# thead.start()
def wp3_header():
@ -115,31 +116,31 @@ def main():
action="store_true",
default=False,
)
parser.add_argument(
"--rest",
dest="restmode",
help="Run the Wp3 RESTful API.",
action="store_true",
default=False,
)
parser.add_argument(
"--restport",
dest="restport",
help="Port to run the Wp3 RESTful API on. default is 1337",
default=1337,
)
parser.add_argument(
"--username",
dest="username",
help="Start the RESTful API with the specified username instead of pulling from wp3.db",
default="wp3admin",
)
parser.add_argument(
"--password",
dest="password",
help="Start the RESTful API with the specified password instead of pulling from wp3.db",
default=None,
)
# parser.add_argument(
# "--rest",
# dest="restmode",
# help="Run the Wp3 RESTful API.",
# action="store_true",
# default=False,
# )
# parser.add_argument(
# "--restport",
# dest="restport",
# help="Port to run the Wp3 RESTful API on. default is 1337",
# default=1337,
# )
# parser.add_argument(
# "--username",
# dest="username",
# help="Start the RESTful API with the specified username instead of pulling from wp3.db",
# default="wp3admin",
# )
# parser.add_argument(
# "--password",
# dest="password",
# help="Start the RESTful API with the specified password instead of pulling from wp3.db",
# default=None,
# )
parser.add_argument(
"-v",
"--version",

View File

@ -220,19 +220,22 @@ class PumpkinShell(Qt.QObject, ConsoleUI):
self.threads["RogueAP"].extend(self.proxy_controller.ActiveReactor)
self.threads["RogueAP"].extend(self.mitm_controller.ActiveReactor)
if not self.parse_args.restmode:
self.wireless_controller.ActiveReactor.start()
self.wireless_controller.ActiveReactor.signalApIsRuning.connect(
self.signalHostApdProcessIsRunning
)
return
self.wireless_controller.ActiveReactor.start()
for thread in self.threads["RogueAP"]:
if thread is not None:
QtCore.QThread.sleep(1)
if not (isinstance(thread, list)):
thread.start()
self.wireless_controller.ActiveReactor.signalApIsRuning.connect(self.signalHostApdProcessIsRunning)
# if not self.parse_args.restmode:
# self.wireless_controller.ActiveReactor.start()
# self.wireless_controller.ActiveReactor.signalApIsRuning.connect(
# self.signalHostApdProcessIsRunning
# )
# return
# self.wireless_controller.ActiveReactor.start()
# for thread in self.threads["RogueAP"]:
# if thread is not None:
# QtCore.QThread.sleep(1)
# if not (isinstance(thread, list)):
# thread.start()
def signalHostApdProcessIsRunning(self, status):
if status: