News for hackers. Stuff that matters.
Re:MitmProxy2Swagger: Automagically reverse-engineer REST APIs by soheil on Thursday January 02, 2025 @07:41AM (#42573933)
A common misconception is that these tools would work on production APIs. They won't. They are only useful for local development since in production all data is almost certainly encrypted with SSL and no man in the middle technique like this proxy would work.

It's unfortunate that these tools don't explicitly rule that out as not to confuse users.

To actually reverse-engineer production APIs you'll either

a) need access to either the client or the server source code so you can deploy a custom certificate for SSL

b) create your own certificate authority and gain enough trust to have it be accepted on major OS' (this option requires you to be NSA or a secret govt affiliated agency)

Re:MitmProxy2Swagger: Automagically reverse-engineer REST APIs by eightnoneone on Thursday January 02, 2025 @08:17AM (#42574140)
This is only a problem if a client application has a server certificate pinned in source code. Otherwise, you can create a cert with a privacy CA and add it to a desktop OS trusted cert store.
Re:MitmProxy2Swagger: Automagically reverse-engineer REST APIs by K0nserv on Thursday January 02, 2025 @08:26AM (#42574201)
Adding a CA cert to the OS trust store only works if the application uses it. I've encountered apps that don't use the OS trust store or networking stack; even then it's possible to reverse engineer the traffic though[0].

0: https://hugotunius.se/2020/08/07/stealing-tls-sessions-keys-...

Re:MitmProxy2Swagger: Automagically reverse-engineer REST APIs by daemonhorn on Thursday January 02, 2025 @08:14AM (#42574119)
[delayed]
Re:MitmProxy2Swagger: Automagically reverse-engineer REST APIs by CubsFan1060 on Thursday January 02, 2025 @08:06AM (#42574073)
https://docs.mitmproxy.org/stable/overview-getting-started/#...

Seems like the proxy handles all the SSL, and likely strips any SSL Specific headers, etc..

But also, many, many, many companies do this exact thing. Just one example: https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?...

Re:MitmProxy2Swagger: Automagically reverse-engineer REST APIs by cenamus on Thursday January 02, 2025 @07:53AM (#42574002)
Option b could be more about breaking into some office that happens to contain those keys ;)
Re:MitmProxy2Swagger: Automagically reverse-engineer REST APIs by dtn on Thursday January 02, 2025 @07:47AM (#42573961)
Isn't that the point of mitmproxy? https://github.com/mitmproxy/mitmproxy
Re:MitmProxy2Swagger: Automagically reverse-engineer REST APIs by bandrami on Thursday January 02, 2025 @07:56AM (#42574013)
Wait, it works fine on production APIs, what it doesn't work on is "production clients". You're deliberately man-in-the-middling yourself.
Re:MitmProxy2Swagger: Automagically reverse-engineer REST APIs by at0mic22 on Thursday January 02, 2025 @09:10AM (#42574541)
I think HAR export consumption lets you avoid the whole MITM part if we are talking about website API detection