10. Malware

ushin20
|2023. 6. 14. 13:48

Malware에는 다음의 타입이 있습니다.

  • Infectious
    viruses, worms
  • Concealment
    Trojan horses, logic bombs, rootkits
  • Strealing information
    Spyware, keyloggers, screen scrapers
  • For profit
    Dialers, scarewares, ransomware
  • As platform for other attacks
    Botnets, backdoors

 

Trojan horse

정상적인 SW처럼 동작하면서 정보를 훔치거나 시스템을 다운시킵니다.

트리거는 유저의 특정 행동입니다.

 

Backdoor

시스템에 비밀 entry point를 만들어둡니다.

 

Logic Bomb

합법적인 프로그램에 설치되어 있습니다. 

특정 조건을 만족하면 공격이 활성화됩니다.

주로 시스템을 다운시킵니다.

 

Spyware

은밀하게 유저의 정보를 수집합니다.

  • Keyloggers
  • Screen scrapers
  • Borwsing habit
  • Re-direct browsing and display ads

 

Scareware

바이러스에 감염되었다고 겁주고 결제하게 만들어 가짜 백신을 설치하게 만듭니다.

 

Ransomware

컴퓨터를 감염시키고 시스템을 암호화합니다.

암호를 풀어주는 대가로 금전적 요구를 하는 공격입니다.

 

Virus

Host에 감염되면 스스로를 복제합니다.

복제 과정은 host program에 의해서만 가능하기 때문에 host에 의해서 실행되는 경우에만 복제됩니다.

 

Worm

Host program 없이 스스로 복제합니다.

다른 머신으로 전파됩니다.

(1)탐지 (2)개척 (3)복제 (4)양 늘리기

 

Worm 자체로는 악의적인 payload는 발생하지 않습니다.

 

Morris worm

대표적으로 Morris worm이 있습니다. 두 부분으로 구현되어 있습니다.

  • Main program: Spread worm
  • Vector program

 

Vector1: Debug feature of sendmail

SMTP port(75)에 접근해서 DEBUG option을 킴

shell script를 host한테 보내서 실행할 수 있음

Main program 전파함

 

Vector2: Exploiting Fingerd

Fingerd라고 client한테 welcome message보내는 게 있음(port 79)

Fingerd가 admin으로 부터 message를 기다리고 있음(gets)

worm이 대신 이거 작성

=> Return address가 shell code로 작성됨

Main program 전파

 

Vector3: Exploiting Trust in remote login

UNIX에는 remote login 명령어 rlogin, rsh가 있음

Trusted machine에는 같은 user 계정이 존재함

Trusted machine간에는 password 없이 로그인 가능

 

=> Worm이 이를 활용해서 정보를 빼감

=> Fingerd로 shell 탈취한 상태 = daemon

root 권한을 얻기 위해서 /etc/password를 읽고 

common password 기반으로 ~/.rhosts 계속 시도(dictionary attack)

 

General worm trends

  • 퍼지는 속도 늘리기
    • Slow -> Fast -> Stealthy
    • 한 14시간 걸리던거 10분 대로 줄음
  • 감염 Vector
    • Single -> Vaired
    • Exploit SW 취약점 -> Exploit human 취약점
  • Payload
    • 없었음 -> botnet, spyware, physical system 뿌시기

 

Slammer worm

SQL 2000 공격했던 worm이다.

2002년 버퍼 오버플로우가 보고되었고 2003년 패치되었는데 공격에 성공헀다.

10분이 걸렸다.

 

Research worm

모든 취약한 host를 15분에서 1시간 안에 감염시킨다.

 

*Warhol worms

최적화된 scanning 기법을 사용한다.

  • Phase1: 모든 잠재적 취약 host 찾기
  • Phase2: local subnet scanning
  • Phase3: permutation scanning for complete coverage

*Flash worms

 

Eamil worm

worm이 이메일에 attached되어 퍼진다.

 

Nimda worm

HTML 랜더링 과정에서 발생하는 logic bug를 이용한 worm이다.

