mirror of
https://github.com/Cronocide/wifipumpkin3.git
synced 2025-01-22 19:37:18 +00:00
removed support to Rest API controller temporally
This commit is contained in:
parent
6368a0091e
commit
1d02e4a725
@ -17,6 +17,7 @@ All notable changes to this project will be documented in this file.
|
|||||||
### Deprecated
|
### Deprecated
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
- removed support to Rest API controller temporally
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- fixed cli error when resquest restAPI plugins and proxies
|
- fixed cli error when resquest restAPI plugins and proxies
|
||||||
|
@ -20,7 +20,7 @@ requests>=2.18.4
|
|||||||
beautifulsoup4>=4.9.1
|
beautifulsoup4>=4.9.1
|
||||||
black
|
black
|
||||||
coverage==5.1
|
coverage==5.1
|
||||||
jwt>=1.0.0
|
# jwt>=1.0.0
|
||||||
Flask-RESTful==0.3.7
|
# Flask-RESTful==0.3.7
|
||||||
Werkzeug==1.0.1
|
# Werkzeug==1.0.1
|
||||||
|
|
||||||
|
@ -18,6 +18,6 @@ Flask==1.1.1
|
|||||||
requests>=2.18.4
|
requests>=2.18.4
|
||||||
beautifulsoup4>=4.9.1
|
beautifulsoup4>=4.9.1
|
||||||
asn1crypto>=1.0.0
|
asn1crypto>=1.0.0
|
||||||
jwt>=1.0.0
|
#jwt>=1.0.0
|
||||||
Flask-RESTful==0.3.7
|
#Flask-RESTful==0.3.7
|
||||||
Werkzeug==1.0.1
|
#Werkzeug==1.0.1
|
||||||
|
@ -18,7 +18,8 @@ from wifipumpkin3._author import __author__
|
|||||||
import wifipumpkin3.core.utility.constants as C
|
import wifipumpkin3.core.utility.constants as C
|
||||||
from os import getuid
|
from os import getuid
|
||||||
|
|
||||||
from wifipumpkin3.core.servers.rest.application import RestControllerAPI
|
# disable RestAPI
|
||||||
|
# from wifipumpkin3.core.servers.rest.application import RestControllerAPI
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
|
|
||||||
@ -37,27 +38,27 @@ def parser_args_func(parse_args, config):
|
|||||||
info=True,
|
info=True,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if parse_args.restmode:
|
# if parse_args.restmode:
|
||||||
if not (parse_args.password):
|
# if not (parse_args.password):
|
||||||
print(
|
# print(
|
||||||
display_messages(
|
# display_messages(
|
||||||
"{} \n rest mode require a valid password.".format(
|
# "{} \n rest mode require a valid password.".format(
|
||||||
setcolor("password invalid", color="red")
|
# setcolor("password invalid", color="red")
|
||||||
),
|
# ),
|
||||||
info=True,
|
# info=True,
|
||||||
)
|
# )
|
||||||
)
|
# )
|
||||||
exit(0)
|
# exit(0)
|
||||||
|
|
||||||
set_nocolors()
|
# set_nocolors()
|
||||||
config.set_one("ap_mode", "restapi", True)
|
# config.set_one("ap_mode", "restapi", True)
|
||||||
config.set("rest_api_settings", "PASSWORD", parse_args.password)
|
# config.set("rest_api_settings", "PASSWORD", parse_args.password)
|
||||||
config.set("rest_api_settings", "USERNAME", parse_args.username)
|
# config.set("rest_api_settings", "USERNAME", parse_args.username)
|
||||||
config.set("rest_api_settings", "port", parse_args.restport)
|
# config.set("rest_api_settings", "port", parse_args.restport)
|
||||||
server_restapi = RestControllerAPI("wp3API", config)
|
# server_restapi = RestControllerAPI("wp3API", config)
|
||||||
thead = threading.Thread(target=server_restapi.run)
|
# thead = threading.Thread(target=server_restapi.run)
|
||||||
thead.setDaemon(True)
|
# thead.setDaemon(True)
|
||||||
thead.start()
|
# thead.start()
|
||||||
|
|
||||||
|
|
||||||
def wp3_header():
|
def wp3_header():
|
||||||
@ -115,31 +116,31 @@ def main():
|
|||||||
action="store_true",
|
action="store_true",
|
||||||
default=False,
|
default=False,
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
# parser.add_argument(
|
||||||
"--rest",
|
# "--rest",
|
||||||
dest="restmode",
|
# dest="restmode",
|
||||||
help="Run the Wp3 RESTful API.",
|
# help="Run the Wp3 RESTful API.",
|
||||||
action="store_true",
|
# action="store_true",
|
||||||
default=False,
|
# default=False,
|
||||||
)
|
# )
|
||||||
parser.add_argument(
|
# parser.add_argument(
|
||||||
"--restport",
|
# "--restport",
|
||||||
dest="restport",
|
# dest="restport",
|
||||||
help="Port to run the Wp3 RESTful API on. default is 1337",
|
# help="Port to run the Wp3 RESTful API on. default is 1337",
|
||||||
default=1337,
|
# default=1337,
|
||||||
)
|
# )
|
||||||
parser.add_argument(
|
# parser.add_argument(
|
||||||
"--username",
|
# "--username",
|
||||||
dest="username",
|
# dest="username",
|
||||||
help="Start the RESTful API with the specified username instead of pulling from wp3.db",
|
# help="Start the RESTful API with the specified username instead of pulling from wp3.db",
|
||||||
default="wp3admin",
|
# default="wp3admin",
|
||||||
)
|
# )
|
||||||
parser.add_argument(
|
# parser.add_argument(
|
||||||
"--password",
|
# "--password",
|
||||||
dest="password",
|
# dest="password",
|
||||||
help="Start the RESTful API with the specified password instead of pulling from wp3.db",
|
# help="Start the RESTful API with the specified password instead of pulling from wp3.db",
|
||||||
default=None,
|
# default=None,
|
||||||
)
|
# )
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-v",
|
"-v",
|
||||||
"--version",
|
"--version",
|
||||||
|
@ -220,19 +220,22 @@ class PumpkinShell(Qt.QObject, ConsoleUI):
|
|||||||
self.threads["RogueAP"].extend(self.proxy_controller.ActiveReactor)
|
self.threads["RogueAP"].extend(self.proxy_controller.ActiveReactor)
|
||||||
self.threads["RogueAP"].extend(self.mitm_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.start()
|
||||||
self.wireless_controller.ActiveReactor.signalApIsRuning.connect(
|
self.wireless_controller.ActiveReactor.signalApIsRuning.connect(self.signalHostApdProcessIsRunning)
|
||||||
self.signalHostApdProcessIsRunning
|
|
||||||
)
|
|
||||||
return
|
|
||||||
|
|
||||||
self.wireless_controller.ActiveReactor.start()
|
# if not self.parse_args.restmode:
|
||||||
for thread in self.threads["RogueAP"]:
|
# self.wireless_controller.ActiveReactor.start()
|
||||||
if thread is not None:
|
# self.wireless_controller.ActiveReactor.signalApIsRuning.connect(
|
||||||
QtCore.QThread.sleep(1)
|
# self.signalHostApdProcessIsRunning
|
||||||
if not (isinstance(thread, list)):
|
# )
|
||||||
thread.start()
|
# 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):
|
def signalHostApdProcessIsRunning(self, status):
|
||||||
if status:
|
if status:
|
||||||
|
Loading…
Reference in New Issue
Block a user