All Projects → HexHive → Printbf

HexHive / Printbf

Brainfuck interpreter inside printf

Projects that are alternatives of or similar to Printbf

Fwdsh3ll
Forward shell generation framework
Stars: ✭ 62 (-86.7%)
Mutual labels:  exploitation-framework
Mouse
Mouse Framework is an iOS and macOS post-exploitation framework that gives you a command line session with extra functionality between you and a target machine using only a simple Mouse payload. Mouse gives you the power and convenience of uploading and downloading files, tab completion, taking pictures, location tracking, shell command execution, escalating privileges, password retrieval, and much more.
Stars: ✭ 186 (-60.09%)
Mutual labels:  exploitation-framework
Zerooo-Exploitation-Framework
异步漏洞利用框架
Stars: ✭ 22 (-95.28%)
Mutual labels:  exploitation-framework
Beef Over Wan
Browser Exploitation Framework is a Open-source penetration testing tool that focuses on browser-based vulnerabilities .This Python Script does the changes Required to make hooked Linked Accessible Over WAN .So anyone can use this framework and Attack Over WAN without Port Forwarding [NGROK or any Localhost to Webhost Service Required ]
Stars: ✭ 82 (-82.4%)
Mutual labels:  exploitation-framework
Proton
Proton Framework is a Windows post-exploitation framework similar to other Windows post-exploitation frameworks. The major difference is that the Proton Framework does most of its operations using Windows Script Host, with compatibility in the core to support a default installation of Windows 2000 with no service packs all the way through Windows 10.
Stars: ✭ 142 (-69.53%)
Mutual labels:  exploitation-framework
lasercrack
Lasercrack-可扩展的Ruby暴力破解框架
Stars: ✭ 45 (-90.34%)
Mutual labels:  exploitation-framework
Ghost
Ghost Framework is an Android post-exploitation framework that exploits the Android Debug Bridge to remotely access an Android device. Ghost Framework gives you the power and convenience of remote Android device administration.
Stars: ✭ 992 (+112.88%)
Mutual labels:  exploitation-framework
Owasp Xenotix Xss Exploit Framework
OWASP Xenotix XSS Exploit Framework is an advanced Cross Site Scripting (XSS) vulnerability detection and exploitation framework.
Stars: ✭ 424 (-9.01%)
Mutual labels:  exploitation-framework
Webpocket
Exploit management framework
Stars: ✭ 142 (-69.53%)
Mutual labels:  exploitation-framework
pwnscripts
Very simple script(s) to hasten binary exploit creation
Stars: ✭ 66 (-85.84%)
Mutual labels:  exploitation-framework
Cmseek
CMS Detection and Exploitation suite - Scan WordPress, Joomla, Drupal and over 180 other CMSs
Stars: ✭ 1,296 (+178.11%)
Mutual labels:  exploitation-framework
Metasploit Cheat Sheet
Metasploit Cheat Sheet 💣
Stars: ✭ 139 (-70.17%)
Mutual labels:  exploitation-framework
Ghost
Ghost Framework is an Android post-exploitation framework that exploits the Android Debug Bridge to remotely access an Android device.
Stars: ✭ 1,934 (+315.02%)
Mutual labels:  exploitation-framework
Prismatica
Responsive Command and Control System
Stars: ✭ 81 (-82.62%)
Mutual labels:  exploitation-framework
Ysomap
A helpful Java Deserialization exploit framework based on ysoserial
Stars: ✭ 314 (-32.62%)
Mutual labels:  exploitation-framework
Pentest Tools Framework
Pentest Tools Framework is a database of exploits, Scanners and tools for penetration testing. Pentest is a powerful framework includes a lot of tools for beginners. You can explore kernel vulnerabilities, network vulnerabilities
Stars: ✭ 48 (-89.7%)
Mutual labels:  exploitation-framework
Tigershark
Bilingual PhishingKit. TigerShark intergrates a vast array of various phishing tools and frameworks, from C2 servers, backdoors and delivery methods in multiple scripting languages in order to suit whatever your deployment needs may be.
Stars: ✭ 212 (-54.51%)
Mutual labels:  exploitation-framework
Fireelf
fireELF - Fileless Linux Malware Framework
Stars: ✭ 435 (-6.65%)
Mutual labels:  exploitation-framework
Rext
Router EXploitation Toolkit - small toolkit for easy creation and usage of various python scripts that work with embedded devices.
Stars: ✭ 336 (-27.9%)
Mutual labels:  exploitation-framework
ronin-exploits
A Ruby micro-framework for writing and running exploits
Stars: ✭ 36 (-92.27%)
Mutual labels:  exploitation-framework

printbf -- Brainfuck interpreter in printf

Authors

Background

Generic POSIX printf itself can be Turing complete as shown in Control-Flow Bending. Here we take printf-oriented programming one step further and preset a brainfuck interpreter inside a single printf statement.

An attacker can control a printf statement through a format string vulnerability (where an attacker-controlled string is used as first parameter to a printf-like statement) or if the attacker can control the first argument to a printf statement through, e.g., a generic memory corruption. See the disclaimer below for practical in the wild considerations.

Brainfuck is a Turing-complete language that has the following commands (and their mapping to format strings):

  • > == dataptr++ (%1$.*1$d %2$hn)
  • < == dataptr-- (%1$65535d%1$.*1$d%2$hn)
  • + == (*dataptr)++ (%3$.*3$d %4$hhn)
  • - == (*dataptr)-- (%3$255d%3$.*3$d%4$hhn -- plus check for ovfl)
  • . == putchar(*dataptr) (%3$.*3$d%5$hn)
  • , == getchar(dataptr) (%13$.*13$d%4$hn)
  • [ == if (*dataptr == 0) goto ] (%1$.*1$d%10$.*10$d%2$hn)
  • ] == if (*dataptr != 0) goto [ (%1$.*1$d%10$.*10$d%2$hn)

Demo and sources

Have a look at the bf_pre.c sources to see what is needed to setup the interpreter and also look at the tokenizer in toker.py.

Run make in ./src to generate a couple of sample programs (in ./src).

Disclaimer

Keep in mind that this printbf interpreter is supposed to be a fun example of Turing completeness that is available in current programs and not a new generic attack vector. This demo is NOT intended to be a generic FORTIFY_SOURCE bypass.

Current systems often either (i) disable %n (which is used to write to memory and allowed according to the standard but rarely used in practice) or (ii) through a set of of patches that test for attack-like conditions, e.g., if the format string is in writable memory.

To use printbf in the wild an attacker will either have to disable FORTIFY_SOURCE checking or get around the checks by placing lining up the format strings and placing them in readonly memory. The FORTIFY_SOURCE mitigations are glibc specific. The attacker model for printbf assumes that the attacker can use memory corruption vulnerabilities to set-up the attack or that the sources are compiled without enabled FORTIFY_SOURCE defenses.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].