DESCRIPTION:

BScan is a configurable and extendable command line application security scanner. It’s built on top of arguably the most popular commercial security testing tool Burp Suite from PortSwigger

USE CASES:

  • Run Burp proxy from a command line and passively scan, e.g. QA regression traffic: jruby -S bscan -c bscan.config -l bscan.log

  • Run security scans offline from a command line headless (without UI).

  • Change the type of scanning easily by changing configuration parameters.

  • Extend the BScan’s functionality by adding external modules.

  • Utilize Burp’s default spidering, active and passing scanning features.

  • Integrate scan with different sources of known injections (e.g. Google’s fuzzdb: code.google.com/p/fuzzdb/).

  • Create comprehensive security regression tests suites from artifacts provided by security auditors and run them periodically from a command line.

  • Log found issues to a plain text file.

DOCS, CODE, etc.:

REQUIREMENTS:

  • JRuby - jruby.org

  • Burp pro if you want to use default Burp’s scanners

BUILD/INSTALL:

Gem

sudo jruby -S gem install buby -d --source=http://gemcutter.org (not necessary for modules_only)
sudo jruby -S gem install bscan --source=http://gemcutter.org

Building Manually from Git

git git://git.code.sf.net/p/b-scan/trunk <src_dir> cd <src_dir> jruby -S rake build gemspec sudo jruby -S gem install –local pkg/bscan-*.gem (sudo might not be necessary on some systems) bscan –help bscan –help config

Linking BScan and Buby to Burp’s JAR.

  • This step is not neccessary for modules_only mode

Java code is used to register a Burp extension and to bind Burp’s events to Ruby functions.

You’ll need to re-compile it in at least three following cases:

  1. You want to link to your own license version of Burp’s jar. The default BScan comes with a public Burp’s version.

  2. You want to update the Burp’s jar when a new version is released (either public or licensed).

  3. You want to change the Java code.

Use the following commands to recompile Java and to put a generated jar to the right location

cd <src-dir>/java ./build.sh <path-to-burp-jar>

Verify that the Java build was successful by typing:

ls -l ../lib

You should look for two jar files in that directory:

bscan.jar burp.jar

They will be deployed to JRuby locations when you install the gem

TEST AND USAGE EXAMPLE:

To get help run:

bscan --help

To get help for config layout run:

bscan --help config

RUNNING, REGISTERING Burp Pro:

You need to register you burp.jar before you can run it headless

  • Not neccessary for modules_only mode

  • Either run Burp with UI and upload the license there or run it headless and copy/paste the license when prompted.

  • No license will be asked for a public version.

DOCUMENTATION, SAMPLES, RUNNING HEADLESSLY

  • Rdoc generated files: gryb.info/bscan/

  • After installing BScan’s gem find the location of ‘samples’ dir:

jgem contents bscan | grep samples

  • Check ‘config’ sub-dir in samples to see examples of config files and static requests

  • samples/bscan_headless file show how to run bscan headlesly:

#!/bin/sh jruby -J-Xmx1024M -J-Djava.awt.headless=true -S bscan -c ../config/conf -L 2 -l bscan.log

CREDITS:

  • Burp and Burp Suite are trademarks of PortSwigger(ltd) Copyright 2012 PortSwigger Ltd. All rights reserved. See portswigger.net for license terms.

  • Buby BurpExtender.java has been initially implemented by Eric Monti @ Matasano Security and modified by Oleg Gryb. Matasano Security claims no professional or legal affiliation with PortSwigger LTD.

  • This BScan tools and library written by Oleg Gryb who claims no professional or legal affiliation with PortSwigger LTD or Matasano Security.

  • The ideas for slowloris attack have been borrowed from slowloris.pl written by RSnake and John Kinsella

  • The ideas for apache killer attack were borrowed from killap.pl written by Kingcope

LICENSE:

  • Burp and Burp Suite are trademarks of PortSwigger Ltd. Copyright 2012 PortSwigger Ltd. All rights reserved. See portswigger.net for license terms.

  • The BurpExtender implementation is freely available under the terms of the MIT public and BSD 2-Clause license:

(The MIT License)

Copyright © 2009 Eric Monti, Matasano Security

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

  • The BScan tools and library are freely available under the terms of the BSD 2-Clause license:

Copyright © 2015, Oleg Gryb All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.