IoT Security: Backdooring a smart camera by creating a malicious firmware upgrade

Sdílet
Vložit
  • čas přidán 12. 01. 2020
  • In this video we look at reverse engineering a basic firmware format of a commonly found IoT camera - and then creating a backdoored firmware that calls back to our command & control server and allows us to remotely control it!
    Camera in the video: Wyze Cam v2
    Scripts from the video: github.com/ghidraninja/wyze_s...
    A lot more information on the hardware and software, as well as an awesome custom firmware can be found here: github.com/EliasKotlyar/Xiaom...
  • Věda a technologie

Komentáře • 304

  • @moth.monster
    @moth.monster Před 4 lety +2103

    Remember kids. The S in IoT stands for security.

    • @woodie07
      @woodie07 Před 4 lety +91

      eri bUt ThErE iS nO s In IoT

    • @AndreasDelleske
      @AndreasDelleske Před 4 lety +83

      eri and the R for reliability, M for maintenance, U for upgradeability.

    • @hernancoronel
      @hernancoronel Před 4 lety +6

      Ok deploy my IOTs please! :-)

    • @dk14929
      @dk14929 Před 4 lety +28

      @@AndreasDelleske sounds like you'd prefer some RUM

    • @McDonnerbogen
      @McDonnerbogen Před 4 lety +13

      Well when you flash your own firmware to add security vulnerables...

  • @4g3v
    @4g3v Před 4 lety +1003

    Take a look at the access log of your server :)

    • @stacksmashing
      @stacksmashing  Před 4 lety +892

      "GET /Awesome_video_dude_Keep_up_the_great_work
      Hah, love it! Thanks man!

    • @4g3v
      @4g3v Před 4 lety +205

      @@stacksmashing awesome that the message got to you :) Really enjoyed the video. Hope you have some more planned ^^

    • @meh.7539
      @meh.7539 Před 4 lety +96

      /slow clap.

    • @sadface
      @sadface Před 4 lety +24

      haha thats awesome

    • @coler154
      @coler154 Před 3 lety +27

      @xOr Vega sent a GET request to his server saying "/Awesome_video_dude_Keep_up_the_great_work"

  • @woodie07
    @woodie07 Před 4 lety +284

    The 19 dislikes are smart camera manufacturers

    • @fivethreeone2132
      @fivethreeone2132 Před 3 lety +1

      the 20 dislikes are fucking bots

    • @prakharmishra3000
      @prakharmishra3000 Před 3 lety +3

      @@fivethreeone2132 stop blaming everything on bots probably lol, maybe people tap on it by mistake. Happenes to me sometimes too.

    • @wishihadablog
      @wishihadablog Před 3 lety +1

      The 75 people only like cat videos

  • @DerrickJolicoeur
    @DerrickJolicoeur Před 4 lety +88

    This is EXACTLY what I was looking for when I bought this camera. I hate that the default firmware doesn't allow video streaming via the Wise app without an internet connection [via LAN]. So finally I have a means to circumvent their servers while still attaining live video footage.
    We don't need to see the baby-monitors when we're out of the house.

  • @williamwatkins6669
    @williamwatkins6669 Před 4 lety +239

    Through all the video I was like '' ok that's very theoretical, how would you install the firmware in real life's and the you gave the example at the last second and my blood turned cold 😱

    • @maddoggLP
      @maddoggLP Před 4 lety +5

      same for me haha

    • @nolangelinas3566
      @nolangelinas3566 Před 3 lety +5

      @@mshthn It would be perfect for a semi-targettted attack on someone by simply selling them a camera on ebay. You could just set up an ebay account that sell compromised cameras and no one would figure it out unless you sell one to an IT guy.

  • @nastysdsi
    @nastysdsi Před 4 lety +198

    So if you buy one of these used, you should flash the official firmware. Apart from that, not restricting firmware flashing is not a big deal, since flashing it requires physical access to the camera anyway, and having the ability to flash a custom firmware means one can make custom security updates after the camera is discontinued and no longer receives official updates.

    • @DerrickJolicoeur
      @DerrickJolicoeur Před 4 lety +35

      And hope that a return doesn't get repacked as new

    • @robk5969
      @robk5969 Před 4 lety +18

      " not restricting firmware flashing is not a big deal"
      if this was the only way to install firmware, that might be true,
      BUT, it can also be upgraded remotely, without touching the camera. i dont know if that has any extra security or not.

    • @statinskill
      @statinskill Před 4 lety +18

      It's a big deal because I can tamper with that camera and then sell it on ebay. Then as luck will have it that camera winds up somewhere important.

    • @thilotech
      @thilotech Před 4 lety

      @@statinskill but then the app won't work anymore.

    • @motsgar
      @motsgar Před 4 lety +6

      @@statinskill also because now it is in the local network, any other not so secure home device can be hacked

  • @rakeshchowdhury202
    @rakeshchowdhury202 Před 4 lety +179

    Exactly what I was searching for, a well detailed CCTV firmware reversing tutorial. Hey Ninja, I really like your work and your way of explanation, Please Upload more videos, please make it a bit frequent like 1v/month.

  • @erinkourelis7430
    @erinkourelis7430 Před 11 měsíci +64

    We’ve only had the cameras up and running for a short time. czcams.com/users/postUgkxOXxsTZ3ptV_Pk0fFl8bNZvVqeoqBQFwe So far we love them! I got the outdoor mounting kit for them and they were easy to install. Once you download the app, it walks you through the very easy set up. The clarity, and range is awesome. I am thinking seriously about adding another camera or two to my 3 camera system. The price is lower than a lot of comparable systems.

  • @INTJames
    @INTJames Před 4 lety +99

    That was a lot easier than it should've been lol..

  • @nullpwn
    @nullpwn Před 4 lety +8

    That was so easy to watch and learn, no extra and unnecessary steps, no stupids and distractive ads. simple and awesome iot exploit. Keep up the good work

  • @popcorny007
    @popcorny007 Před 4 lety +19

    Really fantastic video, well done. Your explanations and visuals are easy to follow, and we can all tell that you have a good understanding of what you're doing.

  • @AlmightyGauss
    @AlmightyGauss Před 4 lety +5

    It's good to see this channel is still alive, I love your content! Thank you for sharing your knowledge, hope to see more updates in the future

  • @jacobyoung6876
    @jacobyoung6876 Před 3 lety +5

    Wow this was really interesting to see a demonstration by someone willing to explain the thinking process along the way. This is very inspiring!

  • @matteog7579
    @matteog7579 Před 4 lety +6

    Awesome video! Exactly the type of hands-on example I love to see/learn from.

  • @neilyoung6671
    @neilyoung6671 Před 3 lety +71

    A German Engineer. Nothing more to say :) Ah, wait. A German Reverse Engineer :)) Well done.

  • @EnWeee
    @EnWeee Před 4 lety +9

    Great to see you back. Hope you'll post more videos.

  • @redpillcommando
    @redpillcommando Před 4 lety +8

    Ghidra Ninja - It's been a while. I love your work and want to see more. Thanks of the video.

  • @d1v1ne312
    @d1v1ne312 Před 4 lety +6

    I really liked the style of this video, because it was "just right" for the knowledge I have. You explained it very well and with not too much or too less informations. thx!

    • @cocosloan3748
      @cocosloan3748 Před 4 lety +1

      Yeah-the level of knowledge we have is much lower then we think we have!.Try explaining this to someone or to replicate it..You will need to watch this video 100 times over :)

  • @mhmek7324
    @mhmek7324 Před 4 lety +2

    Really good video with good explanations! Love it dude! Keep up the good work!

  • @EtienneLouw
    @EtienneLouw Před 3 lety

    Found your channel watching the new Game and Watch hacks and enjoying the content library, this video was awesome to watch and might try to do this myself on my own Wyze cam.

  • @user-oj7hf2qc9u
    @user-oj7hf2qc9u Před 3 lety

    i just found your content yesterday, and I am HOOKED. Keep up the awesome work :)

  • @AndrewMcOlash
    @AndrewMcOlash Před 4 lety +6

    Great job on this! I actually have one of these hacked cameras to use a security cam (but keep it off of the wyze network). Crazy how simple it is to hack the firmware and can't wait to see more. Might be time for me to start hacking some of my IoT devices. Makes me a bit nervous of how vulnerable my network might be though!

  • @theleopards4198
    @theleopards4198 Před 4 lety +1

    Amazing to see you back.Loved the video

  • @ashishpatel350
    @ashishpatel350 Před 4 lety +223

    I would back up your channel on another platform like Bitchute or library. CZcams has been deleting channels like yours.

  • @FunnyPantsTV124
    @FunnyPantsTV124 Před 3 lety

    I loved this video! i plan on picking up a camera to play around with myself! Im glad I'm not the only one who thought "what if it has been backdoored and returned to the wild" you're a legend man!

  • @alexscarbro796
    @alexscarbro796 Před 3 lety

    What an fantastic video!
    Excellent content and perfect pace.

  • @patrickm9953
    @patrickm9953 Před 3 lety

    Great tutorial, lots of new utilities I have never heard of before

  • @chadiusmaximus9350
    @chadiusmaximus9350 Před 4 lety +17

    Awesome. I actually have one of these sitting around.

  • @PyPylia
    @PyPylia Před 4 lety +228

    Can we quickly laugh at how stupid their way of stopping telnetd is? Instead of uninstalling it and or removing it from the rcS file, instead, they just kill it (And not even stop the service, just use killall.)

    • @Acorn_Anomaly
      @Acorn_Anomaly Před 4 lety +84

      Based on where the killall is from, I'm guessing the telnetd was a backup access point for testing. If the camera starts up, but can't load the camera app for some reason, it won't kill the telnet daemon, and they can log in to figure out what broke.

    • @ArnaudMEURET
      @ArnaudMEURET Před 3 lety +12

      @@Acorn_Anomaly Shouldn’t make it into prod FW though

    • @Acorn_Anomaly
      @Acorn_Anomaly Před 3 lety +7

      @@ArnaudMEURET No, but taking advantage of it in this instance would still require either an already compromised or non-functioning device. There have been worse backdoor incidents.
      Ideally, they'd have removed it or disabled it, but after they had an already working image, they may not have wanted to mess around too much with it, especially since, as I said above, taking advantage of that isn't generally achievable remotely.

    • @MygenteTV
      @MygenteTV Před 3 lety +2

      maybe is used for support from the company

    • @RobertHallIV
      @RobertHallIV Před 2 lety +2

      me thinks they be lazy

  • @origamitaco
    @origamitaco Před 3 lety

    I was able to get into a Faleemi outdoor camera with this exact same method (except they have an option to only update the rootfs so I only needed to repack the squash file with no UBoot header). Works like a charm, and with telnet/wget I can update my camera remotely with my custom firmware. Thank you so much for my first IoT hack! I was also able to get a UART terminal to it on the hardware side.

  • @BrandonHall916
    @BrandonHall916 Před 4 lety +1

    Such a great video! Very informational

  • @BroodPitt
    @BroodPitt Před 4 lety +1

    Welcome Back! Finally a new video! 🙌

  • @harshitjoshi3082
    @harshitjoshi3082 Před 4 lety +3

    You should make more such videos, you have the potential to grow your channel

  • @attilapal3786
    @attilapal3786 Před 3 lety

    very cool i have always been thinking about repacking modified firmwares

  • @CyReVolt
    @CyReVolt Před 4 lety +3

    This is awesome, I can perfectly use tooling such as jefferson right now for firmware modification. To split up flash image partitions, I am simply using dd though and cat things together again.
    Edit: Since it looks like jefferson is for extraction only, I'll stick with mounting the rootfs through the mtd + jffs2 kernel modules, which is a bit of work and annoyance, but solved. =) I will still keep jefferson in mind for extraction-only/analysis use-cases though, makes sense also to have something portable. Thank you!

  • @somehow_sane
    @somehow_sane Před 4 lety +1

    Awesome Video! Keep up the good work!

  • @youssefabdelkhalek2499

    Your videos are amazing, please never stop posting videos, I am now a student of yours.

  • @i_am_dumb1070
    @i_am_dumb1070 Před 5 měsíci

    Learned a lot thanks 👍🙏

  • @fabiorj2008
    @fabiorj2008 Před 2 lety

    This video is AMAZING. Thx

  • @JLK89
    @JLK89 Před 4 lety +1

    Awesome video!

  • @stevecross9159
    @stevecross9159 Před 3 lety

    From the UK 🇬🇧. Great stuff

  • @minecraftzombie4120
    @minecraftzombie4120 Před 4 lety +1

    Great content bro 👍😀

  • @ramondunker4981
    @ramondunker4981 Před 3 lety

    Awesome video 😍

  • @MinhNguyen-kv2mz
    @MinhNguyen-kv2mz Před 4 lety +1

    Amazing video :) Please make more

  • @nsns7993
    @nsns7993 Před 3 lety

    Amazing vid!

  • @RawApeFromAlbion
    @RawApeFromAlbion Před 6 měsíci

    Awesome video

  • @jmchichstudio9145
    @jmchichstudio9145 Před 2 lety

    Thanks for the tip! Gonna try and modify an init script, pack the squashfs and update the camera. Should be similar to your model

  • @mohamedisaac924
    @mohamedisaac924 Před 3 lety

    dude this channel teach a lot better youtube channel easy tips and learn everyday

  • @neoXXquick
    @neoXXquick Před 4 lety +1

    Amazing video...

  • @ChrisWhalen00
    @ChrisWhalen00 Před 3 lety +1

    Great note about zero padding the modified filesystem image before you bundle it to keep it the same size as the original!

  • @Laflamablanca969
    @Laflamablanca969 Před 4 lety +4

    Whoever disliked this is either an idiot or they accidentally clicked the wrong button. Great video man and it would be good to see more videos like this that give us novices guidance in exploiting devices. It’s also good that you’ve shown it with a device we have access too, so yeh much appreciated 👍

  • @seba123321
    @seba123321 Před 3 lety

    Thank you that knowledge!

  • @nrdesign1991
    @nrdesign1991 Před 3 lety

    interesting to see the miio client on there, same thing is running on my vacuum. Thanks for the very informative video

  • @niklasgs1470
    @niklasgs1470 Před 2 lety

    This is so cool!

  • @More_Row
    @More_Row Před 4 lety +2

    Welcome back-

  • @GnobarEl
    @GnobarEl Před 4 lety

    I love your videos!

  • @mikeydk
    @mikeydk Před 4 lety +2

    Might have to get a few of those cams now :D

  • @njnicho
    @njnicho Před 4 lety

    Dude! Amazing!

  • @colfaxschuyler3675
    @colfaxschuyler3675 Před 3 lety +1

    No doubt, you've already had countless people recommending the Wyze Cam V3. The low light image capability seems very good.
    What it doesn't have is RTSP, and Wyze doesn't seem very anxious to provide that capability.
    But it's a swell cam.

  • @TheSurvivor4
    @TheSurvivor4 Před 3 lety +1

    Amazing video. I love the "hack" where you get it into ram where there was more space. I was just wondering though: The need to store the extra binary was to get the reverse shell, but if bash was there, could you then use that instead? I do really like you went the NC way, because I learned a lot about what to do if the situation arose. Amazing!

  • @juancarlosmartinezhernande7777

    Awesome video very usefull =)

  • @rogerf3622
    @rogerf3622 Před 3 lety

    This could all be avoided if the customer had all cameras on their own network (vLAN) with no internet access and no access to the main network. But this was a very informative detailed video.

  • @MrGTAfan93
    @MrGTAfan93 Před 4 lety +25

    Once i backdoored my neighbour's security cam. He was backdooring his wife...

  • @leonardo9259
    @leonardo9259 Před 3 lety

    I'm taking some courses in IOT, I still can't understand everything here but I'm enjoying it a lot

  • @deppy2165
    @deppy2165 Před 4 lety +5

    This was really interesting, do you have any plans on uploading more IOT videos?

  • @ciaobello1261
    @ciaobello1261 Před 4 lety +1

    cool video..👍👍👍

  • @xtdycxtfuv9353
    @xtdycxtfuv9353 Před 4 lety +1

    hey i love you. this was a fun video to watch

  • @ricardojlrufino
    @ricardojlrufino Před 2 lety

    Very good Job. I liked reverse Shell using netcat , i'm using reverse ssh , bit this is more easy

  • @crystalsheep1434
    @crystalsheep1434 Před rokem

    Nice video

  • @NGHVEVO
    @NGHVEVO Před 3 lety

    Great job :)

  • @cocosloan3748
    @cocosloan3748 Před 4 lety +1

    Wow...Just wow!

  • @wawied7881
    @wawied7881 Před 4 lety +2

    Nice video, keep up the good work! But are you planning on uploading more regularly? And do you have any plans in doing more Ghidra related videos?

  • @HenryTonoyan
    @HenryTonoyan Před 3 lety +1

    I'm going to start checking the firmware on every device I buy from now on. On the plus side it will keep me from buying too many things :D.

  • @karubabu
    @karubabu Před 4 lety +2

    finally !YAY

  • @edgeeffect
    @edgeeffect Před 3 lety

    That's the best CZcams sponsorship I've ever seen.... "this video is sponsored by ME" ;)

  • @DrDre001
    @DrDre001 Před 4 lety +1

    Heck ya new vid

  • @AmnesiaPhotography
    @AmnesiaPhotography Před 4 lety +1

    The oh s*** moment at the end... love it

  • @Rafacz
    @Rafacz Před 4 lety +1

    T.Hanks
    We need more videos xD

  • @KF4IXM_Mike
    @KF4IXM_Mike Před 3 lety +1

    Would this work on the newer v3's? Awesome video and explanation. I'm looking to set one up as a weather webcam for weather underground.

  • @foosabraun2461
    @foosabraun2461 Před 4 lety +2

    Yay! :)

  • @drozcan
    @drozcan Před 4 lety

    15:50 Thanks for the advice :)

  • @p0isN
    @p0isN Před 4 lety +1

    "shameless plug", not sure why but I laughed my ass off at that haha

  • @geekionizado
    @geekionizado Před 4 lety +2

    Could you extract the firmware for Vstarcam cameras? They're not available online and the updater inside the camera only downloads a diff of what needs to be updated. I tried extracting from the flash using a raspberry pi but it didn't work. These cameras are one of the most sold on aliexpress and I can't find a way to telnet to them. Their RTSP server keeps crashing and I wanted to write a custom script to restart this server. Would be nice if you managed to crack these cameras. Thanks!

  • @MygenteTV
    @MygenteTV Před 3 lety

    man, you are a genius. i can only wish to know a half of a half of what you know. can you do some alexa hacking? my brother in law have one and i would love to do some pranks to him

  • @keganpowers3430
    @keganpowers3430 Před 2 lety

    Doom on a wyze camera can't wait to see that

  • @soulife8383
    @soulife8383 Před 3 lety

    It's been a few years, but I believe I used to use squashfs as the system image on the good ol' T-Mobile G1 (HTC Dream), the first Android device. But I thought it wasn't read-only once mounted as I used to manipulate the system partition all the time... I may be mistaken tho, that was 2009

  • @heycherry100
    @heycherry100 Před 4 lety

    a good video after another and another and another ... good job! Open a patreon if you need a little motivation to upload more frequently. I would sign up just like I'm on the LiveOverflow patreon...

  • @AlexMarkessinis
    @AlexMarkessinis Před 3 lety

    Great video! Is there a way to repack the JFS2 directory like you did with the squashfs folders? I took a look at jefferson but the docs only mention the ability to extract.

    • @Wythaneye
      @Wythaneye Před 3 lety +1

      You can re-pack the JFFS2 filesystem by using mkfs.jffs2. The problem I'm running into is that the repacked filesystem (no modification) is larger than the original so my offsets are wrong when I go to re-pack the bin file. I'm not terribly skilled in Python so I'm trying to figure out how to mod the wyze_extractor script to build the image properly using a modified JFFS2 filesystem. Hopefully I'll be able to post my fixes here, as I'm working on a mod for my own purposes.

  • @alexluzinki206
    @alexluzinki206 Před 3 lety

    great.

  • @NortelGeek
    @NortelGeek Před 3 lety

    Thank you for this video. Tell me, please, is it possible to edit files within a SBN (signed binary) file and then repack with this method? I can open the archive and see the files inside but I'm not sure how to repack it.

  • @greatsaid5271
    @greatsaid5271 Před 4 lety +1

    nice

  • @sRCx0sweetRusHC0d3r
    @sRCx0sweetRusHC0d3r Před 4 lety +2

    Can you do one similar reverse engineering on a Huawei 4G dongle , that could be a nice tutorial

  • @v380riMz
    @v380riMz Před 3 lety

    This is seriously impressive. How long did this take?

  • @TheWlr9
    @TheWlr9 Před 4 lety

    Where does the reverse shell point to initially? If you were to run PWD for example. Is it just the home dir of the user? (In the case of the video the user would be root)

  • @AbdelrahmanRashed
    @AbdelrahmanRashed Před 4 lety

    Most devices have some sort of checksum of the firmware binary, how do you usually bypass that?

  • @superb7319
    @superb7319 Před 4 lety

    Subbed ;)

  • @craig3714
    @craig3714 Před 4 lety +1

    Thanks I believe my nosey neighbors watch me through my LED lights also .

  • @Gie93uck294bx
    @Gie93uck294bx Před 4 lety

    bin mir absolut sicher, dass du aus dem deutschsprachigem raum bist. dieser akzent ist so einzigartig hahah :D

    • @stacksmashing
      @stacksmashing  Před 4 lety

      Ich nix verstehen😇

    • @Gie93uck294bx
      @Gie93uck294bx Před 4 lety

      @@stacksmashing
      i thought your mother language is german. you sound like a german person is speaking english haha

    • @stacksmashing
      @stacksmashing  Před 4 lety +1

      War ein Witz, ich bin Deutsch :)

    • @Gie93uck294bx
      @Gie93uck294bx Před 4 lety

      @@stacksmashing (x

  • @westernvibes1267
    @westernvibes1267 Před 4 lety

    I am dumb i couldn't understand the packing part a bit. Do you have any course online? Or any resources that would help. I come from web and Network exploitation background am getting into firmware reversing and stuffs i couldn't understand a bit while packing the firmware. :(

  • @MiniArts159
    @MiniArts159 Před 3 lety

    I had a friend whose mom purchased a cheap Walmart IoT camera.
    This camera has two-way communication features and makes an alert when the owner rings in. One time it made the alert sound but no audio on the other end. They literally believed it was caused by ghosts as the camera ". . . doesn't connect to the internet, it goes through my mom's phone."