{"id":111,"date":"2012-07-25T00:47:35","date_gmt":"2012-07-24T16:47:35","guid":{"rendered":"http:\/\/matnet.my\/blog\/?p=111"},"modified":"2012-07-29T21:52:19","modified_gmt":"2012-07-29T13:52:19","slug":"symlink","status":"publish","type":"post","link":"https:\/\/matnet.my\/blog\/2012\/07\/symlink\/","title":{"rendered":"Symlink"},"content":{"rendered":"<p>I just played with symlink on the shell. I&#8217;m try to understand how sym.php from\u00a0r.Alsa3ek and Al-Swisre are working.<\/p>\n<p>Still can&#8217;t decode the code so I send the code to my old buddy to help me decode the code.<\/p>\n<p>The first operation of the sym.php is to create a folder name sym and create symlink name root to \/<\/p>\n<p>So with my low knowledge of symlink i&#8217;d tried to simulate the scenario by manually \u00a0create some folder in the web root and create the symlink.<\/p>\n<p>Then i chown it to username of the webroot using ROOT .<\/p>\n<p>So what happen ? suddenly all scripts on the server were error and got 403.<\/p>\n<p>I&#8217;m unconscious that i have been chown \/ to user.user LOL.<\/p>\n<p>total 526<br \/>\ndrwxr-xr-x 26 user user 4096 Jul 19 19:22 .\/<br \/>\ndrwxr-xr-x 26 user user 4096 Jul 19 19:22 ..\/<br \/>\n-rw-r&#8211;r&#8211; 1 root root 0 Jul 19 05:39 .autofsck<br \/>\n-rw-r&#8211;r&#8211; 1 root root 0 Jul 19 02:30 .autorelabel<br \/>\ndrwx&#8212;&#8212; 2 root root 4096 Jul 19 05:39 .spamassassin\/<br \/>\ndrwx&#8211;x&#8211;x 4 root root 4096 Jul 20 17:05 backup\/<br \/>\ndrwxr-xr-x 2 root root 4096 Jul 20 04:25 bin\/<br \/>\ndrwxr-xr-x 4 root root 1024 Jul 19 04:18 boot\/<\/p>\n<p>Look at the .\/ and ..\/<\/p>\n<p>:P~<\/p>\n<p>The lesson of this article is beware to use root account. Better use users account then sudoing and please understand where the symlink is link to \ud83d\ude42<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I just played with symlink on the shell. I&#8217;m try to understand how sym.php from\u00a0r.Alsa3ek and Al-Swisre are working. Still &hellip; <a href=\"https:\/\/matnet.my\/blog\/2012\/07\/symlink\/\" class=\"more-link\">More <span class=\"screen-reader-text\">Symlink<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[14],"class_list":["post-111","post","type-post","status-publish","format-standard","hentry","category-bsd-nix","tag-symlink-cmd-linux","standard"],"_links":{"self":[{"href":"https:\/\/matnet.my\/blog\/wp-json\/wp\/v2\/posts\/111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/matnet.my\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/matnet.my\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/matnet.my\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/matnet.my\/blog\/wp-json\/wp\/v2\/comments?post=111"}],"version-history":[{"count":4,"href":"https:\/\/matnet.my\/blog\/wp-json\/wp\/v2\/posts\/111\/revisions"}],"predecessor-version":[{"id":114,"href":"https:\/\/matnet.my\/blog\/wp-json\/wp\/v2\/posts\/111\/revisions\/114"}],"wp:attachment":[{"href":"https:\/\/matnet.my\/blog\/wp-json\/wp\/v2\/media?parent=111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/matnet.my\/blog\/wp-json\/wp\/v2\/categories?post=111"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/matnet.my\/blog\/wp-json\/wp\/v2\/tags?post=111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}