2005-11-24 03:31:23 +00:00
|
|
|
module Msf
|
|
|
|
module Ui
|
|
|
|
module Web
|
|
|
|
|
|
|
|
###
|
|
|
|
#
|
|
|
|
# This class implements helper methods for sharing across web pages.
|
|
|
|
#
|
|
|
|
###
|
|
|
|
module Common
|
|
|
|
|
2005-11-24 03:48:30 +00:00
|
|
|
#
|
|
|
|
# Returns the header string that is common to most pages.
|
|
|
|
#
|
|
|
|
def self.header(v, active = "none")
|
2005-11-24 03:31:23 +00:00
|
|
|
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">
|
|
|
|
<html>
|
|
|
|
<head>
|
2005-11-24 03:48:30 +00:00
|
|
|
<title>Metasploit Framework Web Console v#{v}</title>
|
2005-11-24 03:31:23 +00:00
|
|
|
<link type='text/css' rel='stylesheet' href='style.css'/>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
<div align='center'>
|
|
|
|
<img src='images/logo.jpg' alt='msfweb'/>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<table align='center' cellpadding='8' border='0' cellspacing='1' width='100%' class='tblInner'>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<table align='center' cellpadding='8' cellspacing='1' width='100%' class='tblOuter'>
|
|
|
|
<tr>
|
2006-06-08 20:53:15 +00:00
|
|
|
<td class='tab" + ((active == "exploits") ? "Light" : "Dark") + "' width='25%' align='center'>
|
2005-11-24 03:31:23 +00:00
|
|
|
<a href='exploits.rhtml'>EXPLOITS</a>
|
|
|
|
</td>
|
2006-06-08 20:53:15 +00:00
|
|
|
<td class='tab" + ((active == "payloads") ? "Light" : "Dark") + "' width='25%' align='center'>
|
2005-11-24 03:31:23 +00:00
|
|
|
<a href='payloads.rhtml'>PAYLOADS</a>
|
|
|
|
</td>
|
2006-06-08 20:53:15 +00:00
|
|
|
<td class='tab" + ((active == "sessions") ? "Light" : "Dark") + "' width='25%' align='center'>
|
2005-11-24 03:31:23 +00:00
|
|
|
<a href='sessions.rhtml'>SESSIONS</a>
|
|
|
|
</td>
|
2006-06-08 20:53:15 +00:00
|
|
|
<td class='tab" + ((active == "jobs") ? "Light" : "Dark") + "' width='25%' align='center'>
|
|
|
|
<a href='jobs.rhtml'>JOBS</a>
|
|
|
|
</td>
|
2005-11-24 03:31:23 +00:00
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
"
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.footer
|
|
|
|
"
|
|
|
|
<br/>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
"
|
|
|
|
end
|
|
|
|
|
2005-11-24 04:23:43 +00:00
|
|
|
#
|
|
|
|
# Returns the HTML for displaying an icon for each platform the supplied
|
|
|
|
# module instance supports.
|
|
|
|
#
|
|
|
|
def self.module_icons(modinst)
|
2005-11-24 05:13:40 +00:00
|
|
|
platform_icons(modinst.platform)
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.target_icons(target)
|
|
|
|
platform_icons(target.platform)
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.platform_icons(platform)
|
2006-01-05 22:20:28 +00:00
|
|
|
# nil?
|
|
|
|
return "" if (platform.nil?)
|
2005-11-24 04:23:43 +00:00
|
|
|
# If this module has no platforms, then we don't show any icons...
|
2005-11-24 05:13:40 +00:00
|
|
|
return "" if (platform.empty?)
|
2005-11-24 04:23:43 +00:00
|
|
|
|
|
|
|
# Otherwise, get the platform specific information...
|
|
|
|
html = ""
|
|
|
|
|
|
|
|
[
|
|
|
|
[ Msf::Module::Platform::Windows, "win32.gif", "win32" ],
|
|
|
|
[ Msf::Module::Platform::Linux, "linux.gif", "linux" ],
|
|
|
|
[ Msf::Module::Platform::Solaris, "sun.gif", "solaris" ],
|
|
|
|
[ Msf::Module::Platform::OSX, "osx.gif", "osx" ],
|
|
|
|
[ Msf::Module::Platform::BSD, "bsd.gif", "bsd" ],
|
|
|
|
].each { |plat|
|
2005-11-24 05:13:40 +00:00
|
|
|
if (platform.supports?(Msf::Module::PlatformList.new(plat[0])) == true)
|
2005-11-24 04:23:43 +00:00
|
|
|
html += "<img src='images/#{plat[1]}' class='iconset' border='0' alt='#{plat[2]}'/>"
|
|
|
|
end
|
|
|
|
}
|
|
|
|
|
|
|
|
html
|
|
|
|
end
|
|
|
|
|
2005-11-24 03:31:23 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|