forked from fuzzitdev/pythonfuzz
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfuzz.py
More file actions
29 lines (22 loc) · 702 Bytes
/
Copy pathfuzz.py
File metadata and controls
29 lines (22 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import os
import sqlite3
import sys
from pythonfuzz.main import PythonFuzz
here = os.path.dirname(__file__)
@PythonFuzz
def fuzz(buf):
try:
conn = sqlite3.connect(':memory:')
string = buf.decode("utf-8")
c = conn.cursor()
c.execute(string)
except (UnicodeDecodeError, sqlite3.DatabaseError):
pass
if __name__ == '__main__':
# Forcibly add our SQL words list to those that we'll use as a dictionary
sys.argv.extend(['--dict', os.path.join(here, 'words.txt')])
# Restrict to remove the binary type operations
sys.argv.extend(['--mutator-filter', '!byte !short !long !longlong !bit'])
import random
random.seed(56)
fuzz()