{"id":1070,"date":"2023-09-25T11:38:28","date_gmt":"2023-09-25T11:38:28","guid":{"rendered":"https:\/\/shreyapohekar.com\/blogs\/?p=1070"},"modified":"2023-09-25T11:40:26","modified_gmt":"2023-09-25T11:40:26","slug":"winja-ctf-nullcon-goa-2023-edition-solutions","status":"publish","type":"post","link":"https:\/\/shreyapohekar.com\/blogs\/winja-ctf-nullcon-goa-2023-edition-solutions\/","title":{"rendered":"Winja CTF @ Nullcon Goa 2023 Edition Solutions"},"content":{"rendered":"\n<p>Hello, Everyone! I trust you had a fantastic time at Winja CTF 2023 &#8211; Goa Edition. I hope you found the challenges intriguing. <\/p>\n\n\n\n<p>In this blog post, I will be sharing the solutions to the challenges I built.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Faulty Portal<\/h2>\n\n\n\n<p>This was a web challenge that&#8217;s based on collibra.<\/p>\n\n\n\n<p><br>Collibra is a software company that specializes in data governance and cataloging solutions. It provides a platform that helps organizations manage and govern their data assets, ensuring that data is accurate, consistent, and compliant with regulations.<\/p>\n\n\n\n<p>Lets get to the solution.<\/p>\n\n\n\n<p>The landing page looks like this.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-1024x445.png\" alt=\"\" class=\"wp-image-1071\" width=\"840\" height=\"365\" srcset=\"https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-1024x445.png 1024w, https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-300x130.png 300w, https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-768x334.png 768w, https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-640x278.png 640w, https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image.png 1046w\" sizes=\"(max-width: 840px) 100vw, 840px\" \/><\/figure>\n\n\n\n<p>If you go to the page-source, you will find that there is a todo that talks about installing collibra.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"855\" height=\"320\" src=\"https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-1.png\" alt=\"\" class=\"wp-image-1072\" srcset=\"https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-1.png 855w, https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-1-300x112.png 300w, https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-1-768x287.png 768w, https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-1-640x240.png 640w\" sizes=\"(max-width: 855px) 100vw, 855px\" \/><\/figure>\n\n\n\n<p>With this information, you&#8217;ll have a jot down a list that contains possible collibra file and directory names and bruteforce.<\/p>\n\n\n\n<p>You will get a hit for <code>collibra.properties<\/code> which has the username and password. But there is still a hunt for url<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"675\" height=\"226\" src=\"https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-2.png\" alt=\"\" class=\"wp-image-1073\" srcset=\"https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-2.png 675w, https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-2-300x100.png 300w, https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-2-640x214.png 640w\" sizes=\"(max-width: 675px) 100vw, 675px\" \/><\/figure>\n\n\n\n<p>It says check notes.<\/p>\n\n\n\n<p>An easy guess is to check in notes files. But we dont know the extension yet. Extension list can be bruteforced and you will get a hit for <code>notes.png<\/code>. But it shows this.<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"945\" height=\"121\" src=\"https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-3.png\" alt=\"\" class=\"wp-image-1074\" srcset=\"https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-3.png 945w, https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-3-300x38.png 300w, https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-3-768x98.png 768w, https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-3-640x82.png 640w\" sizes=\"(max-width: 945px) 100vw, 945px\" \/><\/figure>\n\n\n\n<p>Retrieve the file using wget and open the file in vim. You will see a base64 text.<\/p>\n\n\n\n<p>Now make the file of the format <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;img src=\"data:image\/png;base64,iVBORw0KG...\" \/><\/pre>\n\n\n\n<p>This is the html representation. Also save the file as notes.html and you will see the vulnerable path `\/mysecretflag.php`.<\/p>\n\n\n\n<p>Now just visit the path and enter the credentials to get the flag.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Crawlwise<\/h2>\n\n\n\n<p>This challenge is inspired by a dependency confusion attack where you just need to identify the unusual package name and get the flag.<\/p>\n\n\n\n<p>Lets get to the solution.<\/p>\n\n\n\n<p>Once you get to https:\/\/github.com\/Winja-Events\/CrawlWise, you will see a lot of code around AI\/ ML and how different models are implemented. The code is a misdirection and the original vulnerability lies here.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"912\" height=\"685\" src=\"https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-4.png\" alt=\"\" class=\"wp-image-1075\" srcset=\"https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-4.png 912w, https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-4-300x225.png 300w, https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-4-768x577.png 768w, https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-4-640x481.png 640w\" sizes=\"(max-width: 912px) 100vw, 912px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>See something different here?<br>Its the package name of line number 7 <code>winja-exploitr<\/code>. So you simply need to run <code>pip3 install winja-exploitr<\/code>. Once the package is installed, nothing will happen as such (even when you import it). <\/p>\n\n\n\n<p>Now go to site-packages path of your python environment and search for package winja_exploitr. In the main.py file, you will find your flag.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"633\" height=\"226\" src=\"https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-5.png\" alt=\"\" class=\"wp-image-1076\" srcset=\"https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-5.png 633w, https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-5-300x107.png 300w\" sizes=\"(max-width: 633px) 100vw, 633px\" \/><\/figure>\n\n\n\n<p>And there you see the flag! Hope you learned about AI\/ML implementations too \ud83d\ude42<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Mycamera App<\/h2>\n\n\n\n<p>My camera app is an Android application that clicks a photo and uploads it somewhere. But does it really uploads stuff? The challenge is inspired from the real-world scenario where you need to read the code and strings.<\/p>\n\n\n\n<p>Lets get to the solution.<br>The app is a basic one and once a photo is clicked, you will get a toast saying <code>image is uploaded<\/code>.<\/p>\n\n\n\n<p>Now there is nothing much in the UI, so we can move to app decompilation.<\/p>\n\n\n\n<p>Decompile it using jadx and open the extracted files in android studio. Its gives better code readability.<\/p>\n\n\n\n<p>You will see a few java files. But the interesting stuff lies in strings.xml and EncryptDecrypt.java<\/p>\n\n\n\n<p>In <code>strings.xml<\/code> you will see the following keys that are interesting and suggest that firebase is used.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    &lt;string name=\"key\"&gt;AIzaSyDVoHL4OvktJRo-gQo952SP8ytyz22LAOA&lt;\/string&gt;\n    &lt;string name=\"client_id\"&gt;467331769845-sdd0ukl3fmj2irb0nor30801dqc0hp73.apps.googleusercontent.com&lt;\/string&gt;<\/code><\/pre>\n\n\n\n<p>Here, the key is a misdirection as all we need is the project name and the path where the flag may be existing<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    &lt;string name=\"upload_bucket\"&gt;mysecr3tpaper&lt;\/string&gt;\n    &lt;string name=\"image_upload_folder\"&gt;\/secrets&lt;\/string&gt;<\/code><\/pre>\n\n\n\n<p>The bucket has public read access so you can run the following command to get the flag<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -X GET \"https:\/\/firestore.googleapis.com\/v1\/projects\/mysecr3tpaper\/databases\/(default)\/documents\/secrets\"<\/code><\/pre>\n\n\n\n<p>You will see multiple flags here. But the correct one is the one that is encrypted.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"325\" src=\"https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-9-1024x325.png\" alt=\"\" class=\"wp-image-1081\" srcset=\"https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-9-1024x325.png 1024w, https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-9-300x95.png 300w, https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-9-768x244.png 768w, https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-9-640x203.png 640w, https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-9.png 1111w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Cant guess what encryption is used? Time to go back to the code. The EncryptDecrypt file mentioned about <code>Blowfish<\/code> Algorithm. So you can decrypt the text using the secretkey provided in the code to get your flag.<\/p>\n\n\n\n<p>Go to https:\/\/sladex.org\/blowfish.js\/ and enter your encrypted text and key. Mode is CBC.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"601\" height=\"573\" src=\"https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-7.png\" alt=\"\" class=\"wp-image-1078\" srcset=\"https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-7.png 601w, https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/08\/image-7-300x286.png 300w\" sizes=\"(max-width: 601px) 100vw, 601px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Timetrek<\/h2>\n\n\n\n<p>The challenge starts with access to docs file https:\/\/docs.google.com\/document\/d\/1wThMjs8Ro2IMY8K026kso5Fqtk4RsPH6rEYsESN1b8g\/edit?pli=1<br>This looks like documentation which is been reviewed by someone. You will have to first request the permissions. And I give you the commenter access.<\/p>\n\n\n\n<p>If you scroll through the comments, you will observe that they are talking about scheduling a meeting and the user says that my username for the calendar is same. (A hint was provided that the preferred calendar is not google calendar)<\/p>\n\n\n\n<p>This is directed towards calendy account of the user.<\/p>\n\n\n\n<p>Simply go to https:\/\/calendly.com\/infosecshreya to get the flag.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"427\" src=\"https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/09\/image-1024x427.png\" alt=\"\" class=\"wp-image-1083\" srcset=\"https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/09\/image-1024x427.png 1024w, https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/09\/image-300x125.png 300w, https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/09\/image-768x320.png 768w, https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/09\/image-640x267.png 640w, https:\/\/shreyapohekar.com\/blogs\/wp-content\/uploads\/2023\/09\/image.png 1046w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>That&#8217;s all for this post. We look forward to reconnecting with all of you in the next event! Until then, happy hunting! \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello, Everyone! I trust you had a fantastic time at Winja CTF 2023 &#8211; Goa Edition. I hope you found the challenges intriguing. In this blog post, I will be sharing the solutions to the challenges I built. Faulty Portal This was a web challenge that&#8217;s based on collibra. Collibra is a software company that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1087,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"","ocean_second_sidebar":"","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"","ocean_custom_header_template":"","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"","ocean_menu_typo_font_family":"","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"on","ocean_gallery_id":[],"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1070","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","entry","has-media"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/shreyapohekar.com\/blogs\/wp-json\/wp\/v2\/posts\/1070"}],"collection":[{"href":"https:\/\/shreyapohekar.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shreyapohekar.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shreyapohekar.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shreyapohekar.com\/blogs\/wp-json\/wp\/v2\/comments?post=1070"}],"version-history":[{"count":5,"href":"https:\/\/shreyapohekar.com\/blogs\/wp-json\/wp\/v2\/posts\/1070\/revisions"}],"predecessor-version":[{"id":1088,"href":"https:\/\/shreyapohekar.com\/blogs\/wp-json\/wp\/v2\/posts\/1070\/revisions\/1088"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/shreyapohekar.com\/blogs\/wp-json\/wp\/v2\/media\/1087"}],"wp:attachment":[{"href":"https:\/\/shreyapohekar.com\/blogs\/wp-json\/wp\/v2\/media?parent=1070"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shreyapohekar.com\/blogs\/wp-json\/wp\/v2\/categories?post=1070"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shreyapohekar.com\/blogs\/wp-json\/wp\/v2\/tags?post=1070"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}