Jump to content

Caml Light

Member
  • Posts

    85
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Italy

Posts posted by Caml Light

  1. Yzöwl i've an idea! Could it to be possible to obfuscate the content of a batch file?

    I can create a compiled exe file from an authoring software, a GUI with a button. Clicking on that button, i can launch the CMD batch file with a specified parameter, for example: mybatch.cmd -param

    You wrote for me something like this some months ago:

    @ECHO OFF
    ECHO=_%~1|FINDSTR/X "_-param">NUL 2>&1||GOTO Error

    ECHO Logged succesfully
    >NUL PAUSE
    EXIT

    :Error
    ECHO Error
    >NUL PAUSE
    EXIT

    My idea is that the batch should recognize the correct parameter given (%~1) and apply it as "algorithm key" to decode the obfuscated batch.

    I hope to be explain me fine.

    Thank you

  2. Hi bphpt, if you want we can do a game... you ask a question to me and i ask a question to you. Is this a specialist forum or a facebook branch?? :lol:

    Hi Yzöwl, that program decompiles the batch into the HD. Anyway, since you know more things than me in this area and i wish to learn, can i send you some PM if i have need? Please let me know.

    To learn, to learn, to learn, always! :hello:

  3. How much are you charging for this script that it would be beneficial for them to steal it. Does Yzowl make a percentage ? For the right price, I will rewrite the entire thing to be encrypted and only decompile in RAM.

    CMD batch or converted to a different language?

    I'm enthusiast about security, and i want to learn, to learn, to learn, this is the way for me! I'm curious if exists a way to don't decompile in the the HD. I know that is possible to do what you wrote with VBScript, not with a CMD batch.

  4. I'm confused as to why your non secret updates installation routine being extracted, run and deleted from a default hidden location is considered 'useless'!

    Because everyone can access to that folder and get the batch. I wish to hide the batch file. The world is big, not all people are skillful as you or other members of this community. :lol:

    Anyway, for a UNskillful person, the %TEMP% folder is easy to get.

  5. I'm using powershell started from cmd.exe via a single line (registry shell extension). How many characters in yours, this one is 498 characters and does not throw me any error.

    @ECHO OFF & cmd /k start /b powershell -command "clear-host;[void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic');$INDEX = [Microsoft.VisualBasic.Interaction]::InputBox('Enter Image #', 'Which image to mount', '1');$PROMPT = [Microsoft.VisualBasic.Interaction]::MsgBox('Ready to mount image ?', 'OKCancel,Question', 'Last Chance to Cancel');switch ($PROMPT) {'OK'{Dism /mount-wim /wimfile:D:\sources\boot.wim /index:$INDEX /mountdir:C:\zMountDir}'Cancel'{exit}}" & PAUSE

    On second thought, your script looks short but that %%A variable expands at runtime, the problem could be the expanded 'path' length being more than 256 characters, why not convert the %%A variable to 8.3 short naming before it loops.

    Alternatively try encrypting your batch as an exe. Plenty of free-wares offer that agility.

    I've already bought (paid version) a well-known batch compiler program, but it extracts the batch into the %TEMP% folder, so it's useless.

    Most authoring language uses their own scripting language so maybe you should use it instead of using it to launch batch code.

    Anyway if you need the loop part, this might work:

    FOR /R %A IN (Windows*-KB*.EXE) DO ( SET _=T && ECHO= Installation of %~nA... && PING -n 4 127.0.0.1 >NUL && "%A" /quiet /norestart)

    Do you know Multimedia Builder? I use that program. Anyway, my batch is very long, and with MMB i must create several Run("CMD","parameter$") commands (very bad), so i've choice to do it with a single Run command unifying the whole batch into a single line. But for CMD.exe that line is too long.

  6. Thank you for your support. Mainly the batch must be read (its content) by a authoring software. Once read, it is saved as variable by the authoring program, than executed as parameter of "CMD.exe". This method works if batch are not too long, because the batch become the parameter of CMD. Is there an alternative way to protect the batch, hiding its content? I also can host the batch on my website, in case of a valid "online protection". I've already bought a specific professional compiler, but during the execution of the compiled EXE, the batch is extracted into the %TEMP% folder, so it is useless.

    Thank you

  7. My batch is based on a old cmd script written by Yzöwl:

    @ECHO OFF
    ECHO=_%~1|FINDSTR/X "_-123456 _/123456">NUL 2>&1||GOTO Error
    SETLOCAL ENABLEEXTENSIONS
    SET "_="
    PUSHD %~dp0
    FOR /R %%A IN (Windows*-KB*.EXE) DO (
    SET _=T
    ECHO= Installation of %%~nA...
    >NUL PING -n 4 127.0.0.1
    "%%A" /quiet /norestart)
    IF NOT DEFINED _ GOTO Error
    ECHO=
    ECHO= == Press any key to restart. ==
    >NUL PAUSE
    SHUTDOWN.EXE /r /t 0
    GOTO :EOF
    :Error
    ECHO= Error.
    ECHO=
    ECHO= Press any key to exit...
    >NUL PAUSE

    My batch repeats the central part several times to install other software:

    FOR /R %%A IN (Windows*-KB*.EXE) DO (
    SET _=T
    ECHO= Installation of %%~nA...
    >NUL PING -n 4 127.0.0.1
    "%%A" /quiet /norestart)

    Converting it into a single line batch, results too long to execute for CMD.exe. Is there a solution to this limitation?

    Thank you

  8. Thank you gunsmokingman! I've a question for you. If i wish to add other commands... for example to install other type of files, is it possible?

    Example:

    Windows Updates:

    KB123456

    KB234567

    KB345678

    ...

    IE9

    .NET 4.0

    and so on...

    With the bath i can do:

    FOR /R %%A IN (KB*.EXE) DO (
    ...
    START "" /MIN /WAIT "%%A" /param1)

    FOR /R %%A IN (IE9*.EXE) DO (
    ...
    START "" /MIN /WAIT "%%A" /param2)

    FOR /R %%A IN (NET*.EXE) DO (
    ...
    START "" /MIN /WAIT "%%A" /param3)

    You're the guru of VBS, so i hope you can solve my problem. :yes:

    Thank you for now!

  9. Hi guys, as from title, i need a complete conversion of one of my batch file. Could you help me please?

    @ECHO OFF
    ECHO=_%~1|FINDSTR/X "_ _">NUL 2>&1||GOTO Error
    SETLOCAL ENABLEEXTENSIONS
    SET "_="
    PUSHD %~dp0

    :: Title

    FOR /R %%A IN (file*.EXE) DO (
    SET _=T
    ECHO=Installation of %%~nA ...>>install.log
    >NUL PING -n 4 127.0.0.1
    IF "%PROCESSOR_ARCHITECTURE%"=="x86" (
    START "" /MIN /WAIT REG ADD "HKLM\SOFTWARE\Key" /v "Key" /t REG_DWORD /d 20991231 /f)
    IF "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
    START "" /MIN /WAIT REG ADD "HKLM\SOFTWARE\Wow6432Node\Key" /v "Key" /t REG_DWORD /d 20991231 /f)
    START "" /MIN /WAIT "%%A" /param)

    IF NOT DEFINED _ GOTO Error
    ECHO=Installation completed.>>install.log
    >NUL PING -n 4 127.0.0.1
    EXIT
    GOTO :EOF

    :Error
    ECHO=Install error.>>install.log
    >NUL PAUSE

    Thank you in advance for your help!

  10. Infact there is no reason to use the RD command running a DVD-R but how could it possible to use both commands (ROBOCOPY and DISM) with the same batch (without RD obviously)? On ss64.com i've read that XCOPY is deprecated with the newer O.S. and we should use ROBOCOPY, but in case of problems i can replace it with the old and simple XCOPY.

    If you can, could you write an example of a correct SetupComplete.cmd integrating both ROBOCOPY or XCOPY and DISM please? Thanks :)

  11. Hi guys, i need to copy two files from a DVD-R to the %SystemDrive% folder using ROBOCOPY command with a batch file located in the same DVD-R dir of the two files to copy

    My problem is that i don't know how specify as source the dir of the batch file...

    For now this is my script:

    @SETLOCAL ENABLEEXTENSIONS
    @CD /D "%~dp0"
    ROBOCOPY "???" "%SystemDrive%" file1.ext
    ROBOCOPY "???" "%SystemDrive%" file2.ext

    Feel free to fully rewrite my batch. Thank you in advance!

×
×
  • Create New...