Network Security CPSC6128 – Lecture 4 Post Exploitation 1.

Slides:



Advertisements
Similar presentations
Enabling Secure Internet Access with ISA Server
Advertisements

Backdoors, Trojans and Rootkits CIS 413 This presentation is an amalgam of presentations by Mark Michael, Randy Marchany and Ed Skoudis. I have edited.
Network and Application Attacks Contributed by- Chandra Prakash Suryawanshi CISSP, CEH, SANS-GSEC, CISA, ISO 27001LI, BS 25999LA, ERM (ISB) June 2006.
1 Topic 2 – Lesson 4 Packet Filtering Part I. 2 Basic Questions What is packet filtering? What is packet filtering? What elements are inside an IP header?
1 Reading Log Files. 2 Segment Format
FIREWALLS. What is a Firewall? A firewall is hardware or software (or a combination of hardware and software) that monitors the transmission of packets.
1 Topic 1 – Lesson 3 Network Attacks Summary. 2 Questions ► Compare passive attacks and active attacks ► How do packet sniffers work? How to mitigate?
Telnet and FTP. Telnet Lets you use the resources of some other computer on the Internet to access files, run programs, etc. Creates interactive connection.
Unit 18 Data Security 1.
Aktueller Status How Hackers Cover Their Tracks ECE 4112 May 1st, 2007 Group 1 Chris Garyet Christopher Smith Introduction Lab Content Conclusions Questions.
Security (Continued) V.T. Raja, Ph.D., Oregon State University.
Hacking Presented By :KUMAR ANAND SINGH ,ETC/2008.
Web Server Administration TEC 236 Securing the Web Environment.
System and Network Security Practices COEN 351 E-Commerce Security.
Intruder Trends Tom Longstaff CERT Coordination Center Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Sponsored by.
Security Awareness: Applying Practical Security in Your World, Second Edition Chapter 5 Network Security.
Security Awareness: Applying Practical Security in Your World, Second Edition Chapter 3 Internet Security.
Network Security. Network security starts from authenticating any user. Once authenticated, firewall enforces access policies such as what services are.
Analysis of Attack By Matt Kennedy. Different Type of Attacks o Access Attacks o Modification and Repudiation Attacks o DoS Attacks o DDoS Attacks o Attacks.
Covering Tracks and Hiding 1 Covering Tracks and Hiding.
Privacy - not readable Permanent - not alterable (can't edit, delete) Reliable - (changes detectable) But the data must be accessible to persons authorized.
Lesson 9-Securing a Network. Overview Identifying threats to the network security. Planning a secure network.
Chapter 2 Networking Overview. Figure 2.1 Generic protocol layers move data between systems.
COEN 252: Computer Forensics Router Investigation.
1 Lecture 20: Firewalls motivation ingredients –packet filters –application gateways –bastion hosts and DMZ example firewall design using firewalls – virtual.
Internet Relay Chat Security Issues By Kelvin Lau and Ming Li.
Internet Relay Chat Chandrea Dungy Derek Garrett #29.
FIREWALL TECHNOLOGIES Tahani al jehani. Firewall benefits  A firewall functions as a choke point – all traffic in and out must pass through this single.
Chapter 11 Phase 5: Covering Tracks and Hiding. Attrition Web Site  Contains an archive of Web vandalism attacks
Port Knocking Software Project Presentation Paper Study – Part 1 Group member: Liew Jiun Hau ( ) Lee Shirly ( ) Ong Ivy ( )
OSI Model Routing Connection-oriented/Connectionless Network Services.
Forensic and Investigative Accounting
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public ITE PC v4.0 Chapter 1 1 Basic Security Networking for Home and Small Businesses – Chapter 8.
January 2009Prof. Reuven Aviv: Firewalls1 Firewalls.
Web Server Administration Chapter 10 Securing the Web Environment.
FTP (File Transfer Protocol) & Telnet
Network security Further protocols and issues. Protocols: recap There are a few main protocols that govern the internet: – Internet Protocol: IP – Transmission.
CIS 450 – Network Security Chapter 16 – Covering the Tracks.
ITIS 1210 Introduction to Web-Based Information Systems Chapter 45 How Hackers can Cripple the Internet and Attack Your PC How Hackers can Cripple the.
--Harish Reddy Vemula Distributed Denial of Service.
Attacks On systems And Networks To understand how we can protect our system and network we need to know about what kind of attacks a hacker/cracker would.
1 CHAPTER 3 CLASSES OF ATTACK. 2 Denial of Service (DoS) Takes place when availability to resource is intentionally blocked or degraded Takes place when.
1 The Internet and Networked Multimedia. 2 Layering  Internet protocols are designed to work in layers, with each layer building on the facilities provided.
TCP/IP Protocols Contains Five Layers
Denial of Service (DoS) DoS attacks are aggressive attacks on an individual computer or groups of computers with the intent to deny services to intended.
Beginning Network Security Monitor and control flow into and out of the LAN Ingress Egress Only let in the good guys Only let out the corp. business.
Lecture 20 Hacking. Over the Internet Over LAN Locally Offline Theft Deception Modes of Hacker Attack.
Fundamentals of Proxying. Proxy Server Fundamentals  Proxy simply means acting on someone other’s behalf  A Proxy acts on behalf of the client or user.
Application Layer Khondaker Abdullah-Al-Mamun Lecturer, CSE Instructor, CNAP AUST.
CHAPTER 3 Classes of Attack. INTRODUCTION Network attacks come from both inside and outside firewall. Kinds of attacks: 1. Denial-of-service 2. Information.
Week 10-11c Attacks and Malware III. Remote Control Facility distinguishes a bot from a worm distinguishes a bot from a worm worm propagates itself and.
CIS 450 – Network Security Chapter 5 – Session Hijacking.
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.
Department of Information Engineering1 About your assignment 5 -layers Model Application Layer(HTTP, DNS,...) TCP Layer(add sequence number to packets)
CIT 380: Securing Computer SystemsSlide #1 CIT 380: Securing Computer Systems Backdoors and Rootkits.
FTP File Transfer Protocol Graeme Strachan. Agenda  An Overview  A Demonstration  An Activity.
Sniffer, tcpdump, Ethereal, ntop
Rootkits, Backdoors, and Trojans ECE 4112 – Lab 5 Summary – Spring 2006 Group 9 Greg Sheridan Terry Harvey Group 10 Matthew Bowman Laura Silaghi Michael.
Firewalls A brief introduction to firewalls. What does a Firewall do? Firewalls are essential tools in managing and controlling network traffic Firewalls.
CIT 380: Securing Computer SystemsSlide #1 CIT 380: Securing Computer Systems Covert Channels.
K. Salah1 Security Protocols in the Internet IPSec.
Mike Switlick. Overview What is a covert channel? Storage / Timing Requirements Bunratty attack Covert_tcp Questions.
Comparison of Network Attacks COSC 356 Kyler Rhoades.
Port Scanning James Tate II
Backdoor Attacks.
Domain 4 – Communication and Network Security
Overview of Networking & Operating System Security
Lecture 3: Secure Network Architecture
Test 3 review FTP & Cybersecurity
Presentation transcript:

Network Security CPSC6128 – Lecture 4 Post Exploitation 1

Network Attack Methodology Recon – Information gathering Scanning – Enumeration Vulnerability Identification Exploit Gaining access Elevating given access Application/Web level attacks Denial of Service (DOS) Post Exploitation Persistence - Maintaining Access Removing Forensic Evidence Exfiltration TODAY’S LECTURE 12

Persistence, Trojans, Backdoors

Persistence – Maintaining Access Real attackers attempt to be on the compromised system for a long time The longer the attacker has access, the more damage can be done Some exploits only work one time

Startup Service Linux Windows OS X xinetd, initd registry startup key, windows service OS X cron or plist file for Launchd

Trojans Non self replicating “back door” program which runs hidden on the infected computer Can be installed using one of the following methods Non-trusted software download Email Attachments Application level exploits Executable content on websites (Flash or ActiveX) Trojan can be used to maintain control of the system, access password, keylog, etc.

Viruses, Worms Virus Worm Blended Threat typically attaches itself to another program to enable replication much like a human virus. Worm similar to a virus but by design is self replicating can replicate through a network without the assistance of a human. Blended Threat combines aspect of Trojans viruses and worms CodeRed was a example of a blended threat which at the same time launched DDOS attacks left behind trojans, and was self replicating

Trojans – What is the Objective Typically motivated by financial gain they look for credit card, account data, confidential documents, financial data, etc. Make victims computer become a remote proxy allow for the attacker to mask their tracks for additional attacks Make the infected computer part of a BOTnet plant the ability to launch DDOS type attacks

TCP/UDP Port Typically Used by Trojans Protocol Port Back Oriface UDP 31337 or 31338 Deep Throat 2140 and 3150 NetBus TCP 12345 and 12346 Whack a mole 12361 and 12362 NetBus 2 Pro 20034 GirlFriend 21544 Masters Paradise 3129, 40421, 40422, 40423, 40426

Determining which ports are listening Windows – Start->Run->CMD netstat –an netstat –an |findstr <port number>

Proxy Server Trojans Starts a hidden http proxy on the victims computer Uses the victim’s computer as a transit point to attack yet another victim Hides the location of the attacker

NetBus Trojan Remote control Trojan program Allows anyone running the client (control program) to control any machine infected with NetBus Trojan

Netcat Written by “Hobbit” Released in March 1996 Currently hosted at: http://netcat.sourceforge.net/ Blindly reads and writes data to and from network connections Often called the “Swiss Army Knife” of network tools Runs on almost all platforms Linux, Windows, OS X, SunOS, Solaris, etc. Working Mode Client mode Listen mode

Netcat Client Mode Initiates a network connection StdInput is sent from the local system to a specified remote network port StdInput is sent to the remote network port using “pipes” Works much like standard “cat” command Returned data is sent to StdOutput Messages from Netcat itself are sent to StdError

Netcat Listen Mode It waits for a connection from the network “-l” option puts Netcat in listen mode Basically take it as a network server Data received from the network is sent to StdOutput Data received from StdInput is sent to the network Messages from Netcat itself are sent to StdError

Important Netcat Switches -l Places Netcat in listen mode -p Specifics the source or local port that Netcat should use -s Source ip address -h Prints help -e Program to execute after connecting -u Use UDP instead of TCP -L Persistent listener in Windows Keeps listening even after nc disconnects Make use of standard IO redirection Use “nc ( >, < or |)” home-macpro:~ kobrien$ nc -h [v1.10] connect to somewhere: nc [-options] hostname port[s] [ports] ... listen for inbound: nc -l -p port [-options] [hostname] [port]

Netcat Uses Data Transfer Backdoors Replay Attacks Vulnerability Scanning Port Scanning Relays *** Be sure to check out “Counter Hack Reloaded” by Ed Skoudis. Has a very thorough explanation of nc.

Example: Netcat Data Transfer Send a file between two machines Send a file from the nc listener to the nc client Listener: nc –l –p [port] < [filename] Client: nc [listener ip] [port] > [filename] Send a file from the nc client to the nc listener Listener: nc –l –p [port] > [filename] Client: nc [listener IP] [port] < [filename]

Example: Netcat Data Transfer from Listener to Client nc listener nc client

Example: Make Connection to Open Port Better to use in place of telnet nc is faster and it is easier to drop the connection Some raw binary data can be accidently interpreted by telnet nc can do UDP as well as TCP

Wrappers So how does one get a Trojan on a machine? Typical method “wrapping” the Trojan with another executable file which the user runs The two programs are wrapped together into a single file However, the user only sees the exe which was used to wrap the Trojan The Trojan runs in the background

Wrappers - Examples

Network Steganography for Data Exfiltration

Steganography Concept In Art and science a secret message can be hidden no one other than the sender and receiver is aware of the message Physical steganography Can be dated back to ancient Greece Stories told of tattoos on the heads of slaves Heads can then be shaved to reveal the message

Steganography Example During WWII “microdots” where used extensively to transmit messages. Microdots are small dots which covers a hidden message. KGB Microdot camera for single exposures smaller than 1mm diameter on a special colloid emulsion, size of the camera 7x12mm, the negatives were sent behind stamps and viewed through microscopes Courtesy: WestLicht Auctions

Covert Channel The “message” is hidden within the traffic of a legitimate communications channel. Normal Traffic Covert Channel Sender Hiding Process Detection Process Receiver

Network Steganography The “message” is hidden within the traffic of a legitimate communications channel secret info secret info sender receiver Stego Algorithm Channel Detection Algorithm network packet network packet secret key

Common Example – Tunnel inside TCP 80 Tunneling Encapsulating one protocol into another protocol Very common method for even legitimate applications Tunnel communications over TCP 80 Other methods include tunneling inside SSH and GRE tunneling Tunneling may causes problems for firewalls Firewalls rely on restricting traffic by IP and source/destination port Application layer firewalls dig deeper into the packets and can filter by the application itself

Acknowledgement Number TCP Header (review) Bit 0 Bit 4 Bit 8 Bit 12 Bit 16 Bit 20 Bit 24 Bit 28 Bit 32 Source Port Destination Port Sequence Number Acknowledgement Number Reserved U A P R S F Window Checksum Urgent Pointer Options and Padding 16 bits that can be used for a covert channel. (note: all bit combos not available as the flags have to present a valid state)

covert_tcp Some methods hide data in ‘optional’ fields of a protocol header The preferred method is to hide data in mandatory fields It is more effective Network equipment can easily be programmed to reset or erase ‘optional’ fields covert_tcp was created by Craig Rowland http://firstmonday.org/htbin/cgiwrap/bin/ojs/index.php/fm/article/view/528/449 Covert_tcp can hide data in The IP datagram’s ID Field The Sequence number of the TCP segment The ACK number of the TCP segment

covert_tcp -- TCP ACK method IP Identification method Insert a single ASCII character and receive it at the other end TCP Sequence Number method Send SYN with ASCII character as the initial sequence number Reply with a RST RST actually ACKs the receipt of the hidden character TCP ACK # Most covert and sophisticated Sender “bounces” the information off an unwitting intermediate party

covert_tcp (TCP ACK method) Client sends SYN packet to bounce server Source address is spoofed to recipients address ISN # is ASCII # -1 Bounce server responds to receiver Sends SYN ACK or RST Both increment ISN by 1 and ASCII character is received

covert_tcp (TCP ACK method) When using IP Iden mode (default) here is the ASCII to IDENT # encoding Letter Ascii x256 A 65 16640 B 66 16896 D 68 17408 E 69 17664 F 70 17920 G 71 18176 H 72 18432 I 73 18688 J 74 18944 K 75 19200 L 76 19456 M 77 19712 N 78 19968 O 79 20224 P 80 20480 Q 81 20736 R 82 20992 S 83 21248 T 84 21504 U 85 21760 V 86 22016 W 87 22272 X 88 22528 Y 89 22784 Z 90 23040

covert_tcp – Example (sender)

covert_tcp – Example (Receiver)

Loki Covert channel over ICMP Attacker install Loki on compromised server Requires root permissions Grabs incoming ICMP packets from the kernel Attacker installs Loki client on a remote machine Data is sent to client lokid using ICMP packets Under the radar of most detection mechanisms since ICMP is commonly allowed, and doesn’t have UDP/TCP ports

Loki Can use UDP 53 Can switch between UDP and ICMP on the fly to disguise as a DNS request Can switch between UDP and ICMP on the fly Encryption supported Blowfish and DH key exchange For details, see handout

Reverse WWW Shell Covert channel using HTTP Can be installed on compromised machine Every 60 seconds it “phones home” and contacts external server It “pulls” in commands and sends over normal HTTP Looks like normal web traffic Same idea used by legitimate software such as GoToMyPC

Logging

Altering Event Logs Even rootkits may leave traces in log files With admin privilege Attacker could delete log files But probably a bad idea…very obvious A better idea selectively edit the log files

Logs in Windows EventLog is logging server Files ending with .LOG SECURITY, SYSTEM, APPLICATION This info is moved to main event logs SECEVENT.EVT, SYSEVENT.EVT The .EVT files read by admin using Windows Event Viewer

Windows Event Viewer

Windows Logs SECEVENT.EVT SYSEVENT.EVT APPEVENT.EVT Failed logins policy changes attempts to access files without permission, etc. SYSEVENT.EVT E.g. details of driver failures APPEVENT.EVT Application related issues

Windows Logs Altering event logs At a minimum must change SECEVENTs EVT files Are“locked” and Are in a binary format Cannot open/edit with usual tools With physical access Boot to Linux and edit logs Not practical in most cases

Windows Logs Event editing tools Winzapper Attacker can selectively edit EVT files But must reboot machine to restart EventLog service

WinZapper

Unix Logging Log files usually in ASCII text With privilege they are easy to edit Config file tells where log files are located Attacker can locate files and edit Also accounting files utmp, wtmp, lastlog Binary files so they are harder to edit

Unix Logging Tools to edit accounting files Many can be found at http://packetstormsecurity.org wtemped Marry Cloak Logedit wzap Accounting file editing tool is standard part of most rootkits

Shell History Files List of command line, commands issues Attacker would like to edit this Files are in ASCII so they are easy to edit Can insert lines Why would this be useful? Edit to shell file written to shell history When shell is exited gracefully How to get around this?

Defenses Activate logging Periodically audit logging Log according to some specified policy Periodically audit logging Allow plenty of space for logs Restrictive permissions on log files Use separate server for logging Logs redirected to logging server Not everything can be redirected

Defenses Encrypt log files Make log files “append-only” Store files on unalterable media Non rewriteable CD/DVD

Hidden Files Why would an attacker use hidden files Store attack tools Save sniffed passwords, etc. What does “hidden” mean? Maybe just hard to find Or easily overlooked

Hidden Files In Unix prepend “.” to filename Use “,” followed by spaces(s) Other ideas?

Hidden Files in Windows Use “hidden” attribute Not great…

Hidden Files in Windows

Hidden Files in Windows Alternate Data Streams (ADS) Available in NTFS Multiple streams of data can be associated with a single file These streams can store any info “usual” view is just one such stream Fairly effective means of hiding files c:\anyfile.exe > c:\winnt\system32\calc.exe:anyfile.exe (? Need to try it ) Will fork anyfile.exe with the windows calc file Calculator will still work fine!

Defenses File integrity checking Host based IDS In Windows, use ADS aware tools CrucialADS, LADS

Example Attacks

Example – Operation Aurora - 2009 Targeted user received a link in email or instant message from trusted source User clicks on link, visits website with malicious Javascript Exploit downloads a binary disguised as an image from servers and executes the payload Payload sets up long term backdoor and connects back to command and control servers Attackers target intellectual property and source code control system. Reference: McAfee Report – Protecting YourCritcal Assets http://www.wired.com/images_blogs/threatlevel/2010/03/operationaurora_wp_0310_fnl.pdf

Example – RSA Breach - 2011 Phishing targeted two small groups of employees Excel spreadsheet contained Zero Day exploit in Adobe Flash After exploitation of victims machine Poison Ivy RAT tool installed Reverse TCP to attackers command and control server (C&C) Attackers then moved laterally in the organization

Posion Ivy

Questions??