Python/PHP with ZK fingerprint attendance machines


If you are developing for Linux environment and If you have a task related to pulling data from a zkĀ fingerprint attendance machine / biometric device the hair pulling phase may start 1 hour – 3 hours of hopeless search.

Downloading windows SDK and reverse engineering them isn’t the solution. wireshark isn’t the solution and connecting the the shared .mdb file isn’t also a solution the right solution is to connect to the machine using UDP port 4370.

0- Backup your attendance machine data.(You may use zktimes for this step.)

1- clone this repo:

For Python:

For PHP:

2- Login to the attendance machine as admin

and set the communication key (aka communication password to 0 or empty).

3- Set the IP address to some IP (say this is the default one.

4-Connect the attendance machine to the network (ethernet most commonly)

5-Change IP:

zk = zklib.ZKLib(“″, 4370)

6- Comment this (dangerous line that clears admin):

print Pesan Clear Admin:, zk.clearAdmin()

Now, try to run the script with the machine connected to your local network.


I’ve just saved your life.

Check the file capability it should be very easy for any python programmer from here on.

Note: you may find very strange messages like “Pesan Koneksi” or use my safe English translated fork.


6 thoughts on “Python/PHP with ZK fingerprint attendance machines”

  1. I must say it was hard to find your website in google.
    You write awesome content but you should rank your website higher in search engines.
    If you don’t know how to do it search on youtube:
    how to rank a website Marcel’s way

  2. Is there any way to access it while the comm key is set to something like 123? In short, is there a way to pass the comm key in the connect function? Is that an available parameter?

Leave a Reply to Yaseen Shareef Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>