Two Variable command ?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
TosunPASA
Posts: 3
Joined: 13 Aug 2024 04:16

Two Variable command ?

#1 Post by TosunPASA » 13 Aug 2024 04:22

Hello
i got 3 directory

1st directory h$ = c:\Dir1\hs\
2nd directory l$ = c:\Dir1\ls\
3th directory c:\Dir1\run\execute.exe

h$ = There are 150 files with extensions (*.txt ; *.lst ; *.bin) in the h$ directory.

l$ = There are 30 files with extensions (*.txt ; *.lst ; *.dic) in the l$ directory.

My command line is: execute.exe -w:"l$-file" "h$-file"

It will run all the files in l$ for the first file in h$, and when the 30 files are finished, a new command will run;

execute.exe -show h$file>h$file_result.txt

This process will be applied to all the files in h$. In other words, I need to process the 150 files in h$ with the 30 files in l$. I also need to save the result file after 30 attempts for each file.

If I want to do it manually, this process should be ((150*30 = 4500) +150 = 4650) lines.

Can you help me with this?

miskox
Posts: 610
Joined: 28 Jun 2010 03:46

Re: Two Variable command ?

#2 Post by miskox » 14 Aug 2024 04:15

This maybe (make sure your files and folders have no spaces in the directory/filename):

Code: Select all

@echo off
for /f "tokens=1 delims=" %%h in ('dir /b _h\*.*') do (
	for /f "tokens=1 delims=" %%l in ('dir /b _L\*.*') do echo EXECUTE execute.exe -w:"%%l" "%%h"
	echo execute.exe -show %%h ^>%%h_result.txt
	echo/
)
I made two folders:

_H with these files:

Code: Select all

H_100.txt
H_101.txt
H_102.txt
and _L:

Code: Select all

L_100.txt
L_101.txt
Result:

Code: Select all

EXECUTE execute.exe -w:"L_100.txt" "H_100.txt"
EXECUTE execute.exe -w:"L_101.txt" "H_100.txt"
execute.exe -show H_100.txt >H_100.txt_result.txt

EXECUTE execute.exe -w:"L_100.txt" "H_101.txt"
EXECUTE execute.exe -w:"L_101.txt" "H_101.txt"
execute.exe -show H_101.txt >H_101.txt_result.txt

EXECUTE execute.exe -w:"L_100.txt" "H_102.txt"
EXECUTE execute.exe -w:"L_101.txt" "H_102.txt"
execute.exe -show H_102.txt >H_102.txt_result.txt
You could test run it with ECHO and then remove ECHO and replace other commands.

Saso

TosunPASA
Posts: 3
Joined: 13 Aug 2024 04:16

Re: Two Variable command ?

#3 Post by TosunPASA » 14 Aug 2024 07:45

Hello
thank you very much for ur command

before show me "No such file or directory"

and i check google for path.. find a command smilar site

i do
set YOLD =d:\AppWay\_L\"
set YOLH =d:\AppWay\_H\"


and i change ur command like this

Code: Select all

%YOLD%%%l %YOLH%%%h
and my original command like this

Code: Select all

john --format=raw-md5 -w:sing1.txt kirilacaksifre.txt

and john have moch format like "bsdi crypt  bf afs DES krb5 md5 raw-md5 md4-gen md5-gen mscash mssql mysql ssha openssha oracle oracle11 phpass"

for now "--format=raw-md5 " cant work. in time, if i u can add different/variable type format in command.. will fix my problem complately

if i can add format in command.. will change 3 variable command type.. now only 2 .

if u got more suitable command and way.. i can accept.

thank you very much for support me
have a nice day

miskox
Posts: 610
Joined: 28 Jun 2010 03:46

Re: Two Variable command ?

#4 Post by miskox » 14 Aug 2024 09:42

Updated.

Here is the code based on your original post:

Code: Select all

@echo off
for /f "tokens=1 delims=" %%h in ('dir /b c:\Dir1\HS\*.*') do (
	for /f "tokens=1 delims=" %%l in ('dir /b c:\Dir1\LS\*.*') do echo c:\Dir1\run\execute.exe -w:"c:\Dir1\HL\%%l" "c:\Dir1\HS\%%h"
	echo c:\Dir1\run\execute.exe -show c:\Dir1\HS\%%h ^>%%h_result.txt
	echo/
)
Is this easier to understand?

Do you have some basic knowledge about batch files?

Open command prompt and run this batch file from within this command prompt.

Saso

TosunPASA
Posts: 3
Joined: 13 Aug 2024 04:16

Re: Two Variable command ?

#5 Post by TosunPASA » 14 Aug 2024 09:53

u r amazing
thx

i took note. when finish i will change like that

do u have more idea variable hash format type in command ?

f$= format_types= "bsdi crypt bf afs DES krb5 md5 raw-md5 md4-gen md5-gen mscash mssql mysql ssha openssha oracle oracle11 phpass"

how i can do ?

Code: Select all

john --format=f$ -w:"%%l" "%%h"
list count = 20
hash file count = 50
format type count = 10

20*50*10 = 10000 times "cycles will occur"

thats all for my fun. making a dictionary for self (decrypted)

thank you very much... be safe

miskox
Posts: 610
Joined: 28 Jun 2010 03:46

Re: Two Variable command ?

#6 Post by miskox » 15 Aug 2024 05:48

Why didn't you write *all* the information in the original post?

See: viewtopic.php?p=70082#p70082

Try this:

Code: Select all

@echo off
set "dirH=c:\Dir1\HS"
set "dirL=c:\Dir1\LS"
set /a cnt=0
for /f "tokens=1 delims=" %%h in ('dir /b %dirH%\*.*') do (
	for /f "tokens=1 delims=" %%l in ('dir /b %dirL%\*.*') do (
		for %%H in (bsdi crypt bf afs DES krb5 md5 raw-md5 md4-gen md5-gen mscash mssql mysql ssha openssha oracle oracle11 phpass) do (
			echo c:\dir1\run\john.exe --format=%%H -w:"%dirH%\%%l" "%dirL%\%%h"
			set /a cnt+=1
		)
		echo/
	)
	echo c:\Dir1\run\execute.exe -show c:\Dir1\HS\%%h ^>%%h_result.txt
	set /a cnt+=1
	echo =========================================================
)
echo %cnt%
You can run this .bat with the redirection to a file and check the results (bat_name.bat>logfile.log)

Saso

Post Reply