Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/lib/sqlmap/sqlmap_manager.rb
Views: 11765
require 'json'12module Sqlmap3class Manager4def initialize(session)5@session = session6end78def new_task9res = @session.get('/task/new')10parse_response(res)11end1213def delete_task(task_id)14res = @session.get('/task/' + task_id + '/delete')15parse_response(res)16end1718def set_option(task_id, key, value)19post = { key => value }20res = @session.post('/option/' + task_id + '/set', nil, post.to_json, {'ctype' => 'application/json'})21parse_response(res)22end2324def get_options(task_id)25res = @session.get('/option/' + task_id + '/list')26parse_response(res)27end2829def start_task(task_id, options = {})30res = @session.post('/scan/' + task_id + '/start' , nil, options.to_json, {'ctype' => 'application/json'})31parse_response(res)3233end3435def get_task_status(task_id)36res = @session.get('/scan/' + task_id + '/status')37parse_response(res)38end3940def get_task_log(task_id)41res = @session.get('/scan/' + task_id + '/log')42parse_response(res)43end4445def get_task_data(task_id)46res = @session.get('/scan/' + task_id + '/data')47parse_response(res)48end4950private51def parse_response(res)52json = {}53if res && res.body54begin55json = JSON.parse(res.body)56rescue JSON::ParserError57end58end5960json61end62end63end646566