A preview of this full-text is provided by Springer Nature.
Content available from Journal of Computer Virology and Hacking Techniques
This content is subject to copyright. Terms and conditions apply.
J Comput Virol Hack Tech (2018) 14:139–156
https://doi.org/10.1007/s11416-017-0299-1
ORIGINAL PAPER
Pure-Call Oriented Programming (PCOP): chaining the gadgets
using call instructions
AliAkbar Sadeghi1·Salman Niksefat1·Maryam Rostamipour1
Received: 27 January 2017 / Accepted: 26 April 2017 / Published online: 15 May 2017
© Springer-Verlag France 2017
Abstract Return-oriented programming (ROP) and jump-
oriented programming (JOP) are two well-known code-reuse
attacks in which short code sequences ending in ret or jmp
instructions are located and chained in a specific order to
execute the attacker’s desired payload. JOP, comparing to
ROP, is even more effective because it can be invoked with-
out any reliance on the ret instruction and therefore it can
bypass new defense mechanisms against ROP. In this paper,
we continue this line of work by proposing Pure-Call Ori-
ented Programming (PCOP). In PCOP, we drive the control
flow by proposing special gadgets that all end in a call instruc-
tion rather than ret or jmp. We then propose techniques for
chaining gadgets that removes the side-effects arise from the
call-ending gadgets. The idea of having call-ending gadgets
with the term Call Oriented Programming has been noted in
some previous work but using call gadgets in these works,
due to side-effects of the call instruction, was limited to
one or two call-ending gadgets between other ret/jmp gad-
gets. Our work is the first that shows real code-reuse attacks
solely based on call gadgets. We also show that our proposed
approach is Turing-complete, meaning that any functionality
can be driven by PCOP. We have successfully identified some
call-oriented gadgets inside GNU libc library. Our experi-
This work is supported by APA research center (http://apa.aut.ac.ir)at
Amirkabir University of Technology, Tehran, Iran.
BSalman Niksefat
niksefat@aut.ac.ir
AliAkbar Sadeghi
aliakbar.sadeghi@aut.ac.ir
Maryam Rostamipour
rostamipoor@aut.ac.ir
1APA Research Center, Amirkabir University of Technology,
No. 424, Hafez Ave, Tehran, Iran
ments with the example shellcode show the practicality of the
proposed approach. Finally, we propose a variant of PCOP
named TinyCOP which resists detection by recent code-reuse
defense mechanisms.
Keywords Code-reuse attack ·Pure-Call Oriented Pro-
gramming ·Return oriented programming ·Jump oriented
programming ·Exploitation
1 Introduction
In this paper, we propose new techniques for code-reuse
attacks. The main idea in code-reuse attacks is to use existing
code in a process address space to execute arbitrary payloads.
This is a promising approach since it can bypass the write-
xor-execute(WX) defense mechanism against classic code
injection attacks and also makes it harder for intrusion detec-
tion systems to detect such attacks on the network. This is due
to the fact that the payload is not injected from outside and
the attacker uses the existing pieces of code in the memory
to launch the attack.
The basic building blocks in code-reuse attacks are gad-
gets. Gadgets are sequence of instructions ending in an
instruction that diverts the control flow to the next gadget
or some other structure that is used for chaining the gadgets.
The last instruction of a gadget can be instructions like ret,
jmp or call. In return-oriented-programming (ROP) [14], all
gadgets are ended with the ret whereas in jump-oriented-
programming (JOP) [1,3] the gadgets are ended with jmp
or sometimes call instructions. In JOP, the reliance on the
ret instruction has been removed to bypass detection mecha-
nisms that are sensitive to frequent use of the ret instruction.
In this paper, we argue that the code-reuse attack can be
launched by solely relying on call-ending gadgets. Using of
123
Content courtesy of Springer Nature, terms of use apply. Rights reserved.