SlideShare uma empresa Scribd logo
1 de 58
Asim Hussain
@jawache
codecraft.tv
microsoft.com
@jawache
@jawachePhoto by Kristina Flour on Unsplash
@jawachePhoto by Veri Ivanova on Unsplash
@jawacheMr Robot
@jawache
@jawachePhoto by Nolan Issac on Unsplash
On Premise
Hardware
OS
App
IaaS
Hardware
OS
App
PaaS
Hardware
OS
App
@jawache
Google App Engine
Heroku
Amazon Beanstalk
Azure App Services
@jawache
@jawacheIt's Always Sunny In Philadelphia
@jawache
'SELECT * FROM COMPANIES WHERE name =' + name;
@jawache
SELECT * FROM COMPANIES WHERE name =;
DROP TABLE "COMPANIES";
--LTD
@jawache
@jawache
@jawache
@jawachePhoto by Braydon Anderson on Unsplash
@jawache
@jawache
@orange_8361
git push
http://example.com
@jawache
git push
http://localhost
@jawache
git push
http://0
@jawache
git push
http://0:9200/_shutdown
@jawache
def send_email(request):
try:
recipients = request.GET['to'].split(',')
url = request.GET['url']
proto, server, path, query, frag = urlsplit(url)
if query: path += '?' + query
conn = HTTPConnection(server)
conn.request('GET',path)
resp = conn.getresponse()
...
@jawache
http://0:8000/composer/send_email?
to=orange@nogg&
url=http://127.0.0.1:12345/foo
@jawache
def send_email(request):
try:
recipients = request.GET['to'].split(',')
url = request.GET['url']
proto, server, path, query, frag = urlsplit(url)
if query: path += '?' + query
conn = HTTPConnection(server)
conn.request('GET',path)
resp = conn.getresponse()
...
@jawache
rn
@jawache
%0D%0A
@jawache
http://127.0.0.1:12345/%0D%0Ahello%0D%0AFoo:
@jawache
GET /%0D%0Ahello%0D%0AFoo:
HTTP/1.1
Host: 127.0.0.1:12345
Accept-Encoding: identity
@jawache
GET /
hello
Foo: HTTP/1.1
Host: 127.0.0.1:12345
Accept-Encoding: identity
@jawache
...:11211/%0D%0Aset%20key%200%20900%204%20data%0D%0A
@jawache
GET /
set key 0 900 4 data
HTTP/1.1
Host: 127.0.0.1:11211
Accept-Encoding: identity
@jawache
GET /
set key 0 900 4 data
HTTP/1.1
Host: 127.0.0.1:11211
Accept-Encoding: identity
@jawache
code
code
@jawache
code
code
@jawache
DeprecatedInstanceVariableProxy
@jawache
@jawache
@jawachePhoto by Kelly Sikkema on Unsplash
@jawache
@jawache
@jawache
@jawache
cross-env vs. crossenv
@jawache
@jawachePhoto by Jairo Alzate on Unsplash
Stop pretending
Don't assume
Small vulnerability
Don't trust anyone
PaaS
Sanitise
Fix
@jawache
https://www.pluralsight.com/courses/nodejs-security-
express-angular-get-started/ @jawache
Asim Hussain
@jawache
codecraft.tv
microsoft.com
Azure App Services
https://aka.ms/azure-app-service-docs
Google App Engine
https://cloud.google.com/appengine/
Heroku
https://heroku.com
Amazon Beanstack
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/Welcome.html
PaaS Platforms
Metasploit
https://www.metasploit.com/
DropTables Company
https://beta.companieshouse.gov.uk/company/10542519
SQLMap
http://sqlmap.org/
How I Chained 4 vulnerabilities on GitHub Enterprise - Orange Tsai
http://blog.orange.tw/2017/07/how-i-chained-4-vulnerabilities-on.html
Malicious packages in npm. Here’s what to do - Ivan Akulov
https://iamakulov.com/notes/npm-malicious-packages/
Oscar Bolmsten on Twitter
https://twitter.com/o_cee/status/892306836199800836
npm module sqlstring
https://www.npmjs.com/package/sqlstring
Exploit DB
https://www.exploit-db.com/
Brian Clarke Security Course on Pluralsight
https://www.pluralsight.com/courses/nodejs-security-express-angular-get-started/

