what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

ISO-8385 Protocol Fuzzer

ISO-8385 Protocol Fuzzer
Posted Feb 5, 2020
Authored by Fakhir Karim Reda

This python script is a fuzzer for the ISO-8385 financial protocol. It is compatible with sulley and bofuzz and is now part of the official bofuzz release.

tags | tool, protocol, python, fuzzer
SHA-256 | d1cd712ddf8adaf71b93d57c4b8957aa1038bc884f3451a6f085124d3115cc0d

ISO-8385 Protocol Fuzzer

Change Mirror Download
# Fuzz iso8385 protocol
# Author Fakhir Karim Reda
# kf@cyber-defense.ma / www.cyber-defense.ma

from boofuzz import *
import os


def recordlength(s):
pad = 4 - (len(s) % 4)
if pad == 4:
pad = 0
s = "0" * pad + s
return s


s_initialize("allrandom")

if s_block_start("singlebitmapnaive"):
s_random(
"30 33 32 37 49 53 4F 37 30 31 30 30 30 30 30 31 31 31 30 F6 F3 00 21 8E E1 A0 08 00 00 00 00 00 00 00 01 31 "
"36 34 32 36 30 30 30 30 30 30 31 35 31 30 33 33 35 31 37 30 30 30 30 30 30 30 30 30 30 30 30 31 30 30 30 30 "
"30 30 30 30 30 30 30 31 30 30 30 31 37 30 39 32 37 32 31 35 33 30 30 30 30 30 30 30 31 30 30 30 30 30 30 30 "
"31 30 30 30 39 32 37 31 39 31 31 31 35 31 32 30 30 30 30 31 36 30 34 30 31 31 31 32 31 36 30 36 35 30 30 30 "
"32 30 30 36 30 30 30 30 30 31 30 32 30 36 38 37 30 31 39 31 31 39 31 35 38 34 30 31 39 30 39 32 30 30 31 30 "
"30 30 33 32 30 30 30 30 30 31 35 30 30 30 30 30 30 33 34 30 42 41 4E 41 4E 41 20 52 45 50 55 42 4C 49 43 20 "
"20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 54 59 20 50 52 30 36 32 50 38 37 30 30 31 34 50 32 "
"35 30 30 31 33 50 38 38 30 30 31 34 50 35 34 30 30 31 52 50 39 35 30 30 32 30 31 50 36 38 30 32 30 30 33 30 "
"30 30 39 32 37 30 32 30 36 38 37 30 31 39 31 31 39 38 34 30 38 34 30 30 30 39 30 33 39 30 30 33 39 30 39 36 "
"30 43 30 46 31 31 39",
min_length=331,
max_length=350,
fuzzable=True,
num_mutations=500,
)
s_block_end()


s_initialize("littlestatic")

if s_block_start("singlebitmapverynaive"):
s_binary("30 33 32 37") # size + 3byte of header
s_random(
"49 53 4F 37 30 31 30 30 30 30 30 31 31 31 30 F6 F3 00 21 8E E1 A0 08 00 00 00 00 00 00 00 01 31 36 34 32 36 "
"30 30 30 30 30 30 31 35 31 30 33 33 35 31 37 30 30 30 30 30 30 30 30 30 30 30 30 31 30 30 30 30 30 30 30 30 "
"30 30 30 31 30 30 30 31 37 30 39 32 37 32 31 35 33 30 30 30 30 30 30 30 31 30 30 30 30 30 30 30 31 30 30 30 "
"39 32 37 31 39 31 31 31 35 31 32 30 30 30 30 31 36 30 34 30 31 31 31 32 31 36 30 36 35 30 30 30 32 30 30 36 "
"30 30 30 30 30 31 30 32 30 36 38 37 30 31 39 31 31 39 31 35 38 34 30 31 39 30 39 32 30 30 31 30 30 30 33 32 "
"30 30 30 30 30 31 35 30 30 30 30 30 30 33 34 30 42 41 4E 41 4E 41 20 52 45 50 55 42 4C 49 43 20 20 20 20 20 "
"20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 54 59 20 50 52 30 36 32 50 38 37 30 30 31 34 50 32 35 30 30 31 "
"33 50 38 38 30 30 31 34 50 35 34 30 30 31 52 50 39 35 30 30 32 30 31 50 36 38 30 32 30 30 33 30 30 30 39 32 "
"37 30 32 30 36 38 37 30 31 39 31 31 39 38 34 30 38 34 30 30 30 39 30 33 39 30 30 33 39 30 39 36 30 43 30 46 "
"31 31 39",
min_length=331,
max_length=331,
fuzzable=True,
num_mutations=500,
)
s_block_end()

# fuzz just financial datas
s_initialize("iso8583ng")

