Jump to content

Batch Scripting / AUTOIT Question


Recommended Posts

Here is my program:

#include <Constants.au3>

HotKeySet("{ESC}", "Terminate")

$work = Run("cmd", $STDOUT_CHILD) ;

AutoItSetOption("SendKeyDelay", 1)

send(" path=c:\Program Files\WinRAR")

Send ("{ENTER}")

global $text1

global $size

global $test

global $data

for $i2 = 97 to 105

$text1 = $text1 & Chr($i2)

Send("unrar e hamachi.rar > unrar1.txt")

Send ("{ENTER}")

send($text1)

Send ("{ENTER}")

sleep(100)

While 1

$hello= stdoutread($work)

If @error Then ExitLoop

MsgBox(0, "STDOUT read:", $line)

Wend

MsgBox(0,"Text" , $hello)

$size = FileGetSize("unrar1.txt")

if $size < 110 then send("q")

if $size < 110 then Send ("{ENTER}")

if $size < 110 then exitloop

send("cls")

Send ("{ENTER}")

$text1=""

Next

$text1 = Chr($i2-1)

MsgBox(0, "The Password Was", $text1)

filedelete("c:\unrar1.txt")

Func Terminate()

Exit 0

EndFunc

********************************************************************************

**********

Basically what I'm trying to do is run a brute force unrar attack where it runs unrar on file with all the possible combination. I think I got it to work, but the way it works is it saves the output to a file then compares the outputs. If it was successful, the out put is one size where if it didnt work, the output will be another size. I have the program running until the output is the size of the correct password. I know there must be a better way to go about this. I'm thinking something along the lines of a getline then compare it to what is should be. I was thinking about using

path=c:\Program Files\WinRAR;c:\windows\system32

echo off

set x="y Assume Yes on all queries"

FOR /F "tokens=*" %%R IN ('unrar') DO if echo %%R

yet I cant get it to work. IF someone who has unRAR installed and can help me code this correctly, I am really trying to learn how to code things like this.

Thanks a bunch

Deathdefyer!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...