{"id":8773,"date":"2021-03-29T07:00:13","date_gmt":"2021-03-28T22:00:13","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=8773"},"modified":"2021-03-29T07:43:19","modified_gmt":"2021-03-28T22:43:19","slug":"%e3%80%90laravel%e3%80%91%e6%a8%99%e7%9a%84%e5%9e%8b%e6%94%bb%e6%92%83%e3%83%a1%e3%83%bc%e3%83%ab%e3%81%ae%e8%a8%93%e7%b7%b4%e3%82%b7%e3%82%b9%e3%83%86%e3%83%a0%e3%82%92%e3%81%a4%e3%81%8f%e3%82%8b","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=8773","title":{"rendered":"\u3010Laravel\u3011\u6a19\u7684\u578b\u653b\u6483\u30e1\u30fc\u30eb\u306e\u8a13\u7df4\u30b7\u30b9\u30c6\u30e0\u3092\u3064\u304f\u308b"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u4ee5\u524d\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u5c02\u9580\u5bb6\u3068\u304a\u4ed5\u4e8b\u3092\u3055\u305b\u3066\u3044\u305f\u3060\u3044\u305f\u3053\u3068\u304c\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u305d\u306e\u969b\u306b\u300c\u3042\u308b\u30b7\u30b9\u30c6\u30e0\u300d\u306e\u3053\u3068\u3092\u6559\u3048\u3066\u3044\u305f\u3060\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u308c\u306f\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><strong style=\"font-size: 35px;\">\u6a19\u7684\u578b\u653b\u6483\u30e1\u30fc\u30eb\u30fb\u8a13\u7df4\u30b7\u30b9\u30c6\u30e0<\/strong><\/p>\n<p>\u3067\u3059\u3002<\/p>\n<p>\u3053\u308c\u306f\u3001\u5f93\u696d\u54e1\u3055\u3093\u306b<strong>\u308f\u3056\u3068\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3057\u3001\u8ab0\u304c\u300c\u3061\u3083\u3093\u3068\u5bfe\u51e6\u3067\u304d\u305f\uff0f\u3067\u304d\u3066\u306a\u3044\u300d\u304b\u3092\u8abf\u3079\u308b\u30b7\u30b9\u30c6\u30e0<\/strong>\u306e\u3053\u3068\u3067\u3001\u3064\u307e\u308a\u5b66\u6821\u3067\u3088\u304f\u3084\u3063\u305f<strong>\u300c\u629c\u304d\u6253\u3061\u30c6\u30b9\u30c8\u300d<\/strong>\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3059\u306d\u3002<\/p>\n<p>\u203b \u3061\u306a\u307f\u306b\u30012018\u5e74\u306b\u7d04580\u5104\u5186\u76f8\u5f53\u306e\u4eee\u60f3\u901a\u8ca8<code>NEM<\/code>\u304c\u6d41\u51fa\u3057\u305f\u4e8b\u4ef6\u304c\u3042\u308a\u307e\u3057\u305f\u304c\u3001\u305d\u306e\u767a\u7aef\u306b\u306a\u3063\u305f\u306e\u3082\u3001\u6a19\u7684\u578b\u653b\u6483\u30e1\u30fc\u30eb\u3060\u3068\u8a00\u308f\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067\u2757<\/p>\n<p>\u4eca\u56de\u306f\u3053\u306e\u6a19\u7684\u578b\u30e1\u30fc\u30eb\u8a13\u7df4\u30b7\u30b9\u30c6\u30e0\u3092<code>Laravel<\/code>\u3067\u3064\u304f\u3063\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u305c\u3072\u4f55\u304b\u306e\u53c2\u8003\u306b\u306a\u308a\u307e\u3057\u305f\u3089\u5b09\u3057\u3044\u3067\u3059\ud83d\ude0a\u2728<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2173 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/no_24.png\" alt=\"\" width=\"300\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/no_24.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/no_24-281x300.png 281w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>\u300c\u51fa\u5ddd\u3055\u3093\u306e\u300e\u5144\u3055\u3093\u77e5\u3089\u306a\u3044\u3093\u3060\u300f\u306e<br \/>\n\u30b3\u30de\u30fc\u30b7\u30e3\u30eb\u597d\u304d\u3060\u3063\u305f\u306a\u30fb\u30fb\u30fb\u300d<\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> Laravel 8.x<\/p>\n<h1>\u3084\u308a\u305f\u3044\u3053\u3068<\/h1>\n<p>\u4eca\u56de\u958b\u767a\u3059\u308b\u30b7\u30b9\u30c6\u30e0\u306e\u8a73\u7d30\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<ul>\n<li>\u500b\u5225\u306e\u5f93\u696d\u54e1\u306b\u30e1\u30fc\u30eb\u3092\u9001\u4fe1<\/li>\n<li>\u8ab0\u304c\u300c\u30e1\u30fc\u30eb\u3092\u958b\u5c01\u3057\u305f\u300d\u300c\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u305f\u300d\u300c\u30ea\u30f3\u30af\u3092\u30af\u30ea\u30c3\u30af\u3057\u305f\u300d\u306e\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u3059\u308b<\/li>\n<\/ul>\n<h1>\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5<\/h1>\n<p>\u4eca\u56de\u306f\uff08\u64ec\u4f3c\u7684\u306a\uff09\u753b\u50cfURL\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001<code>http:\/\/example.com\/image<\/code> \u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068<strong>PHP\u304c\u5b9f\u884c\u3055\u308c\u308b\u3051\u308c\u3069\u3001\u5b9f\u969b\u306b\u306f\u753b\u50cf\u3092\u8868\u793a\u3059\u308b<\/strong>\u3068\u3044\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3092\u5229\u7528\u3057\u3066\u3001\u6b21\u306e\u3088\u3046\u306b\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u3064\u3051\u3066\u300c\u8ab0\u304c\u4f55\u3092\u3057\u305f\u304b\uff1f\u300d\u3092\u30c1\u30a7\u30c3\u30af\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>&lt;!-- \u3053\u3053\u306f\u753b\u50cf\u304c\u8868\u793a\u3055\u308c\u307e\u3059 --&gt;\n&lt;img src=\"http:\/\/example.com\/image?action=mail_opened&amp;user_id=111\"&gt;<\/strong><\/pre>\n<p>\u306a\u304a\u3001\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u306f<code>zip<\/code>\u3067\u5727\u7e2e\u3055\u308c\u305fHTML\u30d5\u30a1\u30a4\u30eb\u3067\u5b9f\u88c5\u3057\u307e\u3059\u3002<\/p>\n<p><strong>\u26a0\u00a0\u3054\u6ce8\u610f<\/strong><br \/>\n\u30e1\u30fc\u30eb\u30b5\u30fc\u30d3\u30b9\u306b\u3088\u3063\u3066\u306f\u753b\u50cfURL\u3092\u906e\u65ad\u3059\u308b\u8a2d\u5b9a\u306b\u306a\u3063\u3066\u3044\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u3082\u3057\u5fc5\u305a\u300c\u30e1\u30fc\u30eb\u958b\u5c01\u300d\u30c1\u30a7\u30c3\u30af\u3092\u3057\u305f\u3044\u5834\u5408\u306f\u753b\u50cf\u306e\u8868\u793a\u3092\u8a31\u53ef\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h1>\u524d\u63d0\u3068\u3057\u3066<\/h1>\n<p>\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u304c\u3059\u3067\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u3066\u3001\u4f55\u4eba\u304b\u306e\u30c6\u30b9\u30c8\u30e6\u30fc\u30b6\u30fc\u304c\u4fdd\u5b58\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u524d\u63d0\u3067\u3059\u3002<\/p>\n<p>\u3082\u3057\u307e\u3060\u306e\u65b9\u306f\u4ee5\u4e0b\u306e\u3069\u3061\u3089\u304b\u3092\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/blog.capilano-fw.com\/?p=8301\">Laravel Breeze\u3067\u300c\u30b7\u30f3\u30d7\u30eb\u306a\u300d\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a><\/li>\n<li><a href=\"https:\/\/blog.capilano-fw.com\/?p=7827\">Laravel8.x\u4ee5\u964d\u3067\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5<\/a><\/li>\n<\/ul>\n<p>\u30c6\u30fc\u30d6\u30eb\u306e\u4e2d\u306f\u3053\u3093\u306a\u30ab\u30f3\u30b8\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8775\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_1.png\" alt=\"\" width=\"483\" height=\"464\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_1.png 483w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_1-300x288.png 300w\" sizes=\"auto, (max-width: 483px) 100vw, 483px\" \/><\/p>\n<h1>\u30e2\u30c7\u30eb\uff06\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u307e\u308f\u308a\u3092\u69cb\u7bc9\u3059\u308b\u305f\u3081\u306b\u30e2\u30c7\u30eb\uff06\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:model AttackTraining -m<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u30e2\u30c7\u30eb\u3068\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u304c\u4e00\u6c17\u306b\u4f5c\u6210\u3055\u308c\u307e\u3059\u306e\u3067\u3001\u4e2d\u8eab\u3092\u305d\u308c\u305e\u308c\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30e2\u30c7\u30eb<\/h2>\n<p><strong>app\/Models\/AttackTraining.php<\/strong><\/p>\n<pre>&lt;?php\n\nnamespace App\\Models;\n\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass AttackTraining extends Model\n{\n    use HasFactory;\n\n<strong>    protected $guarded = ['id'];<\/strong>\n\n<strong>    \/\/ Relationship<\/strong>\n<strong>    public function user() {<\/strong>\n\n<strong>        return $this-&gt;belongsTo(User::class, 'user_id', 'id');<\/strong>\n\n<strong>    }<\/strong>\n\n<strong>    \/\/ Accessor<\/strong>\n<strong>    public function getEmailOpenedUrlAttribute() {<\/strong>\n\n<strong>        return route('attack_training.image', [<\/strong>\n<strong>           $this-&gt;uuid,<\/strong>\n<strong>           'type' =&gt; 'email_opened'<\/strong>\n<strong>        ]);<\/strong>\n\n<strong>    }<\/strong>\n\n<strong>    public function getFileOpenedUrlAttribute() {<\/strong>\n\n<strong>        return route('attack_training.image', [<\/strong>\n<strong>           $this-&gt;uuid,<\/strong>\n<strong>           'type' =&gt; 'file_opened'<\/strong>\n<strong>        ]);<\/strong>\n\n<strong>    }<\/strong>\n\n<strong>    public function getLinkClickedUrlAttribute() {<\/strong>\n\n<strong>        return route('attack_training.image', [<\/strong>\n<strong>           $this-&gt;uuid,<\/strong>\n<strong>           'type' =&gt; 'link_clicked'<\/strong>\n<strong>        ]);<\/strong>\n\n<strong>    }<\/strong>\n\n<strong>    \/\/ Others<\/strong>\n<strong>    public function generateZipFile() {<\/strong>\n\n<strong>        $html = view('html.attack_training')<\/strong>\n<strong>            -&gt;with(['file_opened_url' =&gt; $this-&gt;file_opened_url])<\/strong>\n<strong>            -&gt;render();<\/strong>\n\n<strong>        $zip_path = storage_path('app\/zip\/'. $this-&gt;uuid .'.zip');<\/strong>\n<strong>        $zip = new \\ZipArchive();<\/strong>\n\n<strong>        if($zip-&gt;open($zip_path, \\ZipArchive::CREATE) === TRUE) {<\/strong>\n\n<strong>            $zip-&gt;addFromString('security.html', $html);<\/strong>\n<strong>            $zip-&gt;close();<\/strong>\n\n<strong>            return $zip_path;<\/strong>\n\n<strong>        }<\/strong>\n\n<strong>        return null;<\/strong>\n\n<strong>    }<\/strong>\n}<\/pre>\n<p>\u306a\u304a\u3001\u3053\u306e\u4e2d\u3067\u3084\u3063\u3066\u3044\u308b\u306e\u306f\u5927\u307e\u304b\u306b\u4ee5\u4e0b\uff14\u3064\u3067\u3059\u3002<\/p>\n<p><strong>\u2460 $guarded \u3092\u8ffd\u52a0<\/strong><\/p>\n<p><code>mass assignment<\/code>\u30a8\u30e9\u30fc\u304c\u51fa\u306a\u3044\u3088\u3046\u306b<code>$guarded<\/code>\u3092\u8ffd\u52a0\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p><strong>\u2461 \u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7<\/strong><\/p>\n<p><code>users<\/code>\u30c6\u30fc\u30d6\u30eb\u3068\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\u3092\u3064\u304f\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u7c21\u5358\u306b\u95a2\u9023\u4ed8\u3051\u3089\u308c\u305f\u30e6\u30fc\u30b6\u30fc\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><strong>$user = $attack_training-&gt;user;<\/strong><\/pre>\n<p><strong>\u2462 Accessor<\/strong><\/p>\n<p>\u30c6\u30fc\u30d6\u30eb\u5185\u306b\u306f\u5b58\u5728\u3057\u306a\u3044\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u300c\u3042\u305f\u304b\u3082\u5b58\u5728\u3057\u3066\u3044\u308b\u300d\u304b\u306e\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u304c<code>Laravel<\/code>\u306e\u4fbf\u5229\u6a5f\u80fd<code>Accessor<\/code>\u3067\u3059\u3002<\/p>\n<p><code>AttackTraining<\/code>\u30e2\u30c7\u30eb\u306e\u306a\u304b\u3067\u306f\uff13\u3064\u306e<code>Accessor<\/code>\u3092\u3064\u304f\u3063\u3066\u3044\u3066\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre><strong>$attack_training = \\App\\Models\\AttackTraining::first();<\/strong>\n\ndump(<strong>$attack_training-&gt;email_opened_url<\/strong>); \/\/ \u30e1\u30fc\u30eb\u304c\u958b\u5c01\u3068\u304d\u306e\u753b\u50cfURL\ndump(<strong>$attack_training-&gt;file_opened_url<\/strong>); \/\/ \u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u305f\u3068\u304d\u306e\u753b\u50cfURL\ndump(<strong>$attack_training-&gt;link_clicked_url<\/strong>); \/\/ \u30ea\u30f3\u30af\u3092\u30af\u30ea\u30c3\u30af\u3057\u305f\u3068\u304d\u306e\u753b\u50cfURL<\/pre>\n<p><strong>\u2463 generateZipFile()<\/strong><\/p>\n<p>\u8a13\u7df4\u30e1\u30fc\u30eb\u306b\u6dfb\u4ed8\u3059\u308bzip\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306e\u3082\u306e\u3067\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3059\u308b\u3068<code>zip<\/code>\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>$attack_training = \\App\\Models\\AttackTraining::first();\n$zip_path = <strong>$attack_training-&gt;generateZipFile();<\/strong><\/pre>\n<h2>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3<\/h2>\n<p>\u7d9a\u3044\u3066\u3001\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n<p><strong>database\/migrations\/****_**_**_******_create_attack_trainings_table.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\n\npublic function up()\n{\n<strong>    Schema::create('attack_trainings', function (Blueprint $table) {<\/strong>\n<strong>        $table-&gt;id();<\/strong>\n<strong>        $table-&gt;unsignedBigInteger('user_id')-&gt;comment('\u30e6\u30fc\u30b6\u30fcID');<\/strong>\n<strong>        $table-&gt;uuid('uuid')-&gt;comment('UUID');<\/strong>\n<strong>        $table-&gt;dateTime('email_opened_at')-&gt;nullable()-&gt;comment('\u65e5\u6642\uff1a\u30e1\u30fc\u30eb\u3092\u958b\u5c01\u3057\u305f');<\/strong>\n<strong>        $table-&gt;dateTime('file_opened_at')-&gt;nullable()-&gt;comment('\u65e5\u6642\uff1a\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u305f');<\/strong>\n<strong>        $table-&gt;dateTime('link_clicked_at')-&gt;nullable()-&gt;comment('\u65e5\u6642\uff1a\u30ea\u30f3\u30af\u3092\u30af\u30ea\u30c3\u30af\u3057\u305f');<\/strong>\n<strong>        $table-&gt;timestamps();<\/strong>\n\n<strong>        $table-&gt;foreign('user_id')-&gt;references('id')-&gt;on('users');<\/strong>\n<strong>    });<\/strong>\n}\n\n\/\/ \u7701\u7565<\/pre>\n<p>\u203b \u5b9f\u969b\u306e\u3068\u3053\u308d\u3001\u8a13\u7df4\u306f\u4f55\u5ea6\u3082\u5b9f\u65bd\u3059\u308b\u3053\u3068\u306b\u306a\u308b\u306e\u3067\u3001\u8a13\u7df4\u3054\u3068\u306e\u8b58\u5225ID\u3092\u8a2d\u3051\u308b\u3079\u304d\u3067\u3059\u304c\u3001\u8907\u96d1\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u306e\u3067\u5272\u611b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u3064\u304f\u308b<\/h2>\n<p>\u7d9a\u3044\u3066\u3001\u30c6\u30b9\u30c8\u30e6\u30fc\u30b6\u30fc\u306b\u5bfe\u3059\u308b\u8a13\u7df4\u30e1\u30fc\u30eb\u306e\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u3064\u304f\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:seed AttackTrainingsTableSeeder<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<p><strong>database\/seeders\/AttackTrainingsTableSeeder.php<\/strong><\/p>\n<pre>&lt;?php\n\nnamespace Database\\Seeders;\n\n<strong>use App\\Models\\AttackTraining;<\/strong>\n<strong>use App\\Models\\User;<\/strong>\nuse Illuminate\\Database\\Seeder;\nuse Illuminate\\Support\\Str;\n\nclass AttackTrainingsTableSeeder extends Seeder\n{\n<strong>    public function run()<\/strong>\n<strong>    {<\/strong>\n<strong>        $users = User::get();<\/strong>\n\n<strong>        foreach ($users as $user) {<\/strong>\n\n<strong>            $attack_training = new AttackTraining();<\/strong>\n<strong>            $attack_training-&gt;uuid = Str::uuid();<\/strong>\n<strong>            $attack_training-&gt;user_id = $user-&gt;id;<\/strong>\n<strong>            $attack_training-&gt;save();<\/strong>\n\n<strong>        }<\/strong>\n<strong>    }<\/strong>\n}<\/pre>\n<p>\u5909\u66f4\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001<code>AttackTrainingsTableSeeder<\/code>\u3092<code>Laravel<\/code>\u3078\u767b\u9332\u3057\u307e\u3059\u3002<\/p>\n<p><strong>database\/seeders\/DatabaseSeeder.php<\/strong><\/p>\n<pre>&lt;?php\n\nnamespace Database\\Seeders;\n\nuse Illuminate\\Database\\Seeder;\n\nclass DatabaseSeeder extends Seeder\n{\n    public function run()\n    {\n        $this-&gt;call(UsersTableSeeder::class); \/\/ \ud83d\udc48 \u3053\u3053\u306f UserFactory \u3067\u3082OK\u3067\u3059\n        <strong>$this-&gt;call(AttackTrainingsTableSeeder::class); \/\/ \ud83d\udc48 \u3053\u3053\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f<\/strong>\n    }\n}<\/pre>\n<p>\u3067\u306f\u3001\u3053\u308c\u3067\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u521d\u671f\u5316\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>php artisan migrate:fresh --seed<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u30c6\u30fc\u30d6\u30eb\u306f\u3053\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8787\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_5.png\" alt=\"\" width=\"640\" height=\"382\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_5.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_5-300x179.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<h1>\u753b\u50cfURL\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u300c\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u300d\u3067\u66f8\u3044\u305f\u3001<strong>PHP\u304c\u5b9f\u884c\u3055\u308c\u308b\u3051\u308c\u3069\u3001\u5b9f\u969b\u306b\u306f\u753b\u50cf\u304c\u8868\u793a\u3055\u308c\u308bURL<\/strong>\u3092\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h2>\u8868\u793a\u3059\u308b\u753b\u50cf\u3092\u7528\u610f\u3059\u308b<\/h2>\n<p>\u4eca\u56de\u306f\u4ee5\u4e0b\u306e\u753b\u50cf\u304c\u8868\u793a\u3055\u308c\u308bURL\u3092<code>Laravel<\/code>\u3067\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<p>\uff08\u3061\u3087\u3063\u3068\u3057\u305f\u904a\u3073\u5fc3\u3067\u3059\u304c\u3001\u3082\u3061\u308d\u3093\u672c\u756a\u74b0\u5883\u3067\u306f\u3082\u3063\u3068\u3057\u3063\u304b\u308a\u3057\u305f\u753b\u50cf\u3092\u7528\u610f\u3057\u3066\u304f\u3060\u3055\u3044\ud83d\ude02\uff09<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8777\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/no_15.png\" alt=\"\" width=\"338\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/no_15.png 338w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/no_15-300x284.png 300w\" sizes=\"auto, (max-width: 338px) 100vw, 338px\" \/><\/p>\n<p>\u3067\u306f\u3001\u3053\u306e\u753b\u50cf\u3092\u300c<strong>\/storage\/app\/images\/attack_training.png<\/strong>\u300d\u3068\u3057\u3066\u4fdd\u5b58\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8778\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_2.png\" alt=\"\" width=\"506\" height=\"172\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_2.png 506w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_2-300x102.png 300w\" sizes=\"auto, (max-width: 506px) 100vw, 506px\" \/><\/p>\n<h2>\u30eb\u30fc\u30c8\u3092\u3064\u304f\u308b<\/h2>\n<p>\u7d9a\u3044\u3066\u30eb\u30fc\u30c8\u3067\u3059\u3002<\/p>\n<p><strong>routes\/web.php<\/strong><\/p>\n<pre><strong>use App\\Http\\Controllers\\AttackTrainingController;\n<\/strong>\n\/\/ \u7701\u7565\n<strong>Route::get('attack_training\/image\/{attack_training:uuid}', [AttackTrainingController::class, 'image'])-&gt;name('attack_training.image');<\/strong><\/pre>\n<p>\u5b9f\u969b\u306eURL\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3082\u306e\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><strong>http:\/\/******\/attack_training\/image\/89697fde-90f4-4d47-a715-1a4b2ac621fa?type=email_opened\n<\/strong><\/pre>\n<h2>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u3064\u304f\u308b<\/h2>\n<p>\u7d9a\u3044\u3066\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:controller AttackTrainingController<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u3001\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<p><strong>app\/Http\/Controllers\/AttackTrainingController.php<\/strong><\/p>\n<pre>&lt;?php\n\nnamespace App\\Http\\Controllers;\n\n<strong>use App\\Models\\AttackTraining;<\/strong>\nuse Illuminate\\Http\\Request;\n\nclass AttackTrainingController extends Controller\n{\n    <strong>public function image(AttackTraining $attack_training, Request $request) {<\/strong>\n\n<strong>        $type = $request-&gt;type;<\/strong>\n<strong>        $valid_types = ['email_opened', 'file_opened', 'link_clicked'];<\/strong>\n\n<strong>        if(in_array($type, $valid_types)) {<\/strong>\n\n<strong>            $attack_training-&gt;{$type .'_at'} = now();<\/strong>\n<strong>            $attack_training-&gt;save(); \/\/ \ud83d\udc48 \u3053\u3053\u3067\u8a13\u7df4\u30e1\u30fc\u30eb\u306e\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u3057\u3066\u3044\u307e\u3059\u3002<\/strong>\n\n<strong>            $image_path = storage_path('app\/images\/attack_training.png');<\/strong>\n<strong>            $image_data = file_get_contents($image_path);<\/strong>\n<strong>            return response($image_data)-&gt;header('Content-type','image\/png');<\/strong>\n\n<strong>        }<\/strong>\n\n<strong>        abort(404);<\/strong>\n\n<strong>    }<\/strong>\n}<\/pre>\n<p>\u3053\u308c\u3067\u3001\u3053\u306eURL\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u753b\u50cf\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u304c\u3001\u88cf\u3067\u8a13\u7df4\u30e1\u30fc\u30eb\u306e\u30c7\u30fc\u30bf\u3082\u4fdd\u5b58\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<h1>\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u4f5c\u6210\u6a5f\u80fd\u3092\u3064\u304f\u308b<\/h1>\n<p>\u6dfb\u4ed8\u3059\u308bHTML\u30d5\u30a1\u30a4\u30eb\u5185\u3067\u753b\u50cf\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u304c\u3001\u3053\u306e\u753b\u50cf\u306eURL\u306f\u5404\u5b9b\u5148\u3054\u3068\u306b\u500b\u5225\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u6301\u305f\u305b\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u30e1\u30fc\u30eb\u9001\u4fe1\u3059\u308b\u3054\u3068\u306bHTML\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001\u3055\u3089\u306b<code>zip\u30d5\u30a1\u30a4\u30eb\u5316<\/code>\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u203b \u306a\u304a\u3001<code>PHP<\/code>\u306b<code>zip\u30e2\u30b8\u30e5\u30fc\u30eb<\/code>\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n<code>phpinfo()<\/code>\u3067\u4e8b\u524d\u306b\u78ba\u8a8d\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8783\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_3.png\" alt=\"\" width=\"640\" height=\"202\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_3.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_3-300x95.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<h2>\u30d5\u30a9\u30eb\u30c0\u3092\u3064\u304f\u308b<\/h2>\n<p>\u6b21\u306b<code>zip<\/code>\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3059\u308b\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u6210\u3057\u3066\u304a\u304d\u307e\u3059\u3002<br \/>\n\uff08\u66f8\u304d\u8fbc\u307f\u6a29\u9650\u3092\u3064\u3051\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\uff09<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8785\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_4.png\" alt=\"\" width=\"435\" height=\"162\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_4.png 435w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_4-300x112.png 300w\" sizes=\"auto, (max-width: 435px) 100vw, 435px\" \/><\/p>\n<h2>\u30d3\u30e5\u30fc\u3092\u3064\u304f\u308b<\/h2>\n<p>\u7d9a\u3044\u3066\u3001<code>HTML<\/code>\u306e\u4e2d\u8eab\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br \/>\n\u4eca\u56de\u306f\u30c6\u30b9\u30c8\u306a\u306e\u3067\u4e2d\u8eab\u306f\u753b\u50cf\u3060\u3051\u3067\u3059\u3002<\/p>\n<p><strong>resources\/views\/html\/attack_training.blade.php<\/strong><\/p>\n<pre><strong>&lt;!doctype html&gt;<\/strong>\n<strong>&lt;html&gt;<\/strong>\n<strong>&lt;head&gt;<\/strong>\n<strong>    &lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=utf-8\"\/&gt;<\/strong>\n<strong>&lt;\/head&gt;<\/strong>\n<strong>&lt;body&gt;<\/strong>\n<strong>    &lt;img src=\"{{ $file_opened_url }}\"&gt;<\/strong>\n<strong>&lt;\/body&gt;<\/strong>\n<strong>&lt;\/html&gt;<\/strong><\/pre>\n<h1>\u30e1\u30fc\u30eb\u9001\u4fe1\u90e8\u5206\u3092\u3064\u304f\u308b<\/h1>\n<p>\u7d9a\u3044\u3066\u3001\u5148\u307b\u3069\u306e<code>zip<\/code>\u30d5\u30a1\u30a4\u30eb\u3092\u6dfb\u4ed8\u3057\u3066\u30e1\u30fc\u30eb\u3067\u9001\u4fe1\u3059\u308b\u90e8\u5206\u3067\u3059\u3002<\/p>\n<h2>\u30d3\u30e5\u30fc\u3092\u3064\u304f\u308b<\/h2>\n<p>\u4eca\u56de\u306f\u8a13\u7df4\u30e1\u30fc\u30eb\u306a\u306e\u3067\u3001\u300c<strong>\u30b3\u30ec\u4f55\u304b\u3042\u3084\u3057\u304f\u306a\u3044\u2753<\/strong>\u300d\u3068\u3044\u3046\u3088\u3046\u306a\u30d2\u30f3\u30c8\u3092\u672c\u6587\u306e\u4e2d\u306b\u542b\u3081\u3066\u304a\u304f\u3053\u3068\u306b\u3057\u307e\u3059\u3002\uff08\u592a\u5b57\u306e\u90e8\u5206\u304c\u4e2d\u56fd\u8a9e\u306e\u6f22\u5b57\u3067\u3059\uff09<\/p>\n<pre>&lt;html&gt;\n&lt;body&gt;\n    &lt;h1&gt;\u65e5\u672c\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u5bfe\u7b56\u6a5f\u69cb\u3088\u308a&lt;\/h1&gt;\n    &lt;div&gt;\n        \u672c\u65e5\u3001<strong>\u4e1a<\/strong>\u52d9\u4e0a\u30b7\u30b9\u30c6\u30e0\u306b\u304a\u3044\u3066\u4efb\u610f\u306e\u30b3\u30fc\u30c9\u304c\u5b9f\u884c\u53ef\u80fd\u306a\u8106\u5f31\u6027\u304c\u5831\u544a\u3055\u308c\u307e\u3057\u305f\u3002&lt;br&gt;\n        \u3053\u306e\u8106\u5f31\u6027\u306e\u30ec\u30d9\u30eb\u306f\u300c<strong>\u7d27<\/strong>\u6025\u300d\u3067\u3059\u3002&lt;br&gt;&lt;br&gt;\n        \u65e9\u6025\u306b\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u306e\u624b\u9806\u306b\u3057\u305f\u304c\u3063\u3066\u5bfe\u7b56\u3092\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002&lt;br&gt;&lt;br&gt;\n        &lt;img src=\"{{ $email_opened_url }}\"&gt;\n    &lt;\/div&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/pre>\n<p>\u203b \u3082\u3061\u308d\u3093\u300c\u65e5\u672c\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u5bfe\u7b56\u6a5f\u69cb\u300d\u306f\u5b9f\u969b\u306b\u306f\u5b58\u5728\u3057\u306a\u3044\u67b6\u7a7a\u306e\u56e3\u4f53\u3067\u3059\u3002<\/p>\n<h2>Mailable\u3092\u3064\u304f\u308b<\/h2>\n<p>\u7d9a\u3044\u3066\u3001<code>Laravel<\/code>\u306e<code>Mailable<\/code>\u3092\u3064\u304f\u308a\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:mail AttackTrainingMailable<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre>&lt;?php\n\nnamespace App\\Mail;\n\n<strong>use App\\Models\\AttackTraining;<\/strong>\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Mail\\Mailable;\nuse Illuminate\\Queue\\SerializesModels;\n\nclass AttackTrainingMailable extends Mailable\n{\n    use Queueable, SerializesModels;\n\n    private $attack_training;\n\n    \/**\n     * Create a new message instance.\n     *\n     * @return void\n     *\/\n    public function __construct(<strong>AttackTraining $attack_training<\/strong>)\n    {\n        <strong>$this-&gt;attack_training = $attack_training;<\/strong>\n    }\n\n    \/**\n     * Build the message.\n     *\n     * @return $this\n     *\/\n    public function build()\n    {\n        <strong>$user = $this-&gt;attack_training-&gt;user;<\/strong>\n<strong>        $zip_path = $this-&gt;attack_training-&gt;generateZipFile();<\/strong>\n\n<strong>        return $this<\/strong>\n<strong>            -&gt;to($user-&gt;email)<\/strong>\n<strong>            -&gt;from('japan.security@example.org', '\u65e5\u672c\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u5bfe\u7b56\u6a5f\u69cb')<\/strong>\n<strong>            -&gt;subject('\u3010\u65e5\u672c\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u5bfe\u7b56\u6a5f\u69cb\u3011\u7dca\u6025\u8b66\u5831')<\/strong>\n<strong>            -&gt;view('email.attack_training')<\/strong>\n<strong>            -&gt;with(['attack_training' =&gt; $this-&gt;attack_training])<\/strong>\n<strong>            -&gt;attach($zip_path, [<\/strong>\n<strong>                'as' =&gt; 'clear-security.zip',<\/strong>\n<strong>                'mime' =&gt; 'application\/zip',<\/strong>\n<strong>            ]);<\/strong>\n    }\n}<\/pre>\n<p>\u3053\u308c\u3067\u8a13\u7df4\u30e1\u30fc\u30eb\u304c\u9001\u4fe1\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<h1>\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u3066\u30c6\u30b9\u30c8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u2757<\/p>\n<pre><strong>$attack_training = \\App\\Models\\AttackTraining::find(1);<\/strong>\n<strong>\\Mail::send(new \\App\\Mail\\AttackTrainingMailable($attack_training));<\/strong><\/pre>\n<p>\u3061\u306a\u307f\u306b\u3001\u73fe\u5728\u306eDB\u30c6\u30fc\u30d6\u30eb\u306f\u3053\u3046\u306a\u3063\u3066\u3044\u307e\u3059\u3002\uff08\uff13\u3064\u306e\u30c1\u30a7\u30c3\u30af\u9805\u76ee\u304c\u5168\u3066<code>NULL<\/code>\u3067\u3059\uff09<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8787\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_5.png\" alt=\"\" width=\"640\" height=\"382\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_5.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_5-300x179.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u3067\u306f\u3001\u30e1\u30fc\u30eb\u9001\u4fe1\u3057\u3066\u30e1\u30fc\u30eb\u30dc\u30c3\u30af\u30b9\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8788\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_6.png\" alt=\"\" width=\"846\" height=\"84\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_6.png 846w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_6-300x30.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_6-768x76.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n<p>\u300c<strong>\u7dca\u6025\u8b66\u5831<\/strong>\u300d\u3068\u3044\u3046\u30e1\u30fc\u30eb\u304c\u5c4a\u304d\u307e\u3057\u305f\u3002<br \/>\n<span style=\"font-size: 1rem;\">\u3067\u306f\u3001\u4e2d\u8eab\u3092\u958b\u3044\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8789\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_7.png\" alt=\"\" width=\"640\" height=\"547\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_7.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_7-300x256.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u4eca\u56de\u5fc5\u8981\u306a\u4ee5\u4e0b\uff13\u3064\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u304c\u304d\u3061\u3093\u3068\u5165\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>\uff08\u958b\u3051\u3061\u3083\u3044\u3051\u306a\u3044\uff09\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb<\/li>\n<li>\uff08\u30af\u30ea\u30c3\u30af\u3057\u3061\u3083\u3044\u3051\u306a\u3044\uff09\u30ea\u30f3\u30af<\/li>\n<li>\uff08\u898b\u3061\u3083\u3044\u3051\u306a\u304b\u3063\u305f\uff09\u30e1\u30fc\u30eb\u5185\u306e\u753b\u50cf<\/li>\n<\/ul>\n<p>\u3067\u306f\u3001\u3053\u306e\u72b6\u614b\u3067DB\u30c6\u30fc\u30d6\u30eb\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8790\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_8.png\" alt=\"\" width=\"781\" height=\"128\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_8.png 781w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_8-300x49.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_8-768x126.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n<p>\u30e1\u30fc\u30eb\u304c\u958b\u5c01\u3055\u308c\u305f\u306e\u3067\u3001<code>email_opened_at<\/code>\u306b\u65e5\u6642\u304c\u4fdd\u5b58\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u3067\u306f\u3001\u6b21\u306b\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u300c<strong>clear-security.zip<\/strong>\u300d\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u5c55\u958b\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8791\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_9.png\" alt=\"\" width=\"436\" height=\"172\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_9.png 436w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_9-300x118.png 300w\" sizes=\"auto, (max-width: 436px) 100vw, 436px\" \/><\/p>\n<p>\u5c55\u958b\u3057\u305fHTML\u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3057\u3066\u30d6\u30e9\u30a6\u30b6\u3067\u8868\u793a\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8792\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_10.png\" alt=\"\" width=\"371\" height=\"383\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_10.png 371w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_10-291x300.png 291w\" sizes=\"auto, (max-width: 371px) 100vw, 371px\" \/><\/p>\n<p>\u753b\u50cf\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<br \/>\n\u3067\u306f\u3001\u3053\u306e\u72b6\u614b\u3067DB\u3092\u898b\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8793\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_11.png\" alt=\"\" width=\"640\" height=\"53\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_11.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_11-300x25.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u4eca\u5ea6\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u304c\u958b\u5c01\u3055\u308c\u305f\u65e5\u6642\u3068\u3057\u3066<code>file_opened_at<\/code>\u304c\u4fdd\u5b58\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u3067\u306f\u6700\u5f8c\u306b\u3001\u30e1\u30fc\u30eb\u306b\u66f8\u304b\u308c\u3066\u3044\u305f\u4ee5\u4e0b\u306e\u30ea\u30f3\u30af\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8794\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_12.png\" alt=\"\" width=\"525\" height=\"32\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_12.png 525w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_12-300x18.png 300w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/p>\n<p>\u3059\u308b\u3068\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8795\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_13.png\" alt=\"\" width=\"640\" height=\"352\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_13.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_13-300x165.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u753b\u50cf\u3060\u3051\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>DB\u30c6\u30fc\u30d6\u30eb\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8796\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_14.png\" alt=\"\" width=\"640\" height=\"52\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_14.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/03\/laravel_targeted_attack_email_training_14-300x24.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u60f3\u5b9a\u901a\u308a<code>link_clicked_at<\/code>\u306b\u30c7\u30fc\u30bf\u304c\u4fdd\u5b58\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u5168\u3066\u6210\u529f\u3067\u3059\u2728\ud83d\ude0a\ud83d\udc4d<\/p>\n<h1>\u3061\u306a\u307f\u306b<\/h1>\n<p>\u8a13\u7df4\u30e1\u30fc\u30eb\u3067\u306f\u3001\u3082\u3061\u308d\u3093\u4e00\u756a\u300c<strong>\u30e1\u30fc\u30eb\u3092\u958b\u5c01\u3057\u306a\u3044\u3053\u3068<\/strong>\u300d\u304c\u5927\u4e8b\u3067\u3059\u304c\u3001\u305d\u308c\u3068\u540c\u3058\u304f\u3089\u3044\u5927\u4e8b\u306a\u306e\u304c\u3001\u300c<strong>\u5909\u306a\u30e1\u30fc\u30eb\u3092\u958b\u5c01\u3057\u3066\u3057\u307e\u3063\u305f<\/strong>\u300d\u3068\u304d\u3061\u3093\u3068\u5831\u544a\u3059\u308b\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u4eca\u56de\u306e\u62e1\u5f35\u6a5f\u80fd\u3068\u3057\u3066\u306f\u3001<code>attack_reported_at<\/code>\u3068\u3044\u3046\u3088\u3046\u306a\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u7528\u610f\u3057\u3066\u304a\u3044\u3066\u3001\u300c<strong>\u30e1\u30fc\u30eb\u306f\u958b\u5c01\u3057\u3066\u3057\u307e\u3063\u305f\u3051\u3069\u3001\u5831\u544a\u306f\u3057\u3066\u304f\u308c\u305f<\/strong>\u300d\u3068\u3044\u3046\u30c7\u30fc\u30bf\u304c\u4fdd\u5b58\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u3082\u3044\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u4eca\u56de\u306f\u3001\u6a19\u7684\u578b\u653b\u6483\u30e1\u30fc\u30eb\u306e\u8a13\u7df4\u3092\u3059\u308b\u305f\u3081\u306e\u30b7\u30b9\u30c6\u30e0\u3092\u958b\u767a\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u3084\u306f\u308a\u3053\u3046\u3044\u3063\u305f\u653b\u6483\u81ea\u4f53\u304c\u306a\u304f\u306a\u308c\u3070\u3044\u3044\u3067\u3059\u304c\u3001\u5b8c\u5168\u306b\u7121\u304f\u3059\u306e\u306f\u96e3\u3057\u3044\u3067\u3059\u3057\u3001\u5358\u306b\u8cc7\u6599\u3092\u898b\u308b\u3060\u3051\u3067\u306f\u3001\u3044\u308f\u3086\u308b\u300c\u7573\u6c34\u7df4\u300d\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u3084\u306f\u308a\u5b9f\u969b\u306b\u3053\u3046\u3044\u3063\u305f\u30b7\u30b9\u30c6\u30e0\u3092\u4f7f\u3063\u3066\u65e5\u9803\u304b\u3089\u8a13\u7df4\u3057\u3066\u304a\u304f\u306e\u304c\u3044\u3044\u306e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u4ee5\u524d\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u95a2\u9023\u306e\u65b9\u306b\u805e\u3044\u305f\u8a71\u3067\u3059\u304c\u3001\u300c<strong>\u653b\u6483\u3059\u308b\u3088\u308a\u5b88\u308b\u65b9\u304c\u96e3\u3057\u3044<\/strong>\u300d\u305d\u3046\u3067\u3059\u3002\u3069\u3053\u3092\u3064\u3044\u3066\u304f\u308b\u304b\u5206\u304b\u3089\u306a\u3044\u3067\u3059\u304b\u3089\u306d\u3002<\/p>\n<p>\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u6280\u8853\u8005\u306e\u304a\u7d66\u6599\u304c\u3044\u3044\u3068\u3044\u3046\u306e\u3082\u3046\u306a\u305a\u3051\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u3082\u8a66\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\u2757<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4445 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png\" alt=\"\" width=\"370\" height=\"310\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png 370w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2-300x251.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/>\u300c\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3055\u3093\u306b\u9802\u3044\u305f<br \/>\n\u30bd\u30fc\u30bb\u30fc\u30b8\u3001\u30a6\u30de\u30a6\u30de\u3067\u3059\ud83c\udf74\ud83d\ude0a\u2728\u300d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u4ee5\u524d\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u5c02\u9580\u5bb6\u3068\u304a\u4ed5\u4e8b\u3092\u3055\u305b\u3066\u3044\u305f\u3060\u3044\u305f\u3053\u3068\u304c\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u305d\u306e\u969b\u306b\u300c\u3042\u308b\u30b7\u30b9\u30c6\u30e0\u300d\u306e\u3053\u3068\u3092\u6559\u3048\u3066\u3044\u305f\u3060\u304d\u307e\u3057\u305f\u3002 \u305d\u308c\u306f\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb \u6a19\u7684 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=8773\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u3010Laravel\u3011\u6a19\u7684\u578b\u653b\u6483\u30e1\u30fc\u30eb\u306e\u8a13\u7df4\u30b7\u30b9\u30c6\u30e0\u3092\u3064\u304f\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":8805,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[47],"class_list":["post-8773","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","tag-47"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/8773","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8773"}],"version-history":[{"count":9,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/8773\/revisions"}],"predecessor-version":[{"id":8806,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/8773\/revisions\/8806"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/8805"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8773"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8773"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8773"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}