the-useless-one / pywerview

A (partial) Python rewriting of PowerSploit's PowerView
GNU General Public License v3.0
890 stars 113 forks source link

Return JSON objects #29

Closed bmarsh9 closed 5 years ago

bmarsh9 commented 5 years ago

Hi there, love the program. Is there an easy way to return all the results as a JSON object instead of just text with newlines?

the-useless-one commented 5 years ago

Hi @bm1391,

Sorry about the delay. As you can see, (and as my colleagues like to remind me, hi guys! :wave:), I don't have much time to take care of this project. Please, feel free make a pull request, if you have time to implement this feature.

Cheers,

Y

bmarsh9 commented 5 years ago

Thanks! This seemed to do the trick

    final = []
    for record in results:
        temp = {}
        for key,value in record.__dict__.items():
            temp[key] = value
        final.append(temp)
    return final