root@kali:/opt/empire# ./ps-empire server
(pymysql.err.OperationalError) (2003, “Can’t connect to MySQL server on ‘localhost’ ([Errno 111] Connection refused)”)
(Background on this error at: https://sqlalche.me/e/20/e3q8)
Traceback (most recent call last):
File “/opt/empire/.venv/lib/python3.11/site-packages/pymysql/connections.py”, line 569, in connect
sock = socket.create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/socket.py”, line 851, in create_connection
raise exceptions[0]
File “/usr/lib/python3.11/socket.py”, line 836, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py”, line 145, in __init__
self._dbapi_connection = engine.raw_connection()
^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py”, line 3288, in raw_connection
return self.pool.connect()
^^^^^^^^^^^^^^^^^^^
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py”, line 452, in connect
return _ConnectionFairy._checkout(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py”, line 1267, in _checkout
fairy = _ConnectionRecord.checkout(pool)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py”, line 716, in checkout
rec = pool._do_get()
^^^^^^^^^^^^^^
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/pool/impl.py”, line 169, in _do_get
with util.safe_reraise():
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py”, line 147, in __exit__
raise exc_value.with_traceback(exc_tb)
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/pool/impl.py”, line 167, in _do_get
return self._create_connection()
^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py”, line 393, in _create_connection
return _ConnectionRecord(self)
^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py”, line 678, in __init__
self.__connect()
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py”, line 902, in __connect
with util.safe_reraise():
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py”, line 147, in __exit__
raise exc_value.with_traceback(exc_tb)
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py”, line 898, in __connect
self.dbapi_connection = connection = pool._invoke_creator(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/engine/create.py”, line 637, in connect
return dialect.connect(*cargs, **cparams)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/engine/default.py”, line 615, in connect
return self.loaded_dbapi.connect(*cargs, **cparams)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/empire/.venv/lib/python3.11/site-packages/pymysql/__init__.py”, line 94, in Connect
return Connection(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/empire/.venv/lib/python3.11/site-packages/pymysql/connections.py”, line 327, in __init__
self.connect()
File “/opt/empire/.venv/lib/python3.11/site-packages/pymysql/connections.py”, line 619, in connect
raise exc
pymysql.err.OperationalError: (2003, “Can’t connect to MySQL server on ‘localhost’ ([Errno 111] Connection refused)”)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “/opt/empire/empire/server/core/db/base.py”, line 34, in try_create_engine
with engine.connect():
^^^^^^^^^^^^^^^^
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py”, line 3264, in connect
return self._connection_cls(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py”, line 147, in __init__
Connection._handle_dbapi_exception_noconnection(
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py”, line 2426, in _handle_dbapi_exception_noconnection
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py”, line 145, in __init__
self._dbapi_connection = engine.raw_connection()
^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py”, line 3288, in raw_connection
return self.pool.connect()
^^^^^^^^^^^^^^^^^^^
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py”, line 452, in connect
return _ConnectionFairy._checkout(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py”, line 1267, in _checkout
fairy = _ConnectionRecord.checkout(pool)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py”, line 716, in checkout
rec = pool._do_get()
^^^^^^^^^^^^^^
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/pool/impl.py”, line 169, in _do_get
with util.safe_reraise():
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py”, line 147, in __exit__
raise exc_value.with_traceback(exc_tb)
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/pool/impl.py”, line 167, in _do_get
return self._create_connection()
^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py”, line 393, in _create_connection
return _ConnectionRecord(self)
^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py”, line 678, in __init__
self.__connect()
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py”, line 902, in __connect
with util.safe_reraise():
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py”, line 147, in __exit__
raise exc_value.with_traceback(exc_tb)
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py”, line 898, in __connect
self.dbapi_connection = connection = pool._invoke_creator(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/engine/create.py”, line 637, in connect
return dialect.connect(*cargs, **cparams)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/empire/.venv/lib/python3.11/site-packages/sqlalchemy/engine/default.py”, line 615, in connect
return self.loaded_dbapi.connect(*cargs, **cparams)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/empire/.venv/lib/python3.11/site-packages/pymysql/__init__.py”, line 94, in Connect
return Connection(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/empire/.venv/lib/python3.11/site-packages/pymysql/connections.py”, line 327, in __init__
self.connect()
File “/opt/empire/.venv/lib/python3.11/site-packages/pymysql/connections.py”, line 619, in connect
raise exc
sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2003, “Can’t connect to MySQL server on ‘localhost’ ([Errno 111] Connection refused)”)
(Background on this error at: https://sqlalche.me/e/20/e3q8)
Failed connecting to database using mysql+pymysql://empire_user:empire_password@localhost:3306
Perhaps the MySQL service is not running.
Try executing: sudo systemctl start mysql
root@kali:/opt/empire# cd ./ps-empier clint
bash: cd: too many arguments
root@kali:/opt/empire# ./ps-empier clint
bash: ./ps-empier: No such file or directory
root@kali:/opt/empire# ./ps-empire client
`
.–::///+
-+sydmmmNNNNNNN
./ymmNNNNNNNNNNNNNN
-ymmNNNNNNNNNNNNNNNNN
`ommmmNNNNNNNNNNNNNNNNN
.ydmNNNNNNNNNNNNNNNNNNNN
`odmmNNNNNNNNNNNNNNNNNNNN
`/hmmmNNNNNNNNNNNNNNNNMNNN
+hmmmNNNNNNNNNNNNNNNNNMMN
..ymmmNNNNNNNNNNNNNNNNNNNN
:.+so+//:—…….—-::-
.
….—-:///++++
.-/osy+////:::—…-dNNNN
:sdyyydy
:mNNNNM
-hmmdhdmm:
`.+hNNNNNNM
.odNNmdmmNNo
`.:+yNNNNNNNNNN
`-sNNNmdh/dNNhhdNNNNNNNNNNNNNNN
`-hNNNmNo::mNNNNNNNNNNNNNNNNNNN
`-hNNmdNo–/dNNNNNNNNNNNNNNNNNN
:dNmmdmd-:+NNNNNNNNNNNNNNNNNNm
`/hNNmmddmd+mNNNNNNNNNNNNNNds++o
/dNNNNNmmmmmmmNNNNNNNNNNNmdoosydd
`sNNNNdyydNNNNmmmmmmNNNNNmyoymNNNNN
:NNmmmdso++dNNNNmmNNNNNdhymNNNNNNNN
-NmdmmNNdsyohNNNNmmNNNNNNNNNNNNNNNN
`sdhmmNNNNdyhdNNNNNNNNNNNNNNNNNNNNN
/yhmNNmmNNNNNNNNNNNNNNNNNNNNNNmhh
`+yhmmNNNNNNNNNNNNNNNNNNNNNNmh+:
`./dmmmmNNNNNNNNNNNNNNNNmmd.
`ommmmmNNNNNNNmNmNNNNmmd:
:dmmmmNNNNNmh../oyhhhy:
`sdmmmmNNNmmh/++-.+oh.
`/dmmmmmmmmdo-:/ossd:
`/ohhdmmmmmmdddddmh/
`-/osyhdddddhyo:
.—-.`
███████╗███╗ ███╗██████╗ ██╗██████╗ ███████╗
██╔════╝████╗ ████║██╔══██╗██║██╔══██╗ ██╔════╝
█████╗ ██╔████╔██║██████╔╝██║██████╔╝ █████╗
██╔══╝ ██║╚██╔╝██║██╔═══╝ ██║██╔══██╗ ██╔══╝
███████╗██║ ╚═╝ ██║██║ ██║██║ █████║███████╗
╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚════╝╚══════╝
Use the ‘connect’ command to connect to your Empire server.
‘connect -c localhost’ will connect to a local empire instance with all the defaults
including the default username and password.
INFO: Attempting to connect to server: localhost
ERROR: <urllib3.connection.HTTPConnection object at 0x7efebecd6a50>: Failed to establish a new connection: [Errno 111] Connection refused