Mais conteúdo relacionado

Mais procurados

DevCon Summit 2014: Trends in Android Development by Evan Dale Aromin
DevCon Summit 2014: Trends in Android Development by Evan Dale ArominDevCon Summit 2014: Trends in Android Development by Evan Dale Aromin
DevCon Summit 2014: Trends in Android Development by Evan Dale ArominDEVCON
 
Mobile web-debug
Mobile web-debugMobile web-debug
Mobile web-debugFINN.no
 
Slam Dunk with Splunk and Stash Data Center
Slam Dunk with Splunk and Stash Data CenterSlam Dunk with Splunk and Stash Data Center
Slam Dunk with Splunk and Stash Data CenterAtlassian
 
Python-Powered Savage Garden Hotline
Python-Powered Savage Garden HotlinePython-Powered Savage Garden Hotline
Python-Powered Savage Garden HotlineMariatta Wijaya
 
Durga soft SCJP part-1
Durga soft SCJP part-1Durga soft SCJP part-1
Durga soft SCJP part-1Satya Johnny
 
Mobile Performance Testing Crash Course
Mobile Performance Testing Crash CourseMobile Performance Testing Crash Course
Mobile Performance Testing Crash CourseTechWell
 
Ignite presentation slideshow
Ignite presentation slideshowIgnite presentation slideshow
Ignite presentation slideshowTylerKane
 
APIdays Paris 2018 - An API Is Not Enough: Crafting a Developer Experience Ad...
APIdays Paris 2018 - An API Is Not Enough: Crafting a Developer Experience Ad...APIdays Paris 2018 - An API Is Not Enough: Crafting a Developer Experience Ad...
APIdays Paris 2018 - An API Is Not Enough: Crafting a Developer Experience Ad...apidays
 

Mais procurados (9)

Hacking title
Hacking titleHacking title
Hacking title
 
DevCon Summit 2014: Trends in Android Development by Evan Dale Aromin
DevCon Summit 2014: Trends in Android Development by Evan Dale ArominDevCon Summit 2014: Trends in Android Development by Evan Dale Aromin
DevCon Summit 2014: Trends in Android Development by Evan Dale Aromin
 
Mobile web-debug
Mobile web-debugMobile web-debug
Mobile web-debug
 
Slam Dunk with Splunk and Stash Data Center
Slam Dunk with Splunk and Stash Data CenterSlam Dunk with Splunk and Stash Data Center
Slam Dunk with Splunk and Stash Data Center
 
Python-Powered Savage Garden Hotline
Python-Powered Savage Garden HotlinePython-Powered Savage Garden Hotline
Python-Powered Savage Garden Hotline
 
Durga soft SCJP part-1
Durga soft SCJP part-1Durga soft SCJP part-1
Durga soft SCJP part-1
 
Mobile Performance Testing Crash Course
Mobile Performance Testing Crash CourseMobile Performance Testing Crash Course
Mobile Performance Testing Crash Course
 
Ignite presentation slideshow
Ignite presentation slideshowIgnite presentation slideshow
Ignite presentation slideshow
 
APIdays Paris 2018 - An API Is Not Enough: Crafting a Developer Experience Ad...
APIdays Paris 2018 - An API Is Not Enough: Crafting a Developer Experience Ad...APIdays Paris 2018 - An API Is Not Enough: Crafting a Developer Experience Ad...
APIdays Paris 2018 - An API Is Not Enough: Crafting a Developer Experience Ad...
 

Semelhante a It could happen to anyone - FrontEnd Connect 2017

How to hack a node app? - LvivJS 2017
How to hack a node app? - LvivJS 2017How to hack a node app? - LvivJS 2017
How to hack a node app? - LvivJS 2017Asim Hussain
 
AppForum 2014 Boost Hybrid App Performance
AppForum 2014 Boost Hybrid App PerformanceAppForum 2014 Boost Hybrid App Performance
AppForum 2014 Boost Hybrid App Performancerobgalvinjr
 
Zero to Sixty: AWS Elastic Beanstalk (DMG204) | AWS re:Invent 2013
Zero to Sixty: AWS Elastic Beanstalk (DMG204) | AWS re:Invent 2013Zero to Sixty: AWS Elastic Beanstalk (DMG204) | AWS re:Invent 2013
Zero to Sixty: AWS Elastic Beanstalk (DMG204) | AWS re:Invent 2013Amazon Web Services
 
