Code Monkey home page Code Monkey logo

hikpwn's Introduction

HikPwn

HikPwn, a simple scanner for Hikvision devices with basic vulnerability scanning capabilities written in Python 3.8. This project was born out of curiosity while I was capturing and watching network traffic generated by some Hikvision's software and devices.

Setup instructions:

git clone https://github.com/4n4nk3/HikPwn.git
cd HikPwn
pip install -r requirements.txt

Tested on:

  • Python 3.8 on Linux 4.19 x86_64

Functions and characteristics:

  • Passive discovery of Hikvision devices.
  • Active discovery and enumeration of Hikvision devices via UDP UPNP probing.
  • Detection and exploitation capabilities for ICSA-17-124-01 leading to admin level access.
  • Save enumerated data to './log.txt'.

Work in progress... stay tuned!

TODO:

  • Add option to skip discovery and only scan a specified IP for ICSA-17-124-01.
  • Testing with more devices.
  • Add detection and exploitation capability for CVE-2021-36260.

Help:

usage: hikpwn.py [-h] --interface INTERFACE --address ADDRESS [--active]  [--ICSA_17_124_01]

HikPwn, a simple scanner for Hikvision devices with basic vulnerability scanning capabilities written in Python 3.8. by Ananke: https://github.com/4n4nk3.

optional arguments:
  -h, --help            show this help message and exit
  --interface INTERFACE the network interface to use
  --address ADDRESS     the ip address of the selected network interface
  --active              enable "active" discovery
  --ICSA_17_124_01      enable ICSA-17-124-01 detection on discovered devices

Censored preview:

Using eth0 as network interface and XXX.XXX.XXX.XXX as its IP address...

[*] Started 30 seconds of both passive and active discovery...

================================================================================
[*] Total detected devices: 1

	XXX.XXX.XXX.XX

================================================================================
[*] Active discovery's results:

DEVICE #1:
	LABEL                     DATA      
	--------------------------------------------------
	Serial Number             xxxxxxxxxxxxxxxxxxxxx
	Description               DS-2DE4220IW-D
	MAC                       XX:XX:XX:XX:XX:XX
	IP                        XXX.XXX.XXX.XX
	DHCP in use               false     
	Software Version          V5.4.3build 160810
	DSP Version               V7.3 build 160801
	Boot Time                 2019-03-01 00:05:33
	Activation Status         true      
	Password Reset Ability    true      


================================================================================
[*] Passive discovery's results:

DEVICE #1:
	Detected a device with ip address XXX.XXX.XXX.XX and MAC address XX:XX:XX:XX:XX:XX.


================================================================================
[*] Starting scan for ICSA-17-124-01...

Checking if XXX.XXX.XXX.XX is vulnerable to ICSA-17-124-01 and if we can get a list of valid users present on the device...
XXX.XXX.XXX.XX is vulnerable to ICSA_17_124_01. Recovered user list:
    user_id                   1
    user_name                 admin
    priority                  high
    user_level                Administrator

Do you want to exploit the vulnerability and try to change admin's password? (y/n)
    >>> y

Enter a password composed by numbers and letters (8-12 characters):
    >>> 

Password change successful.

This project is for educational purposes only. Don't use it for illegal activities. I don't support nor condone illegal or unethical actions and I can't be held responsible for possible misuse of this software.

hikpwn's People

Contributors

4n4nk3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

hikpwn's Issues

Cannot find the devices using discovery, how can i skip thid part and try the exploit? I know the ip and mac of the cameras

I want to try if i can change the password using this exploit in two of my camers in the local network, with only iterface and address arguments i get the message "both passive and active discovery didn't find any device"
With the arguemnt --active i get the message failed to send_probe. Aactive discovery will probably fail.

Can i skip the part of the discovery? I can easily fit nd the ip and mac adress of the cameras using a IP scanner in the network.

The devices:
https://cdn.discordapp.com/attachments/780351360146210826/1157281433652576407/Screenshot_2023-09-29-12-27-45-598_com.overlook.android.fing.png

Error

File "E:\HikPwn-master\hikpwn.py", line 321
HOSTS: Dict[str, HikDevice] = {**DETECTED_PASSIVE, **DETECTED_ACTIVE}
^
SyntaxError: annotated name 'HOSTS' can't be global

Please fix this error

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.