SlideShare a Scribd company logo
CodeEngn 2010
Art of KeyloggingArt of Keylogging
Keyloggers who are nothing to do with the
keyboard security solutionkeyboard security solution
강병탁 (window31)병탁 ( )
2010.07.03
1
www.CodeEngn.com
2010 4th CodeEngn ReverseEngineering Conference
Who am I?Who am I?
• ByungTak Kang (window31)
• NEXON / Security Team – Hacking Analysis,
Security Programmingy g g
• A contributor to “Microsoftware” a monthly IT
Magazine for over 2 yearsg y
• A lecturer on hacking/reversing/security at
various institutions (KISA, security community,( y y
universities, etc)
• 2009 Microsoft MVP Developer Securityp y
2
AgendaAgenda
• Prologue
• K l i Wi d A t• Keylogging Windows Account
• Login without passwordLogin without password
• Keylogging on the website
• Social Engineering Keylogging
• Bypass Keyboard security solution
• Offensive and defensiveOffensive and defensive
3
Prologue
4
Serious account issuesSerious account issues
5
Endless account problemsEndless account problems
• Wh d till f bl ft• Why do we still face many problems even after
Keyboard security solution is installed ?
• What is the trend of malicious code today ?
• What we must do ?What we must do ?
6
Endless account problemsEndless account problems
/Trojan-PWS/W32.WebGame.101888.K
Trojan-PWS/W32.WebGame.102768.B
Trojan-PWS/W32.WebGame.102805
Trojan-PWS/W32.WebGame.103150j /
Trojan-PWS/W32.WebGame.103182
Trojan-PWS/W32.WebGame.103463
Trojan-PWS/W32.WebGame.103556
Trojan-PWS/W32 WebGame 103810Trojan PWS/W32.WebGame.103810
Trojan-PWS/W32.WebGame.10524
Trojan-PWS/W32.WebGame.10724
Trojan-PWS/W32.WebGame.10764
T j PWS/W32 W bG 110145Trojan-PWS/W32.WebGame.110145
Trojan-PWS/W32.WebGame.111085
Trojan-PWS/W32.WebGame.11218
Trojan-PWS/W32.WebGame.116274
Trojan-PWS/W32.WebGame.116606
Trojan-PWS/W32.WebGame.116822
………………………………
Hundreds of viruses signature are added each day
7
Hundreds of viruses signature are added each day
Keylogging Windows Account
8
Windows AccountWindows Account
the winlogon.exe is what you come to face when
lk t l k d l dyou walk up to a locked or un-logged-on
computer.
9
msgina structuremsgina structure
Interaction between winlogon and GINAg
10
msgina structuremsgina structure
The library file msgina.dll, is required by windows. It is
used by WinLogon within windows, when performing
user authentication.
11
WlxLoggedOutSASWlxLoggedOutSAS
int WlxLoggedOutSAS(
PVOID pWlxContext,p
DWORD dwSasType,
PLUID pAuthenticationId,
idPSID pLogonSid,
PDWORD pdwOptions,
PHANDLE phTokenPHANDLE phToken,
PWLX_MPR_NOTIFY_INFO pNprNotifyInfo,
PVOID *pProfile );PVOID pProfile );
12
WLX MPR NOTIFY INFOWLX_MPR_NOTIFY_INFO
Typedef struct _WLX_MPR_NOTIFY_INFO {
PWSTR pszUserName;PWSTR pszUserName;
PWSTR pszDomain;
PWSTR pszPassword;PWSTR pszPassword;
PWSTR pszOldPassword; } LX_MPR_NOTIFY_INFO;
Here we can see a meaningful structure !!!
13
msgina Hookingmsgina Hooking
14
Reversing msgina MalwareReversing msgina Malware
Naming
• i l Hij k• winlogonHijacker
• Domain Keylogger.Domain Keylogger.
DEMODEMO
15
Login without Password
16
Windows AccountWindows Account
If you press the Shift key 5 times…
17
StickKey PopupStickKey Popup
18
StickKey run structureStickKey run structure
Winlogon
thread
Winlogon
thread
CreateProcess
RunRunRun
sethc.exe
Run
sethc.exe
View
StickKey
Di l B
19
DialogBox
StickKey Local BackdoorStickKey Local Backdoor
• You are able to connect without ID/PW !!!
• Y th l d t t• You can see the explorer or command prompt at
the login prompt without authentication.
20
Behavior structureBehavior structure
• Disable WFP (Windows
File Protection)Disable WFP
• Replace the files.
• N If I k fi• Now, If I press key five
times, I can login at any
time
Change File
time.
press the Shift
key
Login success
21
Terminal LoginTerminal Login
22
Next actionNext action
• Create a new user account,
“c:net user iamhacker /add”c:net user iamhacker /add
•• Add this user to the administrators group
“c:net localgroup administrators iamhacker”c:net localgroup administrators iamhacker
• Remove StickKey Local Backdoor and Enable WFP
(T id d bt h ki )
23
(To avoid as doubt as hacking)
Which platform is this vulnerability?Which platform is this vulnerability?
• Windows 2000
• Wi d XP• Windows XP
• Windows 2003Windows 2003
• Windows Vista
Most of windows OS does not check the
integrity of the file that launches StickyKeysintegrity of the file that launches StickyKeys
“sethc.exe” before executing it.
24
From now onFrom now on
Don’t forget to hit the shift key five times and
see what pops up on your desktopsee what pops up on your desktop
….everyday :p
25
Remove StickKeyRemove StickKey
This is the real answer.
26
Reversing stickkey MalwareReversing stickkey Malware
DEMODEMO
27
Keylogging on the website
28
Web-based loginWeb-based login
• Very vulnerabley
• Method of attack is varied
• Keyboard security solution exists (Almost always)
29
Attack positionAttack position
NetworkNetworkKey pressKey press
Keyboard
hardware
Keyboard
hardware
ApplicationApplication
KeyboardKeyboard MessageMessage
controllercontroller QueueQueue
Pot IOPot IO Filter driverFilter driver
ISR in IDTISR in IDT
Keyboard
class driver
Keyboard
class driver
30
class driverclass driver
Keyboard security solutionKeyboard security solution
protect
NetworkNetwork
protect
areas
Keyboard
hardware
Keyboard
hardware
ApplicationApplication
DMZ
KeyboardKeyboard MessageMessage
controllercontroller QueueQueue
Pot IOPot IO Filter driverFilter driver
ISR in IDTISR in IDT
Keyboard
class driver
Keyboard
class driver
31
class driverclass driver
Protocol handlerProtocol handler
Wininet.dll is the protocol handler for HTTP,
HTTPS and FTP It handles all networkHTTPS and FTP. It handles all network
communication over these protocols.
32
Query hookQuery hook
url=http%3A%2F%2Fwindow31.com&fail_ur
l &l i i & i id 31& d l N&l=&loginsite=&site_id=31&adult_yn=N&enc
oding_type=utf-8&ukey=1BBg yp y
7E5F2937203480D408B5196E9AC3B9DDF487
E636EA15426FAEABDAFB00A6908FE636EA15426FAEABDAFB00A6908F
2069ECB5FA6C7B618E4C68C5F37C2900DB07
DE9A0CACEC7300A6DBD342A83&game id=DE9A0CACEC7300A6DBD342A83&game_id=
13&id=window31&pwd=fucking
33
The API issueThe API issue
34
Reversing malwareReversing malware
DEMODEMO
35
Social Engineering Keylogging
36
Human habitsHuman habits
37
Bad habitBad habit
We do cop and paste nconscio slWe do copy and paste unconsciously.
Even the password.
38
Funny CodeFunny Code
while(1)
{{
// …
GetClipBoardData(CF TEXT);p ( _ );
// …//
if (bMaybePW)
SendDataToHacker();();
Sleep(500);S eep(500);
}
39
ProblemsProblems
• This technique is based on the human behaviorThis technique is based on the human behavior.
• You do not have a login, you can be attacked (for
example, paperwork etc).
40
BypassBypass
Keyboard security solutiony y
41
Why?Why?
42
Offensive and defensive
43
Hooking detectionHooking detection.
13:12:31:889 [0x756E40D4] jmp msg1na.dll.0xB0A588
13:12:31:889 Found inject code !!! 5 byte diff13:12:31:889 Found inject code !!! 5 byte diff
13:12:31:889 doubt module: [pid: 420]
??C:WINDOWSsystem32winlogon exe??C:WINDOWSsystem32winlogon.exe -
c:windowssystem32msgina.dll
13:12:31:889 [KEYLOGGER] Domain Keylogger13:12:31:889 [KEYLOGGER] Domain Keylogger
detect !!!! winlogon.exe - msgina.dll inject
44
I hope AntiVirus vendorsI hope AntiVirus vendors.
• WFP check
• Ch k th• Check sethc.exe
• StickyKeys option turns off.StickyKeys option turns off.
• Winlogon dll injection, integrity check
45
ConclusionConclusion
• Keyboard security solution can not prevent
everythingy g
• Each location requires different security.
(ex. kernel : ring0, app : integrity check)
• h ld b d• Parameters should be encrypted.
• Let's try reversing a lot of malicious code We canLet s try reversing a lot of malicious code. We can
get a hint and we learn a lot of their technology.
• The AntiVirus should be upgraded more behavior-
based features
46
Question
http://www.window31.comp //
window31com@gmail.com
Twitter : @window31com
47
www.CodeEngn.com
2010 4th CodeEngn ReverseEngineering Conference

More Related Content

What's hot

Low-cost Protection against Cold Boot Attacks for an Authentication Token
Low-cost Protection against Cold Boot Attacks for an Authentication TokenLow-cost Protection against Cold Boot Attacks for an Authentication Token
Low-cost Protection against Cold Boot Attacks for an Authentication Token
Graeme Jenkinson
 
Exploitation and State Machines
Exploitation and State MachinesExploitation and State Machines
Exploitation and State Machines
Michael Scovetta
 
A Security Barrier Device That Can Protect Critical Data Regardless of OS or ...
A Security Barrier Device That Can Protect Critical Data Regardless of OS or ...A Security Barrier Device That Can Protect Critical Data Regardless of OS or ...
A Security Barrier Device That Can Protect Critical Data Regardless of OS or ...
CODE BLUE
 

What's hot (19)

Hypervisor-Based Active Data Protection for Integrity and Confidentiality of ...
Hypervisor-Based Active Data Protection for Integrity and Confidentiality of ...Hypervisor-Based Active Data Protection for Integrity and Confidentiality of ...
Hypervisor-Based Active Data Protection for Integrity and Confidentiality of ...
 
Protected Process Light will be Protected – MemoryRanger Fills the Gap Again
Protected Process Light will be Protected – MemoryRanger Fills the Gap AgainProtected Process Light will be Protected – MemoryRanger Fills the Gap Again
Protected Process Light will be Protected – MemoryRanger Fills the Gap Again
 
Social Engineering the Windows Kernel by James Forshaw
Social Engineering the Windows Kernel by James ForshawSocial Engineering the Windows Kernel by James Forshaw
Social Engineering the Windows Kernel by James Forshaw
 
Low-cost Protection against Cold Boot Attacks for an Authentication Token
Low-cost Protection against Cold Boot Attacks for an Authentication TokenLow-cost Protection against Cold Boot Attacks for an Authentication Token
Low-cost Protection against Cold Boot Attacks for an Authentication Token
 
Finfisher- Nguyễn Chấn Việt
Finfisher- Nguyễn Chấn ViệtFinfisher- Nguyễn Chấn Việt
Finfisher- Nguyễn Chấn Việt
 
Exploitation and State Machines
Exploitation and State MachinesExploitation and State Machines
Exploitation and State Machines
 
Under the hood of modern HIPS-es and Windows access control mechanisms
Under the hood of modern HIPS-es and Windows access control mechanismsUnder the hood of modern HIPS-es and Windows access control mechanisms
Under the hood of modern HIPS-es and Windows access control mechanisms
 
MemoryRanger Prevents Hijacking FILE_OBJECT Structures in Windows Kernel
MemoryRanger Prevents Hijacking FILE_OBJECT Structures in Windows KernelMemoryRanger Prevents Hijacking FILE_OBJECT Structures in Windows Kernel
MemoryRanger Prevents Hijacking FILE_OBJECT Structures in Windows Kernel
 
44CON London 2015 - 15-Minute Linux Incident Response Live Analysis
44CON London 2015 - 15-Minute Linux Incident Response Live Analysis44CON London 2015 - 15-Minute Linux Incident Response Live Analysis
44CON London 2015 - 15-Minute Linux Incident Response Live Analysis
 
James Forshaw, elevator action
James Forshaw, elevator actionJames Forshaw, elevator action
James Forshaw, elevator action
 
A Security Barrier Device That Can Protect Critical Data Regardless of OS or ...
A Security Barrier Device That Can Protect Critical Data Regardless of OS or ...A Security Barrier Device That Can Protect Critical Data Regardless of OS or ...
A Security Barrier Device That Can Protect Critical Data Regardless of OS or ...
 
Hacking intranet websites
Hacking intranet websitesHacking intranet websites
Hacking intranet websites
 
Indicators of compromise: From malware analysis to eradication
Indicators of compromise: From malware analysis to eradicationIndicators of compromise: From malware analysis to eradication
Indicators of compromise: From malware analysis to eradication
 
On hacking & security
On hacking & security On hacking & security
On hacking & security
 
Detect Kernel-Mode Rootkits via Real Time Logging & Controlling Memory Access
Detect Kernel-Mode Rootkits via Real Time Logging & Controlling Memory AccessDetect Kernel-Mode Rootkits via Real Time Logging & Controlling Memory Access
Detect Kernel-Mode Rootkits via Real Time Logging & Controlling Memory Access
 
Web application architecture
Web application architectureWeb application architecture
Web application architecture
 
Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)
Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)
Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)
 
