Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mqtt FATAL: password authentication failed for user "postgres" #11

Open
tanalam opened this issue Nov 12, 2020 · 1 comment
Open

mqtt FATAL: password authentication failed for user "postgres" #11

tanalam opened this issue Nov 12, 2020 · 1 comment

Comments

@tanalam
Copy link

tanalam commented Nov 12, 2020

I followed following steps:
kali@kali:~ /windows/MQTT/mqtt-pwn$ export MQTTPWN_DB_HOST="127.0.0.1"
kali@kali:~ /windows/MQTT/mqtt-pwn$ sudo service postgresql start
[sudo] password for kali:
kali@kali:~ /windows/MQTT/mqtt-pwn$ pg_lsclusters
Ver Cluster Port Status Owner Data directory Log file
12 main 5432 online postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
kali@kali:~/windows/MQTT/mqtt-pwn$ sudo -u postgres psql postgres
could not change directory to "/home/kali/windows/MQTT/mqtt-pwn": Permission denied
psql (12.4 (Debian 12.4-1), server 12.1 (Debian 12.1-2))
Type "help" for help.
postgres=# \q


kali@kali:~/windows/MQTT/mqtt-pwn$ python3.7 run.py
Traceback (most recent call last):
File "/home/kali/.local/lib/python3.7/site-packages/peewee.py", line 3065, in connect
self._state.set_connection(self._connect())
File "/home/kali/.local/lib/python3.7/site-packages/peewee.py", line 3761, in _connect
conn = psycopg2.connect(database=self.database, **self.connect_params)
File "/home/kali/.local/lib/python3.7/site-packages/psycopg2/init.py", line 127, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: FATAL: password authentication failed for user "postgres"
FATAL: password authentication failed for user "postgres"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/kali/.local/lib/python3.7/site-packages/peewee.py", line 3127, in execute_sql
cursor = self.cursor(commit)
File "/home/kali/.local/lib/python3.7/site-packages/peewee.py", line 3111, in cursor
self.connect()
File "/home/kali/.local/lib/python3.7/site-packages/peewee.py", line 3068, in connect
self._initialize_connection(self._state.conn)
File "/home/kali/.local/lib/python3.7/site-packages/peewee.py", line 2902, in exit
reraise(new_type, new_type(exc_value, *exc_args), traceback)
File "/home/kali/.local/lib/python3.7/site-packages/peewee.py", line 185, in reraise
raise value.with_traceback(tb)
File "/home/kali/.local/lib/python3.7/site-packages/peewee.py", line 3065, in connect
self._state.set_connection(self._connect())
File "/home/kali/.local/lib/python3.7/site-packages/peewee.py", line 3761, in _connect
conn = psycopg2.connect(database=self.database, **self.connect_params)
File "/home/kali/.local/lib/python3.7/site-packages/psycopg2/init.py", line 127, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
peewee.OperationalError: FATAL: password authentication failed for user "postgres"
FATAL: password authentication failed for user "postgres"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "run.py", line 9, in
create_all_tables(db)
File "/home/kali/windows/MQTT/mqtt-pwn/mqtt_pwn/database.py", line 49, in create_all_tables
create_tables(db, _all_tables)
File "/home/kali/windows/MQTT/mqtt-pwn/mqtt_pwn/database.py", line 41, in create_tables
db.create_tables(tables)
File "/home/kali/.local/lib/python3.7/site-packages/peewee.py", line 3317, in create_tables
model.create_table(**options)
File "/home/kali/.local/lib/python3.7/site-packages/peewee.py", line 6644, in create_table
and cls.table_exists():
File "/home/kali/.local/lib/python3.7/site-packages/peewee.py", line 6634, in table_exists
return cls._schema.database.table_exists(M.table.name, M.schema)
File "/home/kali/.local/lib/python3.7/site-packages/peewee.py", line 3295, in table_exists
return table_name in self.get_tables(schema=schema)
File "/home/kali/.local/lib/python3.7/site-packages/peewee.py", line 3795, in get_tables
cursor = self.execute_sql(query, (schema or 'public',))
File "/home/kali/.local/lib/python3.7/site-packages/peewee.py", line 3136, in execute_sql
self.commit()
File "/home/kali/.local/lib/python3.7/site-packages/peewee.py", line 2902, in exit
reraise(new_type, new_type(exc_value, *exc_args), traceback)
File "/home/kali/.local/lib/python3.7/site-packages/peewee.py", line 185, in reraise
raise value.with_traceback(tb)
File "/home/kali/.local/lib/python3.7/site-packages/peewee.py", line 3127, in execute_sql
cursor = self.cursor(commit)
File "/home/kali/.local/lib/python3.7/site-packages/peewee.py", line 3111, in cursor
self.connect()
File "/home/kali/.local/lib/python3.7/site-packages/peewee.py", line 3068, in connect
self._initialize_connection(self._state.conn)
File "/home/kali/.local/lib/python3.7/site-packages/peewee.py", line 2902, in exit
reraise(new_type, new_type(exc_value, *exc_args), traceback)
File "/home/kali/.local/lib/python3.7/site-packages/peewee.py", line 185, in reraise
raise value.with_traceback(tb)
File "/home/kali/.local/lib/python3.7/site-packages/peewee.py", line 3065, in connect
self._state.set_connection(self._connect())
File "/home/kali/.local/lib/python3.7/site-packages/peewee.py", line 3761, in _connect
conn = psycopg2.connect(database=self.database, **self.connect_params)
File "/home/kali/.local/lib/python3.7/site-packages/psycopg2/init.py", line 127, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
peewee.OperationalError: FATAL: password authentication failed for user "postgres"
FATAL: password authentication failed for user "postgres"

kali@kali:~/windows/MQTT/mqtt-pwn$

@rapbando
Copy link

You have to change DB_PASSWORD in config.py

or set METHOD to trust for local connections in /etc/postgresql/(RUNNING POSTGRESQL VERSION)/main/pg_hba.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants