Example #1
0
        static void Main(string[] args)
        {
            string path = string.Empty;

            for (; ;)
            {
                Console.WriteLine("KrBAT is a bruteforce PASSWORD crack program for 7zip. Use at your own risk.\n(c)2015 Dreamware(R) Inc. \nWritten by Shijie. All rights reserved.");


                Console.WriteLine("\n\n===================================================================================");
                Console.WriteLine("Input 7z file path(choose any single file for volume archives end up with .7z.00*):");
                Console.Write("path:");
                path = Console.ReadLine();

                if (path == "" || path.Trim() == "")
                {
                    continue;
                }

                if (!path.Contains(".7z"))
                {
                    continue;
                }

                if (path.Contains(".7z."))
                {
                    FileInfo tempInfo = new FileInfo(path);

                    var newPath = path.Replace(tempInfo.Extension, "");

                    if (!File.Exists(newPath))
                    {
                        string cmdStr = string.Format("cd {0}\ncopy /y /b \"{1}.00*\" \"{2}\"",
                                                      tempInfo.DirectoryName,
                                                      newPath,
                                                      newPath);

                        RunCmd(cmdStr);
                    }

                    path = newPath;
                }

                break;
            }

            KrBat inst = new KrBat(path);

            for (; ;)
            {
                Console.Write("[ext(0) std(1) dict(2)]:");
                string read = Console.ReadLine();

                if (read == "1")
                {
                    inst.GoStd();
                    break;
                }
                else if (read == "0")
                {
                    inst.GoExt();
                    break;
                }
                else if (read == "2")
                {
                    Console.Write("Input password dictionary file path\n");
                    Console.Write("path:");

                    string dicfile = Console.ReadLine();

                    inst.GoDict(dicfile);

                    break;
                }
            }

            for (; !inst.Matched();)
            {
                if (!inst.CanExit())
                {
                    Thread.Sleep(1000);
                }
                else
                {
                    break;
                }
            }

            Console.WriteLine(inst.Matched()?"A match was found":"No match was found");

            Console.WriteLine("Press any key to exit...");

            Console.ReadKey();

            return;
        }
Example #2
0
        static void Main(string[] args)
        {
            string path = string.Empty;

            for (; ;)
            {
                Console.WriteLine("KrBAT is a bruteforce PASSWORD crack program for 7zip. Use at your own risk.\n(c)2015 Dreamware(R) Inc. \nWritten by Shijie. All rights reserved.");

                Console.WriteLine("\n\n===================================================================================");
                Console.WriteLine("Input 7z file path(choose any single file for volume archives end up with .7z.00*):");
                Console.Write("path:");
                path = Console.ReadLine();

                if (path == "" || path.Trim() == "")
                    continue;

                if (!path.Contains(".7z"))
                    continue;

                if (path.Contains(".7z."))
                {
                    FileInfo tempInfo = new FileInfo(path);

                    var newPath = path.Replace(tempInfo.Extension, "");

                    if (!File.Exists(newPath))
                    {
                        string cmdStr = string.Format("cd {0}\ncopy /y /b \"{1}.00*\" \"{2}\"",
                            tempInfo.DirectoryName,
                            newPath,
                            newPath);

                        RunCmd(cmdStr);
                    }

                    path = newPath;
                }

                break;
            }

            KrBat inst = new KrBat(path);

            for (; ; )
            {
                Console.Write("[ext(0) std(1) dict(2)]:");
                string read = Console.ReadLine();

                if (read == "1")
                {
                    inst.GoStd();
                    break;
                }
                else if (read == "0")
                {
                    inst.GoExt();
                    break;
                }
                else if(read == "2")
                {
                    Console.Write("Input password dictionary file path\n");
                    Console.Write("path:");

                    string dicfile = Console.ReadLine();

                    inst.GoDict(dicfile);

                    break;
                }
            }

            for (; !inst.Matched(); )
            {
                if(!inst.CanExit())
                {
                    Thread.Sleep(1000);
                }
                else
                {
                    break;
                }
            }

            Console.WriteLine(inst.Matched()?"A match was found":"No match was found");

            Console.WriteLine("Press any key to exit...");

            Console.ReadKey();

            return;
        }