Category Archives: English

Brute-Force Compress File Archive

Did you forgot the password for your compressed file archive?

This code can open by brute force any file format that 7zip support (including 7z, zip, rar, cab, iso, tgz, arj, gz, gzip).

To speed up the process you need to change some parameters before compiling the program. (see below)

Requirements:

  • Sharp-Dev or Visual Studio for editing and compiling the C# code.
  • 7-Zip install on your system and the full path to 7z.exe (i.e. D:\Downloads\7z1506-x64\7z.exe).

What you need to change:

The parameters that need to be set before the program can run locate at the beginning of the main function:

// --- Please set the parameters before run
Number_Paralel_Program = 15;
continue_from = 0;
ProtectedFile = @"D:\archive.7z";
SevenZipCMDPath=@"D:\Downloadsz1506-x64z.exe";
posibilitys = new string[]{
                "a",
                "b",
                "c",
                "d",
                "e",
                "f",
                "g",
                "h",
                "i",
                "j"
             };
//--------------------------

The parameters:

  • Number_Paralel_Program = should be set to the number of attempts that you want to done simultaneously and should not be more then the number of the cores that in your computer.
  • continue_from = if you run the program for the first time it need to set to zero, if you wont to continue previews run its need to be set to the last attempt number (all other parameters must not change between the runs).
  • ProtectedFile= set to the path of the protected archive
  • SevenZipCMDPath = set the path to the 7z.exe program that installed on your system
  • possibility = this array should be set to the least set of possible passwords.
    For example, you remember that the password to the file contain combination of characters like:
    123 , abc
    There for the password can be one of the 6 possibilities (2^2+2)

    123
    abc
    
    123abc 
    abc123
    
    123abc
    abc123

    so possibility should be set like this

    posibilitys = new string[]{
                    "123",
                    "abc",
                 };

Limitations:

The program use external binary file, it mean that it use the windows environment command prompt to run and try the archive file. therefore the program is not optimized for long brute force attack.

Download

The project can be download here

 

Brute-Force Password Generator / permutations

Generator of all possible N symbols strings

After searching the net for a solution to generate of all possible combination of N symbols from given strings, I decide to write one in python.

This is an algorithm for Permutation Generation you can run it from the beginning of the permutation or start it in the middle.

The algorithm is flexible and can handle any password length for given an “alphabet”

The variables:

characters = “abc” #  this will define the alphabet to generate the combination
letter = 3 # This will define how many combination of letters you want to have? the algorithm will start from 1 to the number you choose here.

Download the source-code

Run Example:

characters = “ab12”
letter = 2;

Output:

a
b
1
2
aa
ba
1a
2a
ab
bb
1b
2b
a1
b1
11
21
a2
b2
12
22
aaa
baa
1aa
2aa
aba
bba
1ba
2ba
a1a
b1a
11a
21a
a2a
b2a
12a
22a
aab
bab
1ab
2ab
abb
bbb
1bb
2bb
a1b
b1b
11b
21b
a2b
b2b
12b
22b
aa1
ba1
1a1
2a1
ab1
bb1
1b1
2b1
a11
b11
111
211
a21
b21
121
221
aa2
ba2
1a2
2a2
ab2
bb2
1b2
2b2
a12
b12
112
212
a22
b22
122
222

Run Example:

characters = “abc123”
letter = 3;

Output:

a
b
1
2
aa
ba
1a
2a
ab
bb
1b
2b
a1
b1
11
21
a2
b2
12
22
aaa
baa
1aa
2aa
aba
bba
1ba
2ba
a1a
b1a
11a
21a
a2a
b2a
12a
22a
aab
bab
1ab
2ab
abb
bbb
1bb
2bb
a1b
b1b
11b
21b
a2b
b2b
12b
22b
aa1
ba1
1a1
2a1
ab1
bb1
1b1
2b1
a11
b11
111
211
a21
b21
121
221
aa2
ba2
1a2
2a2
ab2
bb2
1b2
2b2
a12
b12
112
212
a22
b22
122
222

 

How to Force Dropbox / SkyDrive / Box etc to Backup any Directory?

Problem

I use a couple of syncing / backup solutions to backup my data and sync it across different computers and places. the problem is, some of them force me to put all my synced / backuped files in their special folder while I want to maintain my own directory structure.

