使用CookieJar Pythonにログインwebサイトから"Google App Engine".何が悪い。
-
24-09-2019 - |
質問
していこうとしpythonコードとログインメールボックスyahoo.com から "Google App Engine" . こちら(ここをクリックするとページ) 私はこのようなコード:
import urllib, urllib2, cookielib
url = "https://login.yahoo.com/config/login?"
form_data = {'login' : 'my-login-here', 'passwd' : 'my-password-here'}
jar = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(jar))
form_data = urllib.urlencode(form_data)
# data returned from this pages contains redirection
resp = opener.open(url, form_data)
# yahoo redirects to http://my.yahoo.com, so lets go there instead
resp = opener.open('http://mail.yahoo.com')
print resp.read()
著者はこのスクリプトかHTMLのスクリプトの ヤフーのログイン 出を行ったことを記述します。
このログフォームに含まれの分野では、ユーザーの"Yahoo!IDはユーザーのパスワードになります。ここではどのようにHTMLコードのページの両方の分野で次のように記述されています。
ユーザIDの分野:
<input type="text" maxlength="96" class="yreg_ipt" size="17" value="" id="username" name="login">
パスワード入力フィールド:
<input type="password" maxlength="64" class="yreg_ipt" size="17" value="" id="passwd" name="passwd">
しかし、いろいろ考えさせらこのコードをGoogle App Engineを見るこのログフォームに持ってくると思い、ログインか成功します。なぜそうなんだ。
解決
送信すMD5ハッシュとのない無地のパスワードになります。またいプレイのすべての種類CSRFの保護等いいくらいでしょうか?見る:
<input type="hidden" name=".tries" value="1">
<input type="hidden" name=".src" value="ym">
<input type="hidden" name=".md5" value="">
<input type="hidden" name=".hash" value="">
<input type="hidden" name=".js" value="">
<input type="hidden" name=".last" value="">
<input type="hidden" name="promo" value="">
<input type="hidden" name=".intl" value="us">
<input type="hidden" name=".bypass" value="">
<input type="hidden" name=".partner" value="">
<input type="hidden" name=".u" value="bd5tdpd5rf2pg">
<input type="hidden" name=".v" value="0">
<input type="hidden" name=".challenge" value="5qUiIPGVFzRZ2BHhvtdGXoehfiOj">
<input type="hidden" name=".yplus" value="">
<input type="hidden" name=".emailCode" value="">
<input type="hidden" name="pkg" value="">
<input type="hidden" name="stepid" value="">
<input type="hidden" name=".ev" value="">
<input type="hidden" name="hasMsgr" value="0">
<input type="hidden" name=".chkP" value="Y">
<input type="hidden" name=".done" value="http://mail.yahoo.com">
<input type="hidden" name=".pd" value="ym_ver=0&c=&ivt=&sg=">
発売Wireshark遊びます。運:)
ただし、使用しないですw/アエンジンを常に心がしますIPはほぼ確実に結果w/画像認証の課題です。またヤフーがブロックお User-Agent
ることが恒久的に設定されているようです。
所属していません StackOverflow