首页
38 条评论
alufers大约 3 年前
Wanted to show off my little project which helps whith reverse engneering APIs used by various apps. It takes HTTP traffic capturewd by mitmproxy and generates an OpenAPI specification for a given REST API.<p>I have used it already on two apps and the results are good enough to write an alternative client or quickly automate some stuff.
评论 #31356790 未加载
评论 #31362032 未加载
评论 #31359456 未加载
评论 #31364422 未加载
评论 #31355938 未加载
nickysielicki大约 3 年前
This is really incredible. With a rooted android phone and these tools, plus a couple others [1,2,3], you can get a skeleton to implement a backend for any app you want.<p>[1]: <a href="https://github.com/koxudaxi/fastapi-code-generator" rel="nofollow">https://github.com/koxudaxi/fastapi-code-generator</a><p>[2]: <a href="https://github.com/ioxiocom/openapi-to-fastapi" rel="nofollow">https://github.com/ioxiocom/openapi-to-fastapi</a><p>[3]: <a href="https://infosecwriteups.com/hail-frida-the-universal-ssl-pinning-bypass-for-android-e9e1d733d29?gi=c1ca9139c642" rel="nofollow">https://infosecwriteups.com/hail-frida-the-universal-ssl-pin...</a>
评论 #31360655 未加载
评论 #31359518 未加载
SemanticStrengh大约 3 年前
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.
评论 #31356288 未加载
Labo333大约 3 年前
Very nice!<p>On the same note, I wrote a program to generate Python code (requests) from a HAR capture: <a href="https://github.com/louisabraham/har2requests" rel="nofollow">https://github.com/louisabraham/har2requests</a><p>I think using HAR captures is simpler for the end user than spawning mitmproxy as they don't require any installation and are extracted from the network tab of the browser devtools. Is there a reason why you didn't use them?<p>EDIT: I realized that mitmproxy can also get traffic from other devices like phones. Very cool project, I will think about modifying mine to support mitmproxy captures!
评论 #31397208 未加载
评论 #31364232 未加载
captn3m0大约 3 年前
Almost exactly a fit against my idea[1] to generate OpenAPI from HAR files. Going to read through to see if I can add HAR support.<p>[1]: <a href="https://github.com/captn3m0/ideas#openapi-specification-generator-from-http-archives" rel="nofollow">https://github.com/captn3m0/ideas#openapi-specification-gene...</a>
评论 #31357024 未加载
评论 #31397213 未加载
jeroenhd大约 3 年前
Very interesting! Would this also be able to determine what kind of auth (header tokens, cookies, etc) the APIs require or is that something you still need to detect manually?
评论 #31356149 未加载
upupandup大约 3 年前
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?
评论 #31356159 未加载
aleksiy123大约 3 年前
Really awesome, I tried my hand at writing something similar and was surprised at how well it actually ended up working.<p>I feel liken the next step is automatically generating load tests and/or fuzzing tests. Felt like that could be a real product.
评论 #31364425 未加载
eligro91大约 3 年前
Really amazing.<p>We're having hundreds of undocumented endpoints created over the years, and running this tool on our backends will create instantly good documentation<p>Thanks for that! Will give feedbacks if any issues
POPOSYS大约 3 年前
Can we have this as a browser dev tool please?
F12 -> Tab REST -> Create spec from API
Divyeshkharade大约 3 年前
This looks amazing. Will it also capture data types like enumerators by someway detecting patters?
评论 #31356327 未加载
efitz大约 3 年前
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.
evnix大约 3 年前
I did something similar a year ago at the company which I work, I basically wrote a middleware that intercepts all the requests(express JS) and writes to a OpenAPI YAML file. It diffs previous requests to see which parts of the request path could be variables. The system isn't perfect but you are 95% there which is better than having no documentation or to hand write documentation or keep that spec file updated with changes that people introduce in the code. (got promoted to tech lead after this :-) )
oneweekwonder大约 3 年前
little bit off-topic, but do anybody know of something similar for soap/wsdl? I'm aware of soapui mock service.
评论 #31356483 未加载
klyr大约 3 年前
Hi, I would also like to add another tool I'm contributing to at work (cisco) called APIClarity [1]. It aims at reconstructing swagger specifications of REST microservices running in K8S, but can also be run locally.<p>This is a challenging task and we don't support OpenAPI v3 specs yet (we are working on it).<p>Feel free to have a look, and get ideas from it :)<p>We'll also be presenting it at next Kubecon 2022.<p>[1]: <a href="https://github.com/openclarity/apiclarity" rel="nofollow">https://github.com/openclarity/apiclarity</a>
评论 #31364555 未加载
julianlam大约 3 年前
This is great work!<p>This would come in very handy for codebases where an OpenAPI v3 spec would be welcome, but is too onerous to create by hand. Run this for a bit, have it spit out a nearly complete spec, and tweak it a bit to output the final product.<p>In fact, it is precisely what we did to generate the OpenAPI docs for NodeBB [1]. We had an undocumented API that we turned into an OpenAPI v3 file.<p>[1] <a href="https://docs.nodebb.org/api/read" rel="nofollow">https://docs.nodebb.org/api/read</a>
Cilvic大约 3 年前
The question is maybe a bit off-topic a d vague. That's because I struggle to express it with the right terms:<p>I'm looking for a generic tool to build and then serve:<p>Accept Incoming request (API contract A)
Send outgoing request (API contract B) potentially with parameters from the incoming request
Receiving incoming response (API contract B)
Do some translations/string manipulation
Send outgoing response (API contract A)
评论 #31361035 未加载
lsferreira42大约 3 年前
Congrats, this is really awsome and i have a use for it right now, it will be really useful for debuging old and undocumented api's
andrewstuart2大约 3 年前
I've always wanted to build something similar to this, by reading HAR files captured right out of the devtools. Have you given any thought to that as an alternative input?
评论 #31397215 未加载
ducktective大约 3 年前
Is it possible to do this on wireshark/tcpdump pcap dumps? Like for finding out hostnames, endpoints and request packets of HTTPS requests that an android app is making?
评论 #31359400 未加载
jwong_大约 3 年前
Really neat! Gives me an idea on using something like this to generate e.g., CURL commands to mimic SSO flows.<p>Even just documenting an SSO flow as a diagram would be quite neat.
评论 #31359921 未加载
chrisweekly大约 3 年前
Awesome idea! Thank you for creating and sharing!
renewiltord大约 3 年前
This is great. Good example too since Airbnb could use with some improvement to the user chrome: include cleaning fees, etc
dnnssl2大约 3 年前
Starred. Does this work with non-emulated iOS or Android http calls in which you may need to disable app level security?
评论 #31361073 未加载
nattaylor大约 3 年前
I gave this a try today. It was silky smooth! Is it possible to tell Swagger to omit OPTIONS methods?
thefilmore大约 3 年前
This is one of the most clever projects I've seen in a while. Nice work.
dudus大约 3 年前
This is a great idea. Kudos.
dsfiguer大约 3 年前
Oh I love this so much! This would help me with scraping certain sites.
instagary大约 3 年前
How did you bypass cert pinning in the video for the Airbnb app?
评论 #31357664 未加载
评论 #31357688 未加载
andrewstuart大约 3 年前
Be interesting to run a fuzzer on the API whilst doing this.
mutant大约 3 年前
This is absolutely phenomenal!
difu_disciple大约 3 年前
This is fantastic. Thank you
BWStearns大约 3 年前
This is fantastic!
Sytten大约 3 年前
Super nice! We might integrate something similar in Caido proxy.
a-dub大约 3 年前
lol!<p>step 2: features for training a language model on the request and response variables in the mitm stream and a shim for standing up a fully ml data driven zero code mock backend.
useful大约 3 年前
bravo, I've wanted something like this
h1fra大约 3 年前
very nice !
mro_name大约 3 年前
awesome take