Tag: zip

Brute-force, Cracking, John the Ripper

Crack zip passwords – Bruteforcing

1> Open your kali Distribution 2> Extract password hash from your zip file: /usr/share/metasploit-framework/data/john/run.linux.x64.mmx/zip2john Desktop/myfile.zip > Desktop/myzipfile.hash/usr/share/metasploit-framework/data/john/run.linux.x64.mmx/zip2john Desktop/myfile.zip > Desktop/myzipfile.hash 3> Try to crack password by bruteforcing it using john and its default passwords lists. john Desktop/myzipfile.hashjohn Desktop/myzipfile.hash John Homepage: http://www.openwall.com/john/ Usage: john [OPTIONS] [PASSWORD-FILES]john [OPTIONS] [PASSWORD-FILES] Options: –config=FILE use FILE instead of john.conf or …

C#

Append files to zip file with C#

Open an existing zip file and append files with C# and DotNetZip library. public void AppendFile(String Filename, Zipfilename){ if (File.Exists(Zipfilename)) { ZipFile _zipfile = ZipFile.Read(Zipfilename); try { _zipfile.AddFile(Filename); } catch { } _zipfile.Save(); _zipfile = null; } }public void AppendFile(String Filename, Zipfilename){ if (File.Exists(Zipfilename)) { ZipFile _zipfile = ZipFile.Read(Zipfilename); try { _zipfile.AddFile(Filename); } catch { …

C#, Microsoft Windows

How to create zip file using C#

To create zip files we are going to use the DotNetZip library. Create zip file 1 2 3 4 5 6 7 8 9 10 11 12 13 14 /// <summary> /// add files into zip and save /// </summary> /// <param name="zipfile"></param> /// <param name="files"></param> public void createArchive(String zipfile, List<String> files) { ZipFile zip …

PHP, WEB

Create a zip file using PHP and ZipArchive class

You can create zip archives in PHP using ZipArchive class. public function createZipArchive($files, $archive, $overwrite) { $zip = new ZipArchive (); if ($overwrite) $flags = ZipArchive::CREATE | ZipArchive::OVERWRITE; else $flags = ZipArchive::CREATE; if (($zip->open ( $archive, $flags )) !== true) { return false; } else { foreach ( $files as $file ) { if (file_exists …