Wi-Fiキャプティブポータルの開発について調査しています。
FON認証キャプティブポータルからWiSPrXMLタグをキャプチャしたいと思います(私の隣人はそれをアクティブにしていて、そのためのローミングアカウントも持っています)。
iPhoneまたはMacで認証を試みても、キャプティブポータル/ WIPrタグが検出され、コントロールなしで専用のウィンドウ/ミニブラウザが開くため、認証されません。 Linux / * BSDでページを開こうとすると、ブラウザのユーザーエージェントとして機能しないか、動作がiPhone/Appleとして認識されない可能性があります。
キャプティブポータルのWebログインページはhttps/TLSで処理されるため、iPhoneトランザクションをスニッフィングしても、それはカットされません(たとえば、ネットワーク上で暗号化されます)。
sysdig
も試しました Linuxで、そして明らかに暗号化された送信で再び頭を打った。
wget
また、満足のいく結果が得られていません。
どうすればいいですか?
承認された回答:
最終的にlynx
を使用しました FreeBSDシステムでは;最初は-dump
を使用していました オプション。リダイレクトを表示できますが、出力のみを表示し、コンテンツは表示できません。次に、-source
を発見しました オプション。ソース/HTMLを表示し、レンダリングを試みません。
オプション-useragent
も使用しました 私がWISPrディスカバリーを実行しているiPhoneであるふりをし、iPhoneが検出しようとするページの1つを取得しようとしました キャプティブポータル(http://www.apple.com/library/test/sucess.html)を扱っています。
また、FONキャプティブポータルが自己署名されている(?)という事実に対処する必要がありました。そうでない場合、FreeBSDは基盤となるSSLルート証明書を認識していません。 (私はそれを追跡するのに多くの時間を失いませんでした);自己署名証明書を受け入れるようにlynxを構成する必要がありました(後で質問を書き、ここにリンクがあります)。
したがって、実際に使用したコマンドは次のとおりです。
lynx -useragent=CaptiveNetworkSupport -dump http://www.apple.com/library/test/sucess.html
ただし、最初のものには有用性がありますが、私がもっと興味を持ったのは次のとおりです。
lynx -useragent=CaptiveNetworkSupport -source http://www.apple.com/library/test/sucess.html
後者のコマンドラインを使用して、WISPrタグが埋め込まれたHTMLソースを完全に元に戻しました。
man lynx
から
-dump dumps the formatted output of the default document or those specified on the command line to standard output. Unlike interactive mode, all documents are processed. This can be used in the following way: lynx -dump http://www.subir.com/lynx.html Files specified on the command line are formatted as HTML if their names end with one of the standard web suffixes such as ".htm" or ".html". Use the -force_html option to format files whose names do not follow this convention. -source works the same as dump but outputs HTML source instead of formatted text. For example lynx -source . >foo.html generates HTML source listing the files in the current directory. Each file is marked by an HREF relative to the parent directory. Add a trailing slash to make the HREF's relative to the current directory: lynx -source ./ >foo.html
キャプチャされたログインページから取得:
<!-- WISPr message -->^M
<span class="displayNone"><!--<?xml version="1.0" encoding="UTF-8"?>^M
<WISPAccessGatewayParam xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.acmewisp.com/WISPAccessGatewayParam.xsd">^M
<Redirect>^M
<AccessProcedure>1.0</AccessProcedure>^M
<LoginURL>https://xxxx/captive/noswifi?hmac=xxxx&res=notyet&uamip=xxxx&uamport=80&userurl=&challenge=xxxxxxe&nasid=BC-14-01-XX-XX-XX&mac=00-15-AF-XX-XX-XX</LoginURL>^M
<AbortLoginURL>http://xxxx:80/captive/logoff</AbortLoginURL>^M
<MessageType>100</MessageType>^M
<ResponseCode>0</ResponseCode>^M
<AccessLocation>FonZON:PT</AccessLocation>^M
</Redirect>^M
</WISPAccessGatewayParam>-->^M
</span>