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

Promptmap

Prompt injection is a type of security vulnerability that can be exploited to control the…

6 hours ago

Firefly – Black Box Fuzzer For Web Applications

Firefly is an advanced black-box fuzzer and not just a standard asset discovery tool. Firefly…

6 hours ago

Winit : Cross-Platform Window Creation And Management In Rust

Winit is a robust, cross-platform library designed for creating and managing windows in Rust applications.…

7 hours ago

Browser Autofill Phishing – The Hidden Dangers And Security Risks

In today’s digital age, convenience often comes at the cost of security. One such overlooked…

7 hours ago

Terminal GPT (tgpt) – Your Direct CLI Gateway To ChatGPT 3.5

Terminal GPT (tgpt) offers a seamless way to bring the power of ChatGPT 3.5 directly…

7 hours ago

garak, LLM Vulnerability Scanner : The Comprehensive Tool For Assessing Language Model Security

garak checks if an LLM can be made to fail in a way we don't…

3 days ago