1
mirror of https://github.com/rapid7/metasploit-framework synced 2024-11-12 11:52:01 +01:00

Windows installer files

git-svn-id: file:///home/svn/framework3/trunk@3790 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
HD Moore 2006-07-31 05:04:20 +00:00
parent f7614f7a9e
commit 61b0364ae2
13 changed files with 792 additions and 0 deletions

4
dev/windows/cygwin.bat Normal file
View File

@ -0,0 +1,4 @@
@echo off
chdir bin
bash --login -i

92
dev/windows/launcher.c Normal file
View File

@ -0,0 +1,92 @@
#include <windows.h>
#define ENABLE_INSERT_MODE 0x0020
#define ENABLE_QUICK_EDIT_MODE 0x0040
#define ENABLE_EXTENDED_FLAGS 0x0080
#define ENABLE_AUTO_POSITION 0x0100
int WinMain (
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow
)
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
char cmd[4096];
char exe[4096];
HANDLE o;
HMODULE m;
COORD b;
COORD c;
SMALL_RECT w;
BOOL ok = TRUE;
COORD nw = { 95, 25 };
DWORD dwMode;
char *p;
int i;
// Create a console for this process
AllocConsole();
o = GetStdHandle(STD_OUTPUT_HANDLE);
m = GetModuleHandle(NULL);
GetModuleFileName(m, exe, 4096);
for (i = strlen(exe); i > 0; i--)
if (exe[i] == 0x5c) {
exe[i] = 0;
break;
}
_snprintf_s(cmd, sizeof(cmd), sizeof(cmd) -1, "%s\\%s", exe, "msfconsole.bat");
// Set Quick Edit mode
GetConsoleMode(o, &dwMode);
SetConsoleMode(o, dwMode | ENABLE_EXTENDED_FLAGS | ENABLE_INSERT_MODE | ENABLE_QUICK_EDIT_MODE);
Sleep(10000);
// SetConsoleTextAttribute(o, FOREGROUND_RED|FOREGROUND_INTENSITY);
if (ok) {
SMALL_RECT sz = {0, 0, 0, 0};
ok = SetConsoleWindowInfo(o, TRUE, &sz) ? TRUE : FALSE;
}
if (ok) {
ok = SetConsoleScreenBufferSize(o, nw) ? TRUE : FALSE;
}
if (ok) {
SMALL_RECT sz = {0, 0, nw.X-1, nw.Y-1};
SetConsoleWindowInfo(o, TRUE, &sz) ? TRUE : FALSE;
}
if (ok) {
nw.Y = 1000;
ok = SetConsoleScreenBufferSize(o, nw) ? TRUE : FALSE;
}
if (ok) {
SMALL_RECT sz = {0, 0, nw.X-1, 40};
SetConsoleWindowInfo(o, TRUE, &sz) ? TRUE : FALSE;
}
SetConsoleTitle("Metasploit Framework 3.0 BETA RELEASE");
// Startup information
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
// The console is inherited by the child
if(CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
}
return(0);
}

38
dev/windows/license.rb Executable file
View File

@ -0,0 +1,38 @@
#!/usr/bin/env ruby
exit(0) if (File.exists?(".LICENSED"))
while (true)
$stdout.puts "You must agree to the license terms before using this software."
$stdout.write "Press enter to continue."
$stdin.gets
system("less -e LICENSE")
$stdout.puts ""
$stdout.write "Accept this license? (yes/no) > "
$stdout.flush
answer = $stdin.gets
$stdout.puts ""
if (answer and answer =~ /^yes/i)
fd = File.open(".LICENSED", "w")
fd.write(answer)
fd.close
exit(0)
end
if (answer and answer =~ /^no/i)
$stdout.puts ""
$stdout.puts "Sorry, you must accept the license to use this software."
$stdout.puts "Press enter to quit."
$stdin.gets
exit(1)
end
if (! answer)
exit(1)
end
end

254
dev/windows/license_3.txt Normal file
View File

