mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 14:11:29 +00:00
merge soc07 r5063:5065 - added support for nse-C-modules under windows; misc. nse improvements
This commit is contained in:
@@ -5,6 +5,7 @@ export NMAP_NUM_VERSION := $(shell grep '^\#[ \t]*define[ \t]\+NMAP_NUM_VERSION'
|
||||
COMMA_VERSION=$(shell echo $(NMAP_NUM_VERSION) | tr '.' ',')
|
||||
LOGLOC=c:nmapbuild.log
|
||||
NSE_FILES = scripts/script.db scripts/*.nse
|
||||
NSE_LIB_FILES = nselib/*.lua nselib/*.dll
|
||||
|
||||
winbuild:
|
||||
# VCExpress.exe is devenv.com with the commercial Visual Studio suite instead of VC++ Express
|
||||
@@ -23,6 +24,8 @@ winbuild:
|
||||
cd Release && cp -r ../../CHANGELOG ../../COPYING nmap-mac-prefixes nmap-os-fingerprints nmap-os-db nmap-protocols nmap-rpc nmap-service-probes nmap-services nmap.exe nmap.xsl ../nmap_performance.reg ../../README-WIN32 ../nmap-$(NMAP_VERSION)/
|
||||
mkdir nmap-$(NMAP_VERSION)/scripts
|
||||
cd Release && cp -f $(NSE_FILES) ../nmap-$(NMAP_VERSION)/scripts/
|
||||
mkdir nmap-$(NMAP_VERSION)/nselib
|
||||
cd Release && cp -f $(NSE_LIB_FILES) ../nmap-$(NMAP_VERSION)/nselib/
|
||||
zip -r nmap-$(NMAP_VERSION)-win32.zip nmap-$(NMAP_VERSION)
|
||||
cp winpcap/winpcap-nmap-*.exe nmap-$(NMAP_VERSION)
|
||||
cp nsis/AddToPath.nsh nsis/Nmap.nsi nmap-$(NMAP_VERSION)
|
||||
|
||||
@@ -2,11 +2,11 @@ Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual C++ Express 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nmap", "nmap.vcproj", "{361719F0-AB42-4C93-9DE8-7D2144B96625}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{31FB0767-A71F-4575-8379-002D72B8AF86} = {31FB0767-A71F-4575-8379-002D72B8AF86}
|
||||
{5DE86C7A-DE72-4265-8807-4CA38F94F22A} = {5DE86C7A-DE72-4265-8807-4CA38F94F22A}
|
||||
{5328E0BE-BC0A-4C2A-8CB9-CE00B61B9C4C} = {5328E0BE-BC0A-4C2A-8CB9-CE00B61B9C4C}
|
||||
{F8D6D1E3-D4EA-402C-98AA-168E5309BAF4} = {F8D6D1E3-D4EA-402C-98AA-168E5309BAF4}
|
||||
{B630C8F7-3138-43E8-89ED-78742FA2AC5F} = {B630C8F7-3138-43E8-89ED-78742FA2AC5F}
|
||||
{F8D6D1E3-D4EA-402C-98AA-168E5309BAF4} = {F8D6D1E3-D4EA-402C-98AA-168E5309BAF4}
|
||||
{5328E0BE-BC0A-4C2A-8CB9-CE00B61B9C4C} = {5328E0BE-BC0A-4C2A-8CB9-CE00B61B9C4C}
|
||||
{5DE86C7A-DE72-4265-8807-4CA38F94F22A} = {5DE86C7A-DE72-4265-8807-4CA38F94F22A}
|
||||
{31FB0767-A71F-4575-8379-002D72B8AF86} = {31FB0767-A71F-4575-8379-002D72B8AF86}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nsock", "..\nsock\nsock.vcproj", "{F8D6D1E3-D4EA-402C-98AA-168E5309BAF4}"
|
||||
@@ -22,6 +22,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dnet", "..\libdnet-stripped
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblua", "..\liblua\liblua.vcproj", "{31FB0767-A71F-4575-8379-002D72B8AF86}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nse_bitlib", "..\nselib\nse_bitlib.vcproj", "{FB7F6FD2-A39D-40A1-86DD-9B08370BDEA6}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{31FB0767-A71F-4575-8379-002D72B8AF86} = {31FB0767-A71F-4575-8379-002D72B8AF86}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
@@ -52,6 +57,10 @@ Global
|
||||
{31FB0767-A71F-4575-8379-002D72B8AF86}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{31FB0767-A71F-4575-8379-002D72B8AF86}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{31FB0767-A71F-4575-8379-002D72B8AF86}.Release|Win32.Build.0 = Release|Win32
|
||||
{FB7F6FD2-A39D-40A1-86DD-9B08370BDEA6}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{FB7F6FD2-A39D-40A1-86DD-9B08370BDEA6}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{FB7F6FD2-A39D-40A1-86DD-9B08370BDEA6}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{FB7F6FD2-A39D-40A1-86DD-9B08370BDEA6}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Version="8,00"
|
||||
Name="nmap"
|
||||
ProjectGUID="{361719F0-AB42-4C93-9DE8-7D2144B96625}"
|
||||
RootNamespace="nmap"
|
||||
@@ -107,7 +107,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="xcopy "$(SolutionDir)..\scripts" ".\$(ConfigurationName)\scripts\" /e /y"
|
||||
CommandLine="xcopy "$(SolutionDir)..\scripts" ".\$(ConfigurationName)\scripts\" /e /y "
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
@@ -265,10 +265,6 @@
|
||||
RelativePath="..\nse_auxiliar.cc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\nse_bitlib.cc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\nse_debug.cc"
|
||||
>
|
||||
@@ -454,10 +450,6 @@
|
||||
RelativePath="..\nse_auxiliar.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\nse_bitlib.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\nse_debug.h"
|
||||
>
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
/* Bitwise operations library
|
||||
* by Reuben Thomas (rrt@sc3d.org)
|
||||
* bitlib is a C library for Lua 5.x that provides bitwise operations
|
||||
* It is copyright Reuben Thomas 2000-2006, and is released under the
|
||||
* MIT license, like Lua (see http://www.lua.org/copyright.html for the
|
||||
* full license; it's basically the same as the BSD license). There is no
|
||||
* warranty.
|
||||
* the most recent copy can be found at http://rrt.sc3d.org/Software/Lua/
|
||||
**/
|
||||
|
||||
extern "C" {
|
||||
#include "lauxlib.h"
|
||||
#include "lua.h"
|
||||
}
|
||||
|
||||
#include "nse_bitlib.h"
|
||||
|
||||
typedef long long Integer;
|
||||
typedef unsigned long long UInteger;
|
||||
|
||||
#define luaL_checkbit(L, n) ((Integer)luaL_checknumber(L, n))
|
||||
#define luaL_checkubit(L, n) ((UInteger)luaL_checkbit(L, n))
|
||||
|
||||
#define TDYADIC(name, op, checkbit1, checkbit2) \
|
||||
static int bit_ ## name(lua_State* L) { \
|
||||
lua_pushnumber(L, \
|
||||
checkbit1(L, 1) op checkbit2(L, 2)); \
|
||||
return 1; \
|
||||
}
|
||||
|
||||
#define DYADIC(name, op) \
|
||||
TDYADIC(name, op, luaL_checkbit, luaL_checkbit)
|
||||
|
||||
#define MONADIC(name, op) \
|
||||
static int bit_ ## name(lua_State* L) { \
|
||||
lua_pushnumber(L, op luaL_checkbit(L, 1)); \
|
||||
return 1; \
|
||||
}
|
||||
|
||||
#define VARIADIC(name, op) \
|
||||
static int bit_ ## name(lua_State *L) { \
|
||||
int n = lua_gettop(L), i; \
|
||||
Integer w = luaL_checkbit(L, 1); \
|
||||
for (i = 2; i <= n; i++) \
|
||||
w op luaL_checkbit(L, i); \
|
||||
lua_pushnumber(L, w); \
|
||||
return 1; \
|
||||
}
|
||||
|
||||
MONADIC(bnot, ~)
|
||||
VARIADIC(band, &=)
|
||||
VARIADIC(bor, |=)
|
||||
VARIADIC(bxor, ^=)
|
||||
TDYADIC(lshift, <<, luaL_checkbit, luaL_checkubit)
|
||||
TDYADIC(rshift, >>, luaL_checkubit, luaL_checkubit)
|
||||
TDYADIC(arshift, >>, luaL_checkbit, luaL_checkubit)
|
||||
DYADIC(mod, %)
|
||||
|
||||
static const struct luaL_reg bitlib[] = {
|
||||
{"bnot", bit_bnot},
|
||||
{"band", bit_band},
|
||||
{"bor", bit_bor},
|
||||
{"bxor", bit_bxor},
|
||||
{"lshift", bit_lshift},
|
||||
{"rshift", bit_rshift},
|
||||
{"arshift", bit_arshift},
|
||||
{"mod", bit_mod},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
LUALIB_API int luaopen_bitlib (lua_State *L) {
|
||||
luaL_openlib(L, NSE_BITLIBNAME, bitlib, 0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
#ifndef NSE_BITLIB
|
||||
#define NSE_BITLIB
|
||||
|
||||
#define NSE_BITLIBNAME "bit"
|
||||
|
||||
LUALIB_API int luaopen_bitlib (lua_State *L);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include "nse_debug.h"
|
||||
|
||||
// 3rd Party libs
|
||||
#include "nse_bitlib.h"
|
||||
#include "nse_pcrelib.h"
|
||||
|
||||
#include "nbase.h"
|
||||
@@ -45,7 +44,6 @@ int init_lua(lua_State* l) {
|
||||
{LUA_STRLIBNAME, luaopen_string},
|
||||
{LUA_MATHLIBNAME, luaopen_math},
|
||||
{LUA_DBLIBNAME, luaopen_debug},
|
||||
{NSE_BITLIBNAME, luaopen_bitlib},
|
||||
{NSE_PCRELIBNAME, luaopen_pcrelib},
|
||||
{NULL, NULL}
|
||||
};
|
||||
@@ -83,7 +81,12 @@ int init_setlualibpath(lua_State* l){
|
||||
* (which is read from the package-module) appended -
|
||||
* the path for C-modules is as above but it searches for shared libs (*.so) */
|
||||
luapath= std::string(path) + "?.lua;";
|
||||
#ifdef WIN32
|
||||
luacpath= std::string(path) + "?.dll;";
|
||||
#else
|
||||
luacpath= std::string(path) + "?.so;";
|
||||
#endif
|
||||
|
||||
lua_getglobal(l,"package");
|
||||
if(!lua_istable(l,-1)){
|
||||
error("%s: the lua global-variable package is not a table?!", SCRIPT_ENGINE);
|
||||
|
||||
205
nselib/nse_bitlib.vcproj
Normal file
205
nselib/nse_bitlib.vcproj
Normal file
@@ -0,0 +1,205 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Name="nse_bitlib"
|
||||
ProjectGUID="{FB7F6FD2-A39D-40A1-86DD-9B08370BDEA6}"
|
||||
RootNamespace="nse_bitlib"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\liblua"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;NSE_BITLIB_EXPORTS;WIN32;LUA_BUILD_AS_DLL;LUA_LIB"
|
||||
MinimalRebuild="false"
|
||||
ExceptionHandling="0"
|
||||
BasicRuntimeChecks="0"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="2"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="0"
|
||||
CompileAs="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="liblua.lib"
|
||||
OutputFile=".\bit.dll"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\liblua"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="xcopy "$(SolutionDir)..\nselib\*.lua" "$(SolutionDir)\$(ConfigurationName)\nselib\" /e /y && xcopy "$(SolutionDir)..\nselib\*.dll" "$(SolutionDir)\$(ConfigurationName)\nselib\" /e /y"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\liblua"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;NSE_BITLIB_EXPORTS;WIN32;LUA_BUILD_AS_DLL;LUA_LIB"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="liblua.lib"
|
||||
OutputFile=".\bit.dll"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\liblua"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="xcopy "$(SolutionDir)..\nselib\*.lua" "$(SolutionDir)\$(ConfigurationName)\nselib\" /e /y && xcopy "$(SolutionDir)..\nselib\*.dll" "$(SolutionDir)\$(ConfigurationName)\nselib\" /e /y"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\bit.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\bit.c"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
@@ -8,7 +8,7 @@ license = "See nmaps COPYING for licence"
|
||||
|
||||
categories = {"intrusive"}
|
||||
|
||||
-- require "bit"
|
||||
require "bit"
|
||||
|
||||
portrule = function(host, port)
|
||||
if port.number == 53
|
||||
|
||||
Reference in New Issue
Block a user