Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 60366f7

Browse files
committed
new program for running command prompt commands
1 parent 9c014c0 commit 60366f7

8 files changed

Lines changed: 324 additions & 0 deletions

File tree

extra/runcmd/README.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Files in this folder can be used to compile auxiliary program that can
2+
be used for running command prompt commands skipping standard "cmd /c" way.
3+
They are licensed under the terms of the GNU Lesser General Public License
4+
and it's compiled version is available on the official sqlmap subversion
5+
repository[1].
6+
7+
[1] https://svn.sqlmap.org/sqlmap/trunk/sqlmap/shell/runcmd.exe_

extra/runcmd/windows/README.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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.

extra/runcmd/windows/runcmd.sln

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 9.00
3+
# Visual Studio 2005
4+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "runcmd", "runcmd\runcmd.vcproj", "{1C6185A9-871A-4F6E-9B2D-BE4399479784}"
5+
EndProject
6+
Global
7+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8+
Debug|Win32 = Debug|Win32
9+
Release|Win32 = Release|Win32
10+
EndGlobalSection
11+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
12+
{1C6185A9-871A-4F6E-9B2D-BE4399479784}.Debug|Win32.ActiveCfg = Debug|Win32
13+
{1C6185A9-871A-4F6E-9B2D-BE4399479784}.Debug|Win32.Build.0 = Debug|Win32
14+
{1C6185A9-871A-4F6E-9B2D-BE4399479784}.Release|Win32.ActiveCfg = Release|Win32
15+
{1C6185A9-871A-4F6E-9B2D-BE4399479784}.Release|Win32.Build.0 = Release|Win32
16+
EndGlobalSection
17+
GlobalSection(SolutionProperties) = preSolution
18+
HideSolutionNode = FALSE
19+
EndGlobalSection
20+
EndGlobal
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
runcmd - a program for running command prompt commands
3+
Copyright (C) 2010 Miroslav Stampar
4+
5+
6+
This library is free software; you can redistribute it and/or
7+
modify it under the terms of the GNU Lesser General Public
8+
License as published by the Free Software Foundation; either
9+
version 2.1 of the License, or (at your option) any later version.
10+
11+
This library is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
Lesser General Public License for more details.
15+
16+
You should have received a copy of the GNU Lesser General Public
17+
License along with this library; if not, write to the Free Software
18+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19+
*/
20+
21+
#include <stdio.h>
22+
#include <windows.h>
23+
#include <use_ansi.h>
24+
#include "stdafx.h"
25+
#include <string>
26+
27+
using namespace std;
28+
int main(int argc, char* argv[])
29+
{
30+
FILE *fp;
31+
string cmd;
32+
33+
for( int count = 1; count < argc; count++ )
34+
cmd += " " + string(argv[count]);
35+
36+
fp = _popen(cmd.c_str(), "r");
37+
38+
if (fp != NULL) {
39+
char buffer[BUFSIZ];
40+
41+
while (fgets(buffer, sizeof buffer, fp) != NULL)
42+
fputs(buffer, stdout);
43+
}
44+
45+
return 0;
46+
}
Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
<?xml version="1.0" encoding="windows-1250"?>
2+
<VisualStudioProject
3+
ProjectType="Visual C++"
4+
Version="8,00"
5+
Name="runcmd"
6+
ProjectGUID="{1C6185A9-871A-4F6E-9B2D-BE4399479784}"
7+
RootNamespace="runcmd"
8+
Keyword="Win32Proj"
9+
>
10+
<Platforms>
11+
<Platform
12+
Name="Win32"
13+
/>
14+
</Platforms>
15+
<ToolFiles>
16+
</ToolFiles>
17+
<Configurations>
18+
<Configuration
19+
Name="Debug|Win32"
20+
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
21+
IntermediateDirectory="$(ConfigurationName)"
22+
ConfigurationType="1"
23+
CharacterSet="1"
24+
>
25+
<Tool
26+
Name="VCPreBuildEventTool"
27+
/>
28+
<Tool
29+
Name="VCCustomBuildTool"
30+
/>
31+
<Tool
32+
Name="VCXMLDataGeneratorTool"
33+
/>
34+
<Tool
35+
Name="VCWebServiceProxyGeneratorTool"
36+
/>
37+
<Tool
38+
Name="VCMIDLTool"
39+
/>
40+
<Tool
41+
Name="VCCLCompilerTool"
42+
Optimization="0"
43+
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
44+
MinimalRebuild="true"
45+
BasicRuntimeChecks="3"
46+
RuntimeLibrary="0"
47+
UsePrecompiledHeader="2"
48+
WarningLevel="3"
49+
Detect64BitPortabilityProblems="true"
50+
DebugInformationFormat="4"
51+
/>
52+
<Tool
53+
Name="VCManagedResourceCompilerTool"
54+
/>
55+
<Tool
56+
Name="VCResourceCompilerTool"
57+
/>
58+
<Tool
59+
Name="VCPreLinkEventTool"
60+
/>
61+
<Tool
62+
Name="VCLinkerTool"
63+
LinkIncremental="2"
64+
GenerateDebugInformation="true"
65+
SubSystem="1"
66+
TargetMachine="1"
67+
/>
68+
<Tool
69+
Name="VCALinkTool"
70+
/>
71+
<Tool
72+
Name="VCManifestTool"
73+
/>
74+
<Tool
75+
Name="VCXDCMakeTool"
76+
/>
77+
<Tool
78+
Name="VCBscMakeTool"
79+
/>
80+
<Tool
81+
Name="VCFxCopTool"
82+
/>
83+
<Tool
84+
Name="VCAppVerifierTool"
85+
/>
86+
<Tool
87+
Name="VCWebDeploymentTool"
88+
/>
89+
<Tool
90+
Name="VCPostBuildEventTool"
91+
/>
92+
</Configuration>
93+
<Configuration
94+
Name="Release|Win32"
95+
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
96+
IntermediateDirectory="$(ConfigurationName)"
97+
ConfigurationType="1"
98+
CharacterSet="1"
99+
WholeProgramOptimization="1"
100+
>
101+
<Tool
102+
Name="VCPreBuildEventTool"
103+
/>
104+
<Tool
105+
Name="VCCustomBuildTool"
106+
/>
107+
<Tool
108+
Name="VCXMLDataGeneratorTool"
109+
/>
110+
<Tool
111+
Name="VCWebServiceProxyGeneratorTool"
112+
/>
113+
<Tool
114+
Name="VCMIDLTool"
115+
/>
116+
<Tool
117+
Name="VCCLCompilerTool"
118+
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
119+
RuntimeLibrary="0"
120+
UsePrecompiledHeader="2"
121+
WarningLevel="3"
122+
Detect64BitPortabilityProblems="true"
123+
DebugInformationFormat="3"
124+
/>
125+
<Tool
126+
Name="VCManagedResourceCompilerTool"
127+
/>
128+
<Tool
129+
Name="VCResourceCompilerTool"
130+
/>
131+
<Tool
132+
Name="VCPreLinkEventTool"
133+
/>
134+
<Tool
135+
Name="VCLinkerTool"
136+
LinkIncremental="1"
137+
GenerateDebugInformation="true"
138+
SubSystem="1"
139+
OptimizeReferences="2"
140+
EnableCOMDATFolding="2"
141+
TargetMachine="1"
142+
/>
143+
<Tool
144+
Name="VCALinkTool"
145+
/>
146+
<Tool
147+
Name="VCManifestTool"
148+
/>
149+
<Tool
150+
Name="VCXDCMakeTool"
151+
/>
152+
<Tool
153+
Name="VCBscMakeTool"
154+
/>
155+
<Tool
156+
Name="VCFxCopTool"
157+
/>
158+
<Tool
159+
Name="VCAppVerifierTool"
160+
/>
161+
<Tool
162+
Name="VCWebDeploymentTool"
163+
/>
164+
<Tool
165+
Name="VCPostBuildEventTool"
166+
/>
167+
</Configuration>
168+
</Configurations>
169+
<References>
170+
</References>
171+
<Files>
172+
<Filter
173+
Name="Source Files"
174+
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
175+
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
176+
>
177+
<File
178+
RelativePath=".\runcmd.cpp"
179+
>
180+
</File>
181+
<File
182+
RelativePath=".\stdafx.cpp"
183+
>
184+
<FileConfiguration
185+
Name="Debug|Win32"
186+
>
187+
<Tool
188+
Name="VCCLCompilerTool"
189+
UsePrecompiledHeader="1"
190+
/>
191+
</FileConfiguration>
192+
<FileConfiguration
193+
Name="Release|Win32"
194+
>
195+
<Tool
196+
Name="VCCLCompilerTool"
197+
UsePrecompiledHeader="1"
198+
/>
199+
</FileConfiguration>
200+
</File>
201+
</Filter>
202+
<Filter
203+
Name="Header Files"
204+
Filter="h;hpp;hxx;hm;inl;inc;xsd"
205+
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
206+
>
207+
<File
208+
RelativePath=".\stdafx.h"
209+
>
210+
</File>
211+
</Filter>
212+
<Filter
213+
Name="Resource Files"
214+
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
215+
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
216+
>
217+
</Filter>
218+
<File
219+
RelativePath=".\ReadMe.txt"
220+
>
221+
</File>
222+
</Files>
223+
<Globals>
224+
</Globals>
225+
</VisualStudioProject>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// stdafx.cpp : source file that includes just the standard includes
2+
// runcmd.pch will be the pre-compiled header
3+
// stdafx.obj will contain the pre-compiled type information
4+
5+
#include "stdafx.h"
6+
7+
// TODO: reference any additional headers you need in STDAFX.H
8+
// and not in this file
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// stdafx.h : include file for standard system include files,
2+
// or project specific include files that are used frequently, but
3+
// are changed infrequently
4+
//
5+
6+
#pragma once
7+
8+
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
9+
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
10+
#endif
11+
12+
#include <stdio.h>
13+
#include <tchar.h>
14+
15+
16+
17+
// TODO: reference additional headers your program requires here

shell/runcmd.exe_

37.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)