HTML email을 조작해서 email을 실행할 수 있는 점을 악용했다.

  • Vector1
    10일에 걸쳐서 이메일에 worm보냄
    preview로 보여지면, 일단 실행됨
  • Vector2
    network로 물린 PC의 shared disk에 복제함
  • Vector3
    Directory traversal 취약점 공격
    URL 실행
  • Vector4
    먼저 지나간 worm의 Backdoor 이용 
  • Vector5
    JS code web page에 추가

 

Zombie & Botnet

SW 취약점을 이용해 다른 네트워크 컴퓨터 공격하기

감염된 컴퓨터 botnet에 올리기(zombie network)

공격 수행

DDoS, phishing, spamming, cracking...

 

Zero-Day vulnerability

SW 취약점은 아직 SW 관리자에게 알려지지 않음

zero-day란 취약점이 발견된 이후 남은 날을 말함

 

취약점은 보통 취약점 DB에 올라옴

보통 patch만드는데 9일 정도 걸림

적용하는거는 더 오래 걸림(주~년)

이때 공격하는 것을 Zero-day attack이라고 함

 

Storm Botnet

Vectors

  • Email attachment
  • Download program to show a video
  • Drive-by exploits

이메일로 감염시키고 DDoS같은 공격을 수행함

슈퍼컴퓨터보다 초당 더 많은 명령어 내릴 수 있었음

 

Rootkit

SW는 권한있는 access를 유지하려고 함

관리자로부터 존재를 지워버리는 공격

Malware가 감지되지 않음

 

  • User level
    ps, ls, ifconfig 등의 명령어 replace
    File change를 모니터링하는 유틸에 의해 탐지 가능함
  • Kernel level
    key kernel function을 replace
    kernel code나 kernel data가 바뀌었는지 확인하면 탐지 가능

 

Advanced Persistent Threat (APT)

장기간 공격 (Low and Slow)

Stuxnet

 

Stuxnet

ICS를 공격함

주로 valid certificate에 임베드 되어 있었음

zero-day attack

 

Driver Singing (= Entry point)

Realtek과 jMicron certificate에 숨어 있었음

 

Field PG infection

PG= Window programs PLC

Local LAN으로 퍼짐

USB driver로 퍼짐 (.lnk 취약점 이용, remote code execution이 가능했음)

3 Window zero-day vulnerabilities를 이용함

 

대상

Siemens PLC

 

결론

처음의 장기간 공격이었음

Multiple zero-day 취약점 사용

Digital certificate 감염시킴

ICS에 코드 숨겨둠

CI에 수행된 첫 공격임

 

Attack Entry points

User action

이메일 attachment, Trojan horse 다운로드, USB dirve 삽입 등

 

SW vulnerabilities

Server program, Client program, Local program에서 발생하는 버그, 악의적 input 허용함

 

Configuration error

weak password, gusst account, DEBUG option 등등

 

Physical access to computer

 

Malware Defense

Anti-virus software

Signature based detection이다. 블랙리스트에 존재하는 Known pattern of data를 검출하는 방법이다.

새로운 멀웨어는 탐지하지 못한다.

 

Polymorphic Malware

식별 가능한 기능을 계속해서 변경하는 멀웨어

멀웨어의 여러 카피를 생성함

 

Packers

Executable file을 encrypt하거나 compress하는 tool이다. Runtime에는 unpacking이 수행된다.

 

Metamorphic Malware

Propagate할때마다 자동으로 멀웨어 바꿈

Key encryption은 하지 않음

- NOP instruction 모으고 register use를 생성함

- 의미없는 instruction 추가

- reorder로 데이터 구조 맞춤

 

Semantic based Malware Detection

Static approach: 특정 behavior 관측

Dynamic approach: 실행해보기

 

High false positive가 발생할 수 있음

 

Application Whitelisting

검증된 어플리케이션 리스트 만들어두고 이 친구들만 실행하기

화이트리스트 유지가 어려움

 

Application Integrity control

program code가 변경되었는지 검사함

Buffer overflow 관측 목함 -> CFI

 

Control Flow Integrity

Instruction이 CFG를 따라간다는 invariant 검증

Static 검사임

'Study > Computer Security' 카테고리의 다른 글

9. Program Analysis  (0) 2023.06.14
8. Software Vulnerabilities  (0) 2023.06.14
7. Database Security  (0) 2023.06.13
MIDTERM 정리  (0) 2023.04.18
6. Web security  (0) 2023.04.17