Batips [AlLyleNo] 2006-11-28 [Update]

xiaoxiao2021-03-05  25

Term: freexploit

Author: AlLeesno

Date: 2005 - ????

1.SET per environment variable can accommodate 8179 bytes

2. Legal IF code block

IF 1 == 1 (Echo 1echo 2)

3.MISSION IMPOSSIBLE 1

Custom characters implement implicit environment variables, huh, this is the missions Impossible in the BAT programming. It seems that it is not possible to actually implement this feature to build a virtual environment, implement the custom character in the BAT internal to run, and Direct output, this is implemented

4. Build a virtual environment, you can reflect many statements in the form of C , in a broad sense, you can reflect in any form in any form: Perl, C , JS, VBS (this is not meaningful), shell even Your own language, BAT's function library, 嘎嘎 feel good

5.MISSION IMPOSSIBLE 2

Returns a custom call location, which is also a mission impossible. To implement this feature, you can only use the variable instead of TABLE and determine the next variable as a return location when it is determined that the next variable is returned, and the location between tables How much Mission Impossible is there in the BAT program? It is worth paying attention to :)

6. Bit operation

The BAT can be operated (I don't know what this use is for the time being, if you can support the memory directly to the memory ...)

example:

Bouting and SET / A 1 ^ & 1

Point of different set / a 1 ^^ 1

Bit or set / a 1 ^ | 0

Ethereal examples judge whether the divided is 0

SET / A BOOL = 1 ^ & 0

IF% bool% == 0 ECHO is divided into 0

7.ELSE trap [Note this analysis is wrong, correct time 2006-06-07] [See 20]

This is more than BAT will encounter. The ELSE code block is actually unconditional, so when you want to use Else to make judgments for the previous condition

Don't think of it will be automatically judged, or to embed the IF or equal statement into the ELSE code block, the following example

IF 1 == 1 Echo 1

Echo 1

ELSE

Echo 1! = 1

)

the difference

IF 1 == 1 ECHO 1 (Echo 1) Else (if not 1 == 1 Echo 1! = 1) 8. The execution order of Bat follows the text method, from left to right, from top to bottom example @echo off goto goto Echo no echo: goto goto goto: goto: End 9.Table Label traps, if you use scales to define a tab, you can only display it in the command line, and you can't change it in the form of text, BAT text The code is constant, which cannot be changed. 10. Variable Extensions:% PATH: ~ 10, 5% will expand the PATH environment variable, then use only five from the 11th (offset 10) character in the extended result character. If no length is specified, the default value is used, that is, the number of variable values. If both numbers (offset, and length) are negative, the number used is the value of the environment variable value plus the specified offset or length. % PATH: ~ -10% will extract the last ten characters of the PATH variable. % PATH: ~ 0, -2% will extract all characters of the PATH variable, except for the last two.

11.SET must escape four characters set string = ^^ set string = ^ | set string = ^ 12. Care> NUL> NUL will set the ErrorLevel variable to 1 caused variables possible to be modified The consequences, for example: Echo 1234 | FINDSTR "1234"> NUL If the ERRORLVEL should be 0 in the way Errorlevel, Errorlevel is 1 13. Four BAT Comment Symbol Rem :: ^ (Not Announced) 00 (HEX) (System Vulnerability) 14.FOR statement About: Use of characters cannot be used within the freker cycle, so you must use REM and ^ instead of the for statement in the for statement when FOR is in the FOR statement: Label is playing when it is a limited cycle, performing any jump out of the FOR cycle, equivalent to the exit for 15.cmd / v: ON delay variables, and variable spreads, wonderful demo @echo off :: // Function: Detection Strings Length CMD / V: ON Super Function Demo :: // Checkstring 1.1 Build By AllyESNO CLS :: // Check CMD / V: On OR: OFF :: // Consider CMD_V_ON No Open Situation IF NOT "! cmd_v_on_exist!" == "% cmd_v_on_exist%" (SET CMD_V_ON_EXIST = 1cmd / V: ON / C% 0) :: / * Remember to consider the case * / if "! cmd_v_on_exist!" == "% cmd_v_on_exist % "(goto program_start) :: / * then consider the first instruction execution, then execute again * / if"% cmd_v_on_exist% == "1" (SET CMD_V_ON_EXIST = 0GOTO EOF): Program_Start Echo Please enter strings set string = set / p string = if "% string%" == "" goto endfor / l %% I in (1, 1, 26) DO (Echo loop first ring:! String: ~ %% i! Echo read %% i letter set / a add = %% i 1FOR / L %% J in (! add!, 1,! add!) do (Echo cycle second lap:! String : ~, %% J! Echo Read %% J Letters Echo.): Endif "% string%" == "" (Echo function: Detection string length echo usage: checklen anywordcho eg: checklen abcdefghijk01234567! @ # $% ^ & *): EOF 16. Care uses a number as a batch variable set 1 = 1 if "% 1%" == "1"

