This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
require 'sinatra' | |
require 'scnr/introspector' | |
class MyApp < Sinatra::Base | |
use SCNR::Introspector, scope: { | |
path_start_with: __FILE__ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
require 'scnr/introspector' | |
class MyApp < Sinatra::Base | |
use SCNR::Introspector, scope: { | |
path_start_with: __FILE__ | |
} | |
def process_params( params ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
URL = 'https://ginandjuice.shop/catalog' | |
# Proxy HTTP tragic through Burp/ZAP/whatever. | |
# Options.http.proxy_host = 'localhost' | |
# Options.http.proxy_port = 8282 | |
b = Browser.new( | |
visible: true, | |
on_request: proc do |request, _| | |
# Inspect or manipulate HTTP traffic in the form of an HTTP::Request. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'scnr/introspector' | |
require 'sinatra/base' | |
class MyApp < Sinatra::Base | |
use SCNR::Introspector, scope: { | |
path_start_with: __FILE__ | |
} | |
def noop | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./examples/sinatra_xss.rb | |
[*] Preparing plugins... | |
[*] ... done. | |
[*] [HTTP: 200] http://myapp/ | |
[~] Identified as: linux, ruby, rack | |
[~] Analysis resulted in 1 usable paths. | |
[*] Harvesting HTTP responses... | |
[~] Depending on server responsiveness and network conditions this may take a while. | |
[*] XSS: Auditing link input 'v' pointing to: 'http://myapp/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pry' | |
require 'scnr/introspector' | |
require 'scnr/introspector/helpers/output' | |
include SCNR | |
include Introspector::Helpers::Output | |
# Location of the web application environment loader. | |
APP_PATH = "#{File.expand_path( File.dirname(__FILE__) )}/sinatra_xss.rb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra/base' | |
class MyApp < Sinatra::Base | |
def noop | |
end | |
def process_params( params ) | |
noop | |
params.values.join( ' ' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'pp' | |
require_relative 'rest-http-helpers' | |
# Configure the REST server to use this Agent to provide Instances. | |
request :put, 'agent/url', 'localhost:1111' | |
request :post, 'instances', { | |
url: 'http://testhtml5.vulnweb.com', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'pp' | |
require_relative 'rest-http-helpers' | |
# Create a new scanner Instance (process) and run a scan with the following options. | |
request :post, 'instances', { | |
# Scan this URL. | |
url: 'http://testhtml5.vulnweb.com', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
require 'tmpdir' | |
require 'typhoeus' | |
def response | |
if @last_response.headers['Content-Type'].include? 'json' | |
data = JSON.load( @last_response.body ) | |
else | |
data = @last_response.body | |
end |
NewerOlder