How to drive a malware analyst crazy
How to drive a malware analyst crazyHow to drive a malware analyst crazy
How to drive a malware analyst crazy
 
A client-side vulnerability under the microscope!
A client-side vulnerability under the microscope!A client-side vulnerability under the microscope!
A client-side vulnerability under the microscope!
 

Similar to [2010 CodeEngn Conference 04] window31 - Art of Keylogging 키보드보안과 관계없는 키로거들

Safe and secure programming practices for embedded devices
Safe and secure programming practices for embedded devicesSafe and secure programming practices for embedded devices
Safe and secure programming practices for embedded devices
Soumitra Bhattacharyya
 
Hack any website
Hack any websiteHack any website
Hack any website
sunil kumar
 
SBC 2012 - Malware Memory Forensics (Nguyễn Chấn Việt)
SBC 2012 - Malware Memory Forensics (Nguyễn Chấn Việt)SBC 2012 - Malware Memory Forensics (Nguyễn Chấn Việt)
SBC 2012 - Malware Memory Forensics (Nguyễn Chấn Việt)
Security Bootcamp
 
Io t slides_iotvillage
Io t slides_iotvillageIo t slides_iotvillage
Io t slides_iotvillage
agmoneyy
 

Similar to [2010 CodeEngn Conference 04] window31 - Art of Keylogging 키보드보안과 관계없는 키로거들 (20)

