Adding fuzz testing of auth

This commit is contained in:
evilchili
2022-11-19 16:58:58 -08:00
parent 27b97f2bc4
commit 475ff78a1e
4 changed files with 27 additions and 238 deletions
+22 -4
View File
@@ -1,13 +1,31 @@
from boddle import boddle
from groove import ondemand
import os
import sys
import atheris
from boddle import boddle
from groove import ondemand
def test_ondemand_server():
def test_server():
with boddle():
assert ondemand.index() == 'Groovy.'
def test_ondemand_auth():
def test_auth_with_valid_credentials():
with boddle(auth=(os.environ.get('USERNAME'), os.environ.get('PASSWORD'))):
assert ondemand.admin() == 'Authenticated. Groovy.'
def test_auth_random_input():
def auth(fuzzed_input):
with boddle(auth=(fuzzed_input, fuzzed_input)):
result = ondemand.admin()
assert result.body == 'Access denied'
atheris.Setup([sys.argv[0], "-atheris_runs=100000"], auth)
try:
atheris.Fuzz()
except SystemExit:
pass