systems securitystaff.um.edu.mt/mvel3/files/cps5123_intro.pdf · – detection physical world:...

17
1 Systems Security Hardening of computer systems through 3 classes of protection mechanisms against adversaries Prevention Physical world: Door/window locks, door security Computer security: Net/host firewalls, file permissions, reserved network ports, CPU ring security, vulnerability analysis/secure programming (SDLC) Detection Physical world: Burglar alarm Computer security: Intrusion detection systems, anti-malware Response (& Recovery) Physical world: Police investigation Computer security: Digital investigation/incident response, patching, attack surface reduction, attribution

Upload: others

Post on 25-Sep-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Systems Securitystaff.um.edu.mt/mvel3/files/cps5123_intro.pdf · – Detection Physical world: Burglar alarm Computer security: Intrusion detection systems, antimalware – Response

1

Systems Security● Hardening of computer systems through 3 classes of protection 

mechanisms against adversaries– Prevention

● Physical world: Door/window locks, door security● Computer security: Net/host firewalls, file permissions, reserved network ports, CPU ring 

security, vulnerability analysis/secure programming (SDLC)

– Detection● Physical world: Burglar alarm● Computer security: Intrusion detection systems, anti­malware

– Response (& Recovery)● Physical world: Police investigation● Computer security: Digital investigation/incident response, patching, attack surface 

reduction, attribution

Page 2: Systems Securitystaff.um.edu.mt/mvel3/files/cps5123_intro.pdf · – Detection Physical world: Burglar alarm Computer security: Intrusion detection systems, antimalware – Response

2

Access Control i

Subjects Security­critical objectsin terms of: Confidentiality

  Integrity  Availability

Access ControlPolicy

Audit trail

● Predominantly preventive – ideal

– Authentication/Authorization/Audit

– Essential foundations for computer security

Enforcement

Configures

ControlledAccess

Authentication &Access Request

Log

Page 3: Systems Securitystaff.um.edu.mt/mvel3/files/cps5123_intro.pdf · – Detection Physical world: Burglar alarm Computer security: Intrusion detection systems, antimalware – Response

3

Access Control ii● Security primitives

– Trusted computing bases (TCB) that enforce policies● Ring 0, Hypervisors, TEE, Sandboxes/Jails

– Cryptographic primitives● Stream/block ciphers● Public key crypto● Authentication/key exchange protocols● Authorization policies/Models for Access Control

– Machine learning● Classification/clustering of host/net logs

● No such thing as perfect security!

Page 4: Systems Securitystaff.um.edu.mt/mvel3/files/cps5123_intro.pdf · – Detection Physical world: Burglar alarm Computer security: Intrusion detection systems, antimalware – Response

4

Broken Access Control i● Threats that bypass(type 1)/tamper (type 2) with protection mechanisms

● Predominantly detection/recovery mitigations

Subjects

Security­critical objectsin terms of: Confidentiality

  Integrity  Availability

Access ControlPolicy

Audit trail

Enforcement

Type 2

Type 1

Configures

ControlledAccess

Authentication &Access Request

Log

Adversary

Page 5: Systems Securitystaff.um.edu.mt/mvel3/files/cps5123_intro.pdf · – Detection Physical world: Burglar alarm Computer security: Intrusion detection systems, antimalware – Response

5

● Operating system– e.g. File permissions (DAC), System privileges (MAC)– Type 1: Trojan – Type 1: Browser exploit + malware installation– Type 1: Exploiting misconfiguration to edit setuid’ed scripts having root as owner– Type 2: Brute­force supervisor password

● Enterprise application– e.g. restricted/privileged areas, account­centric forms– Type 1: Password theft– Type 2: Exploit insufficient mechanism 

● E.g. Discover a form button that takes to a sensitive application form without application referring request to access control mechanism

Broken Access Control ii

Page 6: Systems Securitystaff.um.edu.mt/mvel3/files/cps5123_intro.pdf · – Detection Physical world: Burglar alarm Computer security: Intrusion detection systems, antimalware – Response

6

● Web portals– to enterprise applications– Type 1 – SQL injection attack– Type 2 – Exploit non­random session identifiers

● Network Firewall– DMZs, Wifi isolation– Type 1 – IP address spoofing– Type 2 – Malicious de­fragmentation attack

Broken Access Control iii

Page 7: Systems Securitystaff.um.edu.mt/mvel3/files/cps5123_intro.pdf · – Detection Physical world: Burglar alarm Computer security: Intrusion detection systems, antimalware – Response

7

● Malicious logic: ultimate goals– System take over/pivoting– Complete access control sub­version– Various forms and flavors

