Sha256: 325e04cb418714ea56c5f3f5c58aeb00788750c50636f84bf1379dc550057b88

Contents?: true

Size: 1.92 KB

Versions: 8

Compression:

Stored size: 1.92 KB

Contents

=begin
    Copyright 2010-2013 Tasos Laskos <tasos.laskos@gmail.com>

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
=end

#
# @author   Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>, haliphax
# @version  0.1.2
#
class Arachni::Modules::SSN < Arachni::Module::Base

    def self.regexp
        @regexp ||= /\b(((?!000)(?!666)(?:[0-6]\d{2}|7[0-2][0-9]|73[0-3]|7[5-6][0-9]|77[0-2]))-((?!00)\d{2})-((?!0000)\d{4}))\b/
    end

    def run
        match_and_log( self.class.regexp ){ |m| m.gsub( /\D/, '' ).size == 9 }
    end

    def self.info
        {
            name:        'SSN',
            description: %q{Greps pages for disclosed US Social Security Numbers.},
            elements:    [ Element::BODY ],
            author:      [
                'Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>', # original
                'haliphax' # tweaked regexp
            ],
            version:     '0.1.2',
            targets:     %w(Generic),
            references: {
                'ssa.gov' => 'http://www.ssa.gov/pubs/10064.html'
            },
            issue:       {
                name:            %q{Disclosed US Social Security Number (SSN)},
                description:     %q{A US Social Security Number is being disclosed.},
                cwe:             '200',
                severity:        Severity::HIGH,
                remedy_guidance: %q{Remove all SSN occurrences from the page.},
            }
        }
    end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
arachni-0.4.5.2 modules/recon/grep/ssn.rb
arachni-0.4.5.1 modules/recon/grep/ssn.rb
arachni-0.4.5 modules/recon/grep/ssn.rb
arachni-0.4.4 modules/recon/grep/ssn.rb
arachni-0.4.3.2 modules/recon/grep/ssn.rb
arachni-0.4.3.1 modules/recon/grep/ssn.rb
arachni-0.4.3 modules/recon/grep/ssn.rb
arachni-0.4.2 modules/recon/grep/ssn.rb