Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7603819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:45:03+00:00 2026-05-30T23:45:03+00:00

Forgive me guys, new to Ruby, actually this is the first lang I have

  • 0

Forgive me guys, new to Ruby, actually this is the first lang I have taken up, so be gentle with me ok?

Writing a mod for Metasploit which will scan a system or net for 302/500 errors on the file ScriptResource.axd which can be used in further attacks.

It starts, it runs, then crashes with error:

msf  auxiliary(Scriptresource) > exploit

[*] hxxp://192.168.0.18:80 hxxp://192.168.0.18:80/scriptresource.axd?d=AAAAAAAAAAAAAAAAAAAAAA1 302
[*] hxxp://192.168.0.5:80 hxxp://192.168.0.5:80/scriptresource.axd?d=AAAAAAAAAAAAAAAAAAAAAA1 302
[*] hxxp://192.168.0.106:80 hxxp://192.168.0.106:80/scriptresource.axd?d=AAAAAAAAAAAAAAAAAAAAAA1 302
[*] hxxp://192.168.0.4:80 hxxp://192.168.0.4:80/scriptresource.axd?d=AAAAAAAAAAAAAAAAAAAAAA1 302
[*] hxxp://192.168.0.43:80 hxxp://192.168.0.43:80/scriptresource.axd?d=AAAAAAAAAAAAAAAAAAAAAA1 500
[*] hxxp://192.168.0.236:80 hxxp://192.168.0.236:80/scriptresource.axd?d=AAAAAAAAAAAAAAAAAAAAAA1 500
[*] hxxp://192.168.0.238:80 hxxp://192.168.0.238:80/scriptresource.axd?d=AAAAAAAAAAAAAAAAAAAAAA1 500
[-] Auxiliary failed: NoMethodError undefined method `code' for nil:NilClass
[-] Call stack:
[-]   /root/.msf4/modules/auxiliary/scanner/http/Scriptresource.rb:50:in `block in run_host'
[-]   /root/.msf4/modules/auxiliary/scanner/http/Scriptresource.rb:39:in `each'
[-]   /root/.msf4/modules/auxiliary/scanner/http/Scriptresource.rb:39:in `run_host'
[-]   /opt/metasploit-4.2.0/msf3/lib/msf/core/auxiliary/scanner.rb:92:in `block in run'
[-]   /opt/metasploit-4.2.0/msf3/lib/msf/core/thread_manager.rb:64:in `call'
[-]   /opt/metasploit-4.2.0/msf3/lib/msf/core/thread_manager.rb:64:in `block in 

Here is the Program:

require ‘rex/proto/http’
require ‘msf/core’

class Metasploit3 < Msf::Auxiliary

include Msf::Exploit::Remote::HttpClient
include Msf::Auxiliary::WmapScanDir
include Msf::Auxiliary::Scanner

def initialize(info = {})
    super(update_info(info,
        'Name'          => 'ScriptResource Scanner',
        'Description'   => %q{
            This module Will scan for the 302/500 response codes associated 
            with ScriptResource.axd on a traget machine or network.  This 
            file is required for ASP.Net Oracle Padding attack. 
        },
        'Author'        => [ 'MyChickenNinja' ],
        'License'       => BSD_LICENSE,))

    register_options(
        [
            OptString.new('PATH', [ true,  "The path  to identify vulnerable files", '/',
                ]
            )
        ], self.class)

end

def run_host(ip)

    cypher = ['scriptresource.axd?d=AAAAAAAAAAAAAAAAAAAAAA1']

    conn = false

    spath = datastore['PATH']

    cypher.each do |cy|
        queue << cy.strip

        begin
            crypt = cy
            res = send_request_cgi({
                'uri'       =>  spath+crypt,
                'method'    => 'GET',
                'ctype'     => 'text/plain'
            }, 20)

            if res.code == 500 or res.code == 302
                print_status("#{wmap_base_url} #{wmap_base_url}#{spath}#{crypt} #{res.code}")

            end

        rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
            conn = false
        rescue ::Timeout::Error, ::Errno::EPIPE
        end

    end
end

end

Now its referring to the “res.code”. I see that, but I was under the impression that Metasploit handled res.code. Isn’t this confirmed by the fact I am getting res.code output before the program crashes? So now I am at a loss… Yes I looked at other Questions on the site here but usually the answer is that they are not defined. But Metasplot defines this variable.. So… ??

As I said, I’m new to Ruby so if I can get a kinda detailed answer, I would be greatly appreciate it.
Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T23:45:05+00:00Added an answer on May 30, 2026 at 11:45 pm

    Figured it out.
    Just needed a blank rescue to handle nil responses.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hope you guys forgive me ... I know this is simple but its
Forgive my ignorance if this is 'a basic question'..... I have a method that
forgive me i'm new to capistrano we have multiple sites we want to deploy
Forgive my naivety, but I am new to using Delphi with databases (which may
Forgive me if this has already been asked elsewhere. I have a Scala syntax
Forgive me as I'm new to both *nix and ruby on rails. My rails
Forgive me, guys. I am at best a novice when it comes to Ruby.
Forgive me if this post is too naive-sounding. I have a Twitter app that
Forgive me if this sounds impossible, I am new at CSS. I want to
Forgive me if this has already been asked, I couldn't find it. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.