How do I delete a Key List API entry once created?

Issue #279 closed
HankF
created an issue

How do I delete a Key List API entry once created?

An incorrect entry was made in the Key List table and I want to remove it but it is asking for rowid and there is none.

[recon-ng][default][flickr] > delete help Deletes records from the database

Usage: delete <table> [rowid(s)]

optional arguments: rowid(s) => ',' delimited values or '-' delimited ranges representing rowids

[recon-ng][default][flickr] > show keys list rowid

+-------------------------------------------------------------------------------------+ | Name | Value | +-------------------------------------------------------------------------------------+ | bing_api | | | builtwith_api | | | censysio_id | | | censysio_secret | | | flicker_api | I want to delete this entry

Comments (5)

  1. Brian King

    You can delete individual keys by their names. Something like keys delete bing_api

    If you ever forget, you can do the ${object} help thing to get some (very terse) help, as in:

    [recon-ng][default] > keys help
    Manages framework API keys
    
    Usage: keys [list|add|delete]
    
  2. HankF reporter

    Thanks,,,,but that didn't work...it was asking for rowid

    [recon-ng][default] > delete flicker_api Deletes records from the database

    Usage: delete <table> [rowid(s)]

    optional arguments: rowid(s) => ',' delimited values or '-' delimited ranges representing rowids

  3. Brian King

    Maybe I'm misunderstanding.

    The framework treats API keys as a special kind of object. They're different from the data recon_ng collects in the companies or contacts tables of each workspace, for example. The keys are stored in a separate database, so that you don't have to re-enter them for every workspace.

    If you look in your ~/.recon-ng/ directory, you'll see a file keys.db and a directory workspaces.

    • The keys.db file is where your API keys live.
    • You can create any number of workspaces in the workspaces directory.

    When you start a command with delete, the framework is looking at the tables in the database for your current workspace, and not the keys.db database.

    Here's what I see when I add a key and then delete it. Does this help?

    [recon-ng][default] > keys add bing_api 123
    [*] Key 'bing_api' added.
    [recon-ng][default] > keys list
    
      +--------------------------+
      |       Name       | Value |
      +--------------------------+
      | bing_api         | 123   |
      | builtwith_api    |       |
    
    <!-- snip -->
    
    [recon-ng][default] > keys delete bing_api
    [*] Key 'bing_api' deleted.
    [recon-ng][default] > keys list
    
      +--------------------------+
      |       Name       | Value |
      +--------------------------+
      | builtwith_api    |       |
      | censysio_id      |       |
    

    Below shows that 'companies' is a table that's part of my current workspace, but 'keys' is not.

    [recon-ng][default] > query select * from companies
    [*] No data returned.
    
    [recon-ng][default] > query select * from keys
    [!] Invalid query. OperationalError no such table: keys.
    
  4. Tim Tomes repo owner

    Yep. You are trying to delete keys using the delete shorthand command. That isn't possible as it is only meant for harvested data. You can only manipulate keys through the keys interface. Try typing keys help at the prompt.

  5. Log in to comment