bing_linkedin_cache error

Issue #248 resolved
Matt
created an issue

I am getting the following error in the bing_linkedin_cache module.

[!] KeyError: 'webPages'
File "/usr/share/recon-ng/recon/core/module.py", line 361, in search_bing_api.

Is this an api key issue, or software bug?

Comments (11)

  1. Matt reporter

    It looks like it is an API issue. They killed the previous API model at the end of March. I'm setting up an Azure search API to see if the module will work with the new one.

  2. Mark Muir

    I checked the JSON response and it looks like if it finds no results the object doesn't contain the key 'webPages'. Poor API design, I don't think most people would expect that kind of response. Anyhoo, it's fixed by changing the if statement on line 354 of recon/core/web/module.py to:

    if 'webPages' in resp.json:
        results.extend(resp.json['webPages']['value'])
    else:
        break
    
  3. Brian King

    Thanks, @Mark Muir !

    I've got an update planned for bing_linkedin_cache to better report errors related to use of the new API. I'll include something like the code you offered here. Really appreciate the detail!

  4. Mark Muir

    @Tim Tomes Sorry about that, not sure how that extra 'web' got in there. It's at this line. Btw, just reading back on my own comments I realise it could have been taken as a criticism of the module. I actually was aiming that at Bing....

  5. Brian King

    Thanks for your patience, amigos.

    I just submitted PR #256 to address the two problems surfacing in bing_linkedin_cache that I know of. I updated recon/core/module.py instead of bing_linkedin_cache.py because the root cause for both is Bing behavior that'll be common to any Bing API consumer.

  6. Tim Tomes repo owner

    @Brian King FWIW, I'm getting a TON of results from this module that are in no way associated with the target company. So many so that I've had to throw away all results almost every time. I typically manually sample a handful, and in most cases, all of them have been false positives. Not sure if it's a parsing issue, or the nature of the beast, but I've not found it useful thus far. However, as long as you guys do, I'm cool with continuing to merge your fixes.

  7. Tim Tomes repo owner

    Fixed several minor bugs in the bing_search_api method. Resolves issue #248.

    Improved match quality for the bing_linkedin_cache module.

    Cleaned up string processing. Elected to process everything internal as byte strings. All input is coerced to bytes (str), and all output is converted to unicode. Resolves issue #251.

    → <<cset 70d967e3f530>>

  8. Log in to comment