Kali Linux

pyFlipper : Unoffical Flipper Zero Cli Wrapper Written In Python

pyFlipper, is a Unoffical Flipper Zero cli wrapper written in Python.

Functions and characteristics

  • Flipper serial CLI wrapper
  • Websocket client interface

Setup instructions

$ git clone https://github.com/wh00hw/pyFlipper.git
$ cd pyFlipper
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt

Tested on

  • Python 3.8.10 on Linux 5.4.0 x86_64
  • Python 3.9.10 on Windows 10
  • Python 3.10.5 on Android 12 (Termux + OTGSerial2WebSocket NO ROOT REQUIRED)

Usage/Examples

Connection

from pyflipper import PyFlipper
Local serial port
flipper = PyFlipper(com=”/dev/ttyACM0″)
OR
Remote serial2websocket server
flipper = PyFlipper(ws=”ws://192.168.1.5:1337″)

Power

Info
info = flipper.power.info()
Poweroff
flipper.power.off()
Reboot
flipper.power.reboot()
Reboot in DFU mode
flipper.power.reboot2dfu()

Update/Backup

Install update from .fuf file
flipper.update.install(fuf_file=”/ext/update.fuf”)
Backup Flipper to .tar file
flipper.update.backup(dest_tar_file=”/ext/backup.tar”)
Restore Flipper from backup .tar file
flipper.update.restore(bak_tar_file=”/ext/backup.tar”)

Storage

Filesystem Info

Get the storage filesystem info
ext_info = flipper.storage.info(fs=”/ext”)

Explorer

Get the storage /ext dict
ext_list = flipper.storage.list(path=”/ext”)
Get the storage /ext tree dict
ext_tree = flipper.storage.tree(path=”/ext”)
Get file info
file_info = flipper.storage.stat(file=”/ext/foo/bar.txt”)
Make directory
flipper.storage.mkdir(new_dir=”/ext/foo”)

Files

Read file
plain_text = flipper.storage.read(file=”/ext/foo/bar.txt”)
Remove file
flipper.storage.remove(file=”/ext/foo/bar.txt”)
Copy file
flipper.storage.copy(src=”/ext/foo/source.txt”, dest=”/ext/bar/destination.txt”)
Rename file
flipper.storage.rename(file=”/ext/foo/bar.txt”, new_file=”/ext/foo/rab.txt”)
MD5 Hash file
md5_hash = flipper.storage.md5(file=”/ext/foo/bar.txt”)
Write file in one chunk
file = “/ext/bar.txt”
text = “””There are many variations of passages of Lorem Ipsum available,
but the majority have suffered alteration in some form, by injected humour,
or randomised words which don’t look even slightly believable.
If you are going to use a passage of Lorem Ipsum,
you need to be sure there isn’t anything embarrassing hidden in the middle of text.
“””flipper.storage.write.file(file, text)
Write file using a listener
file = “/ext/foo.txt”
text_one = “””There are many variations of passages of Lorem Ipsum available,
but the majority have suffered alteration in some form, by injected humour,
or randomised words which don’t look even slightly believable.
If you are going to use a passage of Lorem Ipsum,
you need to be sure there isn’t anything embarrassing hidden in the middle of text.
“””
flipper.storage.write.start(file)
time.sleep(2)
flipper.storage.write.send(text_one)
text_two = “””All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as
necessary, making this the first true generator on the Internet.
It uses a dictionary of over 200 Latin words, combined with a handful of
model sentence structures, to generate Lorem Ipsum which looks reasonable.
The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.
“””flipper.storage.write.send(text_two)
time.sleep(3)
Don’t forget to stop
flipper.storage.write.stop()

R K

Recent Posts

Kali Linux 2024.4 Released, What’s New?

Kali Linux 2024.4, the final release of 2024, brings a wide range of updates and…

2 days ago

Lifetime-Amsi-EtwPatch : Disabling PowerShell’s AMSI And ETW Protections

This Go program applies a lifetime patch to PowerShell to disable ETW (Event Tracing for…

2 days ago

GPOHunter – Active Directory Group Policy Security Analyzer

GPOHunter is a comprehensive tool designed to analyze and identify security misconfigurations in Active Directory…

4 days ago

2024 MITRE ATT&CK Evaluation Results – Cynet Became a Leader With 100% Detection & Protection

Across small-to-medium enterprises (SMEs) and managed service providers (MSPs), the top priority for cybersecurity leaders…

7 days ago

SecHub : Streamlining Security Across Software Development Lifecycles

The free and open-source security platform SecHub, provides a central API to test software with…

1 week ago

Hawker : The Comprehensive OSINT Toolkit For Cybersecurity Professionals

Don't worry if there are any bugs in the tool, we will try to fix…

1 week ago