XSSの脆弱性診断ツール:paros
2009 年 4 月 13 日 月曜日parosはフリーで利用できるWEBアプリケーションのXSS対策やSQLインジェクションの診断ツールの1つ。
http://www.parosproxy.org/index.shtml
parosはフリーで利用できるWEBアプリケーションのXSS対策やSQLインジェクションの診断ツールの1つ。
http://www.parosproxy.org/index.shtml
フィールド名と属性を変更する
型:alter table テーブル名 change 旧フィールド名 新フィールド名 型;
例:alter table tablename change fieldname1 fildname2 char(255);
フィールドの属性のみ変更する
型:alter table テーブル名 modify フィールド名 新しい属性;
例:alter table tablename modify fieldname1 char(255);
フィールドの追加
型:alter table テーブル名 add フィールド名 属性;
例:alter table tablename add fieldnamex int;
テーブルの削除
型:drop table テーブル名;
例:drop table tablename;
レコードの作成
型:insert into テーブル名 values ('文字列の場合',数字の場合,…);
例:insert into tablename values ('MySQL',255);
※フィールドの数分入力しないと ERROR 1136 (21S01): Column count doesn't match value count at row 1のように表示される。
レコード挿入1
型:select * from テーブル名;
例:select * from tablename;
レコード挿入2
型:insert into テーブル名 (フィールド名,…) values (フィールド名の値,…);
例:insert into tablename (MySQL) values (5.0);
※入力のないフィールド部分はNULLが挿入される。
特定のフィールドだけ表示
型:select フィールド名 from テーブル名;
例:select fieldname,… from tablename;
複数の条件検索
型:select * from テーブル名 where フィールド名 検索条件 and フィールド名 検索条件
例:select * from tablename where fieldname1 like '%文字列%' and filedname2 > 数値;
※フィールド1の中で文字列から始まり、且つ、フィールド2の中で 数値より大きい
型:select * from テーブル名 where フィールド名 検索条件 or フィールド名 検索条件
例:select * from tablename where fieldname1 like '%文字列%' or filedname2 > 数値;
※フィールド1の中で文字列から始まり、又は、フィールド2の中で 数値より大きい
行:レコード
列:フィールド
参考書はset password for root=password('任意のパスワード');と記載されている事が多いが、xamppの場合、ERROR 1133 (42000): Can't find any matching row in the user tableと表示される場合がある。
そこでset password for root@localhost=password('任意のパスワード');とする事でQuery OK, …と表示される。
xamppの場合phpMyAdminがインストールされるので、コマンドプロンプトを用いる必要性はほとんどないが、一般的な参考書や古いphpやMySQLの参考書はapachのインストール、phpのインストール、MySQLのインストールという手順を踏んでいるので、少し悩む初心者も多いが、xamppの場合はパスが若干異なる程度で、最新のapachやphp,mysqlのインストールに悩む場合、xamppを導入して互換をとればいよい。(互換という程のものではないが…
一般参考書
C:\mysql\bin
xampp
C:\xampp\mysql\bin
なお、windowsコマンドプロンプトでlinuxで使うlsの相当するコマンドはdir
C:\xampp\mysql\binに移動しmysqlと実行すると
mysql>
と表示される。
サーバーインストールと方法を変わらない。
XAMPPの任意のフォルダ内にEC CUBEを展開
XAMPPのphpMyAdmin→特権→ユーザー作成→DB作成
EC CUBE(ローカル展開パス)にアクセス
通常通り展開→インストール
SHOW VARIABLES LIKE "collation%";を実行した応答はutf-8である。
Variable_name Value
collation_connection utf8_unicode_ci
collation_database utf8_general_ci
collation_server utf8_general_ci
MySQL の文字セット: UTF-8 Unicode (utf8)であり、MySQL の接続照合順序: utf8_unicode_ciである。
show variables like "char%";を実行した結果はutf-8である。
Variable_name Value
character_set_client utf8
character_set_connection utf8
character_set_database utf8
character_set_filesystem binary
character_set_results utf8
character_set_server utf8
character_set_system utf8
character_sets_dir /usr/local/mysql-src-5.1.22/share/mysql/charsets/
ブラウザ上のエンコード:utf8である。
…にも関わらず以下のように文字化けする。
例:mtb_mail_template
id name rank
1 注文å—付メール 0
2 注文ã‚ャンセルå—付メール 1
3 å–り寄ã›ç¢ºèªãƒ¡ãƒ¼ãƒ« 2
eccube/data/class/SC_DbConn.phpを編集
64行目以下に$this->conn->query("SET NAMES utf8");を追加
$this->conn = $objDbConn
$this->error_mail_to = DB_ERROR_MAIL_TO;
↓
$this->conn = $objDbConn
$this->conn->query("SET NAMES utf8");
$this->error_mail_to = DB_ERROR_MAIL_TO;
データベースの文字化けについて教えてください
http://xoops.ec-cube.net/modules/newbb/viewtopic.php?topic_id=2997&forum=2&post_id=11497#forumpost11497
phpmyadminでの文字化け
http://xoops.ec-cube.net/modules/newbb/viewtopic.php?topic_id=2553&forum=11&post_id=9418#forumpost9418