SlideShare a Scribd company logo
Github Security
n|u - The Open security community
Chennai Meet
Presenter : Vinothkumar
Date : 27/04/2019
About Me
Application security engineer @ Freshworks, Inc.
Blogger @ https://tutorgeeks.blogspot.com
Tweet @vinothpkumar
Github @ https://github.com/tutorgeeks
Agenda for the session
1. What is Github
2. Using Github / Github Gist search for bug bounty hunting
3. Securing Wiki
4. Securing Forked repos
5. Security Audit log
6. Post commit security check using Gitrob
7. Pre commit security check using Git Secrets
8. Github security best practises
1.What is Github
● GitHub is a code hosting platform for collaboration and version control.
● GitHub lets you (and others) work together on projects.
● 28 million users and 57 million repositories making it the largest host of source code
in the world.
● Parent company : Microsoft (2018–present)
● Written in Ruby
Git Cheat Sheet
2.Using Github search for bug bounty hunting
Github is a great place to look for credentials and private API keys. Here’s a list of a few
items that you could use to find information about your target.
● “example.com” API_key
● “example.com” secret_key
● “example.com” aws_key
● “example.com” Password
● “example.com” FTP
● “example.com” login
● “example.com” github_token
PayTM
“paytm.com “ “password”
Bounty awarded : Rs.21200
Status : Fixed
https://twitter.com/s4thi5h_infosec/status/1067004873663639552
Snapchat
Bounty hunter Th3G3nt3lman was awarded $15,000 after discovering and reporting a
sensitive auth token that was accidentally posted by a Snapchat software engineer.
https://medium.com/@cosmobugbounty/bounty-of-the-week-15-000-snapchat-leak-af38f882d3ac
Github security   bug bounty hunting
Search Github Gist [ Mostly Ignored ]
GitHub Gist is used instantly share code, notes, and snippets.
● Helps to create public and secret gist.
● Secret gist is only protected by a token. Use with caution while creating secret gist
since developer could paste the secret gist public along with the token.
site:gist.github.com “companyname”
Zomato - Mandate 2FA
● Zomato’s Github org was compromised using the leaked password of 000webhost.
● Attacker used the credential to login into Zomato Github org account [ 2FA is not
implemented at the time of the hack]
● Attacker looked at the code base and found a RCE vulnerability and exploited it.
● Zomato acknowledged the fact that they could’ve easily avoided this issue if they had
implemented 2FA.
● Avoid using the same credential in all websites.
https://www.zomato.com/blog/security-update-what-really-happened-and-what
3.Securing Wiki
GitHub Org accounts may contain world-editable wiki pages :
https://www.smeegesec.com/2019/03/auditing-github-repo-wikis-for-fun-and.html
Python script to check GitHub accounts for world-editable wiki pages : https://github.com/SmeegeSec/GitHub-Wiki-Auditor
4.Securing Forked repos
A fork is a copy of a repository. Forking a repository allows you to freely experiment with
changes without affecting the original project.
● Forked repositories are public by default.
● Watch out for sensitive PII in forked repo in commits / Pull request.
Instead of forking the repo, create a private repo with the forked repo contents.
5.Security Audit log
● The audit log allows organization admins to quickly review the actions performed by
members of your organization. It includes details such as who performed the action,
what the action was, and when it was performed.
● Logs are useful for debugging and internal and external compliance.
https://help.github.com/en/articles/reviewing-the-audit-log-for-your-organization
6.Gitrob [ post commit checks ]
● Reconnaissance tool for GitHub organizations
● It helps to find potentially sensitive files pushed to public repositories on Github.
● Gitrob will clone repositories belonging to a user or organization down to a
configurable depth and iterate through the commit history and flag files that match
signatures for potentially sensitive files.
● The findings will be presented through a web interface for easy browsing and
analysis.
https://github.com/michenriksen/gitrob
Demo:
7.Git Secrets [ pre commit checks ]
Prevents you from committing secrets and credentials into git repositories
● git secrets --scan [-r|--recursive] [--cached] [--no-index] [--untracked] [<files>...]
● git secrets --scan-history
● git secrets --install [-f|--force] [<target-directory>]
● git secrets --list [--global]
● git secrets --add [-a|--allowed] [-l|--literal] [--global] <pattern>
● git secrets --add-provider [--global] <command> [arguments...]
● git secrets --register-aws [--global]
● git secrets --aws-provider [<credentials-file>]
https://github.com/awslabs/git-secrets
Demo:
8.Github security best practises
1. Never store credentials as code/config in GitHub.
2. Remove Sensitive data in your files and GitHub history
3. Tightly Control Access
4. Add a SECURITY.md file
5. Validate your GitHub Applications Carefully
6. Add Security Testing to PRs
7. Use the Right GitHub Offering for your Security Needs
8. Rotate SSH keys and Personal Access Tokens
9. Create New Projects with Security in Mind
10. Audit the Code/apps you use into GitHub
Reference: https://snyk.io/blog/ten-git-hub-security-best-practices/
Github security   bug bounty hunting

