Rar2john Command Not Found

0 views
Skip to first unread message

Idara Viengxay

unread,
Aug 4, 2024, 7:43:28 PM8/4/24
to tighcharlila
WhenI try to crack zip file it always shows -bash: zip2john: command not found.I installed through homebrew, run john shows no error, I'm not sure is the command not installed or what?When I run ls /bin/ I do not see zip2john command.I tried solutions listed Command zip2john is not working but still not working. New to these staff. HELP T_T (Device: Mac Big Sur)

We learned most of the basic information on John the Ripper in our Previous Article which can be found here. In this article, we will use John the Ripper to crack the password hashes of some of the file formats like zip, rar, pdf and much more.


To crack these password hashes, we are going to use some of the inbuilt and some other utilities which extract the password hash from the locked file. There are some utilities that come inbuilt with John which can be found using the following command.


John the Ripper can crack the PDF file passwords. You can encrypt your pdf online by using this website. This will compress and encrypt our pdf into a password protected file.pdf. So, when you will try to open the file, you will be greeted by the following prompt.


For security reasons, our users often ask whether it is possible to start password recovery without uploading the file to the LostMyPass website? We are happy to answer that you have such an opportunity, however, you will need to get the hash of this file yourself on your PC. Obtaining the file hash value may be difficult to understand for an unprepared person and requires some technical skills from the user. If you find it difficult, then look up for a technically competent person who could help you, simplify and speed up the process.


To extract a hash, you need to have an idea of how to use the command line and install third-party utilities. In most cases, our customers use the MS Windows operating system and therefore may experience some difficulties with these issues. Linux users, as a rule, are more technically savvy and know how to use the command line or terminal, they actively use package managers.


All further instructions are written for Windows users. However, Linux users should not experience problems performing similar actions on their computers. In case of questions, please contact our technical support.


First of all, create a folder to work in. To simplify experience with Command Prompt, the easiest way is to create a folder in the root of your system drive. For example, on drive C: create the Hash folder. Then, copy the protected file to the that folder.


Now you need to figure out how to work with the command prompt. To call the command prompt window on the screen, press the key combination Win + R; a window will appear on your screen, type cmd there and click OK.


Check whether the command is executed correctly and you are in the working folder. To do this, type the dir command. As a result, a list of files that are in this folder should appear on the screen. In your case, you should see the name of your document; if so, then everything is done correctly.


The procedure for obtaining the hash value depends on the type of file and may vary slightly in each individual case. Don't close the command prompt window above, we still need it. But now we have to find and download the appropriate utility to extract the hash from the file.


Copy the office2john.py file to the C:\Hash folder. We will need this script to extract the hash from the document. We also need a Python interpreter to run the script; you can download and install the Python Installer from the official website. When Python is installed on your computer, open the command prompt window and run the following command (replacing your_file.xlsx with your file name):


Copy the pdf2john.pl file to the C:\Hash folder. To run the script, you must have the Perl interpreter installed on the computer. Download and install it from the official website. Then, open the command prompt window and run the following command (replacing your_file.pdf with your file name):


We warn you right away that all the JTR programs are designed for Unix-like systems, but have been ported to Windows. We observed some problems in the operation of the zip2john and rar2john scripts on Windows; sometimes users are not able to get the hash from their files, some files are not processed by scripts. It will be much better to use zip2john and rar2john on Linux. If you do not know how to do this, we recommend that you find a trusted Linux user among your friends and ask him for help.


Note that several hashes can be written in the hash.txt file (one for each line), which means that your archive has multiple passwords. This happens when different files in the archive are encrypted with different passwords. We can start the password recovery for each hash separately, but keep in mind that in this case you will be billed for each password recovered.


In the case when the customer uploads his file to our website on his own, we can open the source file and send the user a screenshot of the opened document as a proof of the successful recovered password.


If we start the process manually with the obtained hash, then obviously we are not able to provide you with such proof. You will have to pay the bill to get the password and verify it by yourself. Or you can just send us the original file, we will open it and send a screenshot to you.


By using the service provided at LostMyPass.com you agree that you are not violating any laws or regulations on copyright or privacy issues that exist in your country and community by doing so. Furthermore, you guarantee that you are the holder of the copyright for the document you intend to recover or that you are using the recovery service for and on behalf of the copyright holder.


In this post we will be exploring the art of password hunting on a target Linux machine as a means to escalate privileges either horizontally or vertically. We will review various techniques to hunt for passwords, as well as some common locations they are stored. During our hunt, we will uncover credentials in scripts, config files, filenames, hashes and much more!


Along with passwords laying around on the system, there are quite a few places where we might find password hashes or files that are password protected and need to be cracked. For this reason, will be doing a lot of cracking in the post using both Hashcat and John the Ripper.


When you find ANY passwords on the system, whether it is during the initial exploitation phase or the post-exploitation phase, you MUST test that password everywhere you can! Also, test any password you find against ALL usernames you find as password re-use is a massive issue and is very common!


Both ways of searching for files with a specific string in their name will produce a lot of results, but if we take our time to review the output, we may find some JUICY files that have passwords inside.


Most often, we will be looking for config PHP files; however, there are many possible file types where we could find credentials including TXT files, bash scripts, other scripts, ZIP files, other compression filetypes (tar, gz, etc.), DB files, and many more.


There is no designated extension for password files generated with htpasswd. For this reason, we can find that the file generated with WebDav credentials can have ANY extension or even no extension at all. I have seen: *.password / *.dav / *.pwd to name a few.


Navigating to the hidden directory and using the ls -la command again, we can see there is a hidden file named .password; and inside, we find another password to add to our password file.


We should always be looking for non-standard directories in the root of the filesystem; however, there are two known hidden files / folders that exist in every users home directory and they are the .bash_history file and the .ssh folder. Well, the history file will be in every home directory, but the SSH folder will only exist if the user has an SSH key.


When we get a foothold on our target, one of the things we want to enumerate ae the number of users that have a home profiles on the system, and out of all the profiles we find, how many of their bash history files we can view.


The id_rsa file is a private key that can be used to login to SSH without knowing the users password, but only if no password was set when the key was created. This file is essentially the equivalent of a password, with regards to getting you into the system.


For most types of password protected files, John the Ripper has different tools that can be used to convert specific filetypes into a crackable format. These tools are all named xxx2john and the whole list can be found on our attacker machine using the following command:


When we run sudo -l, we are prompted for a password. Since password reuse is so common, we can test the password that the user set on their SSH secret key. If we get lucky, they reused their actual login password when they made their key.


You may have noticed that I did not get prompted for a password the second time I ran sudo. This is because by default, sudo will only prompt you for your password after five minutes of sudo inactivity. Each time you run sudo it resets the 5 minute timer and allows sudo to be used without entering the password again.


The first four databases are the default / built-in databases. Of those four, the one we are interested in is the mysql database. This is the database that contains the login credentials that gets us into MySQL itself.


Apart from the default databases, we should ALWAYS be interested in custom ones. Especially when the custom DB is related to a web application. If we find some password hashes in here, we may be able to crack them and use them to increase our access.

3a8082e126
Reply all
Reply to author
Forward
0 new messages