Welcome to our Community
Wanting to join the rest of our members? Feel free to sign up today.
Sign up

Enumerating Parrot Anafi's API endpoints (part 3 of 3)

rudispropmgmt

Member
Joined
Nov 1, 2022
Messages
7
Reaction score
2
Location
Denver, CO (USA)
Website
marcusboydresearch.wordpress.com
In the previous 2 posts I covered:
1. How to discover API endpoints on Parrot Anafi & Skycontroller 3
2. Review API response data & compare API data against SDK events from Wireshark

In this post I'll cover:
  1. How to view events on "SDK" tab of the drone's webserver in other tools
  2. How to snoop around to find other websocket endpoints ;-)
  3. How to via websocket connection to see those events (aka "sdk notifications")
  4. Compare events from "sdk notifications" to Wireshark output & SDK description API endpoint

During this API research process, I found the "SDK" tab from the webserver streamed events in real-time. I'm pretty certain this is the GroundSDK because events do not start flowing on this page until both the drone is running and the controller is open & connected to my phone. Additionally, I played around with the joysticks & camera buttons on the controller & saw corresponding events in this page.
drone-webserver-SDKtab.PNG

I wanted a way to send the events from the drone webserver to an external tool because the webserver only stores 500 events before they're purged. So I started searching for more clues. One good way to find API endpoints & webapp functions is to look at the developer tools of a browser. For example, on Google Chrome you can right-click on screen & select "Inspect". You can Inspect the drone's webserver page, go to the Source tab, then the "JS" (extension for javacript) folder like in the picture below.

Inspecting browser scripts on drone webserver​

drone-webserver-console.PNG

If you do this, then you'll find a large file of javascript commands. Within that file search "api" and you'll sees a series of results that look like this:
WebSocket(o.b.getWebsocketUrl("/api/v1/sdk/notifications"))

The above snippet means a websocket connection is opened to an API endpoitn to get SDK notifications. This is how you can stream SDK messages to places other than the drone's webserver page.

Next, I wanted to test the ability to (1) open a websockets connection & (2) stream events to that tool. So I opened Postman (mentioned on post 1 of this series) & created a new websockets connection:

Postman new websocket connection​

Postman-new-websocket.PNG
Once I created a new websocket connection tab in Postman, I configured it with the details in the picture below:

Postman configured websocket connection​

Postman-websocket1.PNG


aaaaand BOOM! I was excited to see the websocket messages were in the same format as I found in Wireshark from the end of the second post in this series. I suspect you can pull websocket messages with tools other than Postman but won't investigate that here.

In closing, I hope this was a helpful overview to figure out the available API endpoints that can be leveraged. Enjoy!
 

Latest threads

Members online

No members online now.

Forum statistics

Threads
5,030
Messages
43,668
Members
7,282
Latest member
ilizafi