The result of the Echo 1 does not show 1 because the% 1% of the variable is interpreted as% 1 17.cmd / v: ON extension is used as! When the use error is when the CMD / V: ON extension is the variable value When you use the example of the test password to give a check password, please use the encrypted string to copy your encrypted string (for the method of extracting the encrypted string) Echo does not follow the steps mentioned by my article, everything The consequences you are responsible! ! ! ! Echo. :: / * String status initialization * / set string = set stringend = 0set stringlen = set / p string = if "! String!" == "(echo"% string% "goto end) :: / * Crack data initialization * / set password = Crack password is: REM need to initialize the output before the CMD / V: ON extension Rem set encryptdata = Abcdef! Hrem set decryptddata = 12345678echo ency:! Encryptdata! :: / * enumeration Password * / echo enumeration password start: EnumerateStringPassfor / L %% K IN (0, 1, 7) DO (for / l %% L in (0, 1, 7) do (if "! String: ~ %% ​​K 1! "=="! Encryptdata: ~ %% ​​L, 1! "(Set password =! Password !! Decryptdata: ~ %% ​​L, 1! Echo! Password!)))))): End 18. List all files The size of the clip http://www.patching.net/zhaohuan/blogview.asp?logid=45ALLEsNO:

FOR / R% I in (.) Do @echo% I & @ DIR "% i" | Find "byte"

19. Exclude deletion (turn to CCF)

Sometimes I am not very convenient to first Cut & Copy else, then Del, I want a little automated.

CMD

For / f "delims = /"% i in ('DIR / B / S *. *') DO DIR / B / S * .TXT | FIND "% i" || DEL "% i"

Do you need to keep several types?

Example: Keep TXT RAR

FOR / F "delims = /"% I in ('DIR / B / S *. *') DO DIR / B / S * .TXT * .RAR | Find "% i" || DEL "% i"

20. Legal IF ELSE statement @ set / pn = Name: @if "% n%" == "NOP" (echo character is too good, all beautiful MM like him) Else (echo character is too bad, try Enter NOP) 21. Digital symmetric service CLS set n = -1 for %% I IN (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, p, q, r, s, t, u, v, w, x, y, z) DO (SET / A N = 1 for / f %% J in ('set / a n = 1') do echo is Prohibited %% J %% i service) 22. Hundreds of directories are easy to build @echo offtitle http:

//

Blog.9cbs.net

/

Freexploit

/

Hundreds of directorys are easy to build by Allyesno

REM

============================================================================================================================================================================================================= =========

REM

Input frame

CLSECHO is easy to build

set

n

=

0

: Siteecho.

set

/

P n

=

Please enter the number of you want to build:

IF

% N% LEQ

0

(CLSecho.echo, the number of directory you entered must be greater than or equal to 1 integer!

goto

Site) echo.echo you want to create the number of directorys:% N% echo.

REM

============================================================================================================================================================================================================= =========

REM

Select frame

IF

% N% GTR

999

(Echo you have to build is greater than 999, please modify the source program

goto

end

)

IF

% N% GEQ

100

goto

GEQ999

IF

% N% GEQ

10

goto

GEQ99

REM

============================================================================================================================================================================================================= =========

REM

9 directory framework

for

/

L %% I in (% N%,

-

1

,

1

)

DO

(MD

00

%% IECHO established a directory

00

%% i) Echo.ecHo established% N% directory!

goto

end

REM