Safe and secure programming practices for embedded devices
Safe and secure programming practices for embedded devicesSafe and secure programming practices for embedded devices
Safe and secure programming practices for embedded devices
 
Fileless Malware Infections
Fileless Malware InfectionsFileless Malware Infections
Fileless Malware Infections
 
44CON London 2015 - How to drive a malware analyst crazy
44CON London 2015 - How to drive a malware analyst crazy44CON London 2015 - How to drive a malware analyst crazy
44CON London 2015 - How to drive a malware analyst crazy
 
Reverse Engineering 101
Reverse Engineering 101Reverse Engineering 101
Reverse Engineering 101
 
DEF CON 27 - HUBER AND ROSKOSCH - im on your phone listening attacking voip c...
DEF CON 27 - HUBER AND ROSKOSCH - im on your phone listening attacking voip c...DEF CON 27 - HUBER AND ROSKOSCH - im on your phone listening attacking voip c...
DEF CON 27 - HUBER AND ROSKOSCH - im on your phone listening attacking voip c...
 
Rootkit Hunting & Compromise Detection
Rootkit Hunting & Compromise DetectionRootkit Hunting & Compromise Detection
Rootkit Hunting & Compromise Detection
 
Information security & ethical hacking
Information security & ethical hackingInformation security & ethical hacking
Information security & ethical hacking
 