For example, in order to work with Google Drive, Dropbox, SkyDrive, Box, etc. All the files that needs to be backed up and synced MUST be under their special directory!

But I want to maintain my own file structure and not to being limited to living inside this single directory.    How to do that and still use this softwares?

If it was a Linux system it was easy – simply create a hard links!
Oh, Wait, didn’t Microsoft, starting Windows Vista created something that functioned exactly like links in Linux? The command is called ‘mklink’.

Solutions

Install whatever sync/backup solution you want and set its path to where you want, for this example we chose to install Dropbox and to choose the default path. for example:

D:Dropbox

Now, let’s assume that the files that you want to backup are located at:

D:Local User DirectoryMy Documents

We want to create a (hard) link  from “My Documents” to D:DropboxMy Documents

This is how you do it: Click “Start” and search for “Command Prompt”. Right click on it, and click “Run as administrator”

Now on the command prompt write:

mklink /j  “D:DropboxMy Documents” “D:Local User DirectoryMy Documents”

/j stand for make a junction

this is how its should look like

Now, every files that in “D:DropboxMy Documents” is also in “D:Local User DirectoryMy Documents” and vice versa! without taking double space and multiple locations of files..

Important Notice For SkyDrive, Box and maybe more

Because a bug in SkyDrive, Box and possibly more syncing programs, if the directories that giving to Skydrive is not the original directory, for some reason Skydrive / Box stop syncing the content of the directories, The only solution for this is to give SkyDrive, Box etc the original directory and make a junction / links to other locations.

Disclaimer

You should address this post as a solution that work for me only, if you choose to use the way that suggested in this posts you should adapt it to your needs.
I am not responsible on any damage that can be done because of the suggestion in this post.

Thanks

Thanks to Zohar Snir on editing

Benchmark Between to Methods that Resize Array in C#

Prob: There is two methods to change size of array in C#. Using a template of a Benchmark program from this informative site, I checked the two ways:

Array.Resize  VS  Array.CopyTo VS Loop

Conclusion: sometime build it your self is not that better then using the build-in commands…

Array.Resize took 30253 ms
Arryay.CopyTo took 29649 ms
Loop took 58323 ms

Solution:

Here is the code that I use

class Program
{
public static void AddCell1(ref double[] vector,int num)
{
int size = vector.Length;
Array.Resize(ref vector,size+1);
vector[size] = num;
}
//————————————————-

public static void AddCell2(ref double[] vector,int num)
{
double[] tempVec = new double[vector.Length+1];
vector.CopyTo(tempVec,0);
tempVec[vector.Length] = num;
vector = tempVec;
}
//————————————————-

public static void AddCell3(ref double[] vector,int num)
{
double[] tempVec = new double[vector.Length+1];
for (int i = 0; i < vector.Length ; i++) {
tempVec[i] = vector[i];
}
tempVec[vector.Length] = num;
vector = tempVec;
}
//————————————————-

public static void Main(string[] args)
{
Console.WriteLine(“Hello World!”);

double[] arr1 = new double[]{};
double[] arr2 = new double[]{};
double[] arr3 = new double[]{};

Stopwatch s1 = Stopwatch.StartNew();
for (int i = 0; i < 100000; i++)
AddCell1(ref arr1,i);
s1.Stop();

Stopwatch s2 = Stopwatch.StartNew();
for (int i = 0; i < 100000; i++)
AddCell2(ref arr2,i);
s2.Stop();

Stopwatch s3 = Stopwatch.StartNew();
for (int i = 0; i < 100000; i++)
AddCell3(ref arr3,i);
s3.Stop();

// TODO: Implement Functionality Here
Console.WriteLine(“{0},{1},{2}”,
s1.ElapsedMilliseconds,
s2.ElapsedMilliseconds,
s3.ElapsedMilliseconds);
Console.Write(“Press any key to continue . . . “);
Console.ReadKey(true);
}
}

How to temporary erase file in Windows 7 with NTFS without pressing delete button

Weird thing in Windows 7 with NTFS, here is what I accidentally found: If you rename file and add in its end a dot, the file is temporary vanish!!

here is how it happened:

First go to file that you want to delete, in my case the file name is: “win7.ld”
Second: press F2 to rename the file

Windows will ask if you sure, and of-course you say YES!

