CNIT 124: Advanced Ethical Hacking Ch 13: Post Exploitation Part 2.

Slides:



Advertisements
Similar presentations
Hacking Techniques & Intrusion Detection Ali Al-Shemery arabnix [at] gmail.
Advertisements

©2009 Justin C. Klein Keane PHP Code Auditing Session 3 – Tools of the Trade & Crafting Malicious Input Justin C. Klein Keane
Ipchains and Iptables Linux operating system natively supports packet-filtering rules: Kernel versions 2.2 and earlier support the ipchains command. Kernel.
Module 6: Configuring Windows XP Professional to Operate in a Microsoft Network.
A Complete Tool For System Penetration Testing Presented By:- Mahesh Kumar Sharma B.Tech IV Year Computer Science Roll No. :- CS09047.
Web Defacement Anh Nguyen May 6 th, Organization Introduction How Hackers Deface Web Pages Solutions to Web Defacement Conclusions 2.
ITP 457 Network Security Network Hacking 101. Hacking Methodology (review) 1. Gather target information 2. Identify services and ports open on the target.
Hacking Presented By :KUMAR ANAND SINGH ,ETC/2008.
Linux+ Guide to Linux Certification, Second Edition Chapter 3 Linux Installation and Usage.
14.1 © 2004 Pearson Education, Inc. Exam Planning, Implementing, and Maintaining a Microsoft Windows Server 2003 Active Directory Infrastructure.
(NHA) The Laboratory of Computer Communication and Networking Network Host Analyzer.
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
MCTS Guide to Microsoft Windows Server 2008 Network Infrastructure Configuration Chapter 8 Introduction to Printers in a Windows Server 2008 Network.
Microsoft Server 2008 R2 Group Policies & Network Policy and Access Services.
COEN 252: Computer Forensics Router Investigation.
Guide to MCSE , Enhanced 1 Activity 10-1: Restarting Windows Server 2003 Objective: to restart Windows Server 2003 Start  Shut Down  Restart Configure.
Dennis  Application Security Specialist  WhiteHat Security  Full-Time Student  University of Houston – Main Campus ▪ Computer.
Course 6421A Module 7: Installing, Configuring, and Troubleshooting the Network Policy Server Role Service Presentation: 60 minutes Lab: 60 minutes Module.
Microsoft Windows 2003 Server. Client/Server Environment Many client computers connect to a server.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.1 ISP Responsibility Working at a Small-to-Medium Business or ISP – Chapter 8.
Securing Windows 7 Lesson 10. Objectives Understand authentication and authorization Configure password policies Secure Windows 7 using the Action Center.
NetFilter – IPtables Firewall –Series of rules to govern what Kind of access to allow on your system –Packet filtering –Drop or Accept packets NAT –Network.
Internal NetworkExternal Network. Hub Internal NetworkExternal Network WS.
Chapter 14: Remote Server Administration BAI617. Chapter Topics Configure Windows Server 2008 R2 servers for remote administration Remotely connect to.
Remote Desktop Services Remote Desktop Connection Remote Desktop Protocol Remote Assistance Remote Server Administration T0ols.
Module 4: Add Client Computers and Devices to the Network.
FEATURES & FUNCTIONALITY. Page 2 Agenda Main topics Packet Filter Firewall Application Control Other features.
CIS 460 – Network Design Seminar Network Security Scanner Tool GFI LANguard.
Honeypot and Intrusion Detection System
Section 1: Introducing Group Policy What Is Group Policy? Group Policy Scenarios New Group Policy Features Introduced with Windows Server 2008 and Windows.
Module 12: Routing Fundamentals. Routing Overview Configuring Routing and Remote Access as a Router Quality of Service.
INSTALLATION HANDS-ON. Page 2 About the Hands-On This hands-on section is structured in a way, that it allows you to work independently, but still giving.
Chapter 13 Users, Groups Profiles and Policies. Learning Objectives Understand Windows XP Professional user accounts Understand the different types of.
Penetration Testing Training Day Penetration Testing Tools and Techniques – pt 1 Mike Westmacott, IRM plc Supported by.
Client – Server Application Can you create a client server application: The server will be running as a service: does not have a GUI The server will run.
MCTS Guide to Microsoft Windows Server 2008 Applications Infrastructure Configuration (Exam # ) Chapter Four Windows Server 2008 Remote Desktop Services,
Hacker’s Strategies Revealed WEST CHESTER UNIVERSITY Computer Science Department Yuchen Zhou March 22, 2002.
Application Services COM211 Communications and Networks CDA College Theodoros Christophides
1 Figure 4-1: Targeted System Penetration (Break-In Attacks) Host Scanning  Ping often is blocked by firewalls  Send TCP SYN/ACK to generate RST segments.
CIS 450 – Network Security Chapter 4 - Spoofing. Definition - To fool. In networking, the term is used to describe a variety of ways in which hardware.
Penetration Testing 101 (Boot-camp)
Topics Network topology Virtual LAN Port scanners and utilities Packet sniffers Weak protocols Practical exercise.
Hacking Windows 9X/ME. Hacking framework Initial access physical access brute force trojans Privilege escalation Administrator, root privileges Consolidation.
TCOM Information Assurance Management System Hacking.
Unit - III. Providing a Caching Proxy Server (1) A caching proxy server is software that stores (caches) frequently requested internet objects such as.
Monitoring Troubleshooting TCP/IP Chapter 3. Objectives for this Chapter Troubleshoot TCP/IP addressing Diagnose and resolve issues related to incorrect.
Page 1 Printing & Terminal Services Lecture 8 Hassan Shuja 11/16/2004.
Retina Network Security Scanner
CNIT 124: Advanced Ethical Hacking Ch 10: Client-Side Exploitation.
CNIT 124: Advanced Ethical Hacking Docker (not in textbook) & Ch 8: Exploitation.
Announcements RSA Security Conference (extra credit) RSA Security Conference (extra credit) –April 7 through April 11, San Francisco –Visit the Forum for.
Unit 2 Personal Cyber Security and Social Engineering Part 2.
COMP1321 Digital Infrastructure Richard Henson March 2016.
Chapter 7: Using Network Clients The Complete Guide To Linux System Administration.
PostExploitation CIS 5930/4930 Offensive Computer Security Spring 2014.
Linux Firewall Iptables.
Common System Exploits Tom Chothia Computer Security, Lecture 17.
Microsoft OS Vulnerabilities April 1, 2010 MIS 4600 – MBA © Abdou Illia.
Hacking Windows.
Enumeration.
Working at a Small-to-Medium Business or ISP – Chapter 8
Module 36 (Expanding Your Control of Windows Victims)
Chapter 3: Windows7 Part 4.
Real Microsoft Exam Questions and Answers
SSH SSH is “Secure SHell” Secure, compressed, widely supported, fast
BACHELOR’S THESIS DEFENSE
BACHELOR’S THESIS DEFENSE
BACHELOR’S THESIS DEFENSE
From ACCEPT to MASQUERADE Tim(othy) Clark (eclipse)
Presentation transcript:

CNIT 124: Advanced Ethical Hacking Ch 13: Post Exploitation Part 2

Topics Local Information Gathering Lateral Movement Pivoting Persistence

Creating Infectious Media

Local Information Gathering

Sensitive Information Useful data to include in final report to customer – Installed software that stores passwords in plaintext Or weakly hashed – Proprietary data or source code – Credit card information – CEO's account Information to pivot to other systems

Searching for Files

Keylogging Meterpreter has keyscan_start and keyscan_dump – Only capture keystrokes from the process meterpreter is running in – From explorer.exe it gets one user's keystrokes – From winlogon it would get login passwords Smartlocker will fool the user by waiting a while before locking the user out – to prompt a login (Link Ch 13g)

Migrating to Winlogin Link Ch 13e

Gathering Credentials

WinSCP Can Store Passwords

WinSCP

Stealing WinSCP Passwords

credential_collector

Group Policy Preference Saved Passwords

McAfee Virus Scan Enterprise Password Hashes

Outlook

Skype

net Windows command line net users – Shows all local users net localgroup Administrators – Shows local administrators Also works for domain accounts Can also add a user

Processes ps shows processes May reveal other vulnerable processes Such as UDP listeners – Which can't easily be detected with nmap

Bash History.bash_history in a user's home directory May contain passwords or other useful information

Lateral Movement

Moving from One Host to Another In a domain – Compromise a domain account; it will work on many computers – Get domain administrator account for full control of the whole domain Non-domain computers – May have the same local administrator password because they are all from the same image – A user may have accounts on several computers with the same password

PSExec Uploads a service executable to the ADMIN$ share Connects to Windows Service Control Manager using RPC Starts the service Starts a SMB named pipe to send commands to remotely control the system

exploit/windows/smb/psexec Metasploit module does something similar Requires a running SMB server And credentials that give access to the ADMIN$ share

Passwords v. Hashes Notice that the SMB attack used the plaintext password What if you only have a hash you can't crack?

Getting the Hashes First you need the hash Try all of these Meterpreter commands – hashdump – run post/windows/gather/hashdump – run post/windows/gather/smart_hashdump

Pass the Hash Attack Use hash instead of password Works on most Windows systems

Pass the Hash: Fixed? Microsoft changed the advisory title quickly

Pass the Hash Still Works But it's more complicated, especially on the newest Windows systems – Links Ch 13h, 13i

SSHExec Metasploit module allows one set of credentials to be used against other Linux systems Requires plaintext password

Windows Tokens Created when a user logs on By LSASS Link Ch 13k

Token in Process Hacker

Token in Process Explorer

Token Identifies User Like a cookie on a Web page Two types of tokens – Delegation token "Interactive" sessions Users logged on locally or via Remote Desktop – Impersonation token Non-interactive sessions Attaching to a network drive Domain logon script

Token Lifetime Tokens persist until a reboot User logoff doesn't invalidate them – "their delegate token is reported as a impersonate token, but will still hold all of the rights of a delegate token" – Link Ch 13o

Using Incognito

Impersonation

Available Tokens This box is boring, not many tokens available On a file server, there will be a token for each connected user

SMB Capture Domain password hashes are only stored on the domain controller hashdump on a workstation won't find them You can steal the network hash by running a malicious SMB server with Metasploit

Metasploit's SMB Capture

Stolen Hashes

NTLMv2 Windows Vista and later use NTLMv2 over the network It adds HMAC and challenges to the system This makes it much slower to brute-force – Links Ch 13p, 13q

Pivoting

Pivoting Through an Exploited System Needed in a properly segmented network Won't allow traffic from the Internet directly to high- value systems

Metasploit Routing route command sends all metasploit traffic through the exploited system But this only affects traffic generated by metasploit

Metasploit Port Scanners Very basic, fewer features than nmap

Running an Exploit Through a Pivot Bind shell will work for traffic generated by Metasploit It will be forwarded through the exploited system

Socks Proxy An old way to make an Internet gateway, before Network Address Translation Requires each client to run Socks client software Client IP addresses are hidden – All Internet connections are initiated directly from the server – Link Ch 13r

Tor Tor uses Socks proxies Allow all network traffic to be passed through the proxies Any protocol, any port

Socks4a in Metasploit Sets up a Socks4a server in Metasploit This uses proxychains

Proxychains By default, configured to use Tor Must change /etc/proxychains.conf to point to the Metasploit Socks4a listener

Nmap Through Proxychains Run any tool through the pivot Preface each command with proxychains

Persistence

Losing Access A Metasploit session resides on RAM – Within the exploited process When the user logs out, or closes the browser, the session may be lost – Even network interrupts may break the session It's hard to re-exploit the target – Especially if the attack uses social engineering

Persistence A way to control the machine after the Metasploit session ends Should survive log-off and even reboot

Adding a User Then connect directly via SSH, RDP, etc. In a Windows Command Prompt – net user james password /add – net localgroup Administrators james /add Can also be used to create a domain account – If you have domain administrator credentials On Linux, use adduser and add the user to the sudoers group

Metasploit Persistence Automatically connects back to the attacker at every login, reboot, etc.

Disk Usage Persistence agent is written to disk – VBscript script is uploaded to %TEMP% – Registry entry is made to automatically run it

Linux cron Job Add this line to /etc/crontab – It will connect back every 10 minutes Then restart the cron service – service cron restart

A Better cron Script Tests to see if knockd is running Only runs it again if necessary #!/bin/bashp ipgrep knockd if [ $? -eq 1 ]; then nohup /usr/sbin/knockd -c /etc/knockd.conf & fi

A Simple Packet Forwarding Server Makes it possible to log traffic to a server without altering it at all Redirect the DNS record to this cloud server echo 1 >/proc/sys/net/ipv4/ip_forward iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination iptables -t nat -A PREROUTING -p tcp --dport 20:21 -j DNAT --to-destination iptables -t nat -A PREROUTING -p tcp --dport 1025: j DNAT --to-destination iptables -t nat -A POSTROUTING -p tcp -d dport 80 -j MASQUERADE iptables -t nat -A POSTROUTING -p tcp -d dport 20:21 -j MASQUERADE iptables -t nat -A POSTROUTING -p tcp -d dport 1025: j MASQUERADE