├── _posts
├── README.md
├── 2022-03-01-issue2.md
├── 2022-03-01-issue1.md
└── resources
│ ├── 2022-02-15-vulnerable-code-39.md
│ ├── 2022-02-15-vulnerable-code-23.md
│ ├── 2022-02-15-vulnerable-code-38.md
│ ├── 2022-02-15-vulnerable-code-36.md
│ ├── 2022-02-15-vulnerable-code-40.md
│ ├── 2022-02-15-vulnerable-code-45.md
│ ├── 2022-02-15-vulnerable-code-43.md
│ ├── 2022-02-15-vulnerable-code-14.md
│ ├── 2022-02-15-vulnerable-code-10.md
│ ├── 2022-02-15-vulnerable-code-13.md
│ ├── 2022-02-15-vulnerable-code-24.md
│ ├── 2022-02-15-vulnerable-code-33.md
│ ├── 2022-02-15-vulnerable-code-08.md
│ ├── 2022-02-15-vulnerable-code-04.md
│ ├── 2022-02-15-vulnerable-code-16.md
│ ├── 2022-02-15-vulnerable-code-34.md
│ ├── 2022-02-15-vulnerable-code-32.md
│ ├── 2022-02-15-vulnerable-code-26.md
│ ├── 2022-02-15-vulnerable-code-01.md
│ ├── 2022-02-15-vulnerable-code-30.md
│ ├── 2022-02-15-vulnerable-code-28.md
│ ├── 2022-02-15-vulnerable-code-05.md
│ ├── 2022-02-15-vulnerable-code-29.md
│ ├── 2022-02-15-vulnerable-code-17.md
│ ├── 2022-02-15-vulnerable-code-11.md
│ ├── 2022-02-15-vulnerable-code-37.md
│ ├── 2022-02-15-vulnerable-code-20.md
│ ├── 2022-02-15-vulnerable-code-12.md
│ ├── 2022-02-15-vulnerable-code-35.md
│ ├── 2022-02-15-vulnerable-code-06.md
│ ├── 2022-02-15-vulnerable-code-22.md
│ ├── 2022-02-15-vulnerable-code-41.md
│ ├── 2022-02-15-vulnerable-code-44.md
│ ├── 2022-02-15-vulnerable-code-07.md
│ ├── 2022-02-15-vulnerable-code-21.md
│ ├── 2022-02-15-vulnerable-code-02.md
│ ├── 2022-02-15-vulnerable-code-19.md
│ ├── 2022-02-15-vulnerable-code-42.md
│ ├── 2022-02-15-vulnerable-code-18.md
│ ├── 2022-02-15-vulnerable-code-09.md
│ ├── 2022-02-15-vulnerable-code-03.md
│ ├── 2022-02-15-vulnerable-code-15.md
│ ├── 2022-02-15-vulnerable-code-31.md
│ ├── 2022-02-15-vulnerable-code-27.md
│ ├── 2022-02-15-vulnerable-code-25.md
│ ├── 2022-02-09-path-traversal-file-upload.md
│ ├── 2022-02-09-feroxbuster-explained.md
│ ├── 2022-02-09-rustscan-portscanner.md
│ ├── 2022-02-10-xxe-in-json.md
│ ├── 2022-02-09-htmli-to-cloud-ssrf.md
│ ├── 2022-02-09-bypassing-ios-biometrics.md
│ ├── 2022-02-11-zip-slip-file-upload.md
│ └── 2022-02-09-bypassing-filters-visual-spoofing.md
├── CNAME
├── _site
├── robots.txt
├── assets
│ └── images
│ │ ├── pwn
│ │ └── pwn.png
│ │ ├── expdev
│ │ └── expdev.png
│ │ ├── site_data
│ │ ├── avatar.png
│ │ ├── logo.png
│ │ ├── favicon.ico.png
│ │ ├── thumbnail.jpg
│ │ ├── favicon-16x16.png
│ │ └── favicon-32x32.png
│ │ └── binary-exploitation
│ │ └── binexp.png
├── resources
│ ├── vulnerable-code-23.md
│ ├── vulnerable-code-14.md
│ ├── vulnerable-code-10.md
│ ├── vulnerable-code-13.md
│ ├── vulnerable-code-24.md
│ ├── vulnerable-code-8.md
│ ├── vulnerable-code-4.md
│ ├── vulnerable-code-16.md
│ ├── vulnerable-code-1.md
│ ├── vulnerable-code-11.md
│ ├── vulnerable-code-5.md
│ ├── vulnerable-code-17.md
│ ├── vulnerable-code-12.md
│ ├── vulnerable-code-20.md
│ ├── vulnerable-code-22.md
│ ├── vulnerable-code-6.md
│ ├── vulnerable-code-7.md
│ ├── vulnerable-code-21.md
│ ├── vulnerable-code-2.md
│ ├── vulnerable-code-19.md
│ ├── vulnerable-code-18.md
│ ├── vulnerable-code-9.md
│ ├── vulnerable-code-3.md
│ ├── vulnerable-code-15.md
│ ├── vulnerable-code-25.md
│ ├── path-traversal-file-upload.md
│ ├── feroxbuster-explained.md
│ ├── rustscan-portscanner.md
│ ├── xxe-in-json.md
│ ├── htmli-to-cloud-ssrf.md
│ ├── zip-slip-file-upload.md
│ ├── bypassing-ios-biometrics.md
│ └── bypassing-filters-visual-spoofing.md
├── banner.js
└── minimal-mistakes-jekyll.gemspec
├── index.html
├── _sass
├── minimal-mistakes
│ ├── vendor
│ │ ├── susy
│ │ │ ├── _su.scss
│ │ │ ├── _susy.scss
│ │ │ ├── plugins
│ │ │ │ ├── _svg-grid.scss
│ │ │ │ └── svg-grid
│ │ │ │ │ ├── _prefix.scss
│ │ │ │ │ ├── _svg-unprefix.scss
│ │ │ │ │ ├── _svg-settings.scss
│ │ │ │ │ └── _svg-grid-math.scss
│ │ │ ├── _susy-prefix.scss
│ │ │ └── susy
│ │ │ │ └── _unprefix.scss
│ │ └── breakpoint
│ │ │ ├── _no-query.scss
│ │ │ ├── parsers
│ │ │ ├── single
│ │ │ │ └── _default.scss
│ │ │ ├── double
│ │ │ │ ├── _default.scss
│ │ │ │ ├── _double-string.scss
│ │ │ │ └── _default-pair.scss
│ │ │ ├── triple
│ │ │ │ └── _default.scss
│ │ │ ├── _single.scss
│ │ │ ├── _triple.scss
│ │ │ ├── _resolution.scss
│ │ │ ├── _double.scss
│ │ │ └── resolution
│ │ │ │ └── _resolution.scss
│ │ │ └── _settings.scss
│ ├── skins
│ │ ├── _default.scss
│ │ ├── _mint.scss
│ │ ├── _air.scss
│ │ ├── _dirt.scss
│ │ ├── _dark.scss
│ │ ├── _aqua.scss
│ │ ├── _contrast.scss
│ │ ├── _sunrise.scss
│ │ ├── _neon.scss
│ │ └── _plum.scss
│ ├── _animations.scss
│ ├── _tables.scss
│ ├── _footer.scss
│ └── _masthead.scss
└── minimal-mistakes.scss
├── assets
├── images
│ ├── htb
│ │ └── htb.png
│ ├── pwn
│ │ └── pwn.png
│ ├── expdev
│ │ └── expdev.png
│ ├── site_data
│ │ ├── ccc.png
│ │ ├── code.png
│ │ ├── logo.png
│ │ ├── avatar.png
│ │ ├── thumbnail.jpg
│ │ ├── favicon.ico.png
│ │ ├── favicon-16x16.png
│ │ └── favicon-32x32.png
│ ├── redteam
│ │ └── redteam.png
│ └── binary-exploitation
│ │ └── binexp.png
├── css
│ └── main.scss
└── js
│ ├── lunr
│ └── lunr-store.js
│ └── plugins
│ └── jquery.greedy-navigation.js
├── _includes
├── footer
│ └── custom.html
├── analytics-providers
│ ├── custom.html
│ ├── google-universal.html
│ ├── google-gtag.html
│ └── google.html
├── comments-providers
│ ├── custom.html
│ ├── facebook.html
│ ├── scripts.html
│ ├── utterances.html
│ ├── disqus.html
│ ├── discourse.html
│ ├── staticman.html
│ └── staticman_v2.html
├── posts-tag.html
├── posts-category.html
├── page__hero_video.html
├── page__taxonomy.html
├── browser-upgrade.html
├── author-profile-custom-links.html
├── toc
├── figure
├── head
│ └── custom.html
├── search
│ ├── lunr-search-scripts.html
│ ├── google-search-scripts.html
│ ├── search_form.html
│ └── algolia-search-scripts.html
├── analytics.html
├── skip-links.html
├── documents-collection.html
├── read-time.html
├── sidebar.html
├── post_pagination.html
├── video
├── nav_list
├── scripts.html
├── head.html
├── gallery
├── comment.html
├── footer.html
├── tag-list.html
├── group-by-array
├── category-list.html
├── feature_row
├── social-share.html
├── breadcrumbs.html
└── masthead.html
├── _pages
├── cve.md
├── pwn.md
├── htb.md
├── tag-archive.md
├── expdev.md
├── resources.md
├── offsec.md
├── category-archive.md
└── 404.md
├── Gemfile
├── _layouts
├── category.html
├── tag.html
├── collection.html
├── home.html
├── archive.html
├── archive-taxonomy.html
├── pwn.html
├── blog.html
├── htb.html
├── expdev.html
├── resources.html
├── cve.html
├── posts.html
├── splash.html
├── default.html
├── tags.html
├── categories.html
└── search.html
├── _data
└── navigation.yml
├── banner.js
├── resources.html
├── minimal-mistakes-jekyll.gemspec
├── package.json
└── Rakefile
/_posts/README.md:
--------------------------------------------------------------------------------
1 | test
2 |
--------------------------------------------------------------------------------
/CNAME:
--------------------------------------------------------------------------------
1 | test.securityexplained.io
--------------------------------------------------------------------------------
/_site/robots.txt:
--------------------------------------------------------------------------------
1 | Sitemap: http://localhost:4000/sitemap.xml
2 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: home
3 | author_profile: true
4 | ---
5 |
--------------------------------------------------------------------------------
/_sass/minimal-mistakes/vendor/susy/_su.scss:
--------------------------------------------------------------------------------
1 | // Su
2 | // ==
3 |
4 | @import 'susy/su';
5 |
--------------------------------------------------------------------------------
/assets/images/htb/htb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harsh-bothra/test/main/assets/images/htb/htb.png
--------------------------------------------------------------------------------
/assets/images/pwn/pwn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harsh-bothra/test/main/assets/images/pwn/pwn.png
--------------------------------------------------------------------------------
/_includes/footer/custom.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/_site/assets/images/pwn/pwn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harsh-bothra/test/main/_site/assets/images/pwn/pwn.png
--------------------------------------------------------------------------------
/assets/images/expdev/expdev.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harsh-bothra/test/main/assets/images/expdev/expdev.png
--------------------------------------------------------------------------------
/assets/images/site_data/ccc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harsh-bothra/test/main/assets/images/site_data/ccc.png
--------------------------------------------------------------------------------
/assets/images/site_data/code.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harsh-bothra/test/main/assets/images/site_data/code.png
--------------------------------------------------------------------------------
/assets/images/site_data/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harsh-bothra/test/main/assets/images/site_data/logo.png
--------------------------------------------------------------------------------
/_pages/cve.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "My CVE Blogs"
3 | layout: cve
4 | permalink: /cve/
5 | author_profile: true
6 | ---
7 |
--------------------------------------------------------------------------------
/_pages/pwn.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Pwn Challenges"
3 | layout: pwn
4 | permalink: /pwn/
5 | author_profile: true
6 | ---
7 |
--------------------------------------------------------------------------------
/assets/images/redteam/redteam.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harsh-bothra/test/main/assets/images/redteam/redteam.png
--------------------------------------------------------------------------------
/assets/images/site_data/avatar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harsh-bothra/test/main/assets/images/site_data/avatar.png
--------------------------------------------------------------------------------
/_includes/analytics-providers/custom.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/_includes/comments-providers/custom.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/_pages/htb.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Hack The Box Writeups"
3 | layout: htb
4 | permalink: /htb/
5 | author_profile: true
6 | ---
7 |
--------------------------------------------------------------------------------
/_pages/tag-archive.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Posts by Tag"
3 | permalink: /tags/
4 | layout: tags
5 | author_profile: true
6 | ---
7 |
--------------------------------------------------------------------------------
/_site/assets/images/expdev/expdev.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harsh-bothra/test/main/_site/assets/images/expdev/expdev.png
--------------------------------------------------------------------------------
/assets/images/site_data/thumbnail.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harsh-bothra/test/main/assets/images/site_data/thumbnail.jpg
--------------------------------------------------------------------------------
/_pages/expdev.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Exploit Development"
3 | layout: expdev
4 | permalink: /expdev/
5 | author_profile: true
6 | ---
7 |
--------------------------------------------------------------------------------
/_pages/resources.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Resources"
3 | layout: resources
4 | permalink: /resources/
5 | author_profile: true
6 | ---
7 |
--------------------------------------------------------------------------------
/_site/assets/images/site_data/avatar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harsh-bothra/test/main/_site/assets/images/site_data/avatar.png
--------------------------------------------------------------------------------
/_site/assets/images/site_data/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harsh-bothra/test/main/_site/assets/images/site_data/logo.png
--------------------------------------------------------------------------------
/assets/images/site_data/favicon.ico.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harsh-bothra/test/main/assets/images/site_data/favicon.ico.png
--------------------------------------------------------------------------------
/_pages/offsec.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Offensive Security Posts"
3 | layout: offsec
4 | permalink: /offsec/
5 | author_profile: true
6 | ---
7 |
--------------------------------------------------------------------------------
/assets/images/site_data/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harsh-bothra/test/main/assets/images/site_data/favicon-16x16.png
--------------------------------------------------------------------------------
/assets/images/site_data/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harsh-bothra/test/main/assets/images/site_data/favicon-32x32.png
--------------------------------------------------------------------------------
/_site/assets/images/site_data/favicon.ico.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harsh-bothra/test/main/_site/assets/images/site_data/favicon.ico.png
--------------------------------------------------------------------------------
/_site/assets/images/site_data/thumbnail.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harsh-bothra/test/main/_site/assets/images/site_data/thumbnail.jpg
--------------------------------------------------------------------------------
/assets/images/binary-exploitation/binexp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harsh-bothra/test/main/assets/images/binary-exploitation/binexp.png
--------------------------------------------------------------------------------
/_site/assets/images/site_data/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harsh-bothra/test/main/_site/assets/images/site_data/favicon-16x16.png
--------------------------------------------------------------------------------
/_site/assets/images/site_data/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harsh-bothra/test/main/_site/assets/images/site_data/favicon-32x32.png
--------------------------------------------------------------------------------
/_pages/category-archive.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Posts by Category"
3 | layout: categories
4 | permalink: /categories/
5 | author_profile: true
6 | ---
7 |
--------------------------------------------------------------------------------
/_site/assets/images/binary-exploitation/binexp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harsh-bothra/test/main/_site/assets/images/binary-exploitation/binexp.png
--------------------------------------------------------------------------------
/_sass/minimal-mistakes/vendor/susy/_susy.scss:
--------------------------------------------------------------------------------
1 | // Susy (Un-Prefixed)
2 | // ==================
3 |
4 | @import 'susy-prefix';
5 | @import 'susy/unprefix';
6 |
--------------------------------------------------------------------------------
/_sass/minimal-mistakes/vendor/susy/plugins/_svg-grid.scss:
--------------------------------------------------------------------------------
1 | // SVG Grid Background
2 | // ===================
3 |
4 | @import 'svg-grid/prefix';
5 | @import 'svg-grid/svg-unprefix';
6 |
--------------------------------------------------------------------------------
/_includes/posts-tag.html:
--------------------------------------------------------------------------------
1 | {%- for post in site.tags[include.taxonomy] -%}
2 | {%- unless post.hidden -%}
3 | {% include archive-single.html %}
4 | {%- endunless -%}
5 | {%- endfor -%}
6 |
--------------------------------------------------------------------------------
/_includes/posts-category.html:
--------------------------------------------------------------------------------
1 | {%- for post in site.categories[include.taxonomy] -%}
2 | {%- unless post.hidden -%}
3 | {% include archive-single.html %}
4 | {%- endunless -%}
5 | {%- endfor -%}
6 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source "https://rubygems.org"
2 |
3 | gem "github-pages", group: :jekyll_plugins
4 |
5 | gem 'jekyll-include-cache'
6 |
7 | gem 'minimal-mistakes-jekyll'
8 |
9 | gem "activesupport", ">= 6.0.3.1"
10 |
11 |
--------------------------------------------------------------------------------
/_sass/minimal-mistakes/vendor/susy/plugins/svg-grid/_prefix.scss:
--------------------------------------------------------------------------------
1 | // Prefixed SVG Plugin
2 | // ===================
3 |
4 | @import 'svg-settings';
5 | @import 'svg-utilities';
6 | @import 'svg-grid-math';
7 | @import 'svg-api';
8 |
--------------------------------------------------------------------------------
/_includes/page__hero_video.html:
--------------------------------------------------------------------------------
1 | {% capture video_id %}{{ page.header.video.id }}{% endcapture %}
2 | {% capture video_provider %}{{ page.header.video.provider }}{% endcapture %}
3 |
4 | {% include video id=video_id provider=video_provider %}
5 |
--------------------------------------------------------------------------------
/_layouts/category.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: archive
3 | ---
4 |
5 | {{ content }}
6 |
7 |
8 | {% include posts-category.html taxonomy=page.taxonomy type=page.entries_layout %}
9 |
10 |
--------------------------------------------------------------------------------
/_includes/page__taxonomy.html:
--------------------------------------------------------------------------------
1 | {% if site.tag_archive.type and page.tags[0] %}
2 | {% include tag-list.html %}
3 | {% endif %}
4 |
5 | {% if site.category_archive.type and page.categories[0] %}
6 | {% include category-list.html %}
7 | {% endif %}
--------------------------------------------------------------------------------
/_layouts/tag.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: archive
3 | ---
4 |
5 | {{ content }}
6 |
7 |
8 | {% include posts-tag.html taxonomy=page.taxonomy type=page.entries_layout %}
9 |
10 |
--------------------------------------------------------------------------------
/_sass/minimal-mistakes/skins/_default.scss:
--------------------------------------------------------------------------------
1 | /* ==========================================================================
2 | Default skin
3 | ========================================================================== */
4 |
5 | // Intentionally left blank
6 |
--------------------------------------------------------------------------------
/_includes/browser-upgrade.html:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/_includes/author-profile-custom-links.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/_layouts/collection.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: archive
3 | ---
4 |
5 | {{ content }}
6 |
7 |
8 | {% include documents-collection.html collection=page.collection sort_by=page.sort_by sort_order=page.sort_order type=page.entries_layout %}
9 |
10 |
--------------------------------------------------------------------------------
/_pages/404.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Page Not Found"
3 | excerpt: "Page not found. Your pixels are in another canvas."
4 | sitemap: false
5 | layout: single
6 | permalink: /404.html
7 | ---
8 |
9 | Sorry, but the page you were trying to view does not exist.
10 |
11 | Don't try to bruteforce :-(
12 |
--------------------------------------------------------------------------------
/_includes/toc:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/_data/navigation.yml:
--------------------------------------------------------------------------------
1 | # main links
2 | main:
3 | - title: "Home"
4 | url: /
5 | - title: "Resources"
6 | url: /categories/#resources
7 | - title: "Newsletter"
8 | url: /categories/#vulnerable-code-snippet
9 | - title: "MindMaps"
10 | url: /mindmaps
11 | - title: "Guest Resources"
12 | url: /GuestResources
13 |
14 |
--------------------------------------------------------------------------------
/_includes/figure:
--------------------------------------------------------------------------------
1 |
2 |
4 | {% if include.caption %}
5 |
6 | {{ include.caption | markdownify | remove: "" | remove: "
" }}
7 |
8 | {% endif %}
9 |
10 |
--------------------------------------------------------------------------------
/_sass/minimal-mistakes/vendor/susy/_susy-prefix.scss:
--------------------------------------------------------------------------------
1 | // Susy (Prefixed)
2 | // ===============
3 |
4 | $susy-version: 3;
5 |
6 | @import 'susy/utilities';
7 | @import 'susy/su-validate';
8 | @import 'susy/su-math';
9 | @import 'susy/settings';
10 | @import 'susy/normalize';
11 | @import 'susy/parse';
12 | @import 'susy/syntax-helpers';
13 | @import 'susy/api';
14 |
--------------------------------------------------------------------------------
/_posts/2022-03-01-issue2.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Newsletter - Issue #2"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: ""
10 | categories:
11 | - Newsletter
12 | ---
13 | Newsletter
14 |
15 | click here
16 |
--------------------------------------------------------------------------------
/_includes/analytics-providers/google-universal.html:
--------------------------------------------------------------------------------
1 |
7 |
8 |
--------------------------------------------------------------------------------
/assets/css/main.scss:
--------------------------------------------------------------------------------
1 | ---
2 | # Only the main Sass file needs front matter (the dashes are enough)
3 | ---
4 |
5 | @charset "utf-8";
6 |
7 | @import "minimal-mistakes/skins/{{ site.minimal_mistakes_skin | default: 'default' }}"; // skin
8 | @import "minimal-mistakes"; // main partials
9 |
10 | body{
11 | background-color: #222831;
12 | }
13 | .greedy-nav{
14 | background-color: #222831;
15 | }
16 |
--------------------------------------------------------------------------------
/_includes/head/custom.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/_posts/2022-03-01-issue1.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Newsletter - Issue #1"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: ""
10 | categories:
11 | - Newsletter
12 | ---
13 | Newsletter
14 |
15 | Click Here
16 |
--------------------------------------------------------------------------------
/_site/resources/vulnerable-code-23.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-36: Vulnerable Code Snippet - 23
2 |
3 | #### Vulnerable Code:
4 |
5 | 
6 |
7 |
8 | #### Solution:
9 | The code utilizes XPath queries and due to lack of sanitization on line-14, it is possible to perform XPATH injection.
10 |
11 | Twitter Thread: https://twitter.com/harshbothra_/status/1489896229970792449
12 | ##### Code Credits: SonarSource
--------------------------------------------------------------------------------
/_sass/minimal-mistakes/vendor/breakpoint/_no-query.scss:
--------------------------------------------------------------------------------
1 | @function breakpoint-no-query($query) {
2 | @if type-of($query) == 'list' {
3 | $keyword: nth($query, 1);
4 |
5 | @if type-of($keyword) == 'string' and ($keyword == 'no-query' or $keyword == 'no query' or $keyword == 'fallback') {
6 | @return nth($query, 2);
7 | }
8 | @else {
9 | @return false;
10 | }
11 | }
12 | @else {
13 | @return false;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/_sass/minimal-mistakes/_animations.scss:
--------------------------------------------------------------------------------
1 | /* ==========================================================================
2 | ANIMATIONS
3 | ========================================================================== */
4 |
5 | @-webkit-keyframes intro {
6 | 0% {
7 | opacity: 0;
8 | }
9 | 100% {
10 | opacity: 1;
11 | }
12 | }
13 |
14 | @keyframes intro {
15 | 0% {
16 | opacity: 0;
17 | }
18 | 100% {
19 | opacity: 1;
20 | }
21 | }
--------------------------------------------------------------------------------
/_layouts/home.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: archive
3 | ---
4 |
5 | {{ content }}
6 |
7 | {{ site.data.ui-text[site.locale].recent_posts | default: "Recent Posts" }}
8 |
9 | {% if paginator %}
10 | {% assign posts = paginator.posts %}
11 | {% else %}
12 | {% assign posts = site.posts %}
13 | {% endif %}
14 |
15 | {% for post in posts %}
16 | {% include archive-single.html %}
17 | {% endfor %}
18 |
19 | {% include paginator.html %}
20 |
--------------------------------------------------------------------------------
/_sass/minimal-mistakes/vendor/susy/plugins/svg-grid/_svg-unprefix.scss:
--------------------------------------------------------------------------------
1 | // Unprefix Susy SVG Grid
2 | // ======================
3 |
4 |
5 |
6 | // SVG Grid
7 | // --------
8 | /// Un-prefixed alias for `susy-svg-grid`
9 | ///
10 | /// @group plugin_svg-grid
11 | /// @alias susy-svg-grid
12 | @function svg-grid(
13 | $grid: $susy,
14 | $colors: susy-get('svg-grid-colors'),
15 | $offset: null
16 | ) {
17 | @return susy-svg-grid($grid, $colors, $offset);
18 | }
19 |
--------------------------------------------------------------------------------
/_includes/comments-providers/facebook.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/_includes/search/lunr-search-scripts.html:
--------------------------------------------------------------------------------
1 | {% assign lang = site.locale | slice: 0,2 | default: "en" %}
2 | {% case lang %}
3 | {% when "gr" %}
4 | {% assign lang = "gr" %}
5 | {% else %}
6 | {% assign lang = "en" %}
7 | {% endcase %}
8 |
9 |
10 |
--------------------------------------------------------------------------------
/_sass/minimal-mistakes/vendor/breakpoint/parsers/single/_default.scss:
--------------------------------------------------------------------------------
1 | @function breakpoint-parse-default($feature) {
2 | $default: breakpoint-get('default feature');
3 |
4 | // Set Context
5 | $context-setter: private-breakpoint-set-context($default, $feature);
6 |
7 | @if (breakpoint-get('to ems') == true) and (type-of($feature) == 'number') {
8 | @return '#{$default}: #{breakpoint-to-base-em($feature)}';
9 | }
10 | @else {
11 | @return '#{$default}: #{$feature}';
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/_includes/analytics-providers/google-gtag.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
--------------------------------------------------------------------------------
/_sass/minimal-mistakes/vendor/susy/plugins/svg-grid/_svg-settings.scss:
--------------------------------------------------------------------------------
1 | // SVG Settings
2 | // ============
3 |
4 |
5 | // Susy SVG Defaults
6 | // =================
7 | /// This plugin adds the `svg-grid-colors` property
8 | /// and default value to `$_susy-defaults` —
9 | /// you can override that value in `$susy`
10 | /// or any other grid settings map.
11 | /// @group plugin_svg-grid
12 | $_susy-defaults: map-merge((
13 | 'svg-grid-colors': hsla(120, 50%, 50%, 0.5) hsla(120, 50%, 75%, 0.5),
14 | ), $_susy-defaults);
15 |
--------------------------------------------------------------------------------
/_includes/analytics.html:
--------------------------------------------------------------------------------
1 | {% if jekyll.environment == 'production' and site.analytics.provider and page.analytics != false %}
2 |
3 | {% case site.analytics.provider %}
4 | {% when "google" %}
5 | {% include /analytics-providers/google.html %}
6 | {% when "google-universal" %}
7 | {% include /analytics-providers/google-universal.html %}
8 | {% when "google-gtag" %}
9 | {% include /analytics-providers/google-gtag.html %}
10 | {% when "custom" %}
11 | {% include /analytics-providers/custom.html %}
12 | {% endcase %}
13 |
14 | {% endif %}
--------------------------------------------------------------------------------
/_site/resources/vulnerable-code-14.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-26: Vulnerable Code Snippet - 14
2 |
3 | #### Vulnerable Code:
4 |
5 | 
6 |
7 | #### Solution:
8 |
9 | The code is vulnerable to code execution due to use of array_map() function. An attacker can perform attack like: array.php?map=phpinfo, that execute phpinfo() in it.
10 |
11 | ##### Code Credits: Octagon Networks
12 |
13 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1486375951084961792?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
14 |
--------------------------------------------------------------------------------
/_site/resources/vulnerable-code-10.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-22: Vulnerable Code Snippet - 10
2 |
3 | #### Vulnerable Code:
4 |
5 | 
6 |
7 | #### Solution:
8 |
9 | The code is vulnerable to authentication bypass vulnerability. An attacker can impersonate and login as any user as at the line-10 the code doesn't validate the JWT signature.
10 |
11 | ##### Code Credits: SonarSource
12 |
13 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1484947412443545602?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
14 |
--------------------------------------------------------------------------------
/_site/resources/vulnerable-code-13.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-25: Vulnerable Code Snippet - 13
2 |
3 | #### Vulnerable Code:
4 |
5 | 
6 |
7 | #### Solution:
8 |
9 | The code is vulnerable remote code execution vulnerability via Path Traversal. Payload like this works: ?dir=. ./ .. /. ./user/profile.png
10 |
11 | ##### Code Credits: Octagon Networks
12 |
13 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1486000043165634562?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
14 |
--------------------------------------------------------------------------------
/_site/resources/vulnerable-code-24.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-37: Vulnerable Code Snippet - 24
2 |
3 | #### Vulnerable Code:
4 |
5 | 
6 |
7 |
8 | #### Solution:
9 |
10 | The above code is vulnerable to Local File Inclusion (LFI) due to improper sanitization on receiving user input on line-11 and line-12. An attacker may attempt to submit a malicious payload and gain access to internal files.
11 |
12 | Twitter Thread: https://twitter.com/harshbothra_/status/1490320844962377728
13 |
14 | ##### Code Credits: SonarSource
--------------------------------------------------------------------------------
/_site/resources/vulnerable-code-8.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-20: Vulnerable Code Snippet - 8
2 |
3 | #### Vulnerable Code:
4 |
5 | 
6 |
7 | #### Solution:
8 |
9 | The code is vulnerable to path traversal attack. There is a sanitization against this attack but the protection is not sufficient and can be bypassed with the payloads such as ".\./.\.shell.jsp".
10 |
11 | ##### Code Credits: SonarSource
12 |
13 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1484208541707927554?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
14 |
--------------------------------------------------------------------------------
/_site/resources/vulnerable-code-4.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-16: Vulnerable Code Snippet - 4
2 |
3 | #### Vulnerable Code:
4 |
5 | 
6 |
7 | #### Solution:
8 |
9 | The issue in this code snippet is the use of Blacklist (Denylist) instead of using a Whitelist (Allowlist). An attacker can bypass this protection in multiple ways and upload a malicious file on the server.
10 |
11 | ##### Code Credits: SonarSource
12 |
13 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1482740498683285506?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
14 |
--------------------------------------------------------------------------------
/_site/resources/vulnerable-code-16.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-28: Vulnerable Code Snippet - 16
2 |
3 | #### Vulnerable Code:
4 |
5 | 
6 |
7 | #### Solution:
8 |
9 | The code is vulnerable to XXE attack because the use of the `LIBXML_NOENT` enables the external entity loading in php8.
10 |
11 | Similar Issue: https://blog.sonarsource.com/wordpress-xxe-security-vulnerability
12 |
13 | ##### Code Credits: SonarSource
14 |
15 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1487080467861889030?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
16 |
--------------------------------------------------------------------------------
/_site/resources/vulnerable-code-1.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-12: Vulnerable Code Snippet - 1
2 |
3 | #### Vulnerable Code:
4 |
5 | 
6 |
7 | #### Solution:
8 |
9 | The above code is vulnerable to cross-site scripting attacks due to improper filtration! The encoding is missing a single quote (') and it is possible to execute an XSS with payloads such as: '+alert(1)+'.
10 |
11 | ##### Code Credits: OWASP Secure Coding Dojo
12 |
13 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1481257258734727171?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
14 |
--------------------------------------------------------------------------------
/_sass/minimal-mistakes/vendor/breakpoint/parsers/double/_default.scss:
--------------------------------------------------------------------------------
1 | @function breakpoint-parse-double-default($first, $second) {
2 | $feature: '';
3 | $value: '';
4 |
5 | @if type-of($first) == 'string' {
6 | $feature: $first;
7 | $value: $second;
8 | }
9 | @else {
10 | $feature: $second;
11 | $value: $first;
12 | }
13 |
14 | // Set Context
15 | $context-setter: private-breakpoint-set-context($feature, $value);
16 |
17 | @if (breakpoint-get('to ems') == true) {
18 | $value: breakpoint-to-base-em($value);
19 | }
20 |
21 | @return '(#{$feature}: #{$value})'
22 | }
23 |
--------------------------------------------------------------------------------
/_site/resources/vulnerable-code-11.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-23: Vulnerable Code Snippet - 11
2 |
3 | #### Vulnerable Code:
4 |
5 | 
6 |
7 | #### Solution:
8 |
9 | This answer is by SonarSource: There are two ways to serialize classes in PHP, both with O: and C:. The second encoding mode is not supported by the blocklist, and arbitrary objects could then be deserialized! It's not enough to get RCE, but it's a good start.
10 |
11 | ##### Code Credits: SonarSource
12 |
13 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1485315700998938625?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
14 |
--------------------------------------------------------------------------------
/_site/resources/vulnerable-code-5.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-17: Vulnerable Code Snippet - 5
2 |
3 | #### Vulnerable Code:
4 |
5 | 
6 |
7 | #### Solution:
8 |
9 | The issue in this code snippet is that the files are stored without any extension. The Apache does not attach a Content-Type header in the response. Modern browsers will interpret these files as HTML which may lead to an attack such as Stored Cross-Site Scripting.
10 |
11 | ##### Code Credits: SonarSource
12 |
13 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1483124633373409281?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
14 |
--------------------------------------------------------------------------------
/_includes/skip-links.html:
--------------------------------------------------------------------------------
1 |
2 | {{ site.data.ui-text[site.locale].skip_links | default: 'Skip links' }}
3 |
8 |
9 |
--------------------------------------------------------------------------------
/_site/resources/vulnerable-code-17.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-29: Vulnerable Code Snippet - 17
2 |
3 | #### Vulnerable Code:
4 |
5 | 
6 |
7 | #### Solution:
8 |
9 | As per @SonarSource, isPrivileged() will always return true because casting an int to an int-based enum never throws an exception, even if there is no enum member corresponding to that number. To make the check correct, it has to return PrivRoles.IsDefined((PrivRoles) role).
10 |
11 | ##### Code Credits: SonarSource
12 |
13 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1487434398186508294?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
14 |
--------------------------------------------------------------------------------
/_site/resources/vulnerable-code-12.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-24: Vulnerable Code Snippet - 12
2 |
3 | #### Vulnerable Code:
4 |
5 | 
6 |
7 | #### Solution:
8 |
9 | The code is vulnerable to prototype pollution that could even lead to remote code execution. The statement in line 12 uses a dangerous pattern that allows for Prototype Pollution. When type is set to **proto**, then id and content can specify a key and value that will be set on Object.prototype.
10 |
11 | ##### Code Credits: SonarSource
12 |
13 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1485639304861069313?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
14 |
--------------------------------------------------------------------------------
/_site/resources/vulnerable-code-20.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-33: Vulnerable Code Snippet - 20
2 |
3 | #### Vulnerable Code:
4 |
5 | 
6 |
7 | #### Solution:
8 |
9 | As per @SonarSource, The problem lies with the server reading 16 bytes on line 13 into its buffer without making sure that the string is null-terminated (the last byte of the buffer is null). Sending 16 non-null bytes to the server will return them and the adjacent buffer containing sensitive data!
10 |
11 | ##### Code Credits: SonarSource
12 |
13 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1488907363184566275?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
14 |
--------------------------------------------------------------------------------
/_includes/analytics-providers/google.html:
--------------------------------------------------------------------------------
1 |
15 |
--------------------------------------------------------------------------------
/_sass/minimal-mistakes/vendor/breakpoint/parsers/triple/_default.scss:
--------------------------------------------------------------------------------
1 | @function breakpoint-parse-triple-default($feature, $first, $second) {
2 |
3 | // Sort into min and max
4 | $min: min($first, $second);
5 | $max: max($first, $second);
6 |
7 | // Set Context
8 | $context-setter: private-breakpoint-set-context(min-#{$feature}, $min);
9 | $context-setter: private-breakpoint-set-context(max-#{$feature}, $max);
10 |
11 | // Make them EMs if need be
12 | @if (breakpoint-get('to ems') == true) {
13 | $min: breakpoint-to-base-em($min);
14 | $max: breakpoint-to-base-em($max);
15 | }
16 |
17 | @return '(min-#{$feature}: #{$min}) and (max-#{$feature}: #{$max})';
18 | }
19 |
--------------------------------------------------------------------------------
/_site/resources/vulnerable-code-22.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-35: Vulnerable Code Snippet - 22
2 |
3 | #### Vulnerable Code:
4 |
5 | 
6 |
7 | #### Solution:
8 |
9 | As per @SonarSource, Arbitrary arguments can be added to the tar command, e.g. by creating a file named “-I touch shell” in /opt/webapp. The -I argument allows executing an arbitrary command, here “touch shell”. --checkpoint-action works too.
10 |
11 | Twitter Thread: https://twitter.com/harshbothra_/status/1489630710025830400
12 |
13 | ##### Code Credits: SonarSource
14 |
15 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1489630648159846400?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
16 |
--------------------------------------------------------------------------------
/_site/resources/vulnerable-code-6.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-18: Vulnerable Code Snippet - 6
2 |
3 | #### Vulnerable Code:
4 |
5 | 
6 |
7 | #### Solution:
8 |
9 | The code is vulnerable to SSRF attack. The issue in this code snippet is that the Java's URI.resolve() will return its parameter if it is an absolute URL, which can be abused to perform SSRF. By using http:/example.com# as artifact the final URL will start with http:/example.com#, which the OkHttp library will accept when making the request.
10 |
11 | ##### Code Credits: SonarSource
12 |
13 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1483501885235417090?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
14 |
--------------------------------------------------------------------------------
/_site/resources/vulnerable-code-7.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-19: Vulnerable Code Snippet - 7
2 |
3 | #### Vulnerable Code:
4 |
5 | 
6 |
7 | #### Solution:
8 |
9 | The code is vulnerable to Remote Code Execution via SQL Injection. As per SonarSource, addslashes() is not enough to protect against SQL injections because the interpolated value is not surrounded by quotes. This value is later used in the external shell call without proper escaping.
10 |
11 | A payload like 1--$(id>foo) is enough to gain RCE!
12 |
13 | ##### Code Credits: SonarSource
14 |
15 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1483835811896655877?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
16 |
--------------------------------------------------------------------------------
/banner.js:
--------------------------------------------------------------------------------
1 | const fs = require("fs");
2 | const pkg = require("./package.json");
3 | const filename = "assets/js/main.min.js";
4 | const script = fs.readFileSync(filename);
5 | const padStart = str => ("0" + str).slice(-2);
6 | const dateObj = new Date();
7 | const date = `${dateObj.getFullYear()}-${padStart(
8 | dateObj.getMonth() + 1
9 | )}-${padStart(dateObj.getDate())}`;
10 | const banner = `/*!
11 | * Minimal Mistakes Jekyll Theme ${pkg.version} by ${pkg.author}
12 | * Copyright 2013-${dateObj.getFullYear()} Michael Rose - mademistakes.com | @mmistakes
13 | * Licensed under ${pkg.license}
14 | */
15 | `;
16 |
17 | if (script.slice(0, 3) != "/**") {
18 | fs.writeFileSync(filename, banner + script);
19 | }
20 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-39.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 39"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "XPATH"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 |
14 | ### SecurityExplained S-52: Vulnerable Code Snippet - 39
15 |
16 | #### Vulnerable Code:
17 |
18 | 
19 |
20 |
21 | #### Solution:
22 |
23 | This code is vulnerable to XPATH Injection. 🥷
24 |
25 | Twitter Thread: https://twitter.com/harshbothra_/status/1495542532784246784
26 |
27 | ##### Code Credits: @SonarSources
28 |
--------------------------------------------------------------------------------
/_site/banner.js:
--------------------------------------------------------------------------------
1 | const fs = require("fs");
2 | const pkg = require("./package.json");
3 | const filename = "assets/js/main.min.js";
4 | const script = fs.readFileSync(filename);
5 | const padStart = str => ("0" + str).slice(-2);
6 | const dateObj = new Date();
7 | const date = `${dateObj.getFullYear()}-${padStart(
8 | dateObj.getMonth() + 1
9 | )}-${padStart(dateObj.getDate())}`;
10 | const banner = `/*!
11 | * Minimal Mistakes Jekyll Theme ${pkg.version} by ${pkg.author}
12 | * Copyright 2013-${dateObj.getFullYear()} Michael Rose - mademistakes.com | @mmistakes
13 | * Licensed under ${pkg.license}
14 | */
15 | `;
16 |
17 | if (script.slice(0, 3) != "/**") {
18 | fs.writeFileSync(filename, banner + script);
19 | }
20 |
--------------------------------------------------------------------------------
/_site/resources/vulnerable-code-21.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-34: Vulnerable Code Snippet - 21
2 |
3 | #### Vulnerable Code:
4 |
5 | 
6 |
7 | #### Solution:
8 |
9 | As per @SonarSource, This risk of DNS rebinding is always easy to overlook: Dns.GetHostEntry() does a first DNS query, validates the result against the allow-list, and then WebRequest does a second DNS query. Both DNS queries can have a different response, and unintended servers could be reached that way. Always work with the value you first validated!
10 |
11 | ##### Code Credits: SonarSource
12 |
13 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1489280271640055809?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
14 |
--------------------------------------------------------------------------------
/_sass/minimal-mistakes/vendor/breakpoint/parsers/double/_double-string.scss:
--------------------------------------------------------------------------------
1 | @function breakpoint-parse-double-string($first, $second) {
2 | $feature: '';
3 | $value: '';
4 |
5 | // Test to see which is the feature and which is the value
6 | @if (breakpoint-string-value($first) == true) {
7 | $feature: $first;
8 | $value: $second;
9 | }
10 | @else if (breakpoint-string-value($second) == true) {
11 | $feature: $second;
12 | $value: $first;
13 | }
14 | @else {
15 | @warn "Neither #{$first} nor #{$second} is a valid media query name.";
16 | }
17 |
18 | // Set Context
19 | $context-setter: private-breakpoint-set-context($feature, $value);
20 |
21 | @return '(#{$feature}: #{$value})';
22 | }
--------------------------------------------------------------------------------
/_includes/documents-collection.html:
--------------------------------------------------------------------------------
1 | {% assign entries = site[include.collection] %}
2 |
3 | {% if include.sort_by == 'title' %}
4 | {% if include.sort_order == 'reverse' %}
5 | {% assign entries = entries | sort: 'title' | reverse %}
6 | {% else %}
7 | {% assign entries = entries | sort: 'title' %}
8 | {% endif %}
9 | {% elsif include.sort_by == 'date' %}
10 | {% if include.sort_order == 'reverse' %}
11 | {% assign entries = entries | sort: 'date' | reverse %}
12 | {% else %}
13 | {% assign entries = entries | sort: 'date' %}
14 | {% endif %}
15 | {% endif %}
16 |
17 | {%- for post in entries -%}
18 | {%- unless post.hidden -%}
19 | {% include archive-single.html %}
20 | {%- endunless -%}
21 | {%- endfor -%}
22 |
--------------------------------------------------------------------------------
/_includes/comments-providers/scripts.html:
--------------------------------------------------------------------------------
1 | {% if site.comments.provider and page.comments %}
2 | {% case site.comments.provider %}
3 | {% when "disqus" %}
4 | {% include /comments-providers/disqus.html %}
5 | {% when "discourse" %}
6 | {% include /comments-providers/discourse.html %}
7 | {% when "facebook" %}
8 | {% include /comments-providers/facebook.html %}
9 | {% when "staticman" %}
10 | {% include /comments-providers/staticman.html %}
11 | {% when "staticman_v2" %}
12 | {% include /comments-providers/staticman_v2.html %}
13 | {% when "utterances" %}
14 | {% include /comments-providers/utterances.html %}
15 | {% when "custom" %}
16 | {% include /comments-providers/custom.html %}
17 | {% endcase %}
18 | {% endif %}
--------------------------------------------------------------------------------
/_site/resources/vulnerable-code-2.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-13: Vulnerable Code Snippet - 2
2 |
3 | #### Vulnerable Code:
4 |
5 | 
6 |
7 | #### Solution:
8 |
9 | The above code is vulnerable to cross-site scripting attack as it can be observed that on the line 15, a handler for message events is registered which writes the event's data in the DOM on the line 13.
10 | It is possible to embed this page and send an event with an XSS payload to execute a successful attack.
11 |
12 | Similar Bug: https://blog.sonarsource.com/ghost-admin-takeover
13 |
14 | ##### Code Credits: SonarSource
15 |
16 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1481606121991598081?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
17 |
--------------------------------------------------------------------------------
/_sass/minimal-mistakes/vendor/breakpoint/parsers/double/_default-pair.scss:
--------------------------------------------------------------------------------
1 | @function breakpoint-parse-default-pair($first, $second) {
2 | $default: breakpoint-get('default pair');
3 | $min: '';
4 | $max: '';
5 |
6 | // Sort into min and max
7 | $min: min($first, $second);
8 | $max: max($first, $second);
9 |
10 | // Set Context
11 | $context-setter: private-breakpoint-set-context(min-#{$default}, $min);
12 | $context-setter: private-breakpoint-set-context(max-#{$default}, $max);
13 |
14 | // Make them EMs if need be
15 | @if (breakpoint-get('to ems') == true) {
16 | $min: breakpoint-to-base-em($min);
17 | $max: breakpoint-to-base-em($max);
18 | }
19 |
20 | @return '(min-#{$default}: #{$min}) and (max-#{$default}: #{$max})';
21 | }
22 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-23.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 23"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "XPATH"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-36: Vulnerable Code Snippet - 23
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 |
20 | #### Solution:
21 | The code utilizes XPath queries and due to lack of sanitization on line-14, it is possible to perform XPATH injection.
22 |
23 | Twitter Thread: https://twitter.com/harshbothra_/status/1489896229970792449
24 | ##### Code Credits: SonarSource
25 |
--------------------------------------------------------------------------------
/_site/resources/vulnerable-code-19.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-31: Vulnerable Code Snippet - 19
2 |
3 | #### Vulnerable Code:
4 |
5 | 
6 |
7 | #### Solution:
8 |
9 | As per @SonarSource, The regex at line 7 is correct in itself as it checks for the right characters. The bug lies in the g flag; it makes the regex object retain the last match index and will continue after that index when .test() is called again. Attackers could still use quotes, and perform the SQL injection, by sending their request two times in a row: the second regex check will start after the quote.
10 |
11 | ##### Code Credits: SonarSource
12 |
13 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1488191330493014018?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
14 |
--------------------------------------------------------------------------------
/_includes/comments-providers/utterances.html:
--------------------------------------------------------------------------------
1 |
21 |
--------------------------------------------------------------------------------
/_layouts/archive.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: default
3 | ---
4 |
5 | {% if page.header.overlay_color or page.header.overlay_image or page.header.image %}
6 | {% include page__hero.html %}
7 | {% elsif page.header.video.id and page.header.video.provider %}
8 | {% include page__hero_video.html %}
9 | {% endif %}
10 |
11 | {% if page.url != "/" and site.breadcrumbs %}
12 | {% unless paginator %}
13 | {% include breadcrumbs.html %}
14 | {% endunless %}
15 | {% endif %}
16 |
17 |
18 | {% include sidebar.html %}
19 |
20 |
21 | {% unless page.header.overlay_color or page.header.overlay_image %}
22 |
{{ page.title }}
23 | {% endunless %}
24 | {{ content }}
25 |
26 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-38.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 38"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "DOM XSS"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-51: Vulnerable Code Snippet - 38
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 |
20 | #### Solution:
21 |
22 | The code is vulnerable to DOM-based XSS and allows execution of XSS using "s" parameter using payloads like: x'onmouseover=alert(1)//
23 |
24 | Twitter Thread: https://twitter.com/harshbothra_/status/1495224184611524608
25 |
26 | ##### Code Credits: @Brumens2
27 |
--------------------------------------------------------------------------------
/_includes/read-time.html:
--------------------------------------------------------------------------------
1 | {% assign words_per_minute = page.words_per_minute | default: site.words_per_minute | default: 200 %}
2 |
3 | {% if post.read_time %}
4 | {% assign words = post.content | strip_html | number_of_words %}
5 | {% elsif page.read_time %}
6 | {% assign words = page.content | strip_html | number_of_words %}
7 | {% endif %}
8 |
9 | {% if words < words_per_minute %}
10 | {{ site.data.ui-text[site.locale].less_than | default: "less than" }} 1 {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }}
11 | {% elsif words == words_per_minute %}
12 | 1 {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }}
13 | {% else %}
14 | {{ words | divided_by:words_per_minute }} {{ site.data.ui-text[site.locale].minute_read | default: "minute read" }}
15 | {% endif %}
16 |
--------------------------------------------------------------------------------
/_site/resources/vulnerable-code-18.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-30: Vulnerable Code Snippet - 18
2 |
3 | #### Vulnerable Code:
4 |
5 | 
6 |
7 | #### Solution:
8 |
9 | As per SonarSource, At line 9, the email is transformed to uppercase before its use in the SQL query. On Unicode characters, this process has the unintended effect that two distinct code points may result in the same one.
10 |
11 | It can be used to send the password reset token to another email and takeover accounts:
12 |
13 | foo@mix.com -> FOO@MIX.com
14 | foo@mıhttp://x.com -> FOO@MIX.com
15 |
16 | Interesting Blog: https://t.co/UxdZJQxzc1
17 |
18 | ##### Code Credits: SonarSource
19 |
20 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1487850861770731520?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
21 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-36.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 36"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "SSRF"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-49: Vulnerable Code Snippet - 36
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 |
20 | #### Solution:
21 |
22 | This code is vulnerable to Server-Side Request Forgery due to improper filtration in the "connName". An attacker can abuse it perform the attack successfully.
23 |
24 | Twitter Thread: https://twitter.com/harshbothra_/status/1494127206552985605
25 |
26 | ##### Code Credits: @SonarSource
27 |
--------------------------------------------------------------------------------
/_site/resources/vulnerable-code-9.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-21: Vulnerable Code Snippet - 9
2 |
3 | #### Vulnerable Code:
4 |
5 | 
6 |
7 | #### Solution:
8 |
9 | The code is vulnerable to Remote Code Execution by uploading a malicious file named as `img-converter.exe` that will then be executed instead of the one installed on the system.
10 |
11 | As per Sonar Source, When executing commands by name (e.g. `img-converter`) on Windows, the OS looks for the executable in the current directory first and only after that in the PATH. This applies here because the command is executed in the directory where the file is copied to.
12 |
13 | ##### Code Credits: SonarSource
14 |
15 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1484590293483945984?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
16 |
--------------------------------------------------------------------------------
/_includes/sidebar.html:
--------------------------------------------------------------------------------
1 | {% if page.author_profile or layout.author_profile or page.sidebar %}
2 |
19 | {% endif %}
20 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-40.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 40"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "LFI"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-53: Vulnerable Code Snippet - 40
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 |
20 | #### Solution:
21 |
22 | This code is vulnerable to Local File Inclusion as the backslash character can be used in a path traversal attack (..\) to disclose arbitrary files from the (Windows) host.
23 |
24 | Twitter Thread: https://twitter.com/harshbothra_/status/1495950722000580608
25 |
26 | ##### Code Credits: @SonarSources
27 |
--------------------------------------------------------------------------------
/_site/resources/vulnerable-code-3.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-15: Vulnerable Code Snippet - 3
2 |
3 | #### Vulnerable Code:
4 |
5 | 
6 |
7 | #### Solution:
8 |
9 | The issue lies in line 11 due to the use of "os.path.join()" and the issue here is an attacker can read arbitrary files by supplying malicious payload through img variable.
10 |
11 | As per the documentation, when the values passed in "os.path.join()" & one of the paths to concatenate is absolute, previous values will be ignored.
12 |
13 | Hence, here the string passed in "os.path.join(harsh,/etc/passwd)" return as "/etc/passwd" resulting into accessing the sensitive file.
14 |
15 | ##### Code Credits: SonarSource
16 |
17 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1482316119101030411?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
18 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-45.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 45"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "Path Traversal"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 |
14 | ### SecurityExplained S-58: Vulnerable Code Snippet - 45
15 |
16 | #### Vulnerable Code:
17 |
18 | 
19 |
20 |
21 | #### Solution:
22 |
23 | This code is vulnerable to Path Traversal Attack. More information could be found here: https://sonarcloud.io/summary/overall?id=SonarSourceResearch_2020_calendar_15
24 |
25 | Twitter Thread: https://twitter.com/harshbothra_/status/1497776001018859523
26 |
27 | ##### Code Credits: @SonarSource
28 |
--------------------------------------------------------------------------------
/_site/resources/vulnerable-code-15.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-27: Vulnerable Code Snippet - 15
2 |
3 | #### Vulnerable Code:
4 |
5 | 
6 |
7 | #### Solution:
8 |
9 | As per SonarSource, There is a ToCToU (Time of Check - Time of Use) bug: if the file does not exist at the time of the checks, they will be skipped. Attackers could create a symlink at /tmp/logs.txt right before the call to fopen(), and write to an unintended destination! It's very common to find file checks vulnerable to such ToCToU bugs. The best ways to avoid it is to perform these operations in folders with restrictive permissions and prefer file descriptors to paths (fstat, etc).
10 |
11 | ##### Code Credits: SonarSource
12 |
13 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1486753867047997442?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
14 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-43.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 43"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "Command Injection"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-56: Vulnerable Code Snippet - 43
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 |
20 | #### Solution:
21 |
22 | This code is vulnerable to Command Injection as an attacker can inject malicious shell commands into the name of an uploaded file by using characters such as ";" or "`" to start a new command.
23 |
24 | Twitter Thread: https://twitter.com/harshbothra_/status/1496993342378242063
25 |
26 | ##### Code Credits: @SonarSource
27 |
--------------------------------------------------------------------------------
/_sass/minimal-mistakes/skins/_mint.scss:
--------------------------------------------------------------------------------
1 | /* ==========================================================================
2 | Mint skin
3 | ========================================================================== */
4 |
5 | /* Colors */
6 | $background-color: #f3f6f6 !default;
7 | $text-color: #40514e !default;
8 | $muted-text-color: #40514e !default;
9 | $primary-color: #11999e !default;
10 | $border-color: mix(#fff, #40514e, 75%) !default;
11 | $footer-background-color: #30e3ca !default;
12 | $link-color: #11999e !default;
13 | $masthead-link-color: $text-color !default;
14 | $masthead-link-color-hover: $text-color !default;
15 | $navicon-link-color-hover: mix(#fff, $text-color, 80%) !default;
16 |
17 | .page__footer {
18 | color: #fff !important; // override
19 | }
20 |
21 | .page__footer-follow .social-icons .svg-inline--fa {
22 | color: inherit;
23 | }
24 |
--------------------------------------------------------------------------------
/_includes/comments-providers/disqus.html:
--------------------------------------------------------------------------------
1 | {% if site.comments.disqus.shortname %}
2 |
14 | Please enable JavaScript to view the comments powered by Disqus.
15 | {% endif %}
16 |
--------------------------------------------------------------------------------
/_sass/minimal-mistakes/skins/_air.scss:
--------------------------------------------------------------------------------
1 | /* ==========================================================================
2 | Air skin
3 | ========================================================================== */
4 |
5 | /* Colors */
6 | $background-color: #eeeeee !default;
7 | $text-color: #222831 !default;
8 | $muted-text-color: #393e46 !default;
9 | $primary-color: #0092ca !default;
10 | $border-color: mix(#fff, #393e46, 75%) !default;
11 | $footer-background-color: $primary-color !default;
12 | $link-color: #393e46 !default;
13 | $masthead-link-color: $text-color !default;
14 | $masthead-link-color-hover: $text-color !default;
15 | $navicon-link-color-hover: mix(#fff, $text-color, 80%) !default;
16 |
17 | .page__footer {
18 | color: #fff !important; // override
19 | }
20 |
21 | .page__footer-follow .social-icons .svg-inline--fa {
22 | color: inherit;
23 | }
24 |
--------------------------------------------------------------------------------
/_sass/minimal-mistakes/vendor/breakpoint/parsers/_single.scss:
--------------------------------------------------------------------------------
1 | //////////////////////////////
2 | // Import Pieces
3 | //////////////////////////////
4 | @import "single/default";
5 |
6 | @function breakpoint-parse-single($feature, $empty-media, $first) {
7 | $parsed: '';
8 | $leader: '';
9 | // If we're forcing
10 | @if not ($empty-media) or not ($first) {
11 | $leader: 'and ';
12 | }
13 |
14 | // If it's a single feature that can stand alone, we let it
15 | @if (breakpoint-single-string($feature)) {
16 | $parsed: $feature;
17 | // Set Context
18 | $context-setter: private-breakpoint-set-context($feature, $feature);
19 | }
20 | // If it's not a stand alone feature, we pass it off to the default handler.
21 | @else {
22 | $parsed: breakpoint-parse-default($feature);
23 | }
24 |
25 | @return $leader + '(' + $parsed + ')';
26 | }
27 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-14.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 14"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "Code Execution"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-26: Vulnerable Code Snippet - 14
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 | #### Solution:
20 |
21 | The code is vulnerable to code execution due to use of array_map() function. An attacker can perform attack like: array.php?map=phpinfo, that execute phpinfo() in it.
22 |
23 | ##### Code Credits: Octagon Networks
24 |
25 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1486375951084961792?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
26 |
--------------------------------------------------------------------------------
/_sass/minimal-mistakes/_tables.scss:
--------------------------------------------------------------------------------
1 | /* ==========================================================================
2 | TABLES
3 | ========================================================================== */
4 |
5 | table {
6 | display: block;
7 | margin-bottom: 1em;
8 | width: 100%;
9 | font-family: $global-font-family;
10 | font-size: $type-size-6;
11 | border-collapse: collapse;
12 | overflow-x: auto;
13 |
14 | & + table {
15 | margin-top: 1em;
16 | }
17 | }
18 |
19 | thead {
20 | background-color: $border-color;
21 | border-bottom: 2px solid mix(#000, $border-color, 25%);
22 | }
23 |
24 | th {
25 | padding: 0.5em;
26 | font-weight: bold;
27 | text-align: left;
28 | }
29 |
30 | td {
31 | padding: 0.5em;
32 | border-bottom: 1px solid mix(#000, $border-color, 25%);
33 | }
34 |
35 | tr,
36 | td,
37 | th {
38 | vertical-align: middle;
39 | }
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-10.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 10"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "authentication bypass"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-22: Vulnerable Code Snippet - 10
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 | #### Solution:
20 |
21 | The code is vulnerable to authentication bypass vulnerability. An attacker can impersonate and login as any user as at the line-10 the code doesn't validate the JWT signature.
22 |
23 | ##### Code Credits: SonarSource
24 |
25 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1484947412443545602?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
26 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-13.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 13"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "RCE via Path Traversal"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-25: Vulnerable Code Snippet - 13
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 | #### Solution:
20 |
21 | The code is vulnerable remote code execution vulnerability via Path Traversal. Payload like this works: ?dir=. ./ .. /. ./user/profile.png
22 |
23 | ##### Code Credits: Octagon Networks
24 |
25 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1486000043165634562?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
26 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-24.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 24"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "LFI"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-37: Vulnerable Code Snippet - 24
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 |
20 | #### Solution:
21 |
22 | The above code is vulnerable to Local File Inclusion (LFI) due to improper sanitization on receiving user input on line-11 and line-12. An attacker may attempt to submit a malicious payload and gain access to internal files.
23 |
24 | Twitter Thread: https://twitter.com/harshbothra_/status/1490320844962377728
25 |
26 | ##### Code Credits: SonarSource
27 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-33.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 33"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "RCE via SSTI"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 |
14 | ### SecurityExplained S-46: Vulnerable Code Snippet - 33
15 |
16 | #### Vulnerable Code:
17 |
18 | 
19 |
20 |
21 | #### Solution:
22 |
23 | This code is vulnerable to RCE via SSTI due to improper filtration. Additionally, the replace() function is case sensitive and the filters can be bypassed by case juggling to execute an XSS attack as well.
24 |
25 | Twitter Thread: https://twitter.com/harshbothra_/status/1493412245404938241
26 |
27 | ##### Code Credits: @0xryuk
28 |
29 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-08.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 8"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "Path Traversal"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-20: Vulnerable Code Snippet - 8
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 | #### Solution:
20 |
21 | The code is vulnerable to path traversal attack. There is a sanitization against this attack but the protection is not sufficient and can be bypassed with the payloads such as ".\./.\.shell.jsp".
22 |
23 | ##### Code Credits: SonarSource
24 |
25 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1484208541707927554?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
26 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-04.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 4"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "File Upload"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-16: Vulnerable Code Snippet - 4
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 | #### Solution:
20 |
21 | The issue in this code snippet is the use of Blacklist (Denylist) instead of using a Whitelist (Allowlist). An attacker can bypass this protection in multiple ways and upload a malicious file on the server.
22 |
23 | ##### Code Credits: SonarSource
24 |
25 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1482740498683285506?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
26 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-16.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 16"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "XXE"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-28: Vulnerable Code Snippet - 16
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 | #### Solution:
20 |
21 | The code is vulnerable to XXE attack because the use of the `LIBXML_NOENT` enables the external entity loading in php8.
22 |
23 | Similar Issue: https://blog.sonarsource.com/wordpress-xxe-security-vulnerability
24 |
25 | ##### Code Credits: SonarSource
26 |
27 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1487080467861889030?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
28 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-34.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 34"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "IDOR"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-47: Vulnerable Code Snippet - 34
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 |
20 | #### Solution:
21 |
22 | This code is vulnerable IDOR as the user_id and record_id are not properly protected by the authorization verification and as a result an attacker who can guess/know these two parameters can access other user's information.
23 |
24 | Twitter Thread: https://twitter.com/harshbothra_/status/1493789734392373253
25 |
26 | ##### Code Credits: @ChetanyaKunndra
27 |
28 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-32.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 32"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "Open Redirect"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 |
14 | ### SecurityExplained S-45: Vulnerable Code Snippet - 32
15 |
16 | #### Vulnerable Code:
17 |
18 | 
19 |
20 |
21 | #### Solution:
22 |
23 | This code is vulnerable to open redirection attack as the function "get_success_url" on line-27 doesn't properly implement the checks and the "Next" parameter is not using any whitelists. This may result into a redirection issue.
24 |
25 | Twitter Thread: https://twitter.com/harshbothra_/status/1493042310589947906
26 |
27 | ##### Code Credits: @SonarSource
28 |
--------------------------------------------------------------------------------
/_layouts/archive-taxonomy.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: default
3 | author_profile: false
4 | ---
5 |
6 | {% if page.header.overlay_color or page.header.overlay_image or page.header.image %}
7 | {% include page__hero.html %}
8 | {% elsif page.header.video.id and page.header.video.provider %}
9 | {% include page__hero_video.html %}
10 | {% endif %}
11 |
12 | {% if page.url != "/" and site.breadcrumbs %}
13 | {% unless paginator %}
14 | {% include breadcrumbs.html %}
15 | {% endunless %}
16 | {% endif %}
17 |
18 |
19 | {% include sidebar.html %}
20 |
21 |
22 | {% unless page.header.overlay_color or page.header.overlay_image %}
23 |
{{ page.title }}
24 | {% endunless %}
25 | {% for post in page.posts %}
26 | {% include archive-single.html %}
27 | {% endfor %}
28 |
29 |
30 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-26.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 26"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "SQLi"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-39: Vulnerable Code Snippet - 26
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 |
20 | #### Solution:
21 |
22 | This code demonstrates a basic SQL Injection vulnerability. As observed in the code, there is no sanitization performed & the user-controlled input is directly supplied. Looking at Line-19, it can be clearly seen as an SQLi issue.
23 |
24 |
25 | Twitter Thread: https://twitter.com/harshbothra_/status/1490792057597616128
26 |
27 | ##### Code Credits: @ChetanyaKunndra
28 |
29 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-01.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 1"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "XSS"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 |
14 |
15 | ### SecurityExplained S-12: Vulnerable Code Snippet - 1
16 |
17 | #### Vulnerable Code:
18 |
19 | 
20 |
21 | #### Solution:
22 |
23 | The above code is vulnerable to cross-site scripting attacks due to improper filtration! The encoding is missing a single quote (') and it is possible to execute an XSS with payloads such as: '+alert(1)+'.
24 |
25 | ##### Code Credits: OWASP Secure Coding Dojo
26 |
27 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1481257258734727171?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
28 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-30.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 30"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "RCE via SSTI"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-43: Vulnerable Code Snippet - 30
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 |
20 | #### Solution:
21 |
22 |
23 | This code is vulnerable to SSTI and as a result, an attacker may attempt to gain RCE. The code uses "user input" to search in its store. However, it does not filter the return value of the template render.
24 |
25 | Ex Payload: {{10-6}} => 4
26 |
27 |
28 | Twitter Thread: https://twitter.com/harshbothra_/status/1492332636756398083
29 |
30 | ##### Code Credits: @Brumens2
31 |
32 |
--------------------------------------------------------------------------------
/_includes/comments-providers/discourse.html:
--------------------------------------------------------------------------------
1 | {% if site.comments.discourse.server %}
2 | {% capture canonical %}{% if site.permalink contains '.html' %}{{ page.url | absolute_url }}{% else %}{{ page.url | absolute_url | remove:'index.html' | strip_slash }}{% endif %}{% endcapture %}
3 |
12 | Please enable JavaScript to view the comments powered by Discourse.
13 | {% endif %}
14 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-28.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 28"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "IDOR"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-41: Vulnerable Code Snippet - 28
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 |
20 | #### Solution:
21 |
22 |
23 | @Brumens2 explained that this code is vulnerable to Insecure Direct Object Reference. The issue is that the if statement do check with "==" and not "&&" on line-17. This means if irrespective of "true" or "false" condition, it will grant the permission.
24 |
25 |
26 |
27 | Twitter Thread: https://twitter.com/harshbothra_/status/1491644512204394498
28 |
29 | ##### Code Credits: @Brumens2
30 |
31 |
--------------------------------------------------------------------------------
/_site/resources/vulnerable-code-25.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-38: Vulnerable Code Snippet - 25
2 |
3 | #### Vulnerable Code:
4 |
5 | 
6 |
7 |
8 | #### Solution:
9 |
10 | The above code is vulnerable to Remote Code Execution. The code implements a black-list based filter on line-15 which can be bypassed if the payload meets the following requirements:
11 | * Is inside a quote to not take advantage of the bash CLI [Ex: "$(whoami)" ]
12 | * Do not use any of the blacklist chars inside the $(...).
13 | * Execute a system command of any kind that is proven to execute.
14 |
15 | It is recommended to use a whitelist instead and also not use system cmd calls to make a task instead use a built-in function and create an own function that does the same without using os.system(ls).
16 |
17 |
18 | Twitter Thread: https://twitter.com/harshbothra_/status/1490513142375333889
19 |
20 | ##### Code Credits: SonarSource
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-05.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 5"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "XSS"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-17: Vulnerable Code Snippet - 5
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 | #### Solution:
20 |
21 | The issue in this code snippet is that the files are stored without any extension. The Apache does not attach a Content-Type header in the response. Modern browsers will interpret these files as HTML which may lead to an attack such as Stored Cross-Site Scripting.
22 |
23 | ##### Code Credits: SonarSource
24 |
25 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1483124633373409281?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
26 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-29.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 29"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "XSS"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-42: Vulnerable Code Snippet - 29
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 |
20 | #### Solution:
21 |
22 |
23 | This code is vulnerable to cross-site scripting (XSS) as an attacker can perform successful attack by supplying malicious payload in the user_comment parameter. With some interesting response from the community, it looks like the code is also vulnerable to IDOR.
24 |
25 |
26 |
27 | Twitter Thread: https://twitter.com/harshbothra_/status/1491972760343621632
28 |
29 | ##### Code Credits: @ChetanyaKunndra
30 |
31 |
--------------------------------------------------------------------------------
/_includes/post_pagination.html:
--------------------------------------------------------------------------------
1 | {% if page.previous or page.next %}
2 |
14 | {% endif %}
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-17.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 17"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: ""
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-29: Vulnerable Code Snippet - 17
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 | #### Solution:
20 |
21 | As per @SonarSource, isPrivileged() will always return true because casting an int to an int-based enum never throws an exception, even if there is no enum member corresponding to that number. To make the check correct, it has to return PrivRoles.IsDefined((PrivRoles) role).
22 |
23 | ##### Code Credits: SonarSource
24 |
25 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1487434398186508294?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
26 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-11.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 11"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "serialize - deserialized"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-23: Vulnerable Code Snippet - 11
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 | #### Solution:
20 |
21 | This answer is by SonarSource: There are two ways to serialize classes in PHP, both with O: and C:. The second encoding mode is not supported by the blocklist, and arbitrary objects could then be deserialized! It's not enough to get RCE, but it's a good start.
22 |
23 | ##### Code Credits: SonarSource
24 |
25 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1485315700998938625?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
26 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-37.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 37"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "Host Header Injection"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-50: Vulnerable Code Snippet - 37
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 |
20 | #### Solution:
21 |
22 | This code is vulnerable to Host Header Injection as the code takes the value of HOST in the password reset link from request itself. This may allow an attacker to inject arbitrary host in the password reset link and get hold of the valid reset token to perform a successful password reset attack.
23 |
24 | Twitter Thread: https://twitter.com/harshbothra_/status/1494777872929542144
25 |
26 | ##### Code Credits: @Brumens2
27 |
--------------------------------------------------------------------------------
/_sass/minimal-mistakes/vendor/breakpoint/parsers/_triple.scss:
--------------------------------------------------------------------------------
1 | //////////////////////////////
2 | // Import Pieces
3 | //////////////////////////////
4 | @import "triple/default";
5 |
6 | @function breakpoint-parse-triple($feature, $empty-media, $first) {
7 | $parsed: '';
8 | $leader: '';
9 |
10 | // If we're forcing
11 | @if not ($empty-media) or not ($first) {
12 | $leader: 'and ';
13 | }
14 |
15 | // separate the string features from the value numbers
16 | $string: null;
17 | $numbers: null;
18 | @each $val in $feature {
19 | @if type-of($val) == string {
20 | $string: $val;
21 | }
22 | @else {
23 | @if type-of($numbers) == 'null' {
24 | $numbers: $val;
25 | }
26 | @else {
27 | $numbers: append($numbers, $val);
28 | }
29 | }
30 | }
31 |
32 | $parsed: breakpoint-parse-triple-default($string, nth($numbers, 1), nth($numbers, 2));
33 |
34 | @return $leader + $parsed;
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/_sass/minimal-mistakes/vendor/breakpoint/parsers/_resolution.scss:
--------------------------------------------------------------------------------
1 | @import "resolution/resolution";
2 |
3 | @function breakpoint-build-resolution($query-print, $query-resolution, $empty-media, $first) {
4 | $leader: '';
5 | // If we're forcing
6 | @if not ($empty-media) or not ($first) {
7 | $leader: 'and ';
8 | }
9 |
10 | @if breakpoint-get('transform resolutions') and $query-resolution {
11 | $resolutions: breakpoint-make-resolutions($query-resolution);
12 | $length: length($resolutions);
13 | $query-holder: '';
14 |
15 | @for $i from 1 through $length {
16 | $query: '#{$query-print} #{$leader}#{nth($resolutions, $i)}';
17 | @if $i == 1 {
18 | $query-holder: $query;
19 | }
20 | @else {
21 | $query-holder: '#{$query-holder}, #{$query}';
22 | }
23 | }
24 |
25 | @return $query-holder;
26 | }
27 | @else {
28 | // Return with attached resolution
29 | @return $query-print;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-20.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 20"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "Buffer Overflow"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-33: Vulnerable Code Snippet - 20
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 | #### Solution:
20 |
21 | As per @SonarSource, The problem lies with the server reading 16 bytes on line 13 into its buffer without making sure that the string is null-terminated (the last byte of the buffer is null). Sending 16 non-null bytes to the server will return them and the adjacent buffer containing sensitive data!
22 |
23 | ##### Code Credits: SonarSource
24 |
25 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1488907363184566275?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
26 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-12.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 12"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "Prototype Pollution"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-24: Vulnerable Code Snippet - 12
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 | #### Solution:
20 |
21 | The code is vulnerable to prototype pollution that could even lead to remote code execution. The statement in line 12 uses a dangerous pattern that allows for Prototype Pollution. When type is set to **proto**, then id and content can specify a key and value that will be set on Object.prototype.
22 |
23 | ##### Code Credits: SonarSource
24 |
25 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1485639304861069313?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
26 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-35.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 35"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "XSS and LFI"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-48: Vulnerable Code Snippet - 35
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 |
20 | #### Solution:
21 |
22 | The code is vulnerable to XSS and LFI. The focus of this code is that the filename can be used as a payload to execute JavaScript and perform an XSS attack.
23 | When filtering a function always remember that it's more than one bug that can be exploited in it. For example this is highly vulnerable to LFI but it's also vulnerable to XSS.
24 |
25 | Twitter Thread: https://twitter.com/harshbothra_/status/1494127206552985605
26 |
27 | ##### Code Credits: @Brumens2
28 |
29 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-06.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 6"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "SSRF"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-18: Vulnerable Code Snippet - 6
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 | #### Solution:
20 |
21 | The code is vulnerable to SSRF attack. The issue in this code snippet is that the Java's URI.resolve() will return its parameter if it is an absolute URL, which can be abused to perform SSRF. By using http:/example.com# as artifact the final URL will start with http:/example.com#, which the OkHttp library will accept when making the request.
22 |
23 | ##### Code Credits: SonarSource
24 |
25 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1483501885235417090?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
26 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-22.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 22"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "CMD Injextion"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-35: Vulnerable Code Snippet - 22
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 | #### Solution:
20 |
21 | As per @SonarSource, Arbitrary arguments can be added to the tar command, e.g. by creating a file named “-I touch shell” in /opt/webapp. The -I argument allows executing an arbitrary command, here “touch shell”. --checkpoint-action works too.
22 |
23 | Twitter Thread: https://twitter.com/harshbothra_/status/1489630710025830400
24 |
25 | ##### Code Credits: SonarSource
26 |
27 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1489630648159846400?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
28 |
--------------------------------------------------------------------------------
/_includes/video:
--------------------------------------------------------------------------------
1 | {% capture video_id %}{{ include.id }}{% endcapture %}
2 | {% capture video_provider %}{{ include.provider }}{% endcapture %}
3 |
4 |
5 |
6 | {% if video_provider == "vimeo" %}
7 |
8 | {% elsif video_provider == "youtube" %}
9 |
10 | {% elsif video_provider == "google-drive" %}
11 |
12 | {% elsif video_provider == "bilibili" %}
13 |
14 | {% endif %}
15 |
16 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-41.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 41"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "CORS"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-54: Vulnerable Code Snippet - 41
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 |
20 | #### Solution:
21 |
22 | This code is vulnerable to CORS misconfiguration as can be observed on line-14. User-provided data, such as URL parameters, POST data payloads, or cookies, should always be considered untrusted and tainted. Applications constructing HTTP response headers based on tainted data could allow attackers to change security sensitive headers like Cross-Origin Resource Sharing headers.
23 |
24 | Twitter Thread: https://twitter.com/harshbothra_/status/1496326447954341891
25 |
26 | ##### Code Credits: @SonarSource
27 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-44.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 44"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "XSS"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-57: Vulnerable Code Snippet - 44
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 |
20 | #### Solution:
21 |
22 | As per @SonarSource, there is an XSS issue but maybe not as expected. Razor takes care of output encoding for ViewData in line 4. However, ViewData also overwrites the static content in ViewBag & there is an XSS in line 2.
23 | Read More: https://sonarcloud.io/project/issues?id=SonarSourceResearch_2020_calendar_22&open=AXY4_4rsU9JBkqHd22a1&resolved=false&types=VULNERABILITY
24 |
25 | Twitter Thread: https://twitter.com/harshbothra_/status/1497431227451777027
26 |
27 | ##### Code Credits: @SonarSource
28 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-07.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 7"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "RCE via SQLi"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-19: Vulnerable Code Snippet - 7
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 | #### Solution:
20 |
21 | The code is vulnerable to Remote Code Execution via SQL Injection. As per SonarSource, addslashes() is not enough to protect against SQL injections because the interpolated value is not surrounded by quotes. This value is later used in the external shell call without proper escaping.
22 |
23 | A payload like 1--$(id>foo) is enough to gain RCE!
24 |
25 | ##### Code Credits: SonarSource
26 |
27 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1483835811896655877?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
28 |
--------------------------------------------------------------------------------
/_includes/search/google-search-scripts.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/_layouts/pwn.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: archive
3 | ---
4 |
5 | {{ content }}
6 |
7 |
8 | {% assign categories_max = 0 %}
9 | {% for category in site.categories %}
10 | {% if category[1].size > categories_max %}
11 | {% assign categories_max = category[1].size %}
12 | {% endif %}
13 | {% endfor %}
14 |
15 | {% for i in (1..categories_max) reversed %}
16 | {% for category in site.categories %}
17 | {% if category[1].size == i %}
18 | {% if category[0] == "Pwn" %}
19 |
27 | {% endif %}
28 | {% endif %}
29 | {% endfor %}
30 | {% endfor %}
31 |
--------------------------------------------------------------------------------
/_layouts/blog.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: archive
3 | ---
4 |
5 | {{ content }}
6 |
7 |
8 | {% assign categories_max = 0 %}
9 | {% for category in site.categories %}
10 | {% if category[1].size > categories_max %}
11 | {% assign categories_max = category[1].size %}
12 | {% endif %}
13 | {% endfor %}
14 |
15 | {% for i in (1..categories_max) reversed %}
16 | {% for category in site.categories %}
17 | {% if category[1].size == i %}
18 | {% if category[0] == "Blog" %}
19 |
27 | {% endif %}
28 | {% endif %}
29 | {% endfor %}
30 | {% endfor %}
31 |
32 |
--------------------------------------------------------------------------------
/_layouts/htb.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: archive
3 | ---
4 |
5 | {{ content }}
6 |
7 |
8 | {% assign categories_max = 0 %}
9 | {% for category in site.categories %}
10 | {% if category[1].size > categories_max %}
11 | {% assign categories_max = category[1].size %}
12 | {% endif %}
13 | {% endfor %}
14 |
15 | {% for i in (1..categories_max) reversed %}
16 | {% for category in site.categories %}
17 | {% if category[1].size == i %}
18 | {% if category[0] == "HTB" %}
19 |
27 | {% endif %}
28 | {% endif %}
29 | {% endfor %}
30 | {% endfor %}
31 |
32 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-21.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 21"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "DNS rebinding"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-34: Vulnerable Code Snippet - 21
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 | #### Solution:
20 |
21 | As per @SonarSource, This risk of DNS rebinding is always easy to overlook: Dns.GetHostEntry() does a first DNS query, validates the result against the allow-list, and then WebRequest does a second DNS query. Both DNS queries can have a different response, and unintended servers could be reached that way. Always work with the value you first validated!
22 |
23 | ##### Code Credits: SonarSource
24 |
25 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1489280271640055809?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
26 |
--------------------------------------------------------------------------------
/_layouts/expdev.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: archive
3 | ---
4 |
5 | {{ content }}
6 |
7 |
8 | {% assign categories_max = 0 %}
9 | {% for category in site.categories %}
10 | {% if category[1].size > categories_max %}
11 | {% assign categories_max = category[1].size %}
12 | {% endif %}
13 | {% endfor %}
14 |
15 | {% for i in (1..categories_max) reversed %}
16 | {% for category in site.categories %}
17 | {% if category[1].size == i %}
18 | {% if category[0] == "Exploit Development" %}
19 |
27 | {% endif %}
28 | {% endif %}
29 | {% endfor %}
30 | {% endfor %}
31 |
--------------------------------------------------------------------------------
/_layouts/resources.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: archive
3 | ---
4 |
5 | {{ content }}
6 |
7 |
8 | {% assign categories_max = 0 %}
9 | {% for category in site.categories %}
10 | {% if category[1].size > categories_max %}
11 | {% assign categories_max = category[1].size %}
12 | {% endif %}
13 | {% endfor %}
14 |
15 | {% for i in (1..categories_max) reversed %}
16 | {% for category in site.categories %}
17 | {% if category[1].size == i %}
18 | {% if category[0] == "Offsec" %}
19 |
27 | {% endif %}
28 | {% endif %}
29 | {% endfor %}
30 | {% endfor %}
31 |
32 |
--------------------------------------------------------------------------------
/resources.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: archive
3 | ---
4 |
5 | {{ content }}
6 |
7 |
8 | {% assign categories_max = 0 %}
9 | {% for category in site.categories %}
10 | {% if category[1].size > categories_max %}
11 | {% assign categories_max = category[1].size %}
12 | {% endif %}
13 | {% endfor %}
14 |
15 | {% for i in (1..categories_max) reversed %}
16 | {% for category in site.categories %}
17 | {% if category[1].size == i %}
18 | {% if category[0] == "Binary Exploitation" %}
19 |
27 | {% endif %}
28 | {% endif %}
29 | {% endfor %}
30 | {% endfor %}
31 |
32 |
--------------------------------------------------------------------------------
/_layouts/cve.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: archive
3 | ---
4 |
5 | {{ content }}
6 |
7 |
8 | {% assign categories_max = 0 %}
9 | {% for category in site.categories %}
10 | {% if category[1].size > categories_max %}
11 | {% assign categories_max = category[1].size %}
12 | {% endif %}
13 | {% endfor %}
14 |
15 | {% for i in (1..categories_max) reversed %}
16 | {% for category in site.categories %}
17 | {% if category[1].size == i %}
18 | {% if category[0] == "CVE" %}
19 |
27 | {% endif %}
28 | {% endif %}
29 | {% endfor %}
30 | {% endfor %}
31 |
32 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-02.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 2"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "DOM XSS"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 |
14 | ### SecurityExplained S-13: Vulnerable Code Snippet - 2
15 |
16 | #### Vulnerable Code:
17 |
18 | 
19 |
20 | #### Solution:
21 |
22 | The above code is vulnerable to cross-site scripting attack as it can be observed that on the line 15, a handler for message events is registered which writes the event's data in the DOM on the line 13.
23 | It is possible to embed this page and send an event with an XSS payload to execute a successful attack.
24 |
25 | Similar Bug: https://blog.sonarsource.com/ghost-admin-takeover
26 |
27 | ##### Code Credits: SonarSource
28 |
29 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1481606121991598081?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
30 |
--------------------------------------------------------------------------------
/_layouts/posts.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: archive
3 | ---
4 |
5 | {{ content }}
6 |
7 |
17 |
18 | {% assign postsByYear = site.posts | group_by_exp: 'post', 'post.date | date: "%Y"' %}
19 | {% for year in postsByYear %}
20 |
29 | {% endfor %}
30 |
--------------------------------------------------------------------------------
/_layouts/splash.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: default
3 | ---
4 |
5 | {% if page.header.overlay_color or page.header.overlay_image or page.header.image %}
6 | {% include page__hero.html %}
7 | {% elsif page.header.video.id and page.header.video.provider %}
8 | {% include page__hero_video.html %}
9 | {% endif %}
10 |
11 |
12 |
13 | {% if page.title %} {% endif %}
14 | {% if page.excerpt %} {% endif %}
15 | {% if page.date %} {% endif %}
16 | {% if page.last_modified_at %} {% endif %}
17 |
18 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-19.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 19"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "SQLi Regex Bypass"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-31: Vulnerable Code Snippet - 19
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 | #### Solution:
20 |
21 | As per @SonarSource, The regex at line 7 is correct in itself as it checks for the right characters. The bug lies in the g flag; it makes the regex object retain the last match index and will continue after that index when .test() is called again. Attackers could still use quotes, and perform the SQL injection, by sending their request two times in a row: the second regex check will start after the quote.
22 |
23 | ##### Code Credits: SonarSource
24 |
25 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1488191330493014018?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
26 |
--------------------------------------------------------------------------------
/_includes/nav_list:
--------------------------------------------------------------------------------
1 | {% assign navigation = site.data.navigation[include.nav] %}
2 |
3 |
4 | {% if page.sidebar.title %}{{ page.sidebar.title }} {% endif %}
5 |
6 | {{ site.data.ui-text[site.locale].menu_label | default: "Toggle Menu" }}
7 |
8 | {% for nav in navigation %}
9 |
10 | {% if nav.url %}
11 | {{ nav.title }}
12 | {% else %}
13 | {{ nav.title }}
14 | {% endif %}
15 |
16 | {% if nav.children != null %}
17 |
22 | {% endif %}
23 |
24 | {% endfor %}
25 |
26 |
27 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-42.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 42"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "Multiple vulnerabilities"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-55: Vulnerable Code Snippet - 42
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 |
20 | #### Solution:
21 |
22 | This code is vulnerable to multiple security vulnerabilities:
23 | 1. The token generation algorithm is SHA-1 which is known to collision attacks and is not a best practice to use it.
24 | 2. There is a possibility of account takeover based on the actual implementation as an attacker may attempt to inject emails to get it routed to attacker email along with victim email.
25 | 3. This also looks vulnerable to Host Header Injection attack.
26 |
27 | Twitter Thread: https://twitter.com/harshbothra_/status/1496668703181651972
28 |
29 | ##### Code Credits: @SonarSource
30 |
--------------------------------------------------------------------------------
/_includes/scripts.html:
--------------------------------------------------------------------------------
1 | {% if site.footer_scripts %}
2 | {% for script in site.footer_scripts %}
3 |
4 | {% endfor %}
5 | {% else %}
6 |
7 |
8 | {% endif %}
9 |
10 | {% if site.search == true or page.layout == "search" %}
11 | {%- assign search_provider = site.search_provider | default: "lunr" -%}
12 | {%- case search_provider -%}
13 | {%- when "lunr" -%}
14 | {% include_cached search/lunr-search-scripts.html %}
15 | {%- when "google" -%}
16 | {% include_cached search/google-search-scripts.html %}
17 | {%- when "algolia" -%}
18 | {% include_cached search/algolia-search-scripts.html %}
19 | {%- endcase -%}
20 | {% endif %}
21 |
22 | {% include analytics.html %}
23 | {% include /comments-providers/scripts.html %}
24 |
25 | {% if site.after_footer_scripts %}
26 | {% for script in site.after_footer_scripts %}
27 |
28 | {% endfor %}
29 | {% endif %}
30 |
--------------------------------------------------------------------------------
/_includes/head.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | {% include seo.html %}
4 |
5 |
6 |
7 |
8 |
9 |
10 |
13 |
14 |
15 |
16 |
17 |
31 |
32 | {% if site.head_scripts %}
33 | {% for script in site.head_scripts %}
34 |
35 | {% endfor %}
36 | {% endif %}
37 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-18.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 18"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "password reset flaw"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 |
14 | ### SecurityExplained S-30: Vulnerable Code Snippet - 18
15 |
16 | #### Vulnerable Code:
17 |
18 | 
19 |
20 | #### Solution:
21 |
22 | As per SonarSource, At line 9, the email is transformed to uppercase before its use in the SQL query. On Unicode characters, this process has the unintended effect that two distinct code points may result in the same one.
23 |
24 | It can be used to send the password reset token to another email and takeover accounts:
25 |
26 | foo@mix.com -> FOO@MIX.com
27 | foo@mıhttp://x.com -> FOO@MIX.com
28 |
29 | Interesting Blog: https://t.co/UxdZJQxzc1
30 |
31 | ##### Code Credits: SonarSource
32 |
33 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1487850861770731520?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
34 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-09.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 9"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "RCE via File Upload"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-21: Vulnerable Code Snippet - 9
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 | #### Solution:
20 |
21 | The code is vulnerable to Remote Code Execution by uploading a malicious file named as `img-converter.exe` that will then be executed instead of the one installed on the system.
22 |
23 | As per Sonar Source, When executing commands by name (e.g. `img-converter`) on Windows, the OS looks for the executable in the current directory first and only after that in the PATH. This applies here because the command is executed in the directory where the file is copied to.
24 |
25 | ##### Code Credits: SonarSource
26 |
27 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1484590293483945984?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
28 |
--------------------------------------------------------------------------------
/_site/resources/path-traversal-file-upload.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-9: Path Traversal via File Upload
2 |
3 | ```
4 | File upload is a very interesting functionality and there are multiple attacks that are possible such as code execution, cross-site scripting and one of the functionality is "File Overwrite using Path Traversal"
5 |
6 | Whenever you find a file upload functionality that stores the files on the backend instead of just processing the data for one time use, you may try following steps:
7 |
8 | 1. Capture a file upload request.
9 | 2. In the filename parameter, change filename to "../../filename" and forward the request.
10 | 3. See, if the file is getting stored outside the expected directory, if 'yes', it is an issue.
11 | 4. Now, attempt to overwrite a system file and check if it is possible to overwrite the system file.
12 |
13 | Note: It is not recommended to overwrite a critical system file on the production system, make sure you take necessary permissions from the client before you perform such escalations.
14 |
15 | ```
16 |
17 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1480200369732931584?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
18 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-03.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 3"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "Arbitrary File Read"
10 | categories:
11 | - Vulnerable Code Snippet
12 |
13 | ---
14 | ### SecurityExplained S-15: Vulnerable Code Snippet - 3
15 |
16 | #### Vulnerable Code:
17 |
18 | 
19 |
20 | #### Solution:
21 |
22 | The issue lies in line 11 due to the use of "os.path.join()" and the issue here is an attacker can read arbitrary files by supplying malicious payload through img variable.
23 |
24 | As per the documentation, when the values passed in "os.path.join()" & one of the paths to concatenate is absolute, previous values will be ignored.
25 |
26 | Hence, here the string passed in "os.path.join(harsh,/etc/passwd)" return as "/etc/passwd" resulting into accessing the sensitive file.
27 |
28 | ##### Code Credits: SonarSource
29 |
30 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1482316119101030411?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
31 |
--------------------------------------------------------------------------------
/_sass/minimal-mistakes/vendor/susy/susy/_unprefix.scss:
--------------------------------------------------------------------------------
1 | // Unprefix Susy
2 | // =============
3 |
4 |
5 | // Span
6 | // ----
7 | /// Un-prefixed alias for `susy-span`
8 | /// (available by default)
9 | ///
10 | /// @group api
11 | /// @alias susy-span
12 | ///
13 | /// @param {list} $span
14 | /// @param {map} $config [()]
15 | @function span(
16 | $span,
17 | $config: ()
18 | ) {
19 | @return susy-span($span, $config);
20 | }
21 |
22 |
23 | // Gutter
24 | // ------
25 | /// Un-prefixed alias for `susy-gutter`
26 | /// (available by default)
27 | ///
28 | /// @group api
29 | /// @alias susy-gutter
30 | ///
31 | /// @param {integer | list} $context [null] -
32 | /// @param {map} $config [()]
33 | @function gutter(
34 | $context: susy-get('columns'),
35 | $config: ()
36 | ) {
37 | @return susy-gutter($context, $config);
38 | }
39 |
40 |
41 | // Slice
42 | // -----
43 | /// Un-prefixed alias for `susy-slice`
44 | /// (available by default)
45 | ///
46 | /// @group api
47 | /// @alias susy-slice
48 | ///
49 | /// @param {list} $span
50 | /// @param {map} $config [()]
51 | @function slice(
52 | $span,
53 | $config: ()
54 | ) {
55 | @return susy-slice($span, $config);
56 | }
57 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-15.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 15"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "Time of Check - Time of Use"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-27: Vulnerable Code Snippet - 15
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 | #### Solution:
20 |
21 | As per SonarSource, There is a ToCToU (Time of Check - Time of Use) bug: if the file does not exist at the time of the checks, they will be skipped. Attackers could create a symlink at /tmp/logs.txt right before the call to fopen(), and write to an unintended destination! It's very common to find file checks vulnerable to such ToCToU bugs. The best ways to avoid it is to perform these operations in folders with restrictive permissions and prefer file descriptors to paths (fstat, etc).
22 |
23 | ##### Code Credits: SonarSource
24 |
25 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1486753867047997442?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
26 |
--------------------------------------------------------------------------------
/minimal-mistakes-jekyll.gemspec:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | Gem::Specification.new do |spec|
4 | spec.name = "minimal-mistakes-jekyll"
5 | spec.version = "4.19.2"
6 | spec.authors = ["Michael Rose"]
7 |
8 | spec.summary = %q{A flexible two-column Jekyll theme.}
9 | spec.homepage = "https://github.com/mmistakes/minimal-mistakes"
10 | spec.license = "MIT"
11 |
12 | spec.metadata["plugin_type"] = "theme"
13 |
14 | spec.files = `git ls-files -z`.split("\x0").select do |f|
15 | f.match(%r{^(assets|_(data|includes|layouts|sass)/|(LICENSE|README|CHANGELOG)((\.(txt|md|markdown)|$)))}i)
16 | end
17 |
18 | spec.add_runtime_dependency "jekyll", ">= 3.7", "< 5.0"
19 | spec.add_runtime_dependency "jekyll-paginate", "~> 1.1"
20 | spec.add_runtime_dependency "jekyll-sitemap", "~> 1.3"
21 | spec.add_runtime_dependency "jekyll-gist", "~> 1.5"
22 | spec.add_runtime_dependency "jekyll-feed", "~> 0.1"
23 | spec.add_runtime_dependency "jekyll-include-cache", "~> 0.1"
24 |
25 | spec.add_development_dependency "bundler"
26 | spec.add_development_dependency "rake", ">= 12.3.3"
27 | end
28 |
--------------------------------------------------------------------------------
/_site/minimal-mistakes-jekyll.gemspec:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | Gem::Specification.new do |spec|
4 | spec.name = "minimal-mistakes-jekyll"
5 | spec.version = "4.19.2"
6 | spec.authors = ["Michael Rose"]
7 |
8 | spec.summary = %q{A flexible two-column Jekyll theme.}
9 | spec.homepage = "https://github.com/mmistakes/minimal-mistakes"
10 | spec.license = "MIT"
11 |
12 | spec.metadata["plugin_type"] = "theme"
13 |
14 | spec.files = `git ls-files -z`.split("\x0").select do |f|
15 | f.match(%r{^(assets|_(data|includes|layouts|sass)/|(LICENSE|README|CHANGELOG)((\.(txt|md|markdown)|$)))}i)
16 | end
17 |
18 | spec.add_runtime_dependency "jekyll", ">= 3.7", "< 5.0"
19 | spec.add_runtime_dependency "jekyll-paginate", "~> 1.1"
20 | spec.add_runtime_dependency "jekyll-sitemap", "~> 1.3"
21 | spec.add_runtime_dependency "jekyll-gist", "~> 1.5"
22 | spec.add_runtime_dependency "jekyll-feed", "~> 0.1"
23 | spec.add_runtime_dependency "jekyll-include-cache", "~> 0.1"
24 |
25 | spec.add_development_dependency "bundler"
26 | spec.add_development_dependency "rake", ">= 12.3.3"
27 | end
28 |
--------------------------------------------------------------------------------
/_includes/gallery:
--------------------------------------------------------------------------------
1 | {% if include.id %}
2 | {% assign gallery = page[include.id] %}
3 | {% else %}
4 | {% assign gallery = page.gallery %}
5 | {% endif %}
6 |
7 | {% if include.layout %}
8 | {% assign gallery_layout = include.layout %}
9 | {% else %}
10 | {% if gallery.size == 2 %}
11 | {% assign gallery_layout = 'half' %}
12 | {% elsif gallery.size >= 3 %}
13 | {% assign gallery_layout = 'third' %}
14 | {% else %}
15 | {% assign gallery_layout = '' %}
16 | {% endif %}
17 | {% endif %}
18 |
19 |
20 | {% for img in gallery %}
21 | {% if img.url %}
22 |
24 |
26 |
27 | {% else %}
28 |
30 | {% endif %}
31 | {% endfor %}
32 | {% if include.caption %}
33 | {{ include.caption | markdownify | remove: "" | remove: "
" }}
34 | {% endif %}
35 |
36 |
--------------------------------------------------------------------------------
/_sass/minimal-mistakes/skins/_dirt.scss:
--------------------------------------------------------------------------------
1 | /* ==========================================================================
2 | Dirt skin
3 | ========================================================================== */
4 |
5 | /* Colors */
6 | $background-color: #f3f3f3 !default;
7 | $text-color: #343434 !default;
8 | $muted-text-color: #8e8b82 !default;
9 | $primary-color: #343434 !default;
10 | $border-color: #e9dcbe !default;
11 | $footer-background-color: #e9dcbe !default;
12 | $link-color: #343434 !default;
13 | $masthead-link-color: $text-color !default;
14 | $masthead-link-color-hover: $text-color !default;
15 | $navicon-link-color-hover: mix(#fff, $text-color, 80%) !default;
16 |
17 | /* dirt syntax highlighting (base16) */
18 | $base00: #231e18 !default;
19 | $base01: #302b25 !default;
20 | $base02: #48413a !default;
21 | $base03: #9d8b70 !default;
22 | $base04: #b4a490 !default;
23 | $base05: #cabcb1 !default;
24 | $base06: #d7c8bc !default;
25 | $base07: #e4d4c8 !default;
26 | $base08: #d35c5c !default;
27 | $base09: #ca7f32 !default;
28 | $base0a: #e0ac16 !default;
29 | $base0b: #b7ba53 !default;
30 | $base0c: #6eb958 !default;
31 | $base0d: #88a4d3 !default;
32 | $base0e: #bb90e2 !default;
33 | $base0f: #b49368 !default;
34 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-31.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 31"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "SQli"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-44: Vulnerable Code Snippet - 31
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 |
20 | #### Solution:
21 |
22 | This code connects to the backend database & its purpose is to change the username inside the profile page. It first checks the username "id" by user input and runs a SQL statement to extract the current username for that user. The issue is that user input is not filtered. If you infect the "id" when it's reading the user input. It does not convert the "id" variable into an (int) type or filters it. This makes it possible to get access to the database fully by executing a SQL Injection.
23 |
24 | Example Payload: sleep(1): Will sleep "x" row that is in the table. At "line 24".
25 |
26 | Twitter Thread: https://twitter.com/harshbothra_/status/1492657271662206976
27 |
28 | ##### Code Credits: @Brumens2
29 |
30 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-27.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 27"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "XSS"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-40: Vulnerable Code Snippet - 27
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 |
20 | #### Solution:
21 |
22 | This code is vulnerable to Cross-Site Scripting (XSS) attack. Example Payload: \"onload=alert(1)//
23 |
24 | This payload works because the "replace()" function in PHP do not properly replace the user input. The first replacement works fine replace('\"', '') but when it later replace('\\', '\\\\'), the issue occurs. The issue is that the replacement for '"' is first and coverted to '\"'. When the other replace statement is called it sees '\"' and replace the '\' with a duel backslash '\\' but this in fact destroys the filter itself.
25 |
26 | Example:
27 | value = "\\""
28 |
29 |
30 |
31 | Twitter Thread: https://twitter.com/harshbothra_/status/1491160060076376065
32 |
33 | ##### Code Credits: @Brumens2
34 |
35 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-15-vulnerable-code-25.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Vulnerable Code Snippet - 25"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "RCE"
10 | categories:
11 | - Vulnerable Code Snippet
12 | ---
13 | ### SecurityExplained S-38: Vulnerable Code Snippet - 25
14 |
15 | #### Vulnerable Code:
16 |
17 | 
18 |
19 |
20 | #### Solution:
21 |
22 | The above code is vulnerable to Remote Code Execution. The code implements a black-list based filter on line-15 which can be bypassed if the payload meets the following requirements:
23 | * Is inside a quote to not take advantage of the bash CLI [Ex: "$(whoami)" ]
24 | * Do not use any of the blacklist chars inside the $(...).
25 | * Execute a system command of any kind that is proven to execute.
26 |
27 | It is recommended to use a whitelist instead and also not use system cmd calls to make a task instead use a built-in function and create an own function that does the same without using os.system(ls).
28 |
29 |
30 | Twitter Thread: https://twitter.com/harshbothra_/status/1490513142375333889
31 |
32 | ##### Code Credits: SonarSource
33 |
--------------------------------------------------------------------------------
/_sass/minimal-mistakes/vendor/breakpoint/parsers/_double.scss:
--------------------------------------------------------------------------------
1 | //////////////////////////////
2 | // Import Pieces
3 | //////////////////////////////
4 | @import "double/default-pair";
5 | @import "double/double-string";
6 | @import "double/default";
7 |
8 | @function breakpoint-parse-double($feature, $empty-media, $first) {
9 | $parsed: '';
10 | $leader: '';
11 | // If we're forcing
12 | @if not ($empty-media) or not ($first) {
13 | $leader: 'and ';
14 | }
15 |
16 | $first: nth($feature, 1);
17 | $second: nth($feature, 2);
18 |
19 | // If we've got two numbers, we know we need to use the default pair because there are no media queries that has a media feature that is a number
20 | @if type-of($first) == 'number' and type-of($second) == 'number' {
21 | $parsed: breakpoint-parse-default-pair($first, $second);
22 | }
23 | // If they are both strings, we send it through the string parser
24 | @else if type-of($first) == 'string' and type-of($second) == 'string' {
25 | $parsed: breakpoint-parse-double-string($first, $second);
26 | }
27 | // If it's a string/number pair, we parse it as a normal double
28 | @else {
29 | $parsed: breakpoint-parse-double-default($first, $second);
30 | }
31 |
32 | @return $leader + $parsed;
33 | }
34 |
--------------------------------------------------------------------------------
/_includes/comment.html:
--------------------------------------------------------------------------------
1 |
23 |
--------------------------------------------------------------------------------
/_includes/footer.html:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/_sass/minimal-mistakes/skins/_dark.scss:
--------------------------------------------------------------------------------
1 | /* ==========================================================================
2 | Dark skin
3 | ========================================================================== */
4 |
5 | /* Colors */
6 | $background-color: #252a34 !default;
7 | $text-color: #eaeaea !default;
8 | $primary-color: #00adb5 !default;
9 | $border-color: mix(#fff, $background-color, 20%) !default;
10 | $code-background-color: mix(#000, $background-color, 15%) !default;
11 | $code-background-color-dark: mix(#000, $background-color, 20%) !default;
12 | $form-background-color: mix(#000, $background-color, 15%) !default;
13 | $footer-background-color: mix(#000, $background-color, 30%) !default;
14 | $link-color: mix($primary-color, $text-color, 40%) !default;
15 | $link-color-hover: mix(#fff, $link-color, 25%) !default;
16 | $link-color-visited: mix(#000, $link-color, 25%) !default;
17 | $masthead-link-color: $text-color !default;
18 | $masthead-link-color-hover: mix(#000, $text-color, 20%) !default;
19 | $navicon-link-color-hover: mix(#000, $background-color, 30%) !default;
20 |
21 | .author__urls.social-icons .svg-inline--fa,
22 | .page__footer-follow .social-icons .svg-inline--fa {
23 | color: inherit;
24 | }
25 |
26 | .ais-search-box .ais-search-box--input {
27 | background-color: $form-background-color;
28 | }
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "minimal-mistakes",
3 | "version": "4.19.2",
4 | "description": "Minimal Mistakes 2 column Jekyll theme.",
5 | "repository": {
6 | "type": "git",
7 | "url": "git://github.com/mmistakes/minimal-mistakes.git"
8 | },
9 | "keywords": [
10 | "jekyll",
11 | "theme",
12 | "minimal"
13 | ],
14 | "author": "Michael Rose",
15 | "license": "MIT",
16 | "bugs": {
17 | "url": "https://github.com/mmistakes/minimal-mistakes/issues"
18 | },
19 | "homepage": "https://mmistakes.github.io/minimal-mistakes/",
20 | "engines": {
21 | "node": ">= 0.10.0"
22 | },
23 | "devDependencies": {
24 | "npm-run-all": "^4.1.5",
25 | "onchange": "^6.1.0",
26 | "uglify-js": "^3.8.0"
27 | },
28 | "scripts": {
29 | "uglify": "uglifyjs assets/js/vendor/jquery/jquery-3.4.1.js assets/js/plugins/jquery.fitvids.js assets/js/plugins/jquery.greedy-navigation.js assets/js/plugins/jquery.magnific-popup.js assets/js/plugins/jquery.ba-throttle-debounce.js assets/js/plugins/smooth-scroll.js assets/js/plugins/gumshoe.js assets/js/_main.js -c -m -o assets/js/main.min.js",
30 | "add-banner": "node banner.js",
31 | "watch:js": "onchange \"assets/js/**/*.js\" -e \"assets/js/main.min.js\" -- npm run build:js",
32 | "build:js": "npm run uglify && npm run add-banner"
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/_includes/tag-list.html:
--------------------------------------------------------------------------------
1 | {% case site.tag_archive.type %}
2 | {% when "liquid" %}
3 | {% assign path_type = "#" %}
4 | {% when "jekyll-archives" %}
5 | {% assign path_type = nil %}
6 | {% endcase %}
7 |
8 | {% if site.tag_archive.path %}
9 | {% comment %}
10 |
11 |
12 | {% endcomment %}
13 | {% capture page_tags %}{% for tag in page.tags %}{{ tag | downcase }}|{{ tag }}{% unless forloop.last %},{% endunless %}{% endfor %}{% endcapture %}
14 | {% assign tag_hashes = page_tags | split: ',' | sort %}
15 |
16 |
17 | {{ site.data.ui-text[site.locale].tags_label | default: "Tags:" }}
18 |
19 | {% for hash in tag_hashes %}
20 | {% assign keyValue = hash | split: '|' %}
21 | {% capture tag_word %}{{ keyValue[1] | strip_newlines }}{% endcapture %}
22 | {{ tag_word }} {% unless forloop.last %}, {% endunless %}
23 | {% endfor %}
24 |
25 |
26 | {% endif %}
--------------------------------------------------------------------------------
/_site/resources/feroxbuster-explained.md:
--------------------------------------------------------------------------------
1 | # SecurityExplained S-2: FeroxBuster - A Content Discovery Tool!
2 |
3 | ```
4 | Ferox Buster is easy to use, fast & convenient "Content Discovery" tool written in Rust.
5 |
6 | - Tool Link: https://github.com/epi052/feroxbuster
7 |
8 | One of the reasons to like this tool is its neat documentation: https://epi052.github.io/feroxbuster-docs/docs/
9 |
10 | Why choose this tool over others?: https://epi052.github.io/feroxbuster-docs/docs/compare/
11 |
12 | You can install this tool in multiple ways based upon your environment, and a straightforward example is using the following command:
13 |
14 | - sudo apt update && sudo apt install -y feroxbuster
15 |
16 | Using this tool is quite simple. You can run a simple scan with the following command:
17 |
18 | - ./feroxbuster -u -x
19 |
20 | Other interesting use-case examples can be found here: https://epi052.github.io/feroxbuster-docs/docs/examples/core-features/.
21 |
22 | Feel free to ask questions related to "How do I perform Content Discovery", etc. in the comments, and I will try to answer in the best way possible. Cheers!
23 |
24 | ```
25 |
26 | #### Twitter Handle: @harshbothra_
27 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1477541501311676417?s=20&t=QR8LCZPmGCrSu2SuCUBCgQ)
28 |
--------------------------------------------------------------------------------
/_includes/group-by-array:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 | {% assign __empty_array = '' | split: ',' %}
10 | {% assign group_names = __empty_array %}
11 | {% assign group_items = __empty_array %}
12 |
13 |
14 | {% assign __names = include.collection | map: include.field %}
15 |
16 |
17 | {% assign __names = __names | join: ',' | join: ',' | split: ',' %}
18 |
19 |
20 | {% assign __names = __names | sort %}
21 | {% for name in __names %}
22 |
23 |
24 | {% unless name == previous %}
25 |
26 |
27 | {% assign group_names = group_names | push: name %}
28 | {% endunless %}
29 |
30 | {% assign previous = name %}
31 | {% endfor %}
32 |
33 |
34 |
35 | {% for name in group_names %}
36 |
37 |
38 | {% assign __item = __empty_array %}
39 | {% for __element in include.collection %}
40 | {% if __element[include.field] contains name %}
41 | {% assign __item = __item | push: __element %}
42 | {% endif %}
43 | {% endfor %}
44 |
45 |
46 | {% assign group_items = group_items | push: __item %}
47 | {% endfor %}
--------------------------------------------------------------------------------
/_layouts/default.html:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 |
4 |
5 |
11 |
12 |
13 | {% include head.html %}
14 | {% include head/custom.html %}
15 |
16 |
17 |
18 | {% include_cached skip-links.html %}
19 | {% include_cached browser-upgrade.html %}
20 | {% include_cached masthead.html %}
21 |
22 |
23 | {{ content }}
24 |
25 |
26 | {% if site.search == true %}
27 |
28 | {% include_cached search/search_form.html %}
29 |
30 | {% endif %}
31 |
32 |
38 |
39 | {% include scripts.html %}
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/_layouts/tags.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: archive
3 | ---
4 |
5 | {{ content }}
6 |
7 | {% assign tags_max = 0 %}
8 | {% for tag in site.tags %}
9 | {% if tag[1].size > tags_max %}
10 | {% assign tags_max = tag[1].size %}
11 | {% endif %}
12 | {% endfor %}
13 |
14 |
15 | {% for i in (1..tags_max) reversed %}
16 | {% for tag in site.tags %}
17 | {% if tag[1].size == i %}
18 |
19 |
20 | {{ tag[0] }} {{ i }}
21 |
22 |
23 | {% endif %}
24 | {% endfor %}
25 | {% endfor %}
26 |
27 |
28 | {% for i in (1..tags_max) reversed %}
29 | {% for tag in site.tags %}
30 | {% if tag[1].size == i %}
31 |
40 | {% endif %}
41 | {% endfor %}
42 | {% endfor %}
43 |
--------------------------------------------------------------------------------
/_site/resources/rustscan-portscanner.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-11: RustScan - The Modern Port Scanner
2 |
3 | ```
4 | - RustScan is a port scanner written using Rust programming. The tool utilizes adaptive learning model to improvise itself over the time, i.e. more you use the tool, better it becomes.
5 |
6 | # Tool Repo: https://github.com/RustScan/RustScan/
7 |
8 | - It is mentioned on the official repo that this tool can do following:
9 | - Scans all 65k ports in 3 seconds.
10 | - Full scripting engine support. Automatically pipe results into Nmap, or use our scripts (or write your own) to do whatever you want.
11 | - Adaptive learning. RustScan improves the more you use it. No bloated machine learning here, just basic maths.
12 | - The usuals you would expect. IPv6, CIDR, file input and more.
13 | - Automatically pipes ports into Nmap.
14 |
15 | There are two main points that makes this tool my new preffered choice for the Port Scanning Tool:
16 | - Speed [RustScan is pretty fast and I have compared it with a traditional nmap scan too. ]
17 | - Simple Usage Guide: https://github.com/RustScan/RustScan/wiki/Things-you-may-want-to-do-with-RustScan-but-don't-understand-how
18 |
19 | Installation Guide: https://github.com/RustScan/RustScan/wiki/Installation-Guide
20 |
21 | ```
22 |
23 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1480905854433988611?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
24 |
--------------------------------------------------------------------------------
/_sass/minimal-mistakes.scss:
--------------------------------------------------------------------------------
1 | /*!
2 | * Minimal Mistakes Jekyll Theme 4.19.2 by Michael Rose
3 | * Copyright 2013-2019 Michael Rose - mademistakes.com | @mmistakes
4 | * Licensed under MIT (https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE)
5 | */
6 |
7 | /* Variables */
8 | @import "minimal-mistakes/variables";
9 |
10 | /* Mixins and functions */
11 | @import "minimal-mistakes/vendor/breakpoint/breakpoint";
12 | @include breakpoint-set("to ems", true);
13 | @import "minimal-mistakes/vendor/magnific-popup/magnific-popup"; // Magnific Popup
14 | @import "minimal-mistakes/vendor/susy/susy";
15 | @import "minimal-mistakes/mixins";
16 |
17 | /* Core CSS */
18 | @import "minimal-mistakes/reset";
19 | @import "minimal-mistakes/base";
20 | @import "minimal-mistakes/forms";
21 | @import "minimal-mistakes/tables";
22 | @import "minimal-mistakes/animations";
23 |
24 | /* Components */
25 | @import "minimal-mistakes/buttons";
26 | @import "minimal-mistakes/notices";
27 | @import "minimal-mistakes/masthead";
28 | @import "minimal-mistakes/navigation";
29 | @import "minimal-mistakes/footer";
30 | @import "minimal-mistakes/search";
31 | @import "minimal-mistakes/syntax";
32 |
33 | /* Utility classes */
34 | @import "minimal-mistakes/utilities";
35 |
36 | /* Layout specific */
37 | @import "minimal-mistakes/page";
38 | @import "minimal-mistakes/archive";
39 | @import "minimal-mistakes/sidebar";
40 | @import "minimal-mistakes/print";
41 |
--------------------------------------------------------------------------------
/_site/resources/xxe-in-json.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-14: Exploiting XXE in JSON Endpoints
2 |
3 | ```
4 | XXE a.k.a XML External Entities is a vulnerability that is usally found in endpoints that process XML data. This attack happens when a misconfigured or weekly configured XML parser processed the external entity reference from a XML Input.
5 |
6 | However, if an application is using JSON as content-type in request processing, in a usual assumption, we often do not check for the XXE attack but in certain scenarios, it might be possible that the application supports XML parsing along with JSON but that is not visible via request structure. Hence, we should always check for XXE in JSON endpoints.
7 |
8 | # To perform XXE in JSON Endpoints, One can try below steps:
9 |
10 | 1. Capture a JSON request with Burp Suite.
11 | 2. Convert the content-type to XML using "Content-Type Convertor" Burp Extension.
12 | 3. Process the Request and if request is processed successfully, it means that the XML parsing is supported.
13 | 4. Now, attempt to exploit XXE
14 |
15 | Interesting Read: https://www.netspi.com/blog/technical/web-application-penetration-testing/playing-content-type-xxe-json-endpoints/
16 | More About XXE: https://owasp.org/www-community/vulnerabilities/XML_External_Entity_(XXE)_Processing
17 |
18 | ```
19 |
20 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1481974615409041414?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
21 |
--------------------------------------------------------------------------------
/_posts/resources/2022-02-09-path-traversal-file-upload.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Path Traversal via File Upload"
3 | classes: wide
4 | tag:
5 | - ""
6 | header:
7 | teaser: /assets/images/htb/htb.png
8 | ribbon: green
9 | description: "Path Traversal via File Upload"
10 | categories:
11 | - resources
12 | ---
13 |
14 | ### SecurityExplained S-9: Path Traversal via File Upload
15 |
16 |
17 | File upload is a very interesting functionality and there are multiple attacks that are possible such as code execution, cross-site scripting and one of the functionality is "File Overwrite using Path Traversal"
18 |
19 | Whenever you find a file upload functionality that stores the files on the backend instead of just processing the data for one time use, you may try following steps:
20 |
21 | 1. Capture a file upload request.
22 | 2. In the filename parameter, change filename to "../../filename" and forward the request.
23 | 3. See, if the file is getting stored outside the expected directory, if 'yes', it is an issue.
24 | 4. Now, attempt to overwrite a system file and check if it is possible to overwrite the system file.
25 |
26 | Note: It is not recommended to overwrite a critical system file on the production system, make sure you take necessary permissions from the client before you perform such escalations.
27 |
28 |
29 |
30 | [Follow Twitter Thread](https://twitter.com/harshbothra_/status/1480200369732931584?s=20&t=DGEwqEwXwFbWH0VXkOKVsQ)
31 |
--------------------------------------------------------------------------------
/_includes/category-list.html:
--------------------------------------------------------------------------------
1 | {% case site.category_archive.type %}
2 | {% when "liquid" %}
3 | {% assign path_type = "#" %}
4 | {% when "jekyll-archives" %}
5 | {% assign path_type = nil %}
6 | {% endcase %}
7 |
8 | {% if site.category_archive.path %}
9 | {% comment %}
10 |
11 |
12 | {% endcomment %}
13 | {% capture page_categories %}{% for category in page.categories %}{{ category | downcase }}|{{ category }}{% unless forloop.last %},{% endunless %}{% endfor %}{% endcapture %}
14 | {% assign category_hashes = page_categories | split: ',' | sort %}
15 |
16 |
17 | {{ site.data.ui-text[site.locale].categories_label | default: "Categories:" }}
18 |
19 | {% for hash in category_hashes %}
20 | {% assign keyValue = hash | split: '|' %}
21 | {% capture category_word %}{{ keyValue[1] | strip_newlines }}{% endcapture %}
22 | {{ category_word }} {% unless forloop.last %}, {% endunless %}
23 | {% endfor %}
24 |
25 |
26 | {% endif %}
--------------------------------------------------------------------------------
/_includes/search/search_form.html:
--------------------------------------------------------------------------------
1 |
2 | {%- assign search_provider = site.search_provider | default: "lunr" -%}
3 | {%- case search_provider -%}
4 | {%- when "lunr" -%}
5 |
11 |
12 | {%- when "google" -%}
13 |
19 |
20 |
21 |
22 | {%- when "algolia" -%}
23 |
24 |
25 | {%- endcase -%}
26 |
27 |
--------------------------------------------------------------------------------
/_site/resources/htmli-to-cloud-ssrf.md:
--------------------------------------------------------------------------------
1 | ### SecurityExplained S-4: Escalating HTML Injection to Cloud Metadata SSRF
2 |
3 | ```
4 | If you have found an HTML Injection vulnerability that allows you to load