The Supporting Role of Antivirus Evasion while Persisting
The Supporting Role of Antivirus Evasion while PersistingThe Supporting Role of Antivirus Evasion while Persisting
The Supporting Role of Antivirus Evasion while Persisting
 
Embedded government espionage
Embedded government espionageEmbedded government espionage
Embedded government espionage
 
Endpoint is not enough
Endpoint is not enoughEndpoint is not enough
Endpoint is not enough
 
Hack any website
Hack any websiteHack any website
Hack any website
 
Teensy Preso
Teensy PresoTeensy Preso
Teensy Preso
 
SBC 2012 - Malware Memory Forensics (Nguyễn Chấn Việt)
SBC 2012 - Malware Memory Forensics (Nguyễn Chấn Việt)SBC 2012 - Malware Memory Forensics (Nguyễn Chấn Việt)
SBC 2012 - Malware Memory Forensics (Nguyễn Chấn Việt)
 
Security R U Totally Secure !
Security R U Totally Secure ! Security R U Totally Secure !
Security R U Totally Secure !
 
Sandbox detection: leak, abuse, test - Hacktivity 2015
Sandbox detection: leak, abuse, test - Hacktivity 2015Sandbox detection: leak, abuse, test - Hacktivity 2015
Sandbox detection: leak, abuse, test - Hacktivity 2015
 
Piratng Avs to bypass exploit mitigation
Piratng Avs to bypass exploit mitigationPiratng Avs to bypass exploit mitigation
Piratng Avs to bypass exploit mitigation
 