2009 Barcamp Nashville Web Security 101
2009 Barcamp Nashville   Web Security 1012009 Barcamp Nashville   Web Security 101
2009 Barcamp Nashville Web Security 101brian_dailey
 
Summit2011 satellites-robinf-20110605
Summit2011 satellites-robinf-20110605Summit2011 satellites-robinf-20110605
Summit2011 satellites-robinf-20110605Robin Fernandes
 
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...Atlassian
 
Develop and Deploy your JavaEE micro service in less than 5 minutes with Apac...
Develop and Deploy your JavaEE micro service in less than 5 minutes with Apac...Develop and Deploy your JavaEE micro service in less than 5 minutes with Apac...
Develop and Deploy your JavaEE micro service in less than 5 minutes with Apac...Alex Soto
 

Semelhante a It could happen to anyone - FrontEnd Connect 2017 (8)

How to hack a node app? - LvivJS 2017
How to hack a node app? - LvivJS 2017How to hack a node app? - LvivJS 2017
How to hack a node app? - LvivJS 2017
 
AppForum 2014 Boost Hybrid App Performance
AppForum 2014 Boost Hybrid App PerformanceAppForum 2014 Boost Hybrid App Performance
AppForum 2014 Boost Hybrid App Performance
 
Zero to Sixty: AWS Elastic Beanstalk (DMG204) | AWS re:Invent 2013
Zero to Sixty: AWS Elastic Beanstalk (DMG204) | AWS re:Invent 2013Zero to Sixty: AWS Elastic Beanstalk (DMG204) | AWS re:Invent 2013
Zero to Sixty: AWS Elastic Beanstalk (DMG204) | AWS re:Invent 2013
 
2009 Barcamp Nashville Web Security 101
2009 Barcamp Nashville   Web Security 1012009 Barcamp Nashville   Web Security 101
2009 Barcamp Nashville Web Security 101
 
Summit2011 satellites-robinf-20110605
Summit2011 satellites-robinf-20110605Summit2011 satellites-robinf-20110605
Summit2011 satellites-robinf-20110605
 
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
 
TL; DR: iOS 9R
TL; DR: iOS 9RTL; DR: iOS 9R
TL; DR: iOS 9R
 
Develop and Deploy your JavaEE micro service in less than 5 minutes with Apac...
Develop and Deploy your JavaEE micro service in less than 5 minutes with Apac...Develop and Deploy your JavaEE micro service in less than 5 minutes with Apac...
Develop and Deploy your JavaEE micro service in less than 5 minutes with Apac...
 

Último

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
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 organizationRadu Cotescu
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
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 StreamsRoshan Dwivedi
 

