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

Bomber : Navigating Security Vulnerabilities In SBOMs

bomber is an application that scans SBOMs for security vulnerabilities. So you've asked a vendor…

14 hours ago

EmbedPayloadInPng : A Guide To Embedding And Extracting Encrypted Payloads In PNG Files

Embed a payload within a PNG file by splitting the payload across multiple IDAT sections.…

14 hours ago

Exploit Street – Navigating The New Terrain Of Windows LPEs

Exploit-Street, where we dive into the ever-evolving world of cybersecurity with a focus on Local…

3 days ago

ShadowDumper – Advanced Techniques For LSASS Memory Extraction

Shadow Dumper is a powerful tool used to dump LSASS (Local Security Authority Subsystem Service)…

4 days ago

Shadow-rs : Harnessing Rust’s Power For Kernel-Level Security Research

shadow-rs is a Windows kernel rootkit written in Rust, demonstrating advanced techniques for kernel manipulation…

2 weeks ago

ExecutePeFromPngViaLNK – Advanced Execution Of Embedded PE Files via PNG And LNK

Extract and execute a PE embedded within a PNG file using an LNK file. The…

3 weeks ago