Captain Hook: Pirating AVs to Bypass Exploit Mitigations
Captain Hook: Pirating AVs to Bypass Exploit MitigationsCaptain Hook: Pirating AVs to Bypass Exploit Mitigations
Captain Hook: Pirating AVs to Bypass Exploit Mitigations
 
Io t slides_iotvillage
Io t slides_iotvillageIo t slides_iotvillage
Io t slides_iotvillage
 
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
 
Ple18 web-security-david-busby
Ple18 web-security-david-busbyPle18 web-security-david-busby
Ple18 web-security-david-busby
 

More from GangSeok Lee

[2014 CodeEngn Conference 11] 박한범 - 가상화 기술과 보안
[2014 CodeEngn Conference 11] 박한범 - 가상화 기술과 보안[2014 CodeEngn Conference 11] 박한범 - 가상화 기술과 보안
[2014 CodeEngn Conference 11] 박한범 - 가상화 기술과 보안
GangSeok Lee
 

More from GangSeok Lee (20)

[2014 CodeEngn Conference 11] 박한범 - 가상화 기술과 보안
[2014 CodeEngn Conference 11] 박한범 - 가상화 기술과 보안[2014 CodeEngn Conference 11] 박한범 - 가상화 기술과 보안
[2014 CodeEngn Conference 11] 박한범 - 가상화 기술과 보안
 
[2014 CodeEngn Conference 11] 이경식 - 동적 추적 프레임워크를 이용한 OS X 바이너리 분석
[2014 CodeEngn Conference 11] 이경식 - 동적 추적 프레임워크를 이용한 OS X 바이너리 분석[2014 CodeEngn Conference 11] 이경식 - 동적 추적 프레임워크를 이용한 OS X 바이너리 분석
[2014 CodeEngn Conference 11] 이경식 - 동적 추적 프레임워크를 이용한 OS X 바이너리 분석
 
[2014 CodeEngn Conference 11] 남대현 - iOS MobileSafari Fuzzer 제작 및 Fuzzing
[2014 CodeEngn Conference 11] 남대현 - iOS MobileSafari Fuzzer 제작 및 Fuzzing[2014 CodeEngn Conference 11] 남대현 - iOS MobileSafari Fuzzer 제작 및 Fuzzing
[2014 CodeEngn Conference 11] 남대현 - iOS MobileSafari Fuzzer 제작 및 Fuzzing
 
[2014 CodeEngn Conference 11] 김기홍 - 빅데이터 기반 악성코드 자동 분석 플랫폼
[2014 CodeEngn Conference 11] 김기홍 - 빅데이터 기반 악성코드 자동 분석 플랫폼[2014 CodeEngn Conference 11] 김기홍 - 빅데이터 기반 악성코드 자동 분석 플랫폼
[2014 CodeEngn Conference 11] 김기홍 - 빅데이터 기반 악성코드 자동 분석 플랫폼
 
[2014 CodeEngn Conference 11] 최우석 - 자바스크립트 난독화 너네 뭐니?
[2014 CodeEngn Conference 11] 최우석 - 자바스크립트 난독화 너네 뭐니?[2014 CodeEngn Conference 11] 최우석 - 자바스크립트 난독화 너네 뭐니?
[2014 CodeEngn Conference 11] 최우석 - 자바스크립트 난독화 너네 뭐니?
 
[2014 CodeEngn Conference 11] 박세한 - IE 1DAY Case Study KO
[2014 CodeEngn Conference 11] 박세한 - IE 1DAY Case Study KO[2014 CodeEngn Conference 11] 박세한 - IE 1DAY Case Study KO
[2014 CodeEngn Conference 11] 박세한 - IE 1DAY Case Study KO
 
[2014 CodeEngn Conference 11] 박세한 - IE 1DAY Case Study EN
[2014 CodeEngn Conference 11] 박세한 - IE 1DAY Case Study EN[2014 CodeEngn Conference 11] 박세한 - IE 1DAY Case Study EN
[2014 CodeEngn Conference 11] 박세한 - IE 1DAY Case Study EN
 
[2014 CodeEngn Conference 11] 김호빈 - Android Bootkit Analysis KO
[2014 CodeEngn Conference 11] 김호빈 - Android Bootkit Analysis KO[2014 CodeEngn Conference 11] 김호빈 - Android Bootkit Analysis KO
[2014 CodeEngn Conference 11] 김호빈 - Android Bootkit Analysis KO
 
[2014 CodeEngn Conference 11] 김호빈 - Android Bootkit Analysis EN
[2014 CodeEngn Conference 11] 김호빈 - Android Bootkit Analysis EN[2014 CodeEngn Conference 11] 김호빈 - Android Bootkit Analysis EN
[2014 CodeEngn Conference 11] 김호빈 - Android Bootkit Analysis EN
 
