Sha256: 39b914fe20de74747fa66bbf07f9a8c3643df6b7ced51091dbab8ef68b28894e

Contents?: true

Size: 1.05 KB

Versions: 5

Compression:

Stored size: 1.05 KB

Contents

=begin
    Copyright 2010-2015 Tasos Laskos <tasos.laskos@arachni-scanner.com>

    This file is part of the Arachni Framework project and is subject to
    redistribution and commercial restrictions. Please see the Arachni Framework
    web site for more information on licensing and terms of use.
=end

module Arachni
module Platform::Fingerprinters

# Identifies ASP.NET MVC resources.
#
# @author Tasos "Zapotek" Laskos <tasos.laskos@arachni-scanner.com>
# @version 0.1
class ASPXMVC < Platform::Fingerprinter

    ANTI_CSRF_NONCE = '__requestverificationtoken'
    HEADER_FIELDS   = %w(x-aspnetmvc-version)

    def run
        # Naive but enough, I think.
        if html? && page.body =~ /input.*#{ANTI_CSRF_NONCE}/i
            return update_platforms
        end

        if (headers.keys & HEADER_FIELDS).any?
            return update_platforms
        end

        if cookies.include?( ANTI_CSRF_NONCE )
            update_platforms
        end
    end

    def update_platforms
        platforms << :asp << :aspx << :windows << :aspx_mvc
    end

end

end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
arachni-1.3.2 components/fingerprinters/frameworks/aspx_mvc.rb
arachni-1.3.1 components/fingerprinters/frameworks/aspx_mvc.rb
arachni-1.3 components/fingerprinters/frameworks/aspx_mvc.rb
arachni-1.2.1 components/fingerprinters/frameworks/aspx_mvc.rb
arachni-1.2 components/fingerprinters/frameworks/aspx_mvc.rb