Then Windows will not trust you and ask again, and again you will say YES!

Result

The file as been vanish!!

But, if you want to go back, just press F5 (refresh) the the file will appear again…

Brute-Force Truecrypt Password

Did you forget your Truecrypt password?

Not to worry, using simple search in Google I found a script in this site, and I adapt it for my needs, I post it  here because it could be helpful to other.

To succesful run the script you will required to install AutoITscript, that is AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages (e.g. VBScript and SendKeys). AutoIt is also very small, self-contained and will run on all versions of Windows out-of-the-box with no annoying “runtimes” required!

The script will use all the character or words that in the variable $Array, to run on all the possibilities and combination of any order, from 2 combination to 7 combination and try to open the container. The script will run until it will find a match or it will exhaust any of your given possibilities.

Note:

  • $truecryptPath is the path of your TrueCrypt program
  • $containerPath is the path to the container that you wont to open
  • If the script find the right password it automatically mount the container to one of the free drive letters and open explorer to it.
  • The path to the TrueCrypt program and to your container MUST be in DOS-8 characters format, to get it you need to use “dir /x” and CMD.
  • you also can save time by eliminate character that you absolutely sure that you didn’t use in your password oryou can change every place in the array to possible combination of your passwordfor example: if I have same patterns for my password and I am using only combination of it
    • date of my child = 1308200
    • ID number = 123456789
    • name of the neighbor = moshe
    • family name = ofnick

Add  those to the $Array  and run all combination of your favorites password to save you time by running the script only on your your combination password

AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages (e.g. VBScript and SendKeys). AutoIt is also very small, self-contained and will run on all versions of Windows out-of-the-box with no annoying “runtimes” required!

So here is the script:

