Giter Club home page Giter Club logo

Comments (8)

ojensen5115 avatar ojensen5115 commented on August 14, 2024 1

Interesting. This is processing the result of a query to https://api.hackertarget.com/dnslookup. See example:
https://api.hackertarget.com/dnslookup/?q=google.com

Trying to reproduce your error, the only response I've been able to generate which would trigger this error is in the case when the API does not actually return any results, e.g.:
https://api.hackertarget.com/dnslookup/?q=invalidinput

in which case the run of ASM wouldn't make much sense anyway.

from attacksurfacemapper.

warrenjmcdonald avatar warrenjmcdonald commented on August 14, 2024 1

Thanks for looking at this. The case where this fails was where I pointed at a subdomain, that has no MX or TXT records for mail handling.
It works fine for whole domain as those records are present.

I am really just suggesting that since this scenario is not uncommon, it would be better to catch this condition and fail this inside hosthunter.py gracefully rather than exit out of the whole test with failure, requiring to start again with different target params.

from attacksurfacemapper.

ConorDSherman avatar ConorDSherman commented on August 14, 2024 1

@superhedgy I think this is solved by simply change the position of the index in the for loop in the hosthunter.py script. It seems to work for me after I made this adjustment.

Orginal
if (word[4] == "TXT") and ("v=spf1" in word[5]):

Adjusted
if (word[0] == "TXT") and ("v=spf1" in word[1]):

from attacksurfacemapper.

ojensen5115 avatar ojensen5115 commented on August 14, 2024

Huh, actually this is odd. Looks like that API yields the invalid input error for https://api.hackertarget.com/dnslookup/?q=something.com . I would guess that this is a bug in hackertarget where they're incorrectly treating something.com as equivalent to example.com. Do you see this behavior with any other domains?

from attacksurfacemapper.

ojensen5115 avatar ojensen5115 commented on August 14, 2024

Nice find! Yeah, that seems sensible to me too.

from attacksurfacemapper.

serval21 avatar serval21 commented on August 14, 2024

Hi,
I've got the same error with a domain not a subdomain
File "/home/user/AttackSurfaceMapper/modules/hosthunter.py", line 96, in dnslookup
if (word[4] == "TXT") and ("v=spf1" in word[5]):
IndexError: list index out of range

from attacksurfacemapper.

ConorDSherman avatar ConorDSherman commented on August 14, 2024

I am having the same error as @serval21 and I have tried this on multiple hosts now. The domains are legitimate and the results are the expected format from the hackertarget.com service.

The SPF Record matches the results of the google.com query https://api.hackertarget.com/dnslookup/?q=google.com

from attacksurfacemapper.

superhedgy avatar superhedgy commented on August 14, 2024

True, they have changed their format. Thanks again Conor, I am pushing an update tonight.

from attacksurfacemapper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.