Several mistakes were committed: - running everything as root - mounting the root file system as read-write - hardcoding the encryption key - enabling a network service when it's not necessary (we hadn't configured this feature, it is enabled by default) But most importantly, input wasn't sanitised. Notice that it expects a MAC address, which has a very strict and well known format: aa:bb:cc:dd:ee:ff After copying to an intermediate buffer with a limited size (as they did correctly), they should have validated the MAC address before proceeding. This could have easily been done with a regex, such as: ^[a-fA-F0-9]{2}(:[a-fA-F0-9]{2}){5}$ In addition, they could have introduced additional security controls, such as a properly configured firewall, sandboxing, etc.
@Ralph Reilly there's a reason for this, it saves manufacturing costs as they can just flash the same exact image over and over and let the device bootstrap when it's booted up for the first time.
@@TonyLee_windsurf You can't "hide" the private key, as the software will need it to decrypt the packet. Hard coding the key is terrible because every single router using the same firmware uses the same key. If the key was saved on a file, and checked and generated if the file was missing, it would not be possible to hack every router without physical access to it first.
Great work guys! Pedro’s explanation of the team’s process of auditing system calls is exceptional. This kind of breakdown is something I rarely see covered in detail.
We absolutely love these kinds of detailed breakdown of your thought process while looking at a target. Definitely continue doing these types of videos
You guys did an amazing job in explaining the exploitation process. For a next video I would love to see more on how you reverse engineer/decrypt the code and the process of analyzing it. Thanks for giving back to the community! You rock!
Thanks for the feedback! We will show that in detail in future videos. Bear in mind there was a serious reverse engineering effort behind all of this. Most functions in the binary were not even defined, and all symbols are our names (the binary had few symbols).
@@FlashbackTeam I understand. But what for me personally would be super interesting to see, is how to start turning that binary code into code. I think that there are not that many videos on hardware > code > recognising exploitable functions. Again, thanks for giving back to the community!
@@FlashbackTeam I was thinking "how on earth you got all those symbols if the code wasn't compiled for debugging", thanks for the clarification, a lot of effort indeed.
Wow, impressive work guys, learnt so much in a single video. As feedback I would say that it would be cool to have a quick look on the exploiting writing process ;)
I like what you have done there. Very straight forward explenation, and I have to slightly disagree with you saying it was rushed. It was perfect. Longer videos are harder to follow and the amount you put in and the little backstories like being in Laos spiced it up a little. I am looking forward to more of your exploits.
idk what I should comment now.. Everything I wanted to say like 'this is awesome' and stuff has been said by everyone.. But I'm still commenting to let you guys know that we really need more of this great content from you guys!! Really appreciate it!!
Thank for sharing this. I like the no-nonsense style. For your first video this is a great piece of work. Like your graphics - a picture says more than thousand words. Must have been a lot of work but it pays back.
non-programmer here i love this breakdown. i get to witness the mindset of successfully exploiting a vulnerability (within a 13 character limitation). i actually got it. most of it made sense even to an 'illiterate' bystander like myself. pwn bounty well deserved!
From a developer sight of view, it makes me now think twice about validation of strings from not trust able sources, as the exploit would break if any function in the call chain would check the input values fully also for injection. Very interesting how "easy" it is to gain access when you reach a specific level of knowledge, very nice video and remote Injection method of the remote shell!
Hi , Great work guys!!!!!! I just found your channel yesterday and I'm really enjoying your videos !!!!!!!! Everything I wanted to say like 'this is awesome' !!!!!!! Please make longer video about setup your environment and witch program use for exploit for router !
Loved the experience watching the video. As a n00b, I'm thankful for the details presented and would request that even more videos with even more details would be much appreciated. And wish both of you the very best.Cheers,
Money well deserved! This was just beautiful. Thanks for sharing guys. I'd have to re-watch the reverse engineering part of the system calls a few times to understand what's happening though 😅
That was pretty cool. I will like to see more videos like this one. Also a video of how someone can get started in hardware hacking, tools required will be appreciated
Not checking the format of the payload basically. If you are expecting a Mac address then at least check that the payload is a valid Mac address before you append it to a string and execute it (as root too duh!)... Great work guys, this is genius, the tracing of where the data came in, the print 'x'>>a to built up the file was clever and the script to send that over as TPDP packets was great. Then you have the paperclip! A great masterclass... Lots of examples of hacking embedded devices that are online involve getting a firmware update, using binwalk to break it down and look for vulnerabilities in software or hardcoded passwords and that's about it. Actual "hardware" hacking though is a very different beast.
Great job guys! Does that mean that us, the users, are vulnerable through the network just by having one of these at home?. Or would I be in trouble just if I invite you for a cup of coffee?🤣🤣🤣 Keep it up!
If you use it at home, you would only be vulnerable if you invited us for a cup of coffee... but it's not that simple, let us explain! Routers like these are used in small businesses to provide Internet service to the business' customers, which would be connected to the LAN interfaces (Wi-Fi or Ethernet). As a small business customer (let's say in a cafe, hotel or hospital), you could abuse this vulnerability, take control of the router, and attack the other customers. LAN style attacks are also relevant in large businesses, where for example you connect to a segregated Wi-Fi network, but are still connected to the LAN-side of a router, and could then execute similar attacks. In the same competition we actually hacked the same router over the WAN interface (where the router connects to the Internet), we will put a video up describing the attack in the future. This last phrase means that if you use this router, you are still vulnerable from the outside of your local network (outside of the coffee cup zone), NOT due to this specific vulnerability, but due to others we found in the same competition :D
even this video is more than 10 minutes, I'm take a break from my workload to watch this video nice education video bro, from me who interest on vulnerability hardware
Someone help me with a little "slap" on how to get the online interface login once I'm in it. 🤔 (I know the basics and the location of the hash required for encryption. But it has nothing to do with the online superficial passw) I had a lot of fun with the video anyway! Anyway, I had a great time with the video, let there be more of these tplink stuff..! ✔ 😎
Nice video guys! Would it be possible to do a follow up video that talks about your danger.sh script? Not necessarily a line by line review, but maybe big picture "here's some of the ghidra api calls we use." I'd like to make a similar script for IDA.
We only use the Ghidra Hues plugin to have a dark theme. The original author deleted it, but here is a copy in Pedro's github repo: github.com/pedrib/ghidra.hues
I already didn't buy TP-Link for other reasons. This is just the final nail in the coffin. Sadly, alot of even reputable brands do similar things. Would love to see if Asus, Netgear, Eero and others have the same flaws. Makes you understand why Cyclops Blink was so effective in spreading.
Really enjoyed the video.. especially the 13 character limit part.. Out of curiosity, is there any reason tp link left the uart open or was it something they just overlooked? P.S extra kudos to the subtle humor you injected into this video.
"kurwa!" LOL. But yeah, I saw a lot of such holes everywhere, but I'm too lazy to decompile and reverse it. Pedro did a great job explaining it step by step for people who thinks that you can hack it in a jiffy.
My professional background is in IT but programming and hacking are like a totally other world, something I have never gone near. This was mega interesting to me! And I loved the 'urmum' content too ;-)
As a software developer I would have liked to hear what could have been done to prevent this. Obviously not running everything as root to start with.
Several mistakes were committed:
- running everything as root
- mounting the root file system as read-write
- hardcoding the encryption key
- enabling a network service when it's not necessary (we hadn't configured this feature, it is enabled by default)
But most importantly, input wasn't sanitised. Notice that it expects a MAC address, which has a very strict and well known format: aa:bb:cc:dd:ee:ff
After copying to an intermediate buffer with a limited size (as they did correctly), they should have validated the MAC address before proceeding. This could have easily been done with a regex, such as: ^[a-fA-F0-9]{2}(:[a-fA-F0-9]{2}){5}$
In addition, they could have introduced additional security controls, such as a properly configured firewall, sandboxing, etc.
@Ralph Reilly there's a reason for this, it saves manufacturing costs as they can just flash the same exact image over and over and let the device bootstrap when it's booted up for the first time.
for the C, C++ devs : -Wall -Wextra -Wconversion -Werror
@@supermaster2012 One can use public key encryption, at lease hide the private key. Harder for hacker to create diff encrypted pkt.
@@TonyLee_windsurf You can't "hide" the private key, as the software will need it to decrypt the packet. Hard coding the key is terrible because every single router using the same firmware uses the same key. If the key was saved on a file, and checked and generated if the file was missing, it would not be possible to hack every router without physical access to it first.
It wasn't rushed at all. A perfect explanation at a perfect pace.
What was "connected pin to line" what was that? What did he say?
Great work guys! Pedro’s explanation of the team’s process of auditing system calls is exceptional. This kind of breakdown is something I rarely see covered in detail.
We absolutely love these kinds of detailed breakdown of your thought process while looking at a target. Definitely continue doing these types of videos
the way you created a file one character at a time is so smart . i would have felt so stuck with the 13 characters .
My god. I think this is the best channel ive seen so far. These dudes are legit
You guys did an amazing job in explaining the exploitation process. For a next video I would love to see more on how you reverse engineer/decrypt the code and the process of analyzing it. Thanks for giving back to the community! You rock!
Thanks for the feedback!
We will show that in detail in future videos. Bear in mind there was a serious reverse engineering effort behind all of this. Most functions in the binary were not even defined, and all symbols are our names (the binary had few symbols).
@@FlashbackTeam I understand. But what for me personally would be super interesting to see, is how to start turning that binary code into code. I think that there are not that many videos on hardware > code > recognising exploitable functions.
Again, thanks for giving back to the community!
@@FlashbackTeam I was thinking "how on earth you got all those symbols if the code wasn't compiled for debugging", thanks for the clarification, a lot of effort indeed.
I went from trying to find a work around to remove ISP limitation to Getting full control of the device. Your videos were a big help.
I just found your channel yesterday and I'm really enjoying your videos. The information and quality is unmatched!
Wow, impressive work guys, learnt so much in a single video. As feedback I would say that it would be cool to have a quick look on the exploiting writing process ;)
Thank you for your feedback! We will go into depth on that in the next videos!
@@FlashbackTeam u are welcome, can't wait to watch them :P
@@FlashbackTeam yes, I guess, the length of the video doesn't matter for people who will wanna learn. So go for it.
This is my new favorite RUclips channel full stop. Excellent work guys!
I like what you have done there. Very straight forward explenation, and I have to slightly disagree with you saying it was rushed. It was perfect. Longer videos are harder to follow and the amount you put in and the little backstories like being in Laos spiced it up a little. I am looking forward to more of your exploits.
idk what I should comment now.. Everything I wanted to say like 'this is awesome' and stuff has been said by everyone.. But I'm still commenting to let you guys know that we really need more of this great content from you guys!! Really appreciate it!!
Thank for sharing this. I like the no-nonsense style. For your first video this is a great piece of work. Like your graphics - a picture says more than thousand words. Must have been a lot of work but it pays back.
... fiiiiinally an actually GOOD channel on such topics...
This was awesome, and thanks for showing your thought process when discovering this vuln. Hope to learn more from you guys in the future
You guys rocked🔥 lot of learning in a single video from hardware to binary, reverse engineering to maintaining access .....😃
That was fantastic and very well put together. Very educational. So excited to see more of this!
non-programmer here
i love this breakdown. i get to witness the mindset of successfully exploiting a vulnerability (within a 13 character limitation).
i actually got it. most of it made sense even to an 'illiterate' bystander like myself.
pwn bounty well deserved!
Blyat, this is the best router exploit video on RUclips by a long way! More of this guys ✌️
From a developer sight of view, it makes me now think twice about validation of strings from not trust able sources, as the exploit would break if any function in the call chain would check the input values fully also for injection. Very interesting how "easy" it is to gain access when you reach a specific level of knowledge, very nice video and remote Injection method of the remote shell!
Hi ,
Great work guys!!!!!! I just found your channel yesterday and I'm really enjoying your videos !!!!!!!! Everything I wanted to say like 'this is awesome' !!!!!!! Please make longer video about setup your environment and witch program use for exploit for router !
This is very, very well graphiced exploit explanation. Huge thanks, there are million exploit explanations but i never seen like this one.
Awesome guys! What a video... very clear and objective. The exploit sending one char at a time was really dope
Excellent video. I couldn't stop laughing at the `echo urmom>d` hahaha
explanation in the state of art! Brilliant, and waiting for more, congratulations!
brilliant waiting for more!
Great work, love the thought behind constructing the final final in chunks due to the character limitation.
Nice exploit, even better explanation! Great work.
Loved the experience watching the video. As a n00b, I'm thankful for the details presented and would request that even more videos with even more details would be much appreciated. And wish both of you the very best.Cheers,
Congratulations guys. Looking forward to learning more. Thank you for starting this channel 👍🏼👌🏽
I never get tired of your voice ;)
Money well deserved! This was just beautiful. Thanks for sharing guys. I'd have to re-watch the reverse engineering part of the system calls a few times to understand what's happening though 😅
mad respect for you guys, what's better than learning from the bests.
That was pretty cool. I will like to see more videos like this one. Also a video of how someone can get started in hardware hacking, tools required will be appreciated
Nice work, thanks for the great deep dive! Keep up the great work on developing that specialty education platform :)
Thanks, will do!
Great video, first time I've been aware of a reverse shell before really interesting stuff!
The explanation is quite good and making it seem easy. Good guys
Loved it, great explanation with the reversing, thanks guys!
Very nice job! Congratulations boys!!!
Really nice and clear breakdown guys and congrats on the bounty!
Printing one char at a time to a file due to the charlimit then executing the file was genius!
Amazing content guys. Waiting for more🙃
Great work! Looking forward to the next video.
You guy's are insane, please release nore videos. Highly appreciated
Verry nice job. I don’t understand what you exactly does but it is so a nice idea. I want to learn this. Sooo nice
Awesome video! Great pace and explanation. The file buildup within the 13 char limit is genius haha. Well done!
Very cleverly done. I really enjoyed watching 👍
Pure genius the writing to a shell script and then executing lol
Not checking the format of the payload basically. If you are expecting a Mac address then at least check that the payload is a valid Mac address before you append it to a string and execute it (as root too duh!)... Great work guys, this is genius, the tracing of where the data came in, the print 'x'>>a to built up the file was clever and the script to send that over as TPDP packets was great. Then you have the paperclip! A great masterclass...
Lots of examples of hacking embedded devices that are online involve getting a firmware update, using binwalk to break it down and look for vulnerabilities in software or hardcoded passwords and that's about it. Actual "hardware" hacking though is a very different beast.
Awesome work! Wait for more and learn from you.
Wow! Thank you so much for your work on this video. Explanations are great for someone starting out like me.
Panowie, super robota, jako początkujący embeddeddev bardzo dziękuję za content!
Thank you guys. Absolutely awesome video! Really well structured and presented.
Well done Flashback Team!
This video was amazing! Right to the point and I understood everything! thank you!
This is the best hardware hacking video I have seen in my life. Thank you!
Really nice work dudes, love the idea of building it one char at a time.
Really enjoyed this explanation. Great job guys
Absolutely fantastic explanation. Really enjoyed it and understood it!
Amazing, cant wait for next video
Great job guys! Does that mean that us, the users, are vulnerable through the network just by having one of these at home?. Or would I be in trouble just if I invite you for a cup of coffee?🤣🤣🤣 Keep it up!
If you use it at home, you would only be vulnerable if you invited us for a cup of coffee... but it's not that simple, let us explain!
Routers like these are used in small businesses to provide Internet service to the business' customers, which would be connected to the LAN interfaces (Wi-Fi or Ethernet).
As a small business customer (let's say in a cafe, hotel or hospital), you could abuse this vulnerability, take control of the router, and attack the other customers.
LAN style attacks are also relevant in large businesses, where for example you connect to a segregated Wi-Fi network, but are still connected to the LAN-side of a router, and could then execute similar attacks.
In the same competition we actually hacked the same router over the WAN interface (where the router connects to the Internet), we will put a video up describing the attack in the future.
This last phrase means that if you use this router, you are still vulnerable from the outside of your local network (outside of the coffee cup zone), NOT due to this specific vulnerability, but due to others we found in the same competition :D
GND pins are usually easy to find by eye since they're most often connected to a GND plane instead of a line.
ah so late for this, but absolutely worth the watch. Congrats guys on this fantastic job. "Looks juicy" my new favorite phrase :p
Excellent explanation, super cool method of exploit!
even this video is more than 10 minutes, I'm take a break from my workload to watch this video
nice education video bro, from me who interest on vulnerability hardware
This is amazing. Good job guys!
Great video and explanation!
Didn't expect to see Dashie in this video. But I'll take it!
Got damn it congrats flashback team !!!!
awesome video! very interesting to watch because you explain it VERY well
You, Sir, are a scholar and a certified badass.
Great job guys. And great video.
Your getting a sub from me I love how you go into full detail although I wish you told us what disassembler you used
This is amazing! Great work
Damn. That's cool as hell. I've been meaning to learn reverse engineering and exploitation. Very cool stuff guys.
Great video, enjoyed a lot! Clever exploit:)
Perfect explanation, I'm going to copy the part where you go in motorcycles 😄
Someone help me with a little "slap" on how to get the online interface login once I'm in it. 🤔 (I know the basics and the location of the hash required for encryption. But it has nothing to do with the online superficial passw)
I had a lot of fun with the video anyway! Anyway, I had a great time with the video, let there be more of these tplink stuff..! ✔ 😎
Great Job! Super good video! keep on
Nice video guys! Would it be possible to do a follow up video that talks about your danger.sh script? Not necessarily a line by line review, but maybe big picture "here's some of the ghidra api calls we use." I'd like to make a similar script for IDA.
Great vid can't wait to see more! Which plugins are you using on Ghidra?
We only use the Ghidra Hues plugin to have a dark theme. The original author deleted it, but here is a copy in Pedro's github repo:
github.com/pedrib/ghidra.hues
Thank you so much for explaining the process.
Nice work guys. Congratulations on the win. Have you always come across routers with root? What about routers with embedded microcontrollers.
thank you guys, great video!
I already didn't buy TP-Link for other reasons. This is just the final nail in the coffin. Sadly, alot of even reputable brands do similar things. Would love to see if Asus, Netgear, Eero and others have the same flaws. Makes you understand why Cyclops Blink was so effective in spreading.
does this still work if the router was flashed with something like openwrt? or is this specific to the stock os? Anyways great job explaining!
kurrrrrwa Pedro, we have to do it
Really enjoyed the video.. especially the 13 character limit part..
Out of curiosity, is there any reason tp link left the uart open or was it something they just overlooked?
P.S extra kudos to the subtle humor you injected into this video.
I think they assumed physically removing a Rx line would be enough. We see a lot of devices with enabled UART.
@@FlashbackTeam I see.. Yeah it was odd to see the uart still being there because it seemed like such an obvious security hole. Good job still!
@@FlashbackTeam is that why you bridged it with a paperclip?
UART can usually be used to recover softbricked systems.
Very cool, nice job, guys.
It’s awesome guys. It’s very interesting. Thank you for explanation
great presentation, very clearly communicated
great breakdown!
"urmom" LOL, love how they the used the word in every part of the exploit
"kurwa!" LOL. But yeah, I saw a lot of such holes everywhere, but I'm too lazy to decompile and reverse it. Pedro did a great job explaining it step by step for people who thinks that you can hack it in a jiffy.
Great work guys
Excellent work!
Great stuff! Thank you for sharing.
only after this vid i understood purpose for all those exercises with "draw piramid with numbers using C lang")))))))))
thanks a lot!
My professional background is in IT but programming and hacking are like a totally other world, something I have never gone near. This was mega interesting to me! And I loved the 'urmum' content too ;-)