SlideShare une entreprise Scribd logo
1  sur  18
Predrag Cujanović




Kontakt
• mail: predrag@cujanovic.com
• blog: http://www.cujanovic.com
• tw: http://www.twitter.com/cujanovic
• fb: http://www.facebook.com/predrag.cujanovic
Sadržaj:

• Cross side scripting (XSS) napad
• SQL injection (SQLi) napad
• Insecure cryptographic storage
• Primeri
Cross side scripting (XSS) napad

• Šta je XSS napad?
• Tipovi XSS napada
• Opasnost XSS napada
• Kako sprečiti XSS napad?
Šta je XSS napad?
Tipovi XSS napada
• Non-Persistent (Reflected)
• Persistent (Stored)
• DOM Based
Opasnost XSS napada
XSS Shell
Opasnost XSS napada
Cookie stealing




Phishing
Kako sprečiti XSS napad?

• Filtriranjem podataka preko već predefinisanih php
  funkcija:

 strip_tags, htmlspecialchars, htmlentities

• Izbegavati pisanje sopstvenih funkcija samo za ovu
  namenu
SQL injection (SQLi) napad

 Šta je SQLi napad?
 Tipovi SQLi napada
 Opasnost SQLi napada
 Kako sprečiti SQLi napad?
Šta je SQLi napad?
Tipovi SQLi napada

Incorrectly filtered escape characters
(SELECT * FROM users WHERE name = '' OR '1'='1' -- ';)


Incorrect type handling
(SELECT * FROM userinfo WHERE id=1;DROP TABLE users;)


Blind SQL injection
(SELECT booktitle FROM booklist WHERE bookId = 'OOk14cd' AND '1'='1';)


Time Based SQL injection
(download_key=1' AND 6424=BENCHMARK(5000000,MD5(CHAR(102,100,78,99))) AND 'uzOQ'='uzOQ)
Opasnost SQLi napada

 Pristup podacima u bazi (UNION SELECT 1,2,3,4--)

 Izmena, brisanje podataka u bazi – DROP users;

 Čitanje fajlova - load_file('/etc/passwd') ili
load_file(0x2f6574632f706173737764) funkcija

 Pravnjenje novih fajlova - INTO OUTFILE
 '/var/www/victim.com/shell.php'
Kako sprečiti SQLi napad?


 mysql_real_escape_string funkcija

 is_numeric funkcija

 cast to int – (int)
Insecure cryptographic storage
Insecure cryptographic storage

0. koristiti neki hash algoritam

1. ne korisiti zastrarele hash algoritme
 (md5 je zvanično mrtav)

2. korisiti salt, najbolje ih ne čuvati u bazi
 (primer Wordpress)

3. korisiti dva različita hash algoritma
 (sha1($salt.(des($salt.$pass.$salt))))
Insecure cryptographic storage
      oclHashcat-plus
Hvala na pažnji :)



Pitanja?

Contenu connexe

En vedette

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

En vedette (20)

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 

XSS SQLi sigurnost

  • 1. Predrag Cujanović Kontakt • mail: predrag@cujanovic.com • blog: http://www.cujanovic.com • tw: http://www.twitter.com/cujanovic • fb: http://www.facebook.com/predrag.cujanovic
  • 2. Sadržaj: • Cross side scripting (XSS) napad • SQL injection (SQLi) napad • Insecure cryptographic storage • Primeri
  • 3. Cross side scripting (XSS) napad • Šta je XSS napad? • Tipovi XSS napada • Opasnost XSS napada • Kako sprečiti XSS napad?
  • 4. Šta je XSS napad?
  • 5. Tipovi XSS napada • Non-Persistent (Reflected) • Persistent (Stored) • DOM Based
  • 7.
  • 8. Opasnost XSS napada Cookie stealing Phishing
  • 9. Kako sprečiti XSS napad? • Filtriranjem podataka preko već predefinisanih php funkcija: strip_tags, htmlspecialchars, htmlentities • Izbegavati pisanje sopstvenih funkcija samo za ovu namenu
  • 10. SQL injection (SQLi) napad  Šta je SQLi napad?  Tipovi SQLi napada  Opasnost SQLi napada  Kako sprečiti SQLi napad?
  • 11. Šta je SQLi napad?
  • 12. Tipovi SQLi napada Incorrectly filtered escape characters (SELECT * FROM users WHERE name = '' OR '1'='1' -- ';) Incorrect type handling (SELECT * FROM userinfo WHERE id=1;DROP TABLE users;) Blind SQL injection (SELECT booktitle FROM booklist WHERE bookId = 'OOk14cd' AND '1'='1';) Time Based SQL injection (download_key=1' AND 6424=BENCHMARK(5000000,MD5(CHAR(102,100,78,99))) AND 'uzOQ'='uzOQ)
  • 13. Opasnost SQLi napada  Pristup podacima u bazi (UNION SELECT 1,2,3,4--)  Izmena, brisanje podataka u bazi – DROP users;  Čitanje fajlova - load_file('/etc/passwd') ili load_file(0x2f6574632f706173737764) funkcija  Pravnjenje novih fajlova - INTO OUTFILE '/var/www/victim.com/shell.php'
  • 14. Kako sprečiti SQLi napad?  mysql_real_escape_string funkcija  is_numeric funkcija  cast to int – (int)
  • 16. Insecure cryptographic storage 0. koristiti neki hash algoritam 1. ne korisiti zastrarele hash algoritme (md5 je zvanično mrtav) 2. korisiti salt, najbolje ih ne čuvati u bazi (primer Wordpress) 3. korisiti dva različita hash algoritma (sha1($salt.(des($salt.$pass.$salt))))
  • 18. Hvala na pažnji :) Pitanja?