Último (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
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
 

It could happen to anyone - FrontEnd Connect 2017

Notas do Editor

  1. before I begin I'd like to ask a quick question... pee question hopefully, by the end of the talk, that %age will have increased. because today we are going to talk about security and hacking. and Introduce To begin I'd like to tell you a story...
  2. working in investment banking, career going well, good money side project events site slightly successful. quit to work on this full time arrogant money started running out, had 3 months left. found one investor still interested demo 7 days 48 hours linode investigate, confirmed, tmp folder what was the source? found php running, weird since I don't use php remembered resolution
  3. No fool. Took security this very seriously. Followed all the instructions. Forgot one small thing. Lesson Take Away = Happen to you. I love stories. Today I'm going to talk about hacking. But through 3 different hacking stories. Some specific to node Some general. Moral at the end Lesson to learn Steps to protect yourself Lets start off with breaking down exactly how I think I was hacked at eventsushi.
  4. Lets first explain a few terms A vulnerability is a hole in security a weakness - e.g. not using a firewall is a vulnerability. An exploit is a tool, piece of code, or just a sequence of commands which takes advantage of a vulnerability to do bad things. Q) Who here has heard of the term 0 day exploit? A 0 day exploit is one that no one knows about, yet. It's a secret Photo by Kristina Flour on Unsplash https://unsplash.com/search/photos/whisper?photo=BcjdbyKWquw
  5. Once a 0 day exploit is found It's not called a 0 day exploit anymore. 1D, 30D, 6MONTH etc.. Then the clock starts ticking. How hard do you think it would be to get a hold of a 0 day exploit? How hard do you think it would be to get a hold of an exploit that's been in the public domain for 6 months? https://unsplash.com/photos/p3Pj7jOYvnM Photo by Veri Ivanova on Unsplash
  6. In fact it's very easy. you can find them on the internet. There are lots of sites. This one for instance https://www.exploit-db.com/ [SHOW VIDEO]
  7. We like to believe all hackers are like this? black hat mysterious geniuses I think we like to believe that because it makes us feel better when we do get hacked. "I mean it's MrRobot, How am I a supposed to defend against that"?
  8. But MrRobot didn't hack me. They didn't use a 0 day exploit. I was running a really old version of PHP. My attacker GOOGLED how to hack me and followed instructions. Not hard!
  9. Or like this... ooooh mysterious....
  10. http://www.istockphoto.com/gb/photo/hard-at-work-gm518069822-89813857 But it probably looked like this... But I was running an old version of PHP. My attacker GOOGLED how to hack me and followed instructions.
  11. In fact it's even easier than that.. you don't even need to do this manually. tools automate this whole process metasploit is one from rapid7. scans a site. identifies potential vulnerabilities. then lets you automate exploits from its database of plugins. [NO....] So you just need to find an idiot like me on the internet With an old version of PHP running Scan me with metasploit and then try a few known exploits.
  12. So what can we do? We are still vulnerable to 0 day exploits. Can't defend from unknown. Can defend from known exploits simply by keeping our software updated. That's easy right, we just need to update... OS Apache Nginx Database Software Underlying Libraries Bulletins Actually that sounds like a lot of hard work Any my job is to write apps, not maintain servers. So after this attack i started exclusively using PAASs Photo by Nolan Issac on Unsplash https://unsplash.com/photos/K5sjajgbTFw
  13. Describe. Patching Companies SUMMARY: Leaving an OLD version of PHP running was a vulnerability. Don't think they came in through a 0 day. They came in using a known exploit, one that was probably already fixed in the latest version of PHP. So if i had at least updated PHP to the latest version I would be safe. But keeping everything updated is hard. So use a PAAS. On Premise You look after hardware, OS and application code IaaS You look after OS and App code and they look after the Hardware PaaS They look after harware, OS (and software like web servers) and you just release app code In the past i've used Heroku, Google App Engine, Amazon has something called Beanstalk but i've never used it and Azure has something called AppService Doesn't matter which one you use to be honest, they all auto update the infrastructure versions on a pretty regular level just make sure to use one.
  14. Still not convinced? Q) Who's heard of the recent equifax hack? The largest hack in history, affects about 200 million people. Billion dollar company. 10,000 employees. Did the hackers get in through a 0 day exploit? NO. They got in through a KNOWN exploit of Apache Struts. The patch to fix the exploit had been released for 2 months BEFORE the hack. They just hadn't applied the patch.
  15. Azure Security Centre Coolest things about Azure No one else has got this. Signals Alerts create noise So to solve this we trained in AI to detect hacking attempts from the signals. The AI can chain together signals and figure out if you are being attacked with a pretty high degree of certainty. It's not perfect but i'm lazy and it doesn't require any effort to use so I like to switch it on.
  16. Who watches this show? So my closing arguments. Thinking you can create a secure platform to host your app when you are not an expert in security is like thinking you can represent yourself in court if you are not a lawyer. Did I manage to scare any of you? Probably not... maybe this next story will scare you more.
  17. http://www.istockphoto.com/gb/photo/little-boy-stealing-cookies-gm164114602-23379436 http://www.istockphoto.com/gb/photo/close-up-of-a-little-girl-taking-one-cookie-gm160146392-17820916 This story is about a company I used to work at. They were a financial startup. Brought to help them move from an old Java framework to Angular. Framework decommissioned in 2003, first line of code was written in 2005. Can laugh but It's financial services so lots of it regulation including security. Hired a pen testing firm to try to hack us. It wasn't hard. This is the story of one of the vulnerabilities they found. It's called XSS or CrossSiteScripting and it's a type of Injection Attack. They basically found a way to steal a users cookies then login and make trades and financial transactions as that user.
  18. The way they did this was simple. The form that we used to submit a comment allowed some simple formatting, bold etc.. It used HTML to define the text format.
  19. It then converted the HTML to Base64 and this was posted to the server and stored in the database. Later on when it comes to display it converts from base64 on the server side and returns HTML from the server. NOTE: This is NOT an SPA, serverside rendered!
  20. So instead of the HTML you saw before, these hackers crafted their own HTML comment. This one had a script tag. Do you see what it's doing? It's sending your cookie to some other server, assuming you login with cookies this is giving someone else complete access to your account.
  21. Remember it gets converted to base64 first and they just used postman to post it to our APIs. Then when we rendered the page later on. We rendwered it WITH their script tag!
  22. So just VIEWING a forum page with one of these special comments in will send your cookie to someone else server.
  23. http://www.istockphoto.com/gb/photo/deception-concept-disguise-between-shark-and-goldfish-gm534192884-94746997 http://www.istockphoto.com/gb/photo/in-the-wrong-place-gm92469124-700142 https://www.pexels.com/photo/close-up-of-human-hand-257279/ Moral of the story: Don't assume your inputs will arrive in the format you expect. What's the solution? Sanitise on backend - on the serverside should strip tags it doesnt' recognise: https://www.npmjs.com/package/xss [ADD] Sanitise on frontend: With frameworks like Angular it by default assumes that all content is unstrusted and runs it through a sanitiser removing all script tags: https://angular.io/guide/security CSP script-src https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src [CSP]
  24. http://www.istockphoto.com/gb/photo/child-upset-before-getting-a-shot-at-the-doctor-gm97506563-12206370
  25. https://beta.companieshouse.gov.uk/company/10542519 companies house. This is an actual limited company registered in the UK. It's an example of an attempt at an injection attack a sql injection attack. Run untrusted code in a trusted environment. The goal is to trick an application to run some raw SQL.
  26. So if someone wasn't careful and had a script that ran something like this 'select * from companies where name ='+ name;
  27. they would end up running something like this But name might be something a user entered into a form. or came from an API request. You are susceptible to this whenever you use "untrusted" input in an SQL statement. Backup database, so what DROPTABLES isn't the only command Don't even have to try all these commands manually.
  28. http://sqlmap.org/ It's such a common vulnerability that there are automated tools to help you attack, such as this one.
  29. python script pass in the URL which has the vulnerability scans to begin with, finding out things like database software and version. Figured out it's myself so tries to guess the admin password from a database of common passwords. dump users table run shell commands In about a min, we can get access to the database, dump the users table and even run commands on the OS shell.
  30. Moral of the story: Don't assume your inputs will arrive in the format you expect. Photo by Braydon Anderson on Unsplash https://unsplash.com/collections/480109/animals-in-disguise?photo=wOHH-NUTvVc
  31. What's the solution? Sanitise untrusted input. sqlstring Strips out anything that looks unsafe from a sql statement. Others, front end, XSS etc... Anytime you have untrusted input from a user sanitise.
  32. [SLOW] If you use something like azure sql database it automatically ❤️ detects sql injection attacks doesn't stop them but does send you an alert. How are you feeling now? I showed you an automated script which took over a database in under a minute. More scared?
  33. Who's heard of this company? So github has a bug bounty. They pay you if you find a security hole in their software. There was a great exploit found in github enterprse by someone called orange tsai twitter handle. gave a hacker the ability to run any command on the github server as if they have a bash shell open on your server. chaining a number of smaller exploits together into one large exploit. heist movie figuring out how they did it is so facinating. I've tried to break down for you and would love to tell. http://blog.orange.tw/2017/07/how-i-chained-4-vulnerabilities-on.html
  34. You know webhooks right? You can setup a webhook so that when someone pushes to git it will POST to a HTTP endpoint.
  35. What if you set the webhook URL to localhost? Aha... then it will post to a local process instead post to any port behind the firewall! But the github people knew this They USED a sanitiser that blacklisted localhost.
  36. But they didn't blacklist 0 which can resolve to localhost as well!
  37. About the only thing he could do with that is shutdown elastic search. Spent a few more days looking.
  38. graphite charting open source so checked the source code found this function
  39. POST -> GET
  40. But that second GET request is using HttpConnection lib
  41. Which is know to have a vulnerability called called CR-LF Injection
  42. A HTTP Request is just a series of lines sent over a TCP connection. So it opens a port to 12345 Sends GET, \r\n HTTP\r\n etc...
  43. But HTTPConnection converts those special chars to \r\n So now we send GET / then hello Something that is expecting HTTP would probably error at this, the message is not formed correctly.
  44. But HTTPConnection converts those special chars to \r\n So now we send GET / then hello Something that is expecting HTTP would probably error at this, the message is not formed correctly.
  45. This activity opens up the door to something called protocol smuggling. So if we send a HTTP request to the redis instance on the box (6379) with the command SLAVEOF example.com 6379 then this redis instance becomes a slave of our external redis instance. So it opens the door to being attacked through other protocols than HTTP. What other things can we do?
  46. But what if we did something like this. 11211 is memcached. what would HTTPConnection try to send then.
  47. The full HTTP message when generated by HttpConnection library then looks like this. But remember we are not sending this to a server expecting HTTP. We are sending this to memcached which is just expecting the memcached protocol.
  48. Memcached is not expecting HTTP, doesn't know how to parse it, just executes commands if it sees a newline. GET ignored, error. next time, this is a real memecahced command, sets some data in memcached. Lets us smuggle protocols
  49. Developers, we like to store things in memcached, But we are lazy so we like to use libs that do it for is. We might use one which takes an instance of a class and serialises the whole thing. So you take some code that exists in memory. Convert it to a string or binary format. Send that to memcached. Sometime later load the data again, convert it into a class and call a function.
  50. But now we have access to memcached We can set data in memcached. we can CHANGE what code is returned. So when you execturte that code later on, you are running my code, not the code you stored.
  51. Serialised instances contain the name of the class Found this one Instance had a known vulnerability so was depreciated You can change a serialised instance of this class so that when it is called it executes a command in the shell instead. BUT they still used it, so it was easy to hack.
  52. Moral of the story: Big exploits are made from smaller exploits. Attacks don't come in through one big exploit. Multiple smaller exploits chained together. So if you found a vuln and are thinking of ignoring it, think again. How are you feeling now? Anyone need to go to the toilet? No? Maybe after the next story... Photo by Kelly Sikkema on Unsplash https://unsplash.com/search/photos/lego?photo=JRVxgAkzIsM
  53. What does the above code do? It gets all your environment variables and converts them to a base64 encoded string.
  54. What does the above code do? Take a look at the host name. It takes your environment variables and posts them to my server. How many of you keep secret keys, passwords etc... in environment variables. What if I told you I could make you run this code on your server?
  55. Does this make it any clearer, the file is called package-setup.js
  56. How about now? I can see the realisation coming to some of you. This is an npm module, when you install it you send me your environment variables. But you are probably thinking, why would you ever install an npm package you have never heard of?
  57. Take a look at this, was posted a few weeks ago. cross-env is a very popular npm module created by kent dodds, over a million downloads every month.
  58. What they had done was release a module called codeenv without the hyphen. That's it. It's called typosquatting. npm install from memory, tried with and without hyphens? When you run npm install you are basically giving other developers the right to run their code on your server behind all your firewalls as if you wrote the code.
  59. Moral of the story: We are too trusting! maybe because open source. developer is a good person. they have released code to the community for free. multiple eyes on it. the npm modules were up for 2 weeks before they were discovered. not using the environment key vault. but even that would not be safe the code is running as if it was you who wrote it. so it will have access to even read from keyvault npm have taken down crossenv maybe already installed? Links at the end. ecosystem is HUGE static analysis of npm packages double triple sure you typed he module name correctly https://unsplash.com/photos/sssxyuZape8 Photo by Jairo Alzate on Unsplash
  60. What's the takeaway? Stop pretending that because you've spent a few mins thinking about security that you are safe. There are people who spend all day everyday thinking of clever ways to get access to your site. Use a PaaS. Don't assume people will use your site as you expect them to use it, every input can be abused, so sanitise. No such thing as a small exploit, small ones can be chained together to create a big one. Fix your vulnerabilities no matter how small you think they are. Did the npm one scare you? It should... we are too trusting, we trust objects we store in a memcache are not going to be tampered with, we trust that everything we install from npm is trustworthy. Don't trust anyone!
  61. If you want a good follow on course my colleage Brian Clarke has one on Pluralsight, it's a good one for going a bit deeper into some of these issues.
  62. look like from behind