malwaredllc / byob

An open-source post-exploitation framework for students, researchers and developers.
https://byob.dev
GNU General Public License v3.0
8.85k stars 2.1k forks source link

Flask Issue and http://127.0.0.1:5000 cannot open. #690

Closed ThePuteh closed 4 weeks ago

ThePuteh commented 6 months ago

Once followed the common instrucction, the requirements.txt should be followed by ./startup.sh provided by the git from malwaredllc/byob,

1) But the flask are the issue in which i use pip to manually install it and re-run the ../startup.ssh which avoid to run the web-page properly at http://127.0.0.1:5000.

2) Re-run again and using the other version of flask still no changes. FIrst place i thought its about ufw block the 5000 but its checked and no issue with firewall.

3) The issue printed like this : Navigate to http://127.0.0.1:5000 and set up your user to get started. Traceback (most recent call last): File "/usr/lib/python3.10/urllib/request.py", line 1348, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "/usr/lib/python3.10/http/client.py", line 1283, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/lib/python3.10/http/client.py", line 1329, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/usr/lib/python3.10/http/client.py", line 1278, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/lib/python3.10/http/client.py", line 1038, in _send_output self.send(msg) File "/usr/lib/python3.10/http/client.py", line 976, in send self.connect() File "/usr/lib/python3.10/http/client.py", line 942, in connect self.sock = self._create_connection( File "/usr/lib/python3.10/socket.py", line 845, in create_connection raise err File "/usr/lib/python3.10/socket.py", line 833, in create_connection sock.connect(sa) TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/root/byob/web-gui/run.py", line 1, in from buildyourownbotnet import create_app File "/root/byob/web-gui/buildyourownbotnet/init.py", line 16, in from buildyourownbotnet import client, server File "/root/byob/web-gui/buildyourownbotnet/client.py", line 122, in C2_HOST = util.public_ip() File "/root/byob/web-gui/buildyourownbotnet/core/util.py", line 84, in public_ip return urlopen('http://api.ipify.org').read().decode() File "/usr/lib/python3.10/urllib/request.py", line 216, in urlopen return opener.open(url, data, timeout) File "/usr/lib/python3.10/urllib/request.py", line 519, in open response = self._open(req, data) File "/usr/lib/python3.10/urllib/request.py", line 536, in _open result = self._call_chain(self.handle_open, protocol, protocol + File "/usr/lib/python3.10/urllib/request.py", line 496, in _call_chain result = func(*args) File "/usr/lib/python3.10/urllib/request.py", line 1377, in http_open return self.do_open(http.client.HTTPConnection, req) File "/usr/lib/python3.10/urllib/request.py", line 1351, in do_open raise URLError(err) urllib.error.URLError: <urlopen error [Errno 110] Connection timed out>

(Link opened, but not running)

Any idea ? I was thinking it may be of the flask issue. 1) The first running ./.startup show that no modules of flask. The issue found first is here, the flask:

Navigate to http://127.0.0.1:5000 and set up your user to get started. Traceback (most recent call last): File "/root/byob/web-gui/run.py", line 1, in from buildyourownbotnet import create_app File "/root/byob/web-gui/buildyourownbotnet/init.py", line 2, in from flask import Flask ModuleNotFoundError: No module named 'flask' (So i decide to use pip install flask and pip install flask_login)

2) Next it appear as the first comment above which my browser cannot open the http://127.0.0.1:500 ..

I am using : uname -r ubuntu 6.2.0-39-generic Python 3.10.12 Docker version 24.0.5, build 24.0.5-0ubuntu1~22.04.1

I wonder some people said byob are long dead project. Encourage me and consider this as bug to fix and hoping that i can contribute with it to encourage byob.

tiiraluoto commented 6 months ago

same issue here

ThePuteh commented 6 months ago

same issue here

Testing with Deimos, i found that the server will automatically bind 127.0.0.1 as web app, and there's an issue for its payload, specific for Deimos, so by disabling specific NIC and re-run then it work properly. (Recommended to not enable multiple NIC).

And i wondering that the same issue with byob happen, let me check the NIC issue. imo, running c2 web app should point the service as a server to your specific gateway that are used to make it properly.

Tallying both Deimos and BYOB issue. but i hope flask issue is not the issue after that.

tiiraluoto commented 6 months ago

has this been fixed yet?

ThePuteh commented 6 months ago

has this been fixed yet?

Not yet ..

tiiraluoto commented 6 months ago

does an earlier version work?

ThePuteh commented 6 months ago

does an earlier version work?

The issue up above is for flask older version, once try with latest flask by manually pip the flask, and later remove it and use another older version, still no joy ..

The default in requirements.txt still give me no joy ..

crash0verdrive commented 5 months ago

Traceback (most recent call last): File "/home/null/byob/web-gui/run.py", line 1, in from buildyourownbotnet import create_app File "/home/null/byob/web-gui/buildyourownbotnet/init.py", line 16, in from buildyourownbotnet import client, server File "/home/null/byob/web-gui/buildyourownbotnet/server.py", line 32, in from .models import db File "/home/null/byob/web-gui/buildyourownbotnet/models.py", line 2, in from flask_bcrypt import Bcrypt ModuleNotFoundError: No module named 'flask_bcrypt'

Aerialflame7125 commented 3 months ago

reinstall requirements.txt or manually install every module that brings errors, also make sure you're going to the right URL, as OP said that he went to "127.0.0.1:500"

chikabou commented 3 months ago

Traceback (most recent call last): File "/home/null/byob/web-gui/run.py", line 1, in from buildyourownbotnet import create_app File "/home/null/byob/web-gui/buildyourownbotnet/init.py", line 16, in from buildyourownbotnet import client, server File "/home/null/byob/web-gui/buildyourownbotnet/server.py", line 32, in from .models import db File "/home/null/byob/web-gui/buildyourownbotnet/models.py", line 2, in from flask_bcrypt import Bcrypt ModuleNotFoundError: No module named 'flask_bcrypt'

same here

github-actions[bot] commented 1 month ago

Stale issue message