@ -0,0 +1,254 @@
The Metasploit Framework License v1.1
Copyright (C) 2006 METASPLOIT.COM
ATTENTION:
READ THIS LICENSE CAREFULLY BEFORE CLICKING ON THE ACCEPT BUTTON BELOW.
This License governs your use of the Software and any accompanying
materials distributed with this License. By clicking ?ACCEPT? at the end
of this License you are indicating that you have read and understood and
assent to be bound by the terms of this License. You must accept the
terms of this License before using the Software. If you are an individual
working for a company you represent and warrant that you have all
necessary authority to bind your company to the terms and conditions of
this License.
If you do not agree to the terms of this License you are not granted any
rights whatsoever in the Software or Documentation. If you are not
willing to be bound by these terms and conditions do not download the
Software.
Definitions
a. "License" means this particular version of this document (or where
specifically indicated a successor iteration of this License officially
issued by the Developer).
b. "Software" means any software that is distributed under the terms of
this License in both object code and source code.
c. "Enhancement" means any bug fix error correction patch or other
addition to the Software that are independent of the Software and do not
require modification of the Software of the Software itself.
d. "Extension" means any external software program or library that
interfaces with the Software and does not [reproduce or require
modification of the Software itself]. "Extension" includes any module or
plug-in that is intended (by design and coding) to or can be dynamically
loaded by the Software.
d. "Developer" means the then-current copyright holder(s) of the Software
including but not limited to the Metasploit personnel and any third-party
contributors (or their successor(s) or transferee(s)).
e. "Documentation" means any and all end user technical/programmer network
administrator or other manuals tutorials or code samples provided or
offered by Developer with the Software excluding those items created by
someone other than the Developer.
f. "Use" means to download install access copy execute sell or otherwise
benefit from the Software (directly or indirectly with or without notice
or knowledge of the Software's incorporation or utilization in any larger
application or product).
g. "You" means the individual or organization that is using the Software
under the License.
h. "Interface" means to execute parse or otherwise benefit from the use of
the Software.
License Grant and Restrictions
1. Provided that You agree to and do comply with all terms and conditions
in this License You are granted the non-exclusive rights specified in
this License. Your Use of any of the Software in any form and to any
extent signifies acceptance of this License. If You do not agree to all
of these terms and conditions then do not use the Software and
immediately remove all copies of the Software the Documentation and any
other items provided under the License.
2. Subject to the terms and conditions of this License Developer hereby
grants You a worldwide royalty-free non-exclusive license to reproduce
publicly display and publicly perform the Software solely for Your
personal and non-commercial use.
3. The license granted in Section 2 is expressly made subject to and
limited by the following restrictions:
a. You may only distribute publicly display and publicly perform
unmodified Software. Without limiting the foregoing You agree to maintain
(and not supplement remove or modify) the same copyright trademark
notices and disclaimers in the exact wording as released by Developer.
b. You may only distribute the Software free from any charge beyond the
reasonable costs of data transfer or storage media. You may -not- (i)
sell lease rent or otherwise charge for the Software (ii) include any
component or subset of the Software in any commercial application or
product or (iii) sell lease rent or otherwise charge for any appliance
(i.e. hardware peripheral personal digital device or other electronic
product) that includes any component or subset of the Software.
4. You may develop Enhancements to the Software and distribute Your
Enhancements provided that You agree to each of the following
restrictions on this distribution:
a. Enhancements may not modify supplement or obscure the user interface or
output of the Software such that the title of the Software the copyrights
and trademark notices in the Software or the licensing terms of the
Software are removed hidden or made less likely to be discovered or read.
b. If you release any Enhancement to the Software You agree to distribute
the Enhancement under the terms of this License (or any other
later-issued license(s) of Developer for the Software). Upon such release
You hereby grant and agree to grant a non-exclusive royalty-free right to
both (i) Developer and (ii) any of Developer's later licensees owners
contributors agents or business partners to distribute Your
Enhancement(s) with future versions of the Software provided that such
versions remain available under the terms of this License (or any other
later-adopted license(s) of Developer).
5. You may develop Extensions to the Software and distribute these
Extensions under any license You see fit for commercial sale or license
or for non-commercial use so long as -each- of the following conditions
are met:
a. The Extension when installed with the Software must -not- modify any of
the behavior (e.g. change the display modify the available commands etc.)
of the Software until the user explicitly requests (e.g. by invoking or
exercising a command or feature are a screen display or other express
notification of the new code's existence and function) that the Extension
should be activated.
b. The Extension may programmatically execute (e.g. call a method) code
provided by this Software but may not include or create copies of the
Software (modified or otherwise) in the Extension itself.
c. The Extension may not modify supplement or obscure the user interface
or output of the Software such that the title of the Software the
copyrights and trademark notices in the Software or the licensing terms
of the Software are removed hidden or made less likely to be discovered
or read.
6. If you develop external software components that interface with the
Software you may only distribute these components if (a) the external
software component clearly indicates to the user via the user interface
and/or program output both (i) the role of the Software in the component
and (ii) where the user may obtain a copy of the Software and (b) the
external software components do not modify supplement or obscure the user
interface or output of the Software such that the title of the Software
the copyrights and trademark notices in the Software or the licensing
terms of the Software are removed hidden or made less likely to be
discovered or read.
Online Updates
The Software includes the ability to download updates (i.e. additional
code) from Developer's server(s). These updates may contain bug fixes new
functionality updated Documentation and/or Extensions. When retrieving
these updates the Software may transmit the Software version and
operating system information from Your computer to the update server. The
server may record (store) this information in conjunction with the IP
(global Internet Protocol) address of the user in order to attempt to
maintain accurate end user and version statistics. By using the online
update feature You hereby agree to allow this information to be
transmitted recorded and stored in any nation by or for Developer.
Proper Use
As an express condition of this License You agree that You will use the
Software -solely- in compliance with all then-applicable local state
national and international laws rules and regulations as may be amended
or supplemented from time to time including any then-current laws and/or
regulations regarding the transmission and/or encryption of technical
data exported from or imported into Your country of residence. Violation
of any of the foregoing will result in immediate automatic termination of
this License without notice and may subject You to state national and/or
international penalties and other legal consequences.
Intellectual Property Ownership
The Software is licensed not sold. Developer retains exclusive ownership
of all worldwide copyrights trade secrets patents and all other
intellectual property rights throughout the world and all applications
and registrations therefor in and to the Software and any full or partial
copies thereof including any additions thereto. You acknowledge that
except for the limited license rights expressly provided in this
Agreement no right title or interest to the intellectual property in the
Software or Documentation is provided to You and that You do not obtain
any rights express or implied in the Software. All rights in and to the
Software not expressly granted to You in this Agreement are expressly
reserved by Developer. Product names words or phrases mentioned in this
License or the Software may be trademark(s) or servicemark(s) of
Developer registered in certain nations and/or of third parties. You may
not alter or supplement the copyright or trademark notices as contained
in the Software.
License Termination
This License is effective until terminated. This License will terminate
immediately without notice from Developer if You breach or fail to comply
with any provision of this License. Upon such termination You must
destroy the Software all accompanying written materials and all copies
thereof.
Limitations of Liability
In no event will Developer any owner contributor agent business party or
other third party affiliated with Developer be liable to You or any third
party under any legal theory (including contract tort or otherwise) for
any consequential incidental indirect or special damages whatsoever
(including without limitation loss of expected savings loss of
confidential information presence of viruses damages for loss of profits
business interruption loss of business information and the like or
otherwise) or any related expense whether foreseeable or not arising out
of the use of or inability to use or any failure of the Software or
accompanying materials regardless of the basis of the claim and even if
Developer or Developer's owner contributor agent or business partner has
been advised of the possibility of such damage. By using the Software You
hereby acknowledge that Developer would not offer the Software without
the inclusion and enforceability of this provision and that You (and not
the Developer) are solely responsible for Your network data and
application security testing planning audits updates and training which
require regular analysis supplementing and expertise.
No Warranty
The Software and this License document are provided AS IS with NO WARRANTY
OF ANY KIND WHETHER EXPRESS IMPLIED STATUTORY OR OTHERWISE INCLUDING
WITHOUT LIMITATION THE WARRANTY OF DESIGN MERCHANTABILITY TITLE
NON-INFRINGEMENT OR FITNESS FOR A PARTICULAR PURPOSE.
Indemnification
You agree to indemnify hold harmless and defend Developer and Developer's
owners contributors agents and business partners from and against any and
all claims or actions including reasonable legal expenses that arise or
result from Your use of or inability to use the Software. Developer
agrees to notify You and reasonably cooperate with Your defense of any
third party claim triggering such indemnification.
Miscellaneous
If any part of this License is found void and unenforceable it will not
affect the validity of the balance of this License which shall remain
valid and enforceable to the maximum extent according to its terms.
Choice of Law; Venue
This License will be construed interpreted and governed by the laws of
Texas USA without regard to its conflict of law rules. Any litigation
related to this License must be filed and heard in the courts for Travis
County Texas.
To use version 3.0 of the Metasploit Framework you must acknowledge your
acceptance of this license by clicking the 'Accept' button below.

BIN
dev/windows/metasploit.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

127
dev/windows/msf2.nsi Normal file
View File

@ -0,0 +1,127 @@
; Script generated by the HM NIS Edit Script Wizard.
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "Metasploit Framework"
!define PRODUCT_VERSION "2.7"
!define PRODUCT_PUBLISHER "Metasploit.com"
!define PRODUCT_WEB_SITE "http://www.metasploit.com"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
!define PRODUCT_STARTMENU_REGVAL "NSIS:StartMenuDir"
SetCompressor lzma
; MUI 1.67 compatible ------
!include "MUI.nsh"
; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page
!insertmacro MUI_PAGE_LICENSE "license_2.txt"
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Start menu page
var ICONS_GROUP
!define MUI_STARTMENUPAGE_NODISABLE
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "Metasploit 2"
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${PRODUCT_STARTMENU_REGVAL}"
!insertmacro MUI_PAGE_STARTMENU Application $ICONS_GROUP
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!insertmacro MUI_PAGE_FINISH
; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES
; Language files
!insertmacro MUI_LANGUAGE "English"
; Reserve files
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
; MUI end ------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "framework-2.7.exe"
InstallDir "$PROGRAMFILES\Metasploit\Framework2"
ShowInstDetails show
ShowUnInstDetails show
Section "MainSection" SEC01
SetOutPath $INSTDIR
File /r "X:\Framework2\*.*"
SectionEnd
Section -AdditionalIcons
WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\MSFConsole.lnk" "$INSTDIR\msfconsole.exe"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\MSFWeb.lnk" "$INSTDIR\msfweb.bat"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\MSFUpdate.lnk" "$INSTDIR\msfupdate.bat"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Cygshell.lnk" "$INSTDIR\cygwin.bat"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\User Guide.lnk" "$INSTDIR\home\userguide.pdf"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk" "$INSTDIR\uninst.exe"
SectionEnd
Section -Post
WriteRegStr "HKLM" "Software\Cygnus Solutions\Msf200\mounts v2" "cygdrive prefix" "/cygdrive"
WriteRegDword "HKLM" "Software\Cygnus Solutions\Msf200\mounts v2" "cygdrive flags" "0x22"
WriteRegDword "HKLM" "Software\Cygnus Solutions\Msf200\mounts v2\/" "flags" "0x02"
WriteRegStr "HKLM" "Software\Cygnus Solutions\Msf200\mounts v2\/" "native" "$INSTDIR"
WriteRegDword "HKLM" "Software\Cygnus Solutions\Msf200\mounts v2\/usr/bin" "flags" "0x02"
WriteRegStr "HKLM" "Software\Cygnus Solutions\Msf200\mounts v2\/usr/bin" "native" "$INSTDIR/bin"
WriteRegDword "HKLM" "Software\Cygnus Solutions\Msf200\mounts v2\/usr/lib" "flags" "0x02"
WriteRegStr "HKLM" "Software\Cygnus Solutions\Msf200\mounts v2\/usr/lib" "native" "$INSTDIR/lib"
WriteUninstaller "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "${PRODUCT_STARTMENU_REGVAL}" "$ICONS_GROUP"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
Exec "$INSTDIR\msfconsole.bat"
SectionEnd
Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
FunctionEnd
Function un.onInit
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
Abort
FunctionEnd
Section Uninstall
ReadRegStr $ICONS_GROUP ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "${PRODUCT_STARTMENU_REGVAL}"
Delete "$INSTDIR\${PRODUCT_NAME}.url"
Delete "$INSTDIR\uninst.exe"
Delete "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Website.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\MSFConsole.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\MSFWeb.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\MSFUpdate.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Cygshell.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\User Guide.lnk"
RMDir /r "$SMPROGRAMS\$ICONS_GROUP"
RMDir /r "$INSTDIR"
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
SetAutoClose true
SectionEnd

121
dev/windows/msf3.nsi Normal file
View File

@ -0,0 +1,121 @@
; Script generated by the HM NIS Edit Script Wizard.
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "Metasploit Framework"
!define PRODUCT_VERSION "3.0-Beta-1"
!define PRODUCT_PUBLISHER "Metasploit.com"
!define PRODUCT_WEB_SITE "http://www.metasploit.com"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
!define PRODUCT_STARTMENU_REGVAL "NSIS:StartMenuDir"
SetCompressor lzma
; MUI 1.67 compatible ------
!include "MUI.nsh"
; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page
!insertmacro MUI_PAGE_LICENSE "license_3.txt"
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Start menu page
var ICONS_GROUP
!define MUI_STARTMENUPAGE_NODISABLE
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "Metasploit 3"
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${PRODUCT_STARTMENU_REGVAL}"
!insertmacro MUI_PAGE_STARTMENU Application $ICONS_GROUP
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!insertmacro MUI_PAGE_FINISH
; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES
; Language files
!insertmacro MUI_LANGUAGE "English"
; Reserve files
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
; MUI end ------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "framework-3.0-beta1.exe"
InstallDir "$PROGRAMFILES\Metasploit\Framework3"
ShowInstDetails show
ShowUnInstDetails show
Section "MainSection" SEC01
SetOutPath $INSTDIR
File /r "X:\Framework3\*.*"
SectionEnd
Section -AdditionalIcons
WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\MSFConsole.lnk" "$INSTDIR\msfconsole.exe"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Cygshell.lnk" "$INSTDIR\cygwin.bat"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Developer Guide.lnk" "$INSTDIR\developer_guide.pdf"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk" "$INSTDIR\uninst.exe"
SectionEnd
Section -Post
WriteRegStr "HKLM" "Software\Cygnus Solutions\Msf300\mounts v2" "cygdrive prefix" "/cygdrive"
WriteRegDword "HKLM" "Software\Cygnus Solutions\Msf300\mounts v2" "cygdrive flags" "0x22"
WriteRegDword "HKLM" "Software\Cygnus Solutions\Msf300\mounts v2\/" "flags" "0x02"
WriteRegStr "HKLM" "Software\Cygnus Solutions\Msf300\mounts v2\/" "native" "$INSTDIR"
WriteRegDword "HKLM" "Software\Cygnus Solutions\Msf300\mounts v2\/usr/bin" "flags" "0x02"
WriteRegStr "HKLM" "Software\Cygnus Solutions\Msf300\mounts v2\/usr/bin" "native" "$INSTDIR/bin"
WriteRegDword "HKLM" "Software\Cygnus Solutions\Msf300\mounts v2\/usr/lib" "flags" "0x02"
WriteRegStr "HKLM" "Software\Cygnus Solutions\Msf300\mounts v2\/usr/lib" "native" "$INSTDIR/lib"
WriteUninstaller "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "${PRODUCT_STARTMENU_REGVAL}" "$ICONS_GROUP"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
Exec "$INSTDIR\msfconsole.exe"
SectionEnd
Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
FunctionEnd
Function un.onInit
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
Abort
FunctionEnd
Section Uninstall
ReadRegStr $ICONS_GROUP ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "${PRODUCT_STARTMENU_REGVAL}"
Delete "$INSTDIR\${PRODUCT_NAME}.url"
Delete "$INSTDIR\uninst.exe"
Delete "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\MSFConsole.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Cygshell.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Developer Guide.lnk"
RMDir /r "$SMPROGRAMS\$ICONS_GROUP"
RMDir /r "$INSTDIR"
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
SetAutoClose true
SectionEnd

114
dev/windows/msf3_native.nsi Normal file
View File

@ -0,0 +1,114 @@
; Script generated by the HM NIS Edit Script Wizard.
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "Metasploit Framework 3"
!define PRODUCT_VERSION "Beta-1"
!define PRODUCT_PUBLISHER "Metasploit.com"
!define PRODUCT_WEB_SITE "http://www.metasploit.com"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
!define PRODUCT_STARTMENU_REGVAL "NSIS:StartMenuDir"
SetCompressor lzma
; MUI 1.67 compatible ------
!include "MUI.nsh"
; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page
!insertmacro MUI_PAGE_LICENSE "license_3.txt"
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Start menu page
var ICONS_GROUP
!define MUI_STARTMENUPAGE_NODISABLE
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "Metasploit Framework 3"
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${PRODUCT_STARTMENU_REGVAL}"
!insertmacro MUI_PAGE_STARTMENU Application $ICONS_GROUP
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!insertmacro MUI_PAGE_FINISH
; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES
; Language files
!insertmacro MUI_LANGUAGE "English"
; Reserve files
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
; MUI end ------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "framework-3.0b1.exe"
InstallDir "$PROGRAMFILES\Metasploit\Framework3"
ShowInstDetails show
ShowUnInstDetails show
Section "MainSection" SEC01
SetOutPath $INSTDIR
File /r "X:\Framework3\*.*"
SectionEnd
Section -AdditionalIcons
WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\MSFConsole.lnk" "$INSTDIR\msfconsole.bat"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\MSFWeb.lnk" "$INSTDIR\msfweb.bat"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\MSFUpdate.lnk" "$INSTDIR\msfupdate.bat"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\User Guide.lnk" "$INSTDIR\home\userguide.pdf"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk" "$INSTDIR\uninst.exe"
SectionEnd
Section -Post
WriteUninstaller "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "${PRODUCT_STARTMENU_REGVAL}" "$ICONS_GROUP"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
Exec "$INSTDIR\msfconsole.bat"
SectionEnd
Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
FunctionEnd
Function un.onInit
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
Abort
FunctionEnd
Section Uninstall
ReadRegStr $ICONS_GROUP ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "${PRODUCT_STARTMENU_REGVAL}"
Delete "$INSTDIR\${PRODUCT_NAME}.url"
Delete "$INSTDIR\uninst.exe"
Delete "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Website.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\MSFConsole.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\MSFWeb.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\MSFUpdate.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\User Guide.lnk"
RMDir /r "$SMPROGRAMS\$ICONS_GROUP"
RMDir /r "$INSTDIR"
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
SetAutoClose true
SectionEnd

View File

@ -0,0 +1,5 @@
@echo off
chdir bin
bash --login -i -c /home/run_msfconsole || bash --login -i

BIN
dev/windows/msfconsole.exe Normal file

Binary file not shown.

5
dev/windows/msfweb.bat Normal file
View File

@ -0,0 +1,5 @@
@echo off
chdir bin
bash --login -i -c /home/run_msfweb || bash --login -i

16
dev/windows/run_msfconsole Executable file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env ruby
Dir.chdir("/home");
exit(0) if not system("ruby ./license.rb")
if (not File.directory?("framework"))
Dir.mkdir("framework",0755)
system("tar xf framework.tar")
end
system("clear")
exec("/home/framework/msfconsole")
exec("/bin/bash")
exit(0)

16
dev/windows/run_msfweb Executable file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env ruby
Dir.chdir("/home");
exit(0) if not system("ruby ./license.rb")
if (not File.directory?("framework"))
Dir.mkdir("framework",0755)
system("tar xf framework.tar")
end
system("clear")
exec("/home/framework/msfweb")
exec("/bin/bash")
exit(0)