Live data from Hacker News

Show HN: Mitmproxy2swagger – Automagically reverse-engineer REST APIs

github.com

11–20 of 87 posts

Re: Show HN: Mitmproxy2swagger – Automagically reverse-engineer REST APIs

#11

this is absolutely insane!!! I understand capturing the REST api network part, is it then examining the request body, headers being sent back and forth to figure out the API?

Yes, this is basically what this program does.

Re: Show HN: Mitmproxy2swagger – Automagically reverse-engineer REST APIs

#14

Can this be used to generate a REST documentation for your own frontend just by interacting with it? This should be augmented via a crawler, that click everyclickable element recursively.

Totally, but you would need to do some manual cleanup and naming afterwards to make it more useful than just reading the source code. You could also for example use your integration tests if you have some to capture as much routes as possible.

Re: Show HN: Mitmproxy2swagger – Automagically reverse-engineer REST APIs

#15
post #14

Can this be used to generate a REST documentation for your own frontend just by interacting with it? This should be augmented via a crawler, that click everyclickable element recursively.

Totally, but you would need to do some manual cleanup and naming afterwards to make it more useful than just reading the source code. You could also for example use your integration tests if you have some to capture as much routes as possible.

of course the generated doc should be refined (e.g. filling missing types, error codes) but your lib would save us a lot of work and make the world a better place.

Re: Show HN: Mitmproxy2swagger – Automagically reverse-engineer REST APIs

#16

This looks amazing. Will it also capture data types like enumerators by someway detecting patters?

I thought about it, but it would be hard to distinguish between an enumerator and just static data. For example if you logged in with only one account it could classify the "username" field as an enumeration, because there is only one captured value.

Re: Show HN: Mitmproxy2swagger – Automagically reverse-engineer REST APIs

#17
post #16

This looks amazing. Will it also capture data types like enumerators by someway detecting patters?

I thought about it, but it would be hard to distinguish between an enumerator and just static data. For example if you logged in with only one account it could classify the "username" field as an enumeration, because there is only one captured value.

Yeah I imagine that is nearly impossible without capturing data at scale. Awesome tool! I'm super grateful :-)

Re: Show HN: Mitmproxy2swagger – Automagically reverse-engineer REST APIs

#20
This is awesome; I’m going to try it as soon as I get back to my desk. I’ve been working on trying to glue together tools to translate Charles proxy output to OpenAPI (swagger). I think it would be a great tool to have in a web app reverse engineering toolbox.
Post reply on HN