Kali Linux: Ruby Gem Bundler Errors (Ruby libraries) for Metasploit

An error occurred while installing pcaprub (0.12.4), and Bundler cannot
continue.
Make sure that `gem install pcaprub -v '0.12.4'` succeeds before bundling.

This occurs during the installation process for Bundled Gems in Metasploit and within its local Git repository, e.g.:

cd ~/git/metasploit-framework/
bundle install

Note, ~/git/metasploit-framework/ is my locally defined directory for my Github repository in Kali Linux.

In the top example (see above), the error effects the “pcaprub” Gem. To fix this issue, run the following command:

sudo apt-get install libpcap-dev

This will install the package for libpcap-dev (development library for libpcap) – libpcap-dev Debian package

Once the libpcap-dev package has been installed, the bundle install command can be ran:

cd ~/git/metasploit-framework/
bundle install

Note, for other Gem installation errors during bundle install, it is likely to be an issue with missing packages in your system. The missing packages can be installed via sudo apt-get install [package_name].

Metasploit Exploit Module Template (Ruby)

##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

require 'msf/core'

class MetasploitModule < Msf::Exploit::Remote Rank = NormalRanking def initialize(info={}) super(update_info(info, 'Name' => "[Vendor] [Software] [Root Cause] [Vulnerability type]",
'Description' => %q{
Say something that the user might need to know
},
'License' => MSF_LICENSE,
'Author' => [ 'Name' ],
'References' =>
[
[ 'URL', '' ]
],
'Platform' => 'win',
'Targets' =>
[
[ 'System or software version',
{
'Ret' => 0x41414141 # This will be available in `target.ret`
}
]
],
'Payload' =>
{
'BadChars' => "\x00"
},
'Privileged' => false,
'DisclosureDate' => "",
'DefaultTarget' => 0))
end

def check
# For the check command
end

def exploit
# Main function
end

end

Basic Git Commands

1. Configure username and email:
git config --global user.name "git config –global user.email Alice@example.com

2. Create a new local repository:
git init

3. Check-out a repository:
git clone /path/to/repository (local server)
git clone username@host:/path/to/repository (remote server)

4. Add file(s) to staging:
git add
git add *

5. Commit changes:
git commit -m "Commit message"

Setting up XAMPP for Personal XSS Labs

XAMPP (Cross-platform, Apache + MariaDB + PHP + Perl).

1. Download XAMPP from link below:

XAMPP link

2. Follow the XAMPP setup wizard.

3. Leave default XAMPP components enabled (Server, Program Languages, etc.).

4. Select installation folder location.

5. Run XAMPP Control Panel.

6. Enable Apache and MySQL modules by selecting the Start action buttons.

7. Open browser and navigate to localhost or 127.0.0.1 to display XAMPP. This will verify XAMPP is running successfully.