Page 1 of 1
Two Variable command ?
Posted: 13 Aug 2024 04:22
by TosunPASA
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?
Re: Two Variable command ?
Posted: 14 Aug 2024 04:15
by miskox
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:
and _L:
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
Re: Two Variable command ?
Posted: 14 Aug 2024 07:45
by TosunPASA
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
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
Re: Two Variable command ?
Posted: 14 Aug 2024 09:42
by miskox
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
Re: Two Variable command ?
Posted: 14 Aug 2024 09:53
by TosunPASA
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 ?
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
Re: Two Variable command ?
Posted: 15 Aug 2024 05:48
by miskox
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