rapid7 / metasploit-framework

Metasploit Framework
https://www.metasploit.com/
Other
34.13k stars 13.97k forks source link

msfrpc can't store some information to database #11689

Closed n1ngod closed 1 year ago

n1ngod commented 5 years ago

Steps to reproduce

  1. First, i through "./msfrpcd -P test -S -f -a 0.0.0.0" to start a msf rpc services, of course it works
  2. Then, i use pymetasploit library in python to connect it, it's also no problem, then i call "db.connect" to connect postgres, it create some schema in my postgres,it seems all right. 3.then i execute rpc.call("auth.token_generate"), i know it will store the token to the database by document,but i can't get any information in table "api_keys", i really database is no problem, because when i get a meterpreter session, it can store session information to "sessions" table. Why token can't store to the "api_keys" table?what mistake did i make?what should i call the rpc service?

My python code: In [2]: client = MsfRpcClient(password=‘test’) In [3]: client.db.connect(username=‘postgres’, database=‘msf’, host='127.0.0.1',password='test', port='5432', driver='postgres') Out [3]: True In [4]: client.call("auth.token_generate") Out[4]: {'result': 'success', 'token': 'TEMP5221809879810272165168959285'}

I can't get token from "api_keys" table, Why?

n1ngod commented 5 years ago

All versions are up to date,and i through official docker image to use the metasploit.

github-actions[bot] commented 3 years ago

Hi!

This issue has been left open with no activity for a while now.

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 30 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request.

adfoster-r7 commented 1 year ago

Wasn't able to replicate; will close this for now as it might have been fixed