Is this batch file an injection?

C:\>batinjection OFF ^& DEL c.c

batinjection.bat has content ECHO %*

I heard about SQL injection, although I never did it, but is this injection? Are there different types of injections, and is this one of them?

Or is there another technical term for this? or more specific term?

Note - preliminary editing had C:\>batinjection OFF & DEL c.c(i.e. without ^%) and ECHO %1(i.e. without% *), which was not entirely correct. I fixed it. This does not affect the answers.

+5
source share
4 answers

, , , attac, OFF.

, /.

set "param1=%*"
setlocal EnableDelayedExpansion
echo(!param1!

echo( echo. - , .

! , .

, , - set, ( ).

, .
myBatch.bat ^&"&"

SO: ?

- REM, ECHO ON.
, ( : ), , - .

myBatch.bat myContent^&"&"%a

myContent&"&"4

+3

, .

-, Windows "&". .

-, ECHO . "" "/?" , ECHO .

-, , , , , .

, script, . foo.bat.

@echo off
echo before
echo %1
echo after

, ( ) , echo ().

foo dir

:

before
dir
after

. , .

foo /?

:

before
Displays messages, or turns command-echoing on or off.

  ECHO [ON | OFF]
  ECHO [message]

Type ECHO without parameters to display the current echo setting.
after

. echo. , , . " " -, .

foo dog & dir

:

before
dog
after
[A spill of my current directory]

, dir script. .

foo ^&dir/w

:

before
ECHO is off.
[A spill of my current directory in wide format]
after

- . ECHO . - , .

foo ^&dir\/s

! , "% 1".

+7

AFAIK, ( ).

. (www.owasp.org) -.

+1

, " ". SQL Injection Cross Site Scripting , .

In your example, the ECHO statement does not actually perform the deletion, so I would not call this injection. Instead, deletion occurs outside of the call to the batinjection script itself.

+1
source

All Articles