« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 10 of about 173 for Username (0.001 sec.)
ファイルシステムのセキュリティ | PHP 8.3 10089
ファイルシステムのセキュリティ 目次 Null バイト関連の問題 PHP には、多くのサーバーシステムに組み込まれている、 ファイル単位・ディレクトリ単位の権限によるセキュリティが適用されます。これにより、ファイ ルシステム内のファイルを読み込み可能に制 ... あるファイルを削除可能です。 例1 甘い変数の確認から生じるリスク <?php // ユーザーのホームディレクトリからファイルを削除する $username = $_POST [ 'user_submitted_name' ]; $userfile = $_POST [ 'user_submitted_filename' ]; $homedir = "/home/ $username " ; unl ... ink ( " $homedir / $userfile " ); echo "ファイルは削除されました!" ; ?> username および filename はユーザーフォームから投稿可能であるため、他人の username および filename を投稿して、 本来は削除できないは ... 撃 <?php // 外部からPHPユーザーがアクセス可能なハードドライブを削除します。PHPが // ルートのアクセス権限を有している場合、 $username = $_POST [ 'user_submitted_name' ]; // "../etc" $userfile = $_POST [ 'user_submitted_filename' ]; // "passwd" $homedir = " ...
https://man.mtool.work/php/8.3/security.filesystem.html
Script Injection Attacks | PHP 8.3 9427
Script Injection Attacks If you are using JavaScript, make sure that any variables that cross the PHP- to-JavaScript boundary are passed in the scope field of MongoDB\BSON\Javascript , not interpolated into the JavaScript string. This can c ... JavaScript to greet a user in the database logs. We could do: <?php $m = new MongoDB\Driver\Manager ; // Don't do this!!! $username = $_GET [ 'field' ]; $cmd = new \MongoDB\Driver\Command ( [ 'eval' => "print('Hello, $username !');" ] ); $r = $m -> execu ... However, what if a malicious user passes in some JavaScript? <?php $m = new MongoDB\Driver\Manager ; // Don't do this!!! $username = $_GET [ 'field' ]; // $username is set to "'); db.users.drop(); print('" $cmd = new \MongoDB\Driver\Command ( [ 'eval' = ... > "print('Hello, $username !');" ] ); $r = $m -> executeCommand ( 'dramio' , $cmd ); ?> Now MongoDB executes the JavaScript string "print('Hello, '); ...
https://man.mtool.work/php/8.3/mongodb.security.script_injection.html
ssh2_auth_hostbased_file — ホスト公開鍵を使用して認証を行う | PHP 8.3 9348
ssh2_auth_hostbased_file (PECL ssh2 >= 0.9.0) ssh2_auth_hostbased_file — ホスト公開鍵を使用して認証を行う 説明 function ssh2_auth_hostbased_file ( resource $session , string $username , string $hostname , string $pubkeyfile , string $privke ... yfile , string $passphrase = ? , string $local_username = ? ): bool ファイルから読み込まれたホスト公開鍵を使用して認証を行います。 パラメータ session ssh2_connect() のコールによっ ... て取得した SSH 接続リンク ID。 username hostname pubkeyfile privkeyfile passphrase もし privkeyfile が暗号化されている (そのはずです) 場合、パスフレーズを渡す必要 ... があります。 local_username もし local_username を省略した場合、 username の値を使用します。 戻り値 成功した場合に true を、失敗した場合に false を返し ...
https://man.mtool.work/php/8.3/function.ssh2-auth-hostbased-file.html
win32_add_right_access_service — ユーザー名に対する、サービスへのアクセス権を追... 9348
win32_add_right_access_service (PECL win32service >=1.1.0) win32_add_right_access_service — ユーザー名に対する、サービスへのアクセス権を追加する 説明 function win32_add_right_access_service ( string $servicename , string $username , int $ri ... ght , string $machine = null ): void servicename 上の username に、アクセス権を追加します。 これが成功するには、管理者権限が必要です。 パラメータ servicename アクセス権を追加するサービス ... 名 username username のためのアクセス権を読み取ります right username に許可するアクセス権。 この値を定義するために 定数 の値が使えます ... n32Service\RightInfo オブジェクトを返します。 エラー / 例外 service パラメータが空の場合は、 ValueError がスローされます。 username パラメータが空の場合は、 ValueError がスローされます。 エラー時には Win32ServiceException がスローされます。 参考 win32_re ...
https://man.mtool.work/php/8.3/function.win32-add-right-access-service.html
Request Injection Attacks | PHP 8.3 9101
Request Injection Attacks If you are passing $_GET (or $_POST ) parameters to your queries, make sure that they are cast to strings first. Users can insert associative arrays in GET and POST requests, which could then become unwanted $-quer ... ies. A fairly innocuous example: suppose you are looking up a user's information with the request http://www.example.com?username=bob . Your application creates the query $q = new \MongoDB\Driver\Query( [ 'username' => $_GET['username'] ]) . Someone co ... uld subvert this by getting http://www.example.com?username[$ne]=foo , which PHP will magically turn into an associative array, turning your query into $q = new \MongoDB\Driver\Query ... ( [ 'username' => [ '$ne' => 'foo' ] ] ) , which will return all users not named "foo" (all of your users, probably). This is a fairly e ...
https://man.mtool.work/php/8.3/mongodb.security.request_injection.html
win32_remove_right_access_service — ユーザー名に対する、サービスへのアクセス権... 8697
win32_remove_right_access_service (PECL win32service >=1.1.0) win32_remove_right_access_service — ユーザー名に対する、サービスへのアクセス権を削除する 説明 function win32_remove_right_access_service ( string $servicename , string $username ... , string $machine = null ): void servicename 上の username へのアクセス権を削除します。 この操作を成功させるには、管理者権限が必要です。 パラメータ servicename アクセス権を削除するサ ... ービス名 username username の アクセス権を読み取ります。 machine サービスを作成したいオプションのマシン名。 省略すると、ローカルマシン名を使 ... います。 戻り値 値を返しません。 エラー / 例外 service パラメータが空の場合は、 ValueError がスローされます。 username パラメータが空の場合は、 ValueError がスローされます。 エラー時には Win32ServiceException がスローされます。 参考 win32_re ...
https://man.mtool.work/php/8.3/function.win32-remove-right-access-service.html
win32_read_right_access_service — ユーザー名のサービスへのアクセス権を読み取る ... 8529
win32_read_right_access_service (PECL win32service >=1.1.0) win32_read_right_access_service — ユーザー名のサービスへのアクセス権を読み取る 説明 function win32_read_right_access_service ( string $servicename , string $username , string $mach ... ine = null ): Win32Service\RightInfo servicename 上の username のアクセス権を読み取ります。 この操作が成功するには、管理者権限が必要です。 パラメータ servicename アクセス権を読み取るサー ... ビス名 username username のアクセス権を読み取ります。 machine サービスを作成したいオプションのマシン名。 省略すると、ローカルマシン名を使い ... n32Service\RightInfo オブジェクトを返します。 エラー / 例外 service パラメータが空の場合は、 ValueError がスローされます。 username パラメータが空の場合は、 ValueError がスローされます。 エラー時には Win32ServiceException がスローされます。 参考 win32_re ...
https://man.mtool.work/php/8.3/function.win32-read-right-access-service.html
ssh2_auth_pubkey — Authenticate using a public key in a variable | PHP 8.3 8360
ssh2_auth_pubkey (PECL ssh2 >= 1.4) ssh2_auth_pubkey — Authenticate using a public key in a variable 説明 function ssh2_auth_pubkey ( resource $session , string $username , string $pubkey , string $privkey , string $passphrase = ? ): bool A ... a public key in a variable. パラメータ session An SSH connection link identifier, obtained from a call to ssh2_connect() . username Name of the user to authenticate as on the remote server. pubkey Public key in OpenSSH's format. It should look something ... tion = ssh2_connect ( 'shell.example.com' , 22 , array( 'hostkey' => 'ssh-rsa' )); $publicKey = file_get_contents ( '/home/username/.ssh/id_rsa.pub' ); $privateKey = file_get_contents ( '/home/username/.ssh/id_rsa' ); if ( ssh2_auth_pubkey ( $connection ... , 'username' , $publicKey , $privateKey , 'secret' )) { echo "Public Key Authentication Successful\n" ; } else { die( 'Public Key Auth ...
https://man.mtool.work/php/8.3/function.ssh2-auth-pubkey.html
マジックメソッド | PHP 8.3 8360
マジックメソッド マジックメソッドは、 ある動作がオブジェクトに対して行われた場合に、 PHP のデフォルトの動作を上書きする特別なメソッドです。 警告 __ で始まる全てのメソッド名は、 PHP によって予約されています。 よって、PHP の動作を上書きするの ... 能は PHP 7.4.0 以降で利用できます。 例1 Serialize と unserialize <?php class Connection { protected $link ; private $dsn , $username , $password ; public function __construct ( $dsn , $username , $password ) { $this -> dsn = $dsn ; $this -> username = $us ... sword = $password ; $this -> connect (); } private function connect () { $this -> link = new PDO ( $this -> dsn , $this -> username , $this -> password ); } public function __serialize (): array { return [ 'dsn' => $this -> dsn , 'user' => $this -> usern ... => $this -> password , ]; } public function __unserialize (array $data ): void { $this -> dsn = $data [ 'dsn' ]; $this -> username = $data [ 'user' ]; $this -> password = $data [ 'pass' ]; $this -> connect (); } } ?> __sleep() と __wakeup() 警告 このシリ ...
https://man.mtool.work/php/8.3/language.oop5.magic.html
ssh2:// — Secure Shell 2 | PHP 8.3 8360
ssh2:// ssh2:// — Secure Shell 2 説明 ssh2.shell:// ssh2.exec:// ssh2.tunnel:// ssh2.sftp:// ssh2.scp:// (PECL) 注意 : このラッパーはデフォルトでは有効になっていません ssh2.*:// ラッパーを使用するには、 » PECL から » SSH2 拡張モジュールを ... tp 再利用する割り当て済みの sftp リソース methods Key exchange, hostkey, cipher, compression, および MAC methods callbacks username 接続するユーザー名 password パスワード認証に使用するパスワード pubkey_file 認証に使用する公開鍵ファイル privkey_file 認証に ... な接続からストリームをオープンする <?php $session = ssh2_connect ( 'example.com' , 22 ); ssh2_auth_pubkey_file ( $session , 'username' , '/home/username/.ssh/id_rsa.pub' , '/home/username/.ssh/id_rsa' , 'secret' ); $stream = fopen ( "ssh2.tunnel:// $sessio ... コードは、期待通りには動きません。 <?php $session = ssh2_connect ( 'example.com' , 22 ); ssh2_auth_pubkey_file ( $session , 'username' , '/home/username/.ssh/id_rsa.pub' , '/home/username/.ssh/id_rsa' , 'secret' ); $connection_string = "ssh2.sftp:// $sessi ...
https://man.mtool.work/php/8.3/wrappers.ssh2.html
PREV 1 2 3 4 5 6 7 8 9 10 NEXT