● Trojans● Exploits/drive­by­downloads● Worms, Viruses● Scareware● Backdoors, Botnets● Spyware, Key­loggers● Ransomware● Launchers, Rootkits

Malware

Page 8: Systems Securitystaff.um.edu.mt/mvel3/files/cps5123_intro.pdf · – Detection Physical world: Burglar alarm Computer security: Intrusion detection systems, antimalware – Response

8

● Static/dynamic binary code analysis/patching– Predominant security primitive for malware mitigation– Disassembly/reverse code engineering– Applications: 

● Malware analysis, vulnerability analysis, in­memory patching, virtual machine introspection, memory forensics, exploit mitigation etc...

– Interactive malware analysis ideal place to start from– Identify malware goals and use output to configure security 

tools e.g. IDS, memory dump analysis tools

Binary code analysis

Page 9: Systems Securitystaff.um.edu.mt/mvel3/files/cps5123_intro.pdf · – Detection Physical world: Burglar alarm Computer security: Intrusion detection systems, antimalware – Response

9

Malware analysis i

● Dynamic disassembly

Page 10: Systems Securitystaff.um.edu.mt/mvel3/files/cps5123_intro.pdf · – Detection Physical world: Burglar alarm Computer security: Intrusion detection systems, antimalware – Response

10

● Full knowledge of– Instruction trace, including dynamically linked libraries– CPU state– Execution flow state – stack– Data: global, heap, TLS

● However– Information overflow– Thousands of instructions and more– GBs of data– And despite of all this...

● Restricted to a single execution path

Malware analysis ii

Page 11: Systems Securitystaff.um.edu.mt/mvel3/files/cps5123_intro.pdf · – Detection Physical world: Burglar alarm Computer security: Intrusion detection systems, antimalware – Response

11

● Iterative process, with each phase informing the next and refining a set of hypothesis about malware's goals

– Basic static analysis

Malware analysis iii

Using binary meta­data> Architecture> Imports> Memory layout...

> Triage> Guidance for setting up sandbox probes> Static disassembly focus

Page 12: Systems Securitystaff.um.edu.mt/mvel3/files/cps5123_intro.pdf · – Detection Physical world: Burglar alarm Computer security: Intrusion detection systems, antimalware – Response

12

Malware analysis iv

● Basic dynamic analysis: malware sandboxesHow about:­ Multiple execution paths?­ Evasive malware?­ Password­protected malware?­ Or just setting up the right environment e.g.> a keylogger but no Keystrokes are sent, or> IE­targeting spyware but no passwords storedin there, etc...

Need more context fromcode – Machine Code

Page 13: Systems Securitystaff.um.edu.mt/mvel3/files/cps5123_intro.pdf · – Detection Physical world: Burglar alarm Computer security: Intrusion detection systems, antimalware – Response

13

Malware analysis v

● Static disassembly Gain:­ Control flow analysis­ API arguments­ Data structure analysis

But:­ Computed args may be hard to follow­ Optimized code/obscure idioms­ Packed code!

> Execution paths> Right environment> Follow areas of interest               inside a debugger

Page 14: Systems Securitystaff.um.edu.mt/mvel3/files/cps5123_intro.pdf · – Detection Physical world: Burglar alarm Computer security: Intrusion detection systems, antimalware – Response

14

Malware analysis vi

● Dynamic disassembly­ Directed analysis­ Infer obscure instructiontraces from memory/register values­ Patch!­ Unpack!

> Right environment setup> Patched/unpacked binary

> Goto: next iteration of analysis

Page 15: Systems Securitystaff.um.edu.mt/mvel3/files/cps5123_intro.pdf · – Detection Physical world: Burglar alarm Computer security: Intrusion detection systems, antimalware – Response

15

Guide detection

alert tcp $HOME_NET 21 ­> $EXTERNAL_NET any (msg:"BLEEDING­EDGE SCANPotential FTP Brute­Force attempt"; flow:from_server,established;content:"530 "; pcre:"/^530\s+(Login|User)/smi"; classtype:unsuccessful­user; threshold: type threshold, track by_dst, count 5, seconds 120;sid:2002383; rev:3;)

Page 16: Systems Securitystaff.um.edu.mt/mvel3/files/cps5123_intro.pdf · – Detection Physical world: Burglar alarm Computer security: Intrusion detection systems, antimalware – Response

16

Guide digital investigation

Page 17: Systems Securitystaff.um.edu.mt/mvel3/files/cps5123_intro.pdf · – Detection Physical world: Burglar alarm Computer security: Intrusion detection systems, antimalware – Response

17

But first...

● Acquisition– Infected hosts– Suspicious network traffic