============================================================================================================================================================================================================= =========

REM

999 directory framework

: geq999

for

/

L %% I in (% N%,

-

1

,

100

)

DO

(MD %% IECHO established directory %% i)

for

/

L %% I in

99

,

-

1

,

10

)

DO

(MD

0

%% IECHO established a directory

0

%% i)

for

/

L %% I in

9

,

-

1

,

1

)

DO

(MD

00

%% IECHO established a directory

00

%% i) Echo.ecHo established% N% directory!

goto

end

REM

============================================================================================================================================================================================================= =========

REM

99 directory framework

: geq99

for

/

L %% I in (% N%,

-

1

,

10

)

DO

(MD

0

%% IECHO established a directory

0

%% i)

for

/

L %% I in

9

,

-

1

,

1

)

DO

(MD

00

%% IECHO established a directory

00

%% i) Echo established% N% directory!:

end

Echo.echo Please press any key to return to WindowsPause

>

NUL

exit

>

NUL

23. Delete a type of file in all the specified subdirectory in a directory, such as I want to delete all the image files below QQ

for

/

F% i in

'

DIR 1 * 2 * 3 * 4 * 5 * 6 * 7 * 8 * 9 * / b ') do @del% I / *. jpg% I / *. JPEG% I / *. BMP% I / *. GIF % I / *. PNG% i * .pcx / s / f / a

24. Let batch wsh be resolved Author: est Original: http://dormforce.net/Blog/electronixtar/archive/2006/12/01/11901.aspx Original: http://www.ph4nt0m.org/bbs/ Showthread.php? s = & postid = 84852 # post84852 For a long time, a method for performing VBS without a temporary file, performing VBS directly in batch: Test.batcode:

: On Error Resume Next Sub bat echo off & cls echo Batching_codez_here_following_vbs_rules & pause start wscript -e: vbs "% ~ f0" Exit Sub End Sub MsgBox "This is vbs" clever use of the code above bat and grammatical features vbs, so that the same A file, is identified by cmd.exe into batch, allowing WSCRPT.exe to identify VBS and meet both of the syntax and guarantees that there is no error, ensuring the height of both. Just calling it BAT / VBS Composite Program (Hybird Programming) Rough Interpretation Code References: On Error Resume Next Cmd.exe Recognition Wscript.exe This Identification, Representation Branch in VBS Syntax, then On Error ResMe Next That is to let WSH ignore some error references:

Start WScript -e: VBS "% ~ F0" cmd.exe recognition: Start WScript.exe, its parameters are: 1 -e: VBS settings with VBS parsing files 2 "% ~ F0" refers to this batch itself. WScript.exe identifies this sentence: calling a function called Start, the function parameter is WScript variable, then use the result of this function to subtract E. The next is another: branch, then call a function called VBS, the parameter is the character: "% ~ f0" is the most intriguing, because it successfully explains the VBS engine explains a batch of batch, And there is no mistake! Of course, these start (), the VBS () function does not exist, but will be executed by cmd.exe as a command. Why don't you use WScript // E: VBS "% ~ F0" to execute? VBS analysis will be wrong, huh, huh, the core thinking of this code has been introduced. Below, in order to let the batch call itself with VBS, we need Exit or Goto: EOF, but Goto Call Exit is a keyword in VBS, so we can only use Exit Sub in accordance with VBS syntax, so we In the second sentence, add a SUB BAT, in fact, cmd.exe finds a command called sub.exe, but this command does not exist, cmd.exe skips. Then add an exit sub and End Sub in 6,7 sentences, allowing the batch to end, and the echo off & cls of the vBs, the meaning of the echo off & cls, the means is equivalent to @echo off, but VBS does not recognize @ symbol, so Change into Echo Off & Cls, VBS can be resolved to call a function called Echo (), the parameter is OFF & CLS, that is, two strings OFF and CLS add Well, next, you can freely Write a VBS script in writing, efficiency and real VBS! The advantage of this code is: No need to generate temporary files. In fact, use echo or more or find to generate temporary VBS very waste system resources, using this code I wrote, it is completely free of these troubles.

转载请注明原文地址:https://www.9cbs.com/read-32460.html

New Post(0)