[2014 CodeEngn Conference 11] 정든품바 - 웹성코드
[2014 CodeEngn Conference 11] 정든품바 - 웹성코드[2014 CodeEngn Conference 11] 정든품바 - 웹성코드
[2014 CodeEngn Conference 11] 정든품바 - 웹성코드
 
[2014 CodeEngn Conference 10] 정광운 - 안드로이드에서도 한번 후킹을 해볼까 (Hooking on Android)
[2014 CodeEngn Conference 10] 정광운 -  안드로이드에서도 한번 후킹을 해볼까 (Hooking on Android)[2014 CodeEngn Conference 10] 정광운 -  안드로이드에서도 한번 후킹을 해볼까 (Hooking on Android)
[2014 CodeEngn Conference 10] 정광운 - 안드로이드에서도 한번 후킹을 해볼까 (Hooking on Android)
 
[2014 CodeEngn Conference 10] 노용환 - 디버거 개발, 삽질기
[2014 CodeEngn Conference 10] 노용환 -  디버거 개발, 삽질기[2014 CodeEngn Conference 10] 노용환 -  디버거 개발, 삽질기
[2014 CodeEngn Conference 10] 노용환 - 디버거 개발, 삽질기
 
[2014 CodeEngn Conference 10] 심준보 - 급전이 필요합니다
[2014 CodeEngn Conference 10] 심준보 -  급전이 필요합니다[2014 CodeEngn Conference 10] 심준보 -  급전이 필요합니다
[2014 CodeEngn Conference 10] 심준보 - 급전이 필요합니다
 
[2013 CodeEngn Conference 09] x15kangx - MS Office 2010 문서 암호화 방식 분석 결과
[2013 CodeEngn Conference 09] x15kangx - MS Office 2010 문서 암호화 방식 분석 결과[2013 CodeEngn Conference 09] x15kangx - MS Office 2010 문서 암호화 방식 분석 결과
[2013 CodeEngn Conference 09] x15kangx - MS Office 2010 문서 암호화 방식 분석 결과
 
[2013 CodeEngn Conference 09] proneer - Malware Tracker
[2013 CodeEngn Conference 09] proneer - Malware Tracker[2013 CodeEngn Conference 09] proneer - Malware Tracker
[2013 CodeEngn Conference 09] proneer - Malware Tracker
 
[2013 CodeEngn Conference 09] BlueH4G - hooking and visualization
[2013 CodeEngn Conference 09] BlueH4G - hooking and visualization[2013 CodeEngn Conference 09] BlueH4G - hooking and visualization
[2013 CodeEngn Conference 09] BlueH4G - hooking and visualization
 
[2013 CodeEngn Conference 09] wh1ant - various tricks for linux remote exploits
[2013 CodeEngn Conference 09] wh1ant - various tricks for linux remote exploits[2013 CodeEngn Conference 09] wh1ant - various tricks for linux remote exploits
[2013 CodeEngn Conference 09] wh1ant - various tricks for linux remote exploits
 
[2013 CodeEngn Conference 09] 제갈공맹 - MS 원데이 취약점 분석 방법론
[2013 CodeEngn Conference 09] 제갈공맹 - MS 원데이 취약점 분석 방법론[2013 CodeEngn Conference 09] 제갈공맹 - MS 원데이 취약점 분석 방법론
[2013 CodeEngn Conference 09] 제갈공맹 - MS 원데이 취약점 분석 방법론
 
[2013 CodeEngn Conference 09] Park.Sam - 게임 해킹툴의 변칙적 공격 기법 분석
[2013 CodeEngn Conference 09] Park.Sam - 게임 해킹툴의 변칙적 공격 기법 분석[2013 CodeEngn Conference 09] Park.Sam - 게임 해킹툴의 변칙적 공격 기법 분석
[2013 CodeEngn Conference 09] Park.Sam - 게임 해킹툴의 변칙적 공격 기법 분석
 
[2013 CodeEngn Conference 09] 김홍진 - 보안컨설팅 이해 및 BoB 보안컨설팅 인턴쉽
[2013 CodeEngn Conference 09] 김홍진 - 보안컨설팅 이해 및 BoB 보안컨설팅 인턴쉽[2013 CodeEngn Conference 09] 김홍진 - 보안컨설팅 이해 및 BoB 보안컨설팅 인턴쉽
[2013 CodeEngn Conference 09] 김홍진 - 보안컨설팅 이해 및 BoB 보안컨설팅 인턴쉽
 

Recently uploaded

Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 

Recently uploaded (20)

Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 