dim $one, $two, $three, $four, $five, $six, $seven, $eight, $pw, $pp, $count, $truecryptPath, $containerPath
 $truecryptPath = "C:PROGRA~1TrueCryptTrueCrypt.exe /q background /s "
 $containerPath = "d:cscs2.tre"
 dim $numberOfCharacters = 92
 dim $Array[$numberOfCharacters+1]
 $Array[0]="a"
 $Array[1]="b"
 $Array[2]="c"
 $Array[3]="d"
 $Array[4]="e"
 $Array[5]="f"
 $Array[6]="g"
 $Array[7]="h"
 $Array[8]="i"
 $Array[9]="j"
 $Array[10]="k"
 $Array[11]="l"
 $Array[12]="m"
 $Array[13]="n"
 $Array[14]="o"
 $Array[15]="p"
 $Array[16]="q"
 $Array[17]="r"
 $Array[18]="s"
 $Array[19]="t"
 $Array[20]="u"
 $Array[21]="v"
 $Array[22]="w"
 $Array[23]="x"
 $Array[24]="y"
 $Array[25]="z"
 $Array[26]="A"
 $Array[27]="B"
 $Array[28]="C"
 $Array[29]="D"
 $Array[30]="E"
 $Array[31]="F"
 $Array[32]="G"
 $Array[33]="H"
 $Array[34]="I"
 $Array[35]="J"
 $Array[36]="K"
 $Array[37]="L"
 $Array[38]="M"
 $Array[39]="N"
 $Array[40]="O"
 $Array[41]="P"
 $Array[42]="Q"
 $Array[43]="R"
 $Array[44]="S"
 $Array[45]="T"
 $Array[46]="U"
 $Array[47]="V"
 $Array[48]="W"
 $Array[49]="X"
 $Array[50]="Y"
 $Array[51]="Z"
 $Array[52]="!"
 $Array[53]="@"
 $Array[54]="#"
 $Array[55]="$"
 $Array[56]="%"
 $Array[57]="^"
 $Array[58]="&"
 $Array[59]="*"
 $Array[60]="("
 $Array[61]=")"
 $Array[62]="_"
 $Array[63]="+"
 $Array[64]="~"
 $Array[65]="`"
 $Array[66]="1"
 $Array[67]="2"
 $Array[68]="3"
 $Array[69]="4"
 $Array[70]="5"
 $Array[71]="6"
 $Array[72]="7"
 $Array[73]="8"
 $Array[74]="9"
 $Array[75]="0"
 $Array[76]="-"
 $Array[77]="="
 $Array[78]="["
 $Array[79]="]"
 $Array[80]=""
 $Array[81]="{"
 $Array[82]="}"
 $Array[83]="|"
 $Array[84]=";"
 $Array[85]=":"
 $Array[86]="'"
 $Array[87]=""""
 $Array[88]=","
 $Array[89]="."
 $Array[90]="/"
 $Array[91]="?"
$count = 0
 for $two = 0 to $numberOfCharacters
 for $one = 0 to $numberOfCharacters
 $pw = $Array[$one]
 $pw &= $Array[$two]
 $count = $count+1
 $pp  = Run(@COMSPEC & " /c " & $truecryptPath & " /p "& $pw & " /e /m ro /m rm /v " &$containerPath )
 ProcessSetPriority($pp, 0)
if $count>25 then
 While ProcessExists($pp)>0
 Wend
 EndIf
Next
 Next
While ProcessExists($pp)>0
 Wend
$count = 0
 for $three = 0 to $numberOfCharacters
 for $two = 0 to $numberOfCharacters
 for $one = 0 to $numberOfCharacters
 $pw = $Array[$one]
 $pw &= $Array[$two]
 $pw &= $Array[$three]
 $count = $count+1
 $pp  = Run(@COMSPEC & " /c " & $truecryptPath & " /p "& $pw & " /e /m ro /m rm /v " &$containerPath )
 ProcessSetPriority($pp, 0)
if $count>25 then
 While ProcessExists($pp)>0
 $count = 0
 Wend
 EndIf
Next
 Next
 Next
While ProcessExists($pp)>0
 Wend
$count = 0
 for $four = 0 to $numberOfCharacters
 for $three = 0 to $numberOfCharacters
 for $two = 0 to $numberOfCharacters
 for $one = 0 to $numberOfCharacters
 $pw = $Array[$one]
 $pw &= $Array[$two]
 $pw &= $Array[$three]
 $pw &= $Array[$four]
 $count = $count+1
 $pp  = Run(@COMSPEC & " /c " & $truecryptPath & " /p "& $pw & " /e /m ro /m rm /v " &$containerPath )
 ProcessSetPriority($pp, 0)
if $count>25 then
 While ProcessExists($pp)>0
 $count = 0
 Wend
 EndIf
Next
 Next
 Next
 Next
While ProcessExists($pp)>0
 Wend
$count = 0
 for $five = 0 to $numberOfCharacters
 for $four = 0 to $numberOfCharacters
 for $three = 0 to $numberOfCharacters
 for $two = 0 to $numberOfCharacters
 for $one = 0 to $numberOfCharacters
 $pw = $Array[$one]
 $pw &= $Array[$two]
 $pw &= $Array[$three]
 $pw &= $Array[$four]
 $pw &= $Array[$five]
 $count = $count+1
 $pp  = Run(@COMSPEC & " /c " & $truecryptPath & " /p "& $pw & " /e /m ro /m rm /v " &$containerPath )
 ProcessSetPriority($pp, 0)
if $count>25 then
 While ProcessExists($pp)>0
 Wend
 $count = 0
 EndIf
Next
 Next
 Next
 Next
 Next
While ProcessExists($pp)>0
 Wend
$count = 0
 FOR $six = 0 to $numberOfCharacters
 for $five = 0 to $numberOfCharacters
 for $four = 0 to $numberOfCharacters
 for $three = 0 to $numberOfCharacters
 for $two = 0 to $numberOfCharacters
 for $one = 0 to $numberOfCharacters
 $pw = $Array[$one]
 $pw &= $Array[$two]
 $pw &= $Array[$three]
 $pw &= $Array[$four]
 $pw &= $Array[$five]
 $pw &= $Array[$six]
 $count = $count+1
 $pp  = Run(@COMSPEC & " /c " & $truecryptPath & " /p "& $pw & " /e /m ro /m rm /v " &$containerPath )
 ProcessSetPriority($pp, 0)
if $count>25 then
 While ProcessExists($pp)>0
 Wend
 $count = 0
 EndIf
Next
 Next
 Next
 Next
 Next
 Next
While ProcessExists($pp)>0
 Wend
$count = 0
 for $seven = 0 to $numberOfCharacters
 FOR $six = 0 to $numberOfCharacters
 for $five = 0 to $numberOfCharacters
 for $four = 0 to $numberOfCharacters
 for $three = 0 to $numberOfCharacters
 for $two = 0 to $numberOfCharacters
 for $one = 0 to $numberOfCharacters
 $pw = $Array[$one]
 $pw &= $Array[$two]
 $pw &= $Array[$three]
 $pw &= $Array[$four]
 $pw &= $Array[$five]
 $pw &= $Array[$six]
 $pw &= $Array[$seven]
 $count = $count+1
 $pp  = Run(@COMSPEC & " /c " & $truecryptPath & " /p "& $pw & " /e /m ro /m rm /v " &$containerPath )
 ProcessSetPriority($pp, 0)
if $count>25 then
 While ProcessExists($pp)>0
 Wend
 $count = 0
 EndIf
Next
 Next
 Next
 Next
 Next
 Next
 Next
While ProcessExists($pp)>0
 Wend
for $eight = 0 to $numberOfCharacters
 for $seven = 0 to $numberOfCharacters
 FOR $six = 0 to $numberOfCharacters
 for $five = 0 to $numberOfCharacters
 for $four = 0 to $numberOfCharacters
 for $three = 0 to $numberOfCharacters
 for $two = 0 to $numberOfCharacters
 for $one = 0 to $numberOfCharacters
 $pw = $Array[$one]
 $pw &= $Array[$two]
 $pw &= $Array[$three]
 $pw &= $Array[$four]
 $pw &= $Array[$five]
 $pw &= $Array[$six]
 $pw &= $Array[$seven]
 $pw &= $Array[$eight]
 $count = $count+1
 $pp  = Run(@COMSPEC & " /c " & $truecryptPath & " /p "& $pw & " /e /m ro /m rm /v " &$containerPath )
 ProcessSetPriority($pp, 0)
if $count>25 then
 While ProcessExists($pp)>0
 Wend
 $count = 0
 EndIf
Next
 Next
 Next
 Next
 Next
 Next
 Next
 Next

How to make more space in ROM of Samsung Galaxy S 4GS

How to Delete Fota files

Step 1: Download the files to your computer and upload them to your your phone.

Step 2: Install any ROOT File Expert

Step 3:  Make sure that the File Explorer can mount and write on the ROM system files.

Step 4: Extract fota.zip file and select Unzipped fota files (fota_delta_dp1 and fota_delta_dp2) to /data/fota or paste the 2 files in this folder

Step 5: Reboot phone

WALLA!!

Now check your free space in the ROM.

Sumsung S 4G – Sim Free

Sim-Free for Samsung S – 4G

This method was developed by XDA forums

First : 

I am taking no responsibility on any damage that happen to you phone!  This method works on my Vibrant 4G.

Requirments :

  • hex editor
  • Rooted phone

Before you must be root on your phone! If you are not root on your phone go be a root!

Step 1: Check if you are root already in your phone
Step 2: Go to dial program and enter *#7465625# , if one of the parameters is “on” continue with the instructions to have sim-free.
Step 3: Retrieve nv_data.bin file from the phone

  • use the “adb shell” from the SuperOneClickand write the folowing
    su
    cat /efs/root/afs/settings/nv_data.bin >> /sdcard/nv_data.bin

Step 4: Mount the internal SD Card on your computer.

Step 5: Make a backup copy of the nv_data.bin file on your computer

Step 6: using your favorite HEX editor open the nv_data.bin on the sdcard jump to address 0x1469 , you should see a string: ff ff 01 00 00 00 00 there are 5 different types of locks

ff ff 01 00 00 00 00
should be left alone network lock network subset lock sp lock cp lock data lock.

Change any 0x01 to 0x00 (or 0x00 to 0x01 to lock for warranty)
save and close file

Step 7: unmount SD Card

Step 8: fetch back the file to the phone using “adb shell”:

su
rm /efs/root/afs/settings/nv_data.bin
cat /sdcard/nv_data.bin >> /efs/root/afs/settings/nv_data.bin
chmod 755 /efs/root/afs/settings/nv_data.bin
chown radio.radio /efs/root/afs/settings/nv_data.bin || chown 1001.1001 /efs/root/afs/settings/nv_data.bin
reboot

Congratulation!! Now your phone is Sim – Free