SlideShare a Scribd company logo
<BEYOND XSS>
Project by:
<Judy> & <Munir>
>who we are?
Name? Munir Njiru
Do? Cyber security Consultant
Owasp Rep kenya
Shallow Web > alien-within.com
Member > Africahackon
twitter: @muntopia
Name: Judy Ngure
DO?: Senior QA @ scan group
Jr.Researcher: IBM Africa
Member: shehacks
DevOps
twitter: @codebasher
>what to cover
> What is xss
> Types of xss
> Just because i have an xss in my web app,
does it make my web app risky to use?
> Oooh i have an xss in my web app how can
i exploit it?
> Demos
> protections
> Q& A
<Title> XSS</Title>
What is this xss and what does it entail?
browser attacker
I don’t believe I have…
hey
alert(document.cookie
); I feel drawn to you
for some reason; must
be the javascript.
Hey, I like your hair…where’d
you get it done…. Met my
friend alert(document.cookie);
?
Hey, I really wanna
know that girl,
mind working your
magic.
<Theory>Types</theory>
Reflected
▪ where the malicious string originates from
the victim's request
Stored
▪ where the malicious string originates from
the website's database.
DOM
▪ where the vulnerability is in the client-side
code rather than the server-side code.
>Simple Demo
▪ Simple xss
Reflected :
Input the infamous payload
<script>alert(“hey am a reflected axss”);</script>
to confirm XSS.
http://142.xx.xxx.xxx/admin/home.php/"onmouseover="alert(docume
nt.cookie);"
Stored:
Another example of XSS, but this time it ll be Stored XSS, where the
XSS payload is saved and executed when the saved payload is
executed in victim’s browser.
</Beyond XSS>
What can we do with a site that's
vulnerable to XSS?
> Cookie grabbing
> Phishing attacks
> Defacement (scary and kuwl)
What will we do <Demo Do>
● Allows you to sign in with just a cookie
● Sends the sensitive cookies insecurely
● Allows user-defined text to be parsed without
sanitizing
● Allows sending data out to unknown domains
>Lab set up
victims machine
http:142.xx.xxx.xxx/admin/
http:142.xx.xxx.xxx/user/
attack machine
http://159.xx.xxx.xxx/0x676f6861636b696e67/login
Requirements:
Chrome (or/and) firefox with edit this cookie plugin ☺
>Lets grab some cookies
A lot of sites will let you sign in with just a
cookie. which means you can take a cookie
from one machine, move it to another and sign
in without knowing the users username or
password.
The number of developers who ensure a cookie
only worked on the computer it was created on
by browser fingerprinting are 0.1 out of 10
> Cookie Monster
▪ In this demo, I show how a user impersonates an
administrator by Stealing their session using stored
XSS. Say attacker logins into a vulnerable web app
He crafts a XSS payload that returns victim’s cookies
to an attacker controlled server. When the
administrator who is a victim, logs in to his account
and views the vulnerable page the stored XSS
payload gets triggered in admin’s browser that send
his cookies to attacker.
>..contd
▪ Now, when admin logs in
▪ Now, modifying attacker session using the obtain
admin cookies gives admin user.
▪ (notes) check cookies on source code before and
after escalation
>Defacement
Since the web page has no element identifiers or names we have to
count them on the page , in the payload above if you look at the content
you will see a section of the title with a class name of content-header
the 0 after it means we are taking the first instance of this content-
header as part of our defacement , any other is ignored . without it it
will try action on all; the getElementsByTagName helps us tell the
application that within the content header there is a heading type 1 i.e.
h1 and we also just want the first instance of this heading otherwise it
will try loop through all of them. the innerHTML tells the script the
content we want to appear in the element we have drilled down to and
replace what is there :-) ..... all this just means i defaced you :-D changed
your content unwillingly.
>payload to use
<script>document.getElementsByClas
sName("content-
header")[0].getElementsByTagName("
h1")[0].innerHTML ="Hacked by
Munir";</script>
<explain the payload>
>phishing
Well guess what it’s not just cookies , your
credentials too if a payload is injected onto a page
will redirect all traffic once loaded to a fake login
page; once u enter any details on it it will take you
back to your original home in admin after which it
will have logged the actual username and
password in a text file. we have intentionally
named it fake however in a real life scenario it
wouldn't be as such this is just to help identify the
difference. to view captured password visit the link
below:
http://142.xx.xxx.xxx/fake/shehacks.txt
>payload
<script>window.location.href =
"http://142.xx.xxx.xxx/fake/";</script>
</Cure>
So how do u prevent this as:
> user : Nothing really you are doomed
> Developer: set a cookie and define it as
http only
>Encode output
>use x-xss protection header
this means a hacker cant access the cookie using document.cookie
injected input
encoded outputEncoded output
/>
Thank You
You may now ask questions

More Related Content

What's hot

Xss.e xopresentation from eXo SEA
Xss.e xopresentation from eXo SEAXss.e xopresentation from eXo SEA
Xss.e xopresentation from eXo SEA
Thuy_Dang
 
Cookie replay attack unit wise presentation
Cookie replay attack  unit wise presentationCookie replay attack  unit wise presentation
Cookie replay attack unit wise presentation
Nilu Desai
 
Session tracking In Java
Session tracking In JavaSession tracking In Java
Session tracking In Java
honeyvachharajani
 
CSRF Attack and Its Prevention technique in ASP.NET MVC
CSRF Attack and Its Prevention technique in ASP.NET MVCCSRF Attack and Its Prevention technique in ASP.NET MVC
CSRF Attack and Its Prevention technique in ASP.NET MVC
Suvash Shah
 
Practical Cyber Attacking Tutorial
Practical Cyber Attacking TutorialPractical Cyber Attacking Tutorial
Practical Cyber Attacking Tutorial
Yam Peleg
 
Not just popups- Jaffna meetup
Not just popups- Jaffna meetupNot just popups- Jaffna meetup
Not just popups- Jaffna meetup
Sivakumar Prakhash
 
Cookies: HTTP state management mechanism
Cookies: HTTP state management mechanismCookies: HTTP state management mechanism
Cookies: HTTP state management mechanism
Jivan Nepali
 
Xss mitigation php [Repaired]
Xss mitigation php [Repaired]Xss mitigation php [Repaired]
Xss mitigation php [Repaired]
Tinashe Makuti
 
Two scoops of Django - Security Best Practices
Two scoops of Django - Security Best PracticesTwo scoops of Django - Security Best Practices
Two scoops of Django - Security Best Practices
Spin Lai
 
Session Management & Cookies In Php
Session Management & Cookies In PhpSession Management & Cookies In Php
Session Management & Cookies In Php
Harit Kothari
 

What's hot (10)

Xss.e xopresentation from eXo SEA
Xss.e xopresentation from eXo SEAXss.e xopresentation from eXo SEA
Xss.e xopresentation from eXo SEA
 
Cookie replay attack unit wise presentation
Cookie replay attack  unit wise presentationCookie replay attack  unit wise presentation
Cookie replay attack unit wise presentation
 
Session tracking In Java
Session tracking In JavaSession tracking In Java
Session tracking In Java
 
CSRF Attack and Its Prevention technique in ASP.NET MVC
CSRF Attack and Its Prevention technique in ASP.NET MVCCSRF Attack and Its Prevention technique in ASP.NET MVC
CSRF Attack and Its Prevention technique in ASP.NET MVC
 
Practical Cyber Attacking Tutorial
Practical Cyber Attacking TutorialPractical Cyber Attacking Tutorial
Practical Cyber Attacking Tutorial
 
Not just popups- Jaffna meetup
Not just popups- Jaffna meetupNot just popups- Jaffna meetup
Not just popups- Jaffna meetup
 
Cookies: HTTP state management mechanism
Cookies: HTTP state management mechanismCookies: HTTP state management mechanism
Cookies: HTTP state management mechanism
 
Xss mitigation php [Repaired]
Xss mitigation php [Repaired]Xss mitigation php [Repaired]
Xss mitigation php [Repaired]
 
Two scoops of Django - Security Best Practices
Two scoops of Django - Security Best PracticesTwo scoops of Django - Security Best Practices
Two scoops of Django - Security Best Practices
 
Session Management & Cookies In Php
Session Management & Cookies In PhpSession Management & Cookies In Php
Session Management & Cookies In Php
 

Similar to Beyond xss (SheHacks Nairobi 2018)

Cross-site scripting (XSS) AttacksCross-site scripting (XSS) i.docx
Cross-site scripting (XSS) AttacksCross-site scripting (XSS) i.docxCross-site scripting (XSS) AttacksCross-site scripting (XSS) i.docx
Cross-site scripting (XSS) AttacksCross-site scripting (XSS) i.docx
mydrynan
 
Security testing
Security testingSecurity testing
Security testing
Khizra Sammad
 
Creating web sites using datalife engine
Creating web sites using datalife engineCreating web sites using datalife engine
Creating web sites using datalife engine
Japprend.Com
 
Owasp top 10 2013
Owasp top 10 2013Owasp top 10 2013
Owasp top 10 2013
Edouard de Lansalut
 
Cryptojacking - by Vishwaraj101
Cryptojacking - by Vishwaraj101Cryptojacking - by Vishwaraj101
Cryptojacking - by Vishwaraj101
v_raj
 
How not to suck at Cyber Security
How not to suck at Cyber SecurityHow not to suck at Cyber Security
How not to suck at Cyber Security
Chris Watts
 
eForensics Magazine - HOW TO STEAL GMAIL CREDENTIALS USING SE-TOOLKIT – A CA...
eForensics Magazine - HOW TO STEAL GMAIL CREDENTIALS  USING SE-TOOLKIT – A CA...eForensics Magazine - HOW TO STEAL GMAIL CREDENTIALS  USING SE-TOOLKIT – A CA...
eForensics Magazine - HOW TO STEAL GMAIL CREDENTIALS USING SE-TOOLKIT – A CA...
Kevin M. Moker, CFE, CISSP, ISSMP, CISM
 
BSides Columbus: Active Defense - Helping threat actors hack themselves!
BSides Columbus: Active Defense - Helping threat actors hack themselves!BSides Columbus: Active Defense - Helping threat actors hack themselves!
BSides Columbus: Active Defense - Helping threat actors hack themselves!
ThreatReel Podcast
 
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesW3 conf hill-html5-security-realities
W3 conf hill-html5-security-realities
Brad Hill
 
Top Ten Tips For Tenacious Defense In Asp.Net
Top Ten Tips For Tenacious Defense In Asp.NetTop Ten Tips For Tenacious Defense In Asp.Net
Top Ten Tips For Tenacious Defense In Asp.Net
alsmola
 
_Hackercool - September 2021.pdf
_Hackercool - September 2021.pdf_Hackercool - September 2021.pdf
_Hackercool - September 2021.pdf
ssuser5e1b13
 
Prevent hacking
Prevent hackingPrevent hacking
Prevent hacking
Viswanath Polaki
 
Web Security
Web SecurityWeb Security
Web Security
Supankar Banik
 
Andrews whitakrer lecture18-security.ppt
Andrews whitakrer lecture18-security.pptAndrews whitakrer lecture18-security.ppt
Andrews whitakrer lecture18-security.ppt
SilverGold16
 
2023-May.pptx
2023-May.pptx2023-May.pptx
2023-May.pptx
mnaeemuetcs
 
Basic ethical hacking for seminar presentation
Basic ethical hacking for seminar presentationBasic ethical hacking for seminar presentation
Basic ethical hacking for seminar presentation
Vipin Rawat @ daya
 
Crud tutorial en
Crud tutorial enCrud tutorial en
Crud tutorial en
forkgrown
 
Security Testing Training With Examples
Security Testing Training With ExamplesSecurity Testing Training With Examples
Security Testing Training With Examples
Alwin Thayyil
 
Ethical_Hacking_ppt
Ethical_Hacking_pptEthical_Hacking_ppt
Ethical_Hacking_ppt
Narayanan
 
ethical-hacking-18092013112412-ethical-hacking.ppt
ethical-hacking-18092013112412-ethical-hacking.pptethical-hacking-18092013112412-ethical-hacking.ppt
ethical-hacking-18092013112412-ethical-hacking.ppt
ricagip499
 

Similar to Beyond xss (SheHacks Nairobi 2018) (20)

Cross-site scripting (XSS) AttacksCross-site scripting (XSS) i.docx
Cross-site scripting (XSS) AttacksCross-site scripting (XSS) i.docxCross-site scripting (XSS) AttacksCross-site scripting (XSS) i.docx
Cross-site scripting (XSS) AttacksCross-site scripting (XSS) i.docx
 
Security testing
Security testingSecurity testing
Security testing
 
Creating web sites using datalife engine
Creating web sites using datalife engineCreating web sites using datalife engine
Creating web sites using datalife engine
 
Owasp top 10 2013
Owasp top 10 2013Owasp top 10 2013
Owasp top 10 2013
 
Cryptojacking - by Vishwaraj101
Cryptojacking - by Vishwaraj101Cryptojacking - by Vishwaraj101
Cryptojacking - by Vishwaraj101
 
How not to suck at Cyber Security
How not to suck at Cyber SecurityHow not to suck at Cyber Security
How not to suck at Cyber Security
 
eForensics Magazine - HOW TO STEAL GMAIL CREDENTIALS USING SE-TOOLKIT – A CA...
eForensics Magazine - HOW TO STEAL GMAIL CREDENTIALS  USING SE-TOOLKIT – A CA...eForensics Magazine - HOW TO STEAL GMAIL CREDENTIALS  USING SE-TOOLKIT – A CA...
eForensics Magazine - HOW TO STEAL GMAIL CREDENTIALS USING SE-TOOLKIT – A CA...
 
BSides Columbus: Active Defense - Helping threat actors hack themselves!
BSides Columbus: Active Defense - Helping threat actors hack themselves!BSides Columbus: Active Defense - Helping threat actors hack themselves!
BSides Columbus: Active Defense - Helping threat actors hack themselves!
 
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesW3 conf hill-html5-security-realities
W3 conf hill-html5-security-realities
 
Top Ten Tips For Tenacious Defense In Asp.Net
Top Ten Tips For Tenacious Defense In Asp.NetTop Ten Tips For Tenacious Defense In Asp.Net
Top Ten Tips For Tenacious Defense In Asp.Net
 
_Hackercool - September 2021.pdf
_Hackercool - September 2021.pdf_Hackercool - September 2021.pdf
_Hackercool - September 2021.pdf
 
Prevent hacking
Prevent hackingPrevent hacking
Prevent hacking
 
Web Security
Web SecurityWeb Security
Web Security
 
Andrews whitakrer lecture18-security.ppt
Andrews whitakrer lecture18-security.pptAndrews whitakrer lecture18-security.ppt
Andrews whitakrer lecture18-security.ppt
 
2023-May.pptx
2023-May.pptx2023-May.pptx
2023-May.pptx
 
Basic ethical hacking for seminar presentation
Basic ethical hacking for seminar presentationBasic ethical hacking for seminar presentation
Basic ethical hacking for seminar presentation
 
Crud tutorial en
Crud tutorial enCrud tutorial en
Crud tutorial en
 
Security Testing Training With Examples
Security Testing Training With ExamplesSecurity Testing Training With Examples
Security Testing Training With Examples
 
Ethical_Hacking_ppt
Ethical_Hacking_pptEthical_Hacking_ppt
Ethical_Hacking_ppt
 
ethical-hacking-18092013112412-ethical-hacking.ppt
ethical-hacking-18092013112412-ethical-hacking.pptethical-hacking-18092013112412-ethical-hacking.ppt
ethical-hacking-18092013112412-ethical-hacking.ppt
 

Recently uploaded

GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 

Recently uploaded (20)

GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 

Beyond xss (SheHacks Nairobi 2018)

  • 3. Name? Munir Njiru Do? Cyber security Consultant Owasp Rep kenya Shallow Web > alien-within.com Member > Africahackon twitter: @muntopia
  • 4. Name: Judy Ngure DO?: Senior QA @ scan group Jr.Researcher: IBM Africa Member: shehacks DevOps twitter: @codebasher
  • 5. >what to cover > What is xss > Types of xss > Just because i have an xss in my web app, does it make my web app risky to use? > Oooh i have an xss in my web app how can i exploit it? > Demos > protections > Q& A
  • 6. <Title> XSS</Title> What is this xss and what does it entail? browser attacker I don’t believe I have… hey alert(document.cookie ); I feel drawn to you for some reason; must be the javascript. Hey, I like your hair…where’d you get it done…. Met my friend alert(document.cookie); ? Hey, I really wanna know that girl, mind working your magic.
  • 7. <Theory>Types</theory> Reflected ▪ where the malicious string originates from the victim's request Stored ▪ where the malicious string originates from the website's database. DOM ▪ where the vulnerability is in the client-side code rather than the server-side code.
  • 8. >Simple Demo ▪ Simple xss Reflected : Input the infamous payload <script>alert(“hey am a reflected axss”);</script> to confirm XSS. http://142.xx.xxx.xxx/admin/home.php/"onmouseover="alert(docume nt.cookie);" Stored: Another example of XSS, but this time it ll be Stored XSS, where the XSS payload is saved and executed when the saved payload is executed in victim’s browser.
  • 9. </Beyond XSS> What can we do with a site that's vulnerable to XSS? > Cookie grabbing > Phishing attacks > Defacement (scary and kuwl)
  • 10. What will we do <Demo Do> ● Allows you to sign in with just a cookie ● Sends the sensitive cookies insecurely ● Allows user-defined text to be parsed without sanitizing ● Allows sending data out to unknown domains
  • 11. >Lab set up victims machine http:142.xx.xxx.xxx/admin/ http:142.xx.xxx.xxx/user/ attack machine http://159.xx.xxx.xxx/0x676f6861636b696e67/login Requirements: Chrome (or/and) firefox with edit this cookie plugin ☺
  • 12. >Lets grab some cookies A lot of sites will let you sign in with just a cookie. which means you can take a cookie from one machine, move it to another and sign in without knowing the users username or password. The number of developers who ensure a cookie only worked on the computer it was created on by browser fingerprinting are 0.1 out of 10
  • 13. > Cookie Monster ▪ In this demo, I show how a user impersonates an administrator by Stealing their session using stored XSS. Say attacker logins into a vulnerable web app He crafts a XSS payload that returns victim’s cookies to an attacker controlled server. When the administrator who is a victim, logs in to his account and views the vulnerable page the stored XSS payload gets triggered in admin’s browser that send his cookies to attacker.
  • 14. >..contd ▪ Now, when admin logs in ▪ Now, modifying attacker session using the obtain admin cookies gives admin user. ▪ (notes) check cookies on source code before and after escalation
  • 15. >Defacement Since the web page has no element identifiers or names we have to count them on the page , in the payload above if you look at the content you will see a section of the title with a class name of content-header the 0 after it means we are taking the first instance of this content- header as part of our defacement , any other is ignored . without it it will try action on all; the getElementsByTagName helps us tell the application that within the content header there is a heading type 1 i.e. h1 and we also just want the first instance of this heading otherwise it will try loop through all of them. the innerHTML tells the script the content we want to appear in the element we have drilled down to and replace what is there :-) ..... all this just means i defaced you :-D changed your content unwillingly.
  • 17. >phishing Well guess what it’s not just cookies , your credentials too if a payload is injected onto a page will redirect all traffic once loaded to a fake login page; once u enter any details on it it will take you back to your original home in admin after which it will have logged the actual username and password in a text file. we have intentionally named it fake however in a real life scenario it wouldn't be as such this is just to help identify the difference. to view captured password visit the link below: http://142.xx.xxx.xxx/fake/shehacks.txt
  • 19. </Cure> So how do u prevent this as: > user : Nothing really you are doomed > Developer: set a cookie and define it as http only >Encode output >use x-xss protection header this means a hacker cant access the cookie using document.cookie injected input encoded outputEncoded output
  • 20. /> Thank You You may now ask questions