diff --git a/extra/runcmd/README.txt b/extra/runcmd/README.txt new file mode 100644 index 000000000..7d2e93e9c --- /dev/null +++ b/extra/runcmd/README.txt @@ -0,0 +1,7 @@ +Files in this folder can be used to compile auxiliary program that can +be used for running command prompt commands skipping standard "cmd /c" way. +They are licensed under the terms of the GNU Lesser General Public License +and it's compiled version is available on the official sqlmap subversion +repository[1]. + +[1] https://svn.sqlmap.org/sqlmap/trunk/sqlmap/shell/runcmd.exe_ diff --git a/extra/runcmd/windows/README.txt b/extra/runcmd/windows/README.txt new file mode 100644 index 000000000..e30bdaa8c --- /dev/null +++ b/extra/runcmd/windows/README.txt @@ -0,0 +1 @@ +Compile only the Release version because the Runtime library option (Project Properties -> Configuration Properties -> C/C++ -> Code Generation) is set to "Multi-threaded (/MT)", which statically links everything into executable and doesn't compile Debug version at all. \ No newline at end of file diff --git a/extra/runcmd/windows/runcmd.sln b/extra/runcmd/windows/runcmd.sln new file mode 100644 index 000000000..0770582d0 --- /dev/null +++ b/extra/runcmd/windows/runcmd.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "runcmd", "runcmd\runcmd.vcproj", "{1C6185A9-871A-4F6E-9B2D-BE4399479784}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1C6185A9-871A-4F6E-9B2D-BE4399479784}.Debug|Win32.ActiveCfg = Debug|Win32 + {1C6185A9-871A-4F6E-9B2D-BE4399479784}.Debug|Win32.Build.0 = Debug|Win32 + {1C6185A9-871A-4F6E-9B2D-BE4399479784}.Release|Win32.ActiveCfg = Release|Win32 + {1C6185A9-871A-4F6E-9B2D-BE4399479784}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/extra/runcmd/windows/runcmd/runcmd.cpp b/extra/runcmd/windows/runcmd/runcmd.cpp new file mode 100644 index 000000000..ab40a0c21 --- /dev/null +++ b/extra/runcmd/windows/runcmd/runcmd.cpp @@ -0,0 +1,46 @@ +/* + runcmd - a program for running command prompt commands + Copyright (C) 2010 Miroslav Stampar + email: miroslav.stampar@gmail.com + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include +#include +#include "stdafx.h" +#include + +using namespace std; +int main(int argc, char* argv[]) +{ + FILE *fp; + string cmd; + + for( int count = 1; count < argc; count++ ) + cmd += " " + string(argv[count]); + + fp = _popen(cmd.c_str(), "r"); + + if (fp != NULL) { + char buffer[BUFSIZ]; + + while (fgets(buffer, sizeof buffer, fp) != NULL) + fputs(buffer, stdout); + } + + return 0; +} diff --git a/extra/runcmd/windows/runcmd/runcmd.vcproj b/extra/runcmd/windows/runcmd/runcmd.vcproj new file mode 100644 index 000000000..928c71606 --- /dev/null +++ b/extra/runcmd/windows/runcmd/runcmd.vcproj @@ -0,0 +1,225 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extra/runcmd/windows/runcmd/stdafx.cpp b/extra/runcmd/windows/runcmd/stdafx.cpp new file mode 100644 index 000000000..f5e349538 --- /dev/null +++ b/extra/runcmd/windows/runcmd/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// runcmd.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/extra/runcmd/windows/runcmd/stdafx.h b/extra/runcmd/windows/runcmd/stdafx.h new file mode 100644 index 000000000..bdabbfb48 --- /dev/null +++ b/extra/runcmd/windows/runcmd/stdafx.h @@ -0,0 +1,17 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later. +#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows. +#endif + +#include +#include + + + +// TODO: reference additional headers your program requires here diff --git a/shell/runcmd.exe_ b/shell/runcmd.exe_ new file mode 100644 index 000000000..109987ea1 Binary files /dev/null and b/shell/runcmd.exe_ differ