if s_block_start("eltsize", encoder=recordlength):
s_size("elements", length=2, endian=">", fuzzable=False) # size
s_block_end()
if s_block_start("elements"):
s_binary("49 53 4F 37 30 31 30 30 30 30") # header
s_binary("30 31 31 31") # MTI
s_random(
"30 F6 F3 00 21 8E E1 A0 08 00 00 00 00 00 00 00 01 31 36 34 32 36 30 30 30 30 30 30 31 35 31 30 33 33 35 31 "
"37 30 30 30 30 30 30 30 30 30 30 30 30 31 30 30 30 30 30 30 30 30 30 30 30 31 30 30 30 31 37 30 39 32 37 32 "
"31 35 33 30 30 30 30 30 30 30 31 30 30 30 30 30 30 30 31 30 30 30 39 32 37 31 39 31 31 31 35 31 32 30 30 30 "
"30 31 36 30 34 30 31 31 31 32 31 36 30 36 35 30 30 30 32 30 30 36 30 30 30 30 30 31 30 32 30 36 38 37 30 31 "
"39 31 31 39 31 35 38 34 30 31 39 30 39 32 30 30 31 30 30 30 33 32 30 30 30 30 30 31 35 30 30 30 30 30 30 33 "
"34 30 42 41 4E 41 4E 41 20 52 45 50 55 42 4C 49 43 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 "
"20 54 59 20 50 52 30 36 32 50 38 37 30 30 31 34 50 32 35 30 30 31 33 50 38 38 30 30 31 34 50 35 34 30 30 31 "
"52 50 39 35 30 30 32 30 31 50 36 38 30 32 30 30 33 30 30 30 39 32 37 30 32 30 36 38 37 30 31 39 31 31 39 38 "
"34 30 38 34 30 30 30 39 30 33 39 30 30 33 39 30 39 36 30 43 30 46 31 31 39",
min_length=331,
max_length=350,
fuzzable=True,
num_mutations=500,
)
s_block_end()

# Fuzz all iso8385 payloads

s_initialize("nastyiso")

if s_block_start("eltsize", encoder=recordlength):
s_size("elements", length=2, endian=">", fuzzable=False)
s_block_end()

if s_block_start("elements"):
s_random("49 53 4F 37 30 31 30 30 30 30", min_length=10, max_length=10, num_mutations=50, fuzzable=True) # header
s_random("30 31 31 31", min_length=4, max_length=4, num_mutations=50, fuzzable=True) # MTI
s_random("30 F6 F3 00 21 8E E1 A0", min_length=8, max_length=16, num_mutations=100, fuzzable=True) # BITMAP
s_random(
"08 00 00 00 00 00 00 00 01 31 36 34 32 36 30 30 30 30 30 30 31 35 31 30 33 33 35 31 37 30 30 30 30 30 30 30 "
"30 30 30 30 30 31 30 30 30 30 30 30 30 30 30 30 30 31 30 30 30 31 37 30 39 32 37 32 31 35 33 30 30 30 30 30 "
"30 30 31 30 30 30 30 30 30 30 31 30 30 30 39 32 37 31 39 31 31 31 35 31 32 30 30 30 30 31 36 30 34 30 31 31 "
"31 32 31 36 30 36 35 30 30 30 32 30 30 36 30 30 30 30 30 31 30 32 30 36 38 37 30 31 39 31 31 39 31 35 38 34 "
"30 31 39 30 39 32 30 30 31 30 30 30 33 32 30 30 30 30 30 31 35 30 30 30 30 30 30 33 34 30 42 41 4E 41 4E 41 "
"20 52 45 50 55 42 4C 49 43 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 54 59 20 50 52 30 36 "
"32 50 38 37 30 30 31 34 50 32 35 30 30 31 33 50 38 38 30 30 31 34 50 35 34 30 30 31 52 50 39 35 30 30 32 30 "
"31 50 36 38 30 32 30 30 33 30 30 30 39 32 37 30 32 30 36 38 37 30 31 39 31 31 39 38 34 30 38 34 30 30 30 39 "
"30 33 39 30 30 33 39 30 39 36 30 43 30 46 31 31 39",
min_length=305,
max_length=600,
fuzzable=True,
num_mutations=100,
)
s_block_end()


mysession_filename = "audits\\iso8385.session2"

# remove session filename if exists
if os.path.isfile(mysession_filename):
os.remove(mysession_filename)

target_ip = "8.8.8.8"
start_cmd = ["MYDI_SID", "030001"]

sess = Session(session_filename=mysession_filename, crash_threshold_element=20)

target = Target(target_ip, 6771)
target.netmon = pedrpc.Client("127.0.0.1", 26001)
target.procmon = pedrpc.Client(target_ip, 26013)
target.procmon_options = {
"proc_name": "SID",
"start_commands": ["/usr/bin/start_sid"],
"stop_commands": ["/usr/bin/kill_sid"],
}
sess.add_target(target)


sess.connect(s_get("allrandom"))
sess.connect(s_get("littlestatic"))
sess.connect(s_get("iso8583ng"))
sess.connect(s_get("nastyiso"))


sess.fuzz()
Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    0 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close