More Related Content

PPTX
G suite misconfigurations- Null meet, Chennai
PDF
Develop Hip APIs and Apps with Spring Boot and Angular - Connect.Tech 2017
PDF
Yet another talk on bug bounty
PDF
Developing PWAs and Mobile Apps with Ionic, Angular, and JHipster - Devoxx Mo...
PDF
Front End Development for Back End Developers - Denver Startup Week 2017
PDF
REST API Pentester's perspective
PDF
Front End Development for Back End Java Developers - Jfokus 2020
PDF
Testing iOS apps without jailbreak in 2018
G suite misconfigurations- Null meet, Chennai
Develop Hip APIs and Apps with Spring Boot and Angular - Connect.Tech 2017
Yet another talk on bug bounty
Developing PWAs and Mobile Apps with Ionic, Angular, and JHipster - Devoxx Mo...
Front End Development for Back End Developers - Denver Startup Week 2017
REST API Pentester's perspective
Front End Development for Back End Java Developers - Jfokus 2020
Testing iOS apps without jailbreak in 2018

What's hot (20)

PDF
Reactive Java Microservices with Spring Boot and JHipster - Denver JUG 2021
PDF
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Utah JUG...
PDF
Writing vuln reports that maximize payouts - Nullcon 2016
PDF
Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...
PDF
Approaching the unknown - Windows Phone application security assessment guide
PPTX
Bug Bounty #Defconlucknow2016
PDF
Firebase Auth Tutorial
PPTX
SgCodeJam24 Workshop
PDF
Jesse Siegel Capstone Project
PDF
Intro to Web Development Using Python and Django
PPTX
From Selenium to Appium: How Hard Can It Be? by Sergio Neves Barros
PPTX
Selenium to Appium - how hard can it be (SauceCon).
PDF
Mobile Development with Ionic, React Native, and JHipster - AllTheTalks 2020
PDF
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
PDF
Work with Developers for Fun and Progress - AppSec California
PDF
VyAPI - A Modern Cloud Based Vulnerable Android App (Presented at BSides Delh...
PPTX
React Native
PPTX
Kludges and PHP. Why Should You Use a WAF?
PDF
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx France 2016
PPTX
Getting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Reactive Java Microservices with Spring Boot and JHipster - Denver JUG 2021
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Utah JUG...
Writing vuln reports that maximize payouts - Nullcon 2016
Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...
Approaching the unknown - Windows Phone application security assessment guide
Bug Bounty #Defconlucknow2016
Firebase Auth Tutorial
SgCodeJam24 Workshop
Jesse Siegel Capstone Project
Intro to Web Development Using Python and Django
From Selenium to Appium: How Hard Can It Be? by Sergio Neves Barros
Selenium to Appium - how hard can it be (SauceCon).
Mobile Development with Ionic, React Native, and JHipster - AllTheTalks 2020
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
Work with Developers for Fun and Progress - AppSec California
VyAPI - A Modern Cloud Based Vulnerable Android App (Presented at BSides Delh...
React Native
Kludges and PHP. Why Should You Use a WAF?
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx France 2016
Getting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Ad

Similar to Github security bug bounty hunting (20)

PDF
2022 APIsecure_Securing API Tokens on Github
PPTX
Difference between Github vs Gitlab vs Bitbucket
PPTX
Getting Started with GitHub Security.pptx
PPTX
Git and Github.pptx
PDF
Preventing Code Leaks & Other Critical Security Risks from Code
PDF
Introduction to Github Actions
PDF
Introduction to Github Actions
PPTX
GitHub is a cloud-based platform built around Git.
PPTX
Online Computer Network Security Assignment Help
PPTX
Git Series - Part 1
PPTX
Introduction to git and Github
PPTX
BitBucket presentation
PPTX
IBM Agile Engineering Summit 18: How to Integrate IBM Rational® Team Concert ...
PDF
Git and GitHub Info Session
PPTX
Git and GitHub workshop of GDG on Campus UNSTPB
PPTX
Git and Github Training in Bangalore From myTectra
PPTX
Git step by step
PPTX
Gerrit Code Review with GitHub plugin
PPTX
Git and GitHub Presentation of GDG on Campus UNSTPB
PDF
Git/Gerrit with TeamForge
2022 APIsecure_Securing API Tokens on Github
Difference between Github vs Gitlab vs Bitbucket
Getting Started with GitHub Security.pptx
Git and Github.pptx
Preventing Code Leaks & Other Critical Security Risks from Code
Introduction to Github Actions
Introduction to Github Actions
GitHub is a cloud-based platform built around Git.
Online Computer Network Security Assignment Help
Git Series - Part 1
Introduction to git and Github
BitBucket presentation
IBM Agile Engineering Summit 18: How to Integrate IBM Rational® Team Concert ...
Git and GitHub Info Session
Git and GitHub workshop of GDG on Campus UNSTPB
Git and Github Training in Bangalore From myTectra
Git step by step
Gerrit Code Review with GitHub plugin
Git and GitHub Presentation of GDG on Campus UNSTPB
Git/Gerrit with TeamForge
Ad

Recently uploaded (20)

PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PPTX
master seminar digital applications in india
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PDF
Classroom Observation Tools for Teachers
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
PDF
Complications of Minimal Access Surgery at WLH
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
PPTX
Cell Structure & Organelles in detailed.
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Yogi Goddess Pres Conference Studio Updates
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Updated Idioms and Phrasal Verbs in English subject
PPTX
UNIT III MENTAL HEALTH NURSING ASSESSMENT
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
master seminar digital applications in india
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Chinmaya Tiranga quiz Grand Finale.pdf
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
Classroom Observation Tools for Teachers
2.FourierTransform-ShortQuestionswithAnswers.pdf
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
Complications of Minimal Access Surgery at WLH
LDMMIA Reiki Yoga Finals Review Spring Summer
Cell Structure & Organelles in detailed.
Final Presentation General Medicine 03-08-2024.pptx
Yogi Goddess Pres Conference Studio Updates
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Anesthesia in Laparoscopic Surgery in India
Updated Idioms and Phrasal Verbs in English subject
UNIT III MENTAL HEALTH NURSING ASSESSMENT

Github security bug bounty hunting

  • 1. Github Security n|u - The Open security community Chennai Meet Presenter : Vinothkumar Date : 27/04/2019
  • 2. About Me Application security engineer @ Freshworks, Inc. Blogger @ https://tutorgeeks.blogspot.com Tweet @vinothpkumar Github @ https://github.com/tutorgeeks
  • 3. Agenda for the session 1. What is Github 2. Using Github / Github Gist search for bug bounty hunting 3. Securing Wiki 4. Securing Forked repos 5. Security Audit log 6. Post commit security check using Gitrob 7. Pre commit security check using Git Secrets 8. Github security best practises
  • 4. 1.What is Github ● GitHub is a code hosting platform for collaboration and version control. ● GitHub lets you (and others) work together on projects. ● 28 million users and 57 million repositories making it the largest host of source code in the world. ● Parent company : Microsoft (2018–present) ● Written in Ruby
  • 6. 2.Using Github search for bug bounty hunting Github is a great place to look for credentials and private API keys. Here’s a list of a few items that you could use to find information about your target. ● “example.com” API_key ● “example.com” secret_key ● “example.com” aws_key ● “example.com” Password ● “example.com” FTP ● “example.com” login ● “example.com” github_token
  • 7. PayTM “paytm.com “ “password” Bounty awarded : Rs.21200 Status : Fixed https://twitter.com/s4thi5h_infosec/status/1067004873663639552
  • 8. Snapchat Bounty hunter Th3G3nt3lman was awarded $15,000 after discovering and reporting a sensitive auth token that was accidentally posted by a Snapchat software engineer. https://medium.com/@cosmobugbounty/bounty-of-the-week-15-000-snapchat-leak-af38f882d3ac
  • 10. Search Github Gist [ Mostly Ignored ] GitHub Gist is used instantly share code, notes, and snippets. ● Helps to create public and secret gist. ● Secret gist is only protected by a token. Use with caution while creating secret gist since developer could paste the secret gist public along with the token. site:gist.github.com “companyname”
  • 11. Zomato - Mandate 2FA ● Zomato’s Github org was compromised using the leaked password of 000webhost. ● Attacker used the credential to login into Zomato Github org account [ 2FA is not implemented at the time of the hack] ● Attacker looked at the code base and found a RCE vulnerability and exploited it. ● Zomato acknowledged the fact that they could’ve easily avoided this issue if they had implemented 2FA. ● Avoid using the same credential in all websites. https://www.zomato.com/blog/security-update-what-really-happened-and-what
  • 12. 3.Securing Wiki GitHub Org accounts may contain world-editable wiki pages : https://www.smeegesec.com/2019/03/auditing-github-repo-wikis-for-fun-and.html Python script to check GitHub accounts for world-editable wiki pages : https://github.com/SmeegeSec/GitHub-Wiki-Auditor
  • 13. 4.Securing Forked repos A fork is a copy of a repository. Forking a repository allows you to freely experiment with changes without affecting the original project. ● Forked repositories are public by default. ● Watch out for sensitive PII in forked repo in commits / Pull request. Instead of forking the repo, create a private repo with the forked repo contents.
  • 14. 5.Security Audit log ● The audit log allows organization admins to quickly review the actions performed by members of your organization. It includes details such as who performed the action, what the action was, and when it was performed. ● Logs are useful for debugging and internal and external compliance. https://help.github.com/en/articles/reviewing-the-audit-log-for-your-organization
  • 15. 6.Gitrob [ post commit checks ] ● Reconnaissance tool for GitHub organizations ● It helps to find potentially sensitive files pushed to public repositories on Github. ● Gitrob will clone repositories belonging to a user or organization down to a configurable depth and iterate through the commit history and flag files that match signatures for potentially sensitive files. ● The findings will be presented through a web interface for easy browsing and analysis. https://github.com/michenriksen/gitrob Demo:
  • 16. 7.Git Secrets [ pre commit checks ] Prevents you from committing secrets and credentials into git repositories ● git secrets --scan [-r|--recursive] [--cached] [--no-index] [--untracked] [<files>...] ● git secrets --scan-history ● git secrets --install [-f|--force] [<target-directory>] ● git secrets --list [--global] ● git secrets --add [-a|--allowed] [-l|--literal] [--global] <pattern> ● git secrets --add-provider [--global] <command> [arguments...] ● git secrets --register-aws [--global] ● git secrets --aws-provider [<credentials-file>] https://github.com/awslabs/git-secrets Demo:
  • 17. 8.Github security best practises 1. Never store credentials as code/config in GitHub. 2. Remove Sensitive data in your files and GitHub history 3. Tightly Control Access 4. Add a SECURITY.md file 5. Validate your GitHub Applications Carefully 6. Add Security Testing to PRs 7. Use the Right GitHub Offering for your Security Needs 8. Rotate SSH keys and Personal Access Tokens 9. Create New Projects with Security in Mind 10. Audit the Code/apps you use into GitHub Reference: https://snyk.io/blog/ten-git-hub-security-best-practices/

Editor's Notes