2019/10/16
初心者向けCTFのWeb分野の強化法
CTFのweb分野を勉強しているものの本番でなかなか解けないと悩んでいないでしょうか?そんな悩みを持った方を対象に、私の経験からweb分野の強化法を解説します。
How to strengthen the CTF Web field for beginners !!
Although you are studying the CTF web field, are you worried that you can't solve it in production?
For those who have such problems, I will explain how to strengthen the web field based on my experience.
(study group) https://yahoo-osaka.connpass.com/event/149524/
https://2021.pycon.jp/time-table/?id=273396
Webアプリ開発とデータベースマイグレーションには密接な関係があり、Pythonでよく採用されるDjangoやSQLAlchemyには、DBのスキーマを変更するマイグレーション機能があります。一般的に、プログラムを実装するときはリポジトリでブランチを作りそれぞれのブランチで実装作業を進めます。Webアプリの開発でも同様ですが、各ブランチでDBスキーマを変更する場合には注意が必要です。例えば、複数のブランチで同じテーブルのカラムを追加して使いたい場合や、DBスキーマの変更が競合する場合は、ブランチのマージ時に競合してしまいます。多くの機能を並行開発したり、マージするまでの期間が長い場合には、このような競合が増えてしまいます。
このトークでは、Djangoを例に、データベースマイグレーションの仕組みから、実際の開発現場で発生したトラブルとその解決方法について紹介します。
Migration strategies for parallel development of web applications
This document summarizes a microservices meetup hosted by @mosa_siru. Key points include:
1. @mosa_siru is an engineer at DeNA and CTO of Gunosy.
2. The meetup covered Gunosy's architecture with over 45 GitHub repositories, 30 stacks, 10 Go APIs, and 10 Python batch processes using AWS services like Kinesis, Lambda, SQS and API Gateway.
3. Challenges discussed were managing 30 microservices, ensuring API latency below 50ms across availability zones, and handling 10 requests per second with nginx load balancing across 20 servers.
https://2021.pycon.jp/time-table/?id=273396
Webアプリ開発とデータベースマイグレーションには密接な関係があり、Pythonでよく採用されるDjangoやSQLAlchemyには、DBのスキーマを変更するマイグレーション機能があります。一般的に、プログラムを実装するときはリポジトリでブランチを作りそれぞれのブランチで実装作業を進めます。Webアプリの開発でも同様ですが、各ブランチでDBスキーマを変更する場合には注意が必要です。例えば、複数のブランチで同じテーブルのカラムを追加して使いたい場合や、DBスキーマの変更が競合する場合は、ブランチのマージ時に競合してしまいます。多くの機能を並行開発したり、マージするまでの期間が長い場合には、このような競合が増えてしまいます。
このトークでは、Djangoを例に、データベースマイグレーションの仕組みから、実際の開発現場で発生したトラブルとその解決方法について紹介します。
Migration strategies for parallel development of web applications
This document summarizes a microservices meetup hosted by @mosa_siru. Key points include:
1. @mosa_siru is an engineer at DeNA and CTO of Gunosy.
2. The meetup covered Gunosy's architecture with over 45 GitHub repositories, 30 stacks, 10 Go APIs, and 10 Python batch processes using AWS services like Kinesis, Lambda, SQS and API Gateway.
3. Challenges discussed were managing 30 microservices, ensuring API latency below 50ms across availability zones, and handling 10 requests per second with nginx load balancing across 20 servers.
The document discusses an SSRF attack on Amazon EC2 Instance Metadata Service (IMDS) version 1. It describes how IMDSv1 could be accessed from outside the instance by exploiting vulnerabilities in a web application firewall (WAF). The attack allowed accessing credentials of an IAM role that had permissions to an S3 bucket storing personal information. To mitigate such risks, Amazon introduced IMDSv2, which the document then explains can still be bypassed using techniques like the Gopher protocol. It concludes by emphasizing the need for organizations to strengthen defenses against SSRF attacks.
IoT Devices Compliant with JC-STAR Using Linux as a Container OSTomohiro Saneyoshi
Security requirements for IoT devices are becoming more defined, as seen with the EU Cyber Resilience Act and Japan’s JC-STAR.
It's common for IoT devices to run Linux as their operating system. However, adopting general-purpose Linux distributions like Ubuntu or Debian, or Yocto-based Linux, presents certain difficulties. This article outlines those difficulties.
It also, it highlights the security benefits of using a Linux-based container OS and explains how to adopt it with JC-STAR, using the "Armadillo Base OS" as an example.
Feb.25.2025@JAWS-UG IoT
45. 参考: PHP 7.4にてproc_openに機能追加
proc_open() function
proc_open() now accepts an array instead of a string for the command. In
this case the process will be opened directly (without going through a shell)
and PHP will take care of any necessary argument escaping.
私訳
proc_open() は、コマンドを文字列の代わりに配列として受け入れるように
なりました。この場合、プロセスは(シェルを経由せずに)直接開かれ、
PHPは必要な引数のエスケープを処理します。
45
<?php
proc_open(['php', '-r', 'echo "Hello Worldn";'],
$descriptors, $pipes);
?>
https://www.php.net/manual/en/migration74.new-features.php より引用
53. EC2にてSSRF多層防御が実装された
What’s new in IMDSv2
With IMDSv2, every request is now protected by session authentication. A session
begins and ends a series of requests that software running on an EC2 instance uses
to access the locally-stored EC2 instance metadata and credentials. The software
starts a session with a simple HTTP PUT request to IMDSv2. IMDSv2 returns a secret
token to the software running on the EC2 instance, which will use the token as a
password to make requests to IMDSv2 for metadata and credentials. Unlike
traditional passwords, you don’t need to worry about getting the token to the
software, because the software gets it for itself with the PUT request. The token is
never stored by IMDSv2 and can never be retrieved by subsequent calls, so a session
and its token are effectively destroyed when the process using the token terminates.
There’s no limit on the number of requests within a single session, and there’s no
limit on the number of IMDSv2 sessions. Sessions can last up to six hours and, for
added security, a session token can only be used directly from the EC2 instance
where that session began.
53
https://aws.amazon.com/jp/blogs/security/defense-in-depth-open-firewalls-reverse-
proxies-ssrf-vulnerabilities-ec2-instance-metadata-service/