initstring / cloud_enum

Multi-cloud OSINT tool. Enumerate public resources in AWS, Azure, and Google Cloud.
MIT License
1.54k stars 224 forks source link

Json output #37

Closed maxence-schmitt closed 2 years ago

maxence-schmitt commented 3 years ago

Hello,

I have implemented json output on the project and I want to give it back to the community. I made it using global variable to not impact the structure of the code. I have also update the documentation accordingly. Feel free if you have any remarks

BTW, thanks for this tool. ;)

initstring commented 3 years ago

Thank you so much for the PR!

At quick glance, it looks pretty good. My original code for this project is not great, I know, and I think you've worked around that quite well to get this implemented.

I have considered re-writing from scratch to reduce code re-use and make it easier to contribute additions like this. But to be honest I just don't think I will have the time anytime soon.

I'll come back to this later this week or next.

Thanks again for your great contribution!

maxence-schmitt commented 3 years ago

Hi,

You are welcome. Your code is still pretty good: it makes the job, it is understandable, efficient and modular ;).

Thanks for your feedback don't hesitate if you need some info.

maxence-schmitt commented 3 years ago

Hello,

I have added a fix to a bug. I was getting SERVFAIL error on bruteforcing dns(awsapps,...).

The method used to resolve dns was the "query" method from pythondns. This method is deprecated and was building dns query with search value from resolvconf. Therefore giving SERVFAIL error on some configs(like on Azure VM)

The fix consist to call the not deprecated method "resolve" which by default set the search attribut to None.

Here is some documentation

python dns query doc:

   Query nameservers to find the answer to the question.

    This method calls resolve() with ``search=True``, and is
    provided for backwards compatbility with prior versions of
    dnspython.  See the documentation for the resolve() method for
    further details.

Search attribute of resolve method documentation

A list of dns.name.Name objects. If the query name is a relative name, the resolver will construct absolute query names to try by appending values from the search list.

Regards

initstring commented 2 years ago

So sorry for letting this lag forever! While this is a good contribution, I am trying to keep all things I maintain to a minimum at the moment. Going to close without merging.

Thanks again, have fun hacking!