mirror of
https://github.com/ysoftdevs/wapifuzz.git
synced 2026-04-30 12:34:16 +02:00
Init WFuzz state
This commit is contained in:
25
tests/command_injection/handler.py
Normal file
25
tests/command_injection/handler.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import os
|
||||
import urllib.parse
|
||||
from http.server import BaseHTTPRequestHandler
|
||||
|
||||
class RequestHandler(BaseHTTPRequestHandler):
|
||||
def _set_headers(self):
|
||||
self.send_response(200)
|
||||
self.send_header('Content-type', 'plain/text')
|
||||
self.end_headers()
|
||||
|
||||
def do_GET(self):
|
||||
self._get_path_parameters()
|
||||
self._set_headers()
|
||||
self.wfile.write(b'OK')
|
||||
|
||||
def _get_path_parameters(self):
|
||||
path = urllib.parse.unquote(self.path)[len("/pets?attributeName="):]
|
||||
if path.startswith("sleep "):
|
||||
self._try_to_execute_command(path)
|
||||
|
||||
def _try_to_execute_command(self, path):
|
||||
os.system(path)
|
||||
|
||||
def send_error(self, code, message=None, explain=None):
|
||||
pass
|
||||
2
tests/command_injection/test.sh
Normal file
2
tests/command_injection/test.sh
Normal file
@@ -0,0 +1,2 @@
|
||||
./fuzz_and_grep_logs.sh "$(dirname "${BASH_SOURCE[0]}")" "Timeout or closed connection"
|
||||
exit $?
|
||||
Reference in New Issue
Block a user