[2010 CodeEngn Conference 04] window31 - Art of Keylogging 키보드보안과 관계없는 키로거들

  • 1. CodeEngn 2010 Art of KeyloggingArt of Keylogging Keyloggers who are nothing to do with the keyboard security solutionkeyboard security solution 강병탁 (window31)병탁 ( ) 2010.07.03 1 www.CodeEngn.com 2010 4th CodeEngn ReverseEngineering Conference
  • 2. Who am I?Who am I? • ByungTak Kang (window31) • NEXON / Security Team – Hacking Analysis, Security Programmingy g g • A contributor to “Microsoftware” a monthly IT Magazine for over 2 yearsg y • A lecturer on hacking/reversing/security at various institutions (KISA, security community,( y y universities, etc) • 2009 Microsoft MVP Developer Securityp y 2
  • 3. AgendaAgenda • Prologue • K l i Wi d A t• Keylogging Windows Account • Login without passwordLogin without password • Keylogging on the website • Social Engineering Keylogging • Bypass Keyboard security solution • Offensive and defensiveOffensive and defensive 3
  • 5. Serious account issuesSerious account issues 5
  • 6. Endless account problemsEndless account problems • Wh d till f bl ft• Why do we still face many problems even after Keyboard security solution is installed ? • What is the trend of malicious code today ? • What we must do ?What we must do ? 6
  • 7. Endless account problemsEndless account problems /Trojan-PWS/W32.WebGame.101888.K Trojan-PWS/W32.WebGame.102768.B Trojan-PWS/W32.WebGame.102805 Trojan-PWS/W32.WebGame.103150j / Trojan-PWS/W32.WebGame.103182 Trojan-PWS/W32.WebGame.103463 Trojan-PWS/W32.WebGame.103556 Trojan-PWS/W32 WebGame 103810Trojan PWS/W32.WebGame.103810 Trojan-PWS/W32.WebGame.10524 Trojan-PWS/W32.WebGame.10724 Trojan-PWS/W32.WebGame.10764 T j PWS/W32 W bG 110145Trojan-PWS/W32.WebGame.110145 Trojan-PWS/W32.WebGame.111085 Trojan-PWS/W32.WebGame.11218 Trojan-PWS/W32.WebGame.116274 Trojan-PWS/W32.WebGame.116606 Trojan-PWS/W32.WebGame.116822 ……………………………… Hundreds of viruses signature are added each day 7 Hundreds of viruses signature are added each day
  • 9. Windows AccountWindows Account the winlogon.exe is what you come to face when lk t l k d l dyou walk up to a locked or un-logged-on computer. 9
  • 10. msgina structuremsgina structure Interaction between winlogon and GINAg 10
  • 11. msgina structuremsgina structure The library file msgina.dll, is required by windows. It is used by WinLogon within windows, when performing user authentication. 11
  • 12. WlxLoggedOutSASWlxLoggedOutSAS int WlxLoggedOutSAS( PVOID pWlxContext,p DWORD dwSasType, PLUID pAuthenticationId, idPSID pLogonSid, PDWORD pdwOptions, PHANDLE phTokenPHANDLE phToken, PWLX_MPR_NOTIFY_INFO pNprNotifyInfo, PVOID *pProfile );PVOID pProfile ); 12
  • 13. WLX MPR NOTIFY INFOWLX_MPR_NOTIFY_INFO Typedef struct _WLX_MPR_NOTIFY_INFO { PWSTR pszUserName;PWSTR pszUserName; PWSTR pszDomain; PWSTR pszPassword;PWSTR pszPassword; PWSTR pszOldPassword; } LX_MPR_NOTIFY_INFO; Here we can see a meaningful structure !!! 13
  • 15. Reversing msgina MalwareReversing msgina Malware Naming • i l Hij k• winlogonHijacker • Domain Keylogger.Domain Keylogger. DEMODEMO 15
  • 17. Windows AccountWindows Account If you press the Shift key 5 times… 17
  • 19. StickKey run structureStickKey run structure Winlogon thread Winlogon thread CreateProcess RunRunRun sethc.exe Run sethc.exe View StickKey Di l B 19 DialogBox
  • 20. StickKey Local BackdoorStickKey Local Backdoor • You are able to connect without ID/PW !!! • Y th l d t t• You can see the explorer or command prompt at the login prompt without authentication. 20
  • 21. Behavior structureBehavior structure • Disable WFP (Windows File Protection)Disable WFP • Replace the files. • N If I k fi• Now, If I press key five times, I can login at any time Change File time. press the Shift key Login success 21
  • 23. Next actionNext action • Create a new user account, “c:net user iamhacker /add”c:net user iamhacker /add •• Add this user to the administrators group “c:net localgroup administrators iamhacker”c:net localgroup administrators iamhacker • Remove StickKey Local Backdoor and Enable WFP (T id d bt h ki ) 23 (To avoid as doubt as hacking)
  • 24. Which platform is this vulnerability?Which platform is this vulnerability? • Windows 2000 • Wi d XP• Windows XP • Windows 2003Windows 2003 • Windows Vista Most of windows OS does not check the integrity of the file that launches StickyKeysintegrity of the file that launches StickyKeys “sethc.exe” before executing it. 24
  • 25. From now onFrom now on Don’t forget to hit the shift key five times and see what pops up on your desktopsee what pops up on your desktop ….everyday :p 25
  • 26. Remove StickKeyRemove StickKey This is the real answer. 26
  • 27. Reversing stickkey MalwareReversing stickkey Malware DEMODEMO 27
  • 28. Keylogging on the website 28
  • 29. Web-based loginWeb-based login • Very vulnerabley • Method of attack is varied • Keyboard security solution exists (Almost always) 29
  • 30. Attack positionAttack position NetworkNetworkKey pressKey press Keyboard hardware Keyboard hardware ApplicationApplication KeyboardKeyboard MessageMessage controllercontroller QueueQueue Pot IOPot IO Filter driverFilter driver ISR in IDTISR in IDT Keyboard class driver Keyboard class driver 30 class driverclass driver
  • 31. Keyboard security solutionKeyboard security solution protect NetworkNetwork protect areas Keyboard hardware Keyboard hardware ApplicationApplication DMZ KeyboardKeyboard MessageMessage controllercontroller QueueQueue Pot IOPot IO Filter driverFilter driver ISR in IDTISR in IDT Keyboard class driver Keyboard class driver 31 class driverclass driver
  • 32. Protocol handlerProtocol handler Wininet.dll is the protocol handler for HTTP, HTTPS and FTP It handles all networkHTTPS and FTP. It handles all network communication over these protocols. 32
  • 33. Query hookQuery hook url=http%3A%2F%2Fwindow31.com&fail_ur l &l i i & i id 31& d l N&l=&loginsite=&site_id=31&adult_yn=N&enc oding_type=utf-8&ukey=1BBg yp y 7E5F2937203480D408B5196E9AC3B9DDF487 E636EA15426FAEABDAFB00A6908FE636EA15426FAEABDAFB00A6908F 2069ECB5FA6C7B618E4C68C5F37C2900DB07 DE9A0CACEC7300A6DBD342A83&game id=DE9A0CACEC7300A6DBD342A83&game_id= 13&id=window31&pwd=fucking 33
  • 34. The API issueThe API issue 34
  • 38. Bad habitBad habit We do cop and paste nconscio slWe do copy and paste unconsciously. Even the password. 38
  • 39. Funny CodeFunny Code while(1) {{ // … GetClipBoardData(CF TEXT);p ( _ ); // …// if (bMaybePW) SendDataToHacker();(); Sleep(500);S eep(500); } 39
  • 40. ProblemsProblems • This technique is based on the human behaviorThis technique is based on the human behavior. • You do not have a login, you can be attacked (for example, paperwork etc). 40
  • 44. Hooking detectionHooking detection. 13:12:31:889 [0x756E40D4] jmp msg1na.dll.0xB0A588 13:12:31:889 Found inject code !!! 5 byte diff13:12:31:889 Found inject code !!! 5 byte diff 13:12:31:889 doubt module: [pid: 420] ??C:WINDOWSsystem32winlogon exe??C:WINDOWSsystem32winlogon.exe - c:windowssystem32msgina.dll 13:12:31:889 [KEYLOGGER] Domain Keylogger13:12:31:889 [KEYLOGGER] Domain Keylogger detect !!!! winlogon.exe - msgina.dll inject 44
  • 45. I hope AntiVirus vendorsI hope AntiVirus vendors. • WFP check • Ch k th• Check sethc.exe • StickyKeys option turns off.StickyKeys option turns off. • Winlogon dll injection, integrity check 45
  • 46. ConclusionConclusion • Keyboard security solution can not prevent everythingy g • Each location requires different security. (ex. kernel : ring0, app : integrity check) • h ld b d• Parameters should be encrypted. • Let's try reversing a lot of malicious code We canLet s try reversing a lot of malicious code. We can get a hint and we learn a lot of their technology. • The AntiVirus should be upgraded more behavior- based features 46
  • 47. Question http://www.window31.comp // window31com@gmail.com Twitter : @window31com 47 www.CodeEngn.com 2010 4th CodeEngn ReverseEngineering Conference