<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Marcellus Michael Herman Kahari on Medium]]></title>
        <description><![CDATA[Stories by Marcellus Michael Herman Kahari on Medium]]></description>
        <link>https://medium.com/@michaelkahari.mk?source=rss-24bc55634f37------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*LvcWNEeEb4td_E24.jpg</url>
            <title>Stories by Marcellus Michael Herman Kahari on Medium</title>
            <link>https://medium.com/@michaelkahari.mk?source=rss-24bc55634f37------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 23:31:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@michaelkahari.mk/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[BnB application]]></title>
            <link>https://medium.com/@michaelkahari.mk/bnb-application-280982ef3ac2?source=rss-24bc55634f37------2</link>
            <guid isPermaLink="false">https://medium.com/p/280982ef3ac2</guid>
            <dc:creator><![CDATA[Marcellus Michael Herman Kahari]]></dc:creator>
            <pubDate>Sun, 29 Sep 2024 19:01:32 GMT</pubDate>
            <atom:updated>2024-09-29T19:01:32.797Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/254/0*URMdtiuP39Oj1DVv" /><figcaption>Bold and Brash</figcaption></figure><h3>Short Description</h3><p>The name of the application is inspired by one of art masterpiece by Squidward Tentacles called Bold and Brash (in Indonesia: Tampan dan Berani). With this application, users can see list of games and the detail of the games, included screenshots of games.</p><h3>Screen</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*scwfBzXyVrcrPKeFPWazMA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R7KGs8ag4CV1hgGDVextDQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yjlQaA98bHFIFnOhzmARbg.png" /><figcaption>Screenshots of application</figcaption></figure><h3>Architecture</h3><p>In this application, I create several layer to comply with MVVM. There are activity, view model, usecase, and repository.</p><h4>Activity</h4><p>In this part, activity only displaying data to users and receiving input from users. After receiving input, it will send to view model. In activity, there are observer, so if the data changes by view model, it will also change the data in activity.</p><h4>View Model</h4><p>In view model, the view model will send the request to usecase and waiting to receiving result. Also, there are mutable live data and view model is responsible to change the data after receiving from usecase.</p><h4>Usecase</h4><p>In usecase, main logic happens here. In this case, usecase will mapping redirect request to repository and mapping the result data. To display main screen BnB game app, I create recycler view and inside recycler view, I create items to display image, title, short description, and genre. For detail game, I only create one recycler view. In the detail game page, I use two types of items, which is detail game item that consist of title, genre, and description, and image item to display thumbnail and screenshots. So, my recycler view in second page look like this.</p><p>&lt;image: thumbnail&gt;</p><p>&lt;detail: text title etc&gt;</p><p>&lt;image: screenshot 1&gt;</p><p>&lt;image: screenshot 2&gt;</p><p>Usecase will responsible to mapping this data so it will follow the example above.</p><h4>Repository</h4><p>In this part, the application will fetch the API to get the data.</p><h3>Testing</h3><p>There are view model test, use case test, repository test, and UI test in this application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_tFqPP_eg7Hopo3t3s_XNg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YFfhbhWzoy4rIFBPChgBUA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xd2CvpyOdo9DlqNtrnVkaA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lUZcWZvNzcCIZ6GdALmYdg.jpeg" /><figcaption>List of test in BnB application</figcaption></figure><h3>Conclusion</h3><p>Even tough it’s hard, the application fulfill the requirements. By doing this project, I learn a lot about developing mobile application from scratch, developing using MVVM, and create unit test.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=280982ef3ac2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Memento in Kotlin]]></title>
            <link>https://medium.com/@michaelkahari.mk/memento-in-kotlin-9ce0c0c48c15?source=rss-24bc55634f37------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ce0c0c48c15</guid>
            <dc:creator><![CDATA[Marcellus Michael Herman Kahari]]></dc:creator>
            <pubDate>Thu, 26 Sep 2024 22:22:03 GMT</pubDate>
            <atom:updated>2024-09-26T22:22:03.415Z</atom:updated>
            <content:encoded><![CDATA[<p>When building application, especially when dealing with complex user interactions, save and undo feature can help to enhance user experience. We can imagine save and undo feature like text editor application, when we can save some text and undo until some state. In Kotlin, we can achieve this way using Memento design pattern. We will deep dive about Memento and how to implement it in Kotlin.</p><h3>What is Memento?</h3><p>The <strong>Memento Pattern</strong> is a <strong>behavioral design pattern</strong> that allows you to capture and externalize an object’s state without revealing its internal structure. It has 3 main structure:</p><ol><li>Memento: object that acts like snapshot</li><li>Originator: class that produce Memento and can restore some state with specific Memento</li><li>Caretaker: caretaker is class that store Memento, but it can’t access the data inside Memento</li></ol><p>It’s important to noted that we want Memento can’t be tamper outside the originator class. So, we should make caretaker only can store Memento and should not able to access the value inside Memento. We can achieve this by making Memento as private inner class in Originator.</p><p>Below is example of implementation Memento design pattern in Kotlin.</p><pre>// Originator class whose state is saved<br>class Originator {<br>    var state: String = &quot;&quot;<br><br>    // Nested Memento class, only accessible from Originator<br>    private inner class Memento(val state: String)<br><br>    // Method to create a memento (save state)<br>    fun saveStateToMemento(): Any {<br>        return Memento(state)<br>    }<br><br>    // Method to restore state from a memento<br>    fun restoreStateFromMemento(memento: Any) {<br>        if (memento is Memento) {<br>            state = memento.state<br>        }<br>    }<br>}</pre><p>This is Originator class. Inside originator, we create Memento class. In this example, originator can save it state to memento and also restore it state from specific memento.</p><pre>class Caretaker {<br>    private val mementoStack = ArrayDeque&lt;Any&gt;()<br><br>    fun save(memento: Any) {<br>        mementoStack.addLast(memento)<br>    }<br><br>    // Pop state from the stack (return the last saved state)<br>    fun undo(): Any? {<br>        return if (mementoStack.isNotEmpty()) mementoStack.removeLast() else null<br>    }<br>}</pre><p>In Caretaker class, we create array dequeue data structure to store Memento. To save, we can store it like stack, in last of array dequeue. To undo, or restore, we can pop the last of array dequeue. How we connect both of the class? Below is the example in main application.</p><pre>fun main() {<br>    val originator = Originator()<br>    val caretaker = Caretaker()<br><br>    // Changing and saving states<br>    originator.state = &quot;State #1&quot;<br>    caretaker.save(originator.saveStateToMemento())<br><br>    originator.state = &quot;State #2&quot;<br>    caretaker.save(originator.saveStateToMemento())<br><br>    originator.state = &quot;State #3&quot;<br><br>    println(&quot;Current State: ${originator.state}&quot;)<br><br>    // Undo state changes<br>    originator.restoreStateFromMemento(caretaker.undo() ?: return)<br>    println(&quot;After Undo: ${originator.state}&quot;)<br>}</pre><p>And below is the output example.</p><pre>Current State: State #3<br>After Undo: State #2</pre><p>We can see that to restore state from Memento, originator will ask the caretaker the last memento stored and after receiving, originator will read that memento and update state. When originator want to save the memento, we can call caretaker to save the memento that originator generate.</p><h3>Conclusion</h3><p>Using Memento is good when want to create snapshots of our state so the program can undo in specific state. But, it also have drawbacks. If the application create Memento too often, it will consume a lots of RAM and memory since it will generate snapshots and store it in stack.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ce0c0c48c15" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Visibility in Android]]></title>
            <link>https://medium.com/@michaelkahari.mk/visibility-in-android-42b1e85a04e3?source=rss-24bc55634f37------2</link>
            <guid isPermaLink="false">https://medium.com/p/42b1e85a04e3</guid>
            <dc:creator><![CDATA[Marcellus Michael Herman Kahari]]></dc:creator>
            <pubDate>Wed, 25 Sep 2024 19:14:59 GMT</pubDate>
            <atom:updated>2024-09-25T19:14:59.630Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AxpPj_uS9Rvsfgn6" /><figcaption>View after visibility set to invisible (or gone?)</figcaption></figure><p>When we create view in XML, we can see that there are attribute in view called visibility. We can see that in visibility, there are 3 values: gone, invisible, and visible. What are they? We will discuss it in this story.</p><h4>Visible</h4><p>Visible actually straightforward because it like the name, if we set the visibility to visible, we can see that view in our screen.</p><h4>Invisible</h4><p>Invisible is opposite to visible, it would not displaying the view to user. But, it still take some space to layout of the view. So, it will not collapse and other view still in the same position.</p><h4>Gone</h4><p>What about gone? Well, gone is look like invisible, it’s invisible (yes). But, the difference is it not take some space to layout the view. So, if some view has visibility gone, the other view will fill in that space.</p><h3>Conclusion</h3><p>So, that’s three type of visibility in Android. It’s important for us to know the each functionality of this type. By knowing, tt will help us to debug for some UI error.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42b1e85a04e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tools in Android Studio]]></title>
            <link>https://medium.com/@michaelkahari.mk/tools-in-android-studio-6d297c8c241b?source=rss-24bc55634f37------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d297c8c241b</guid>
            <dc:creator><![CDATA[Marcellus Michael Herman Kahari]]></dc:creator>
            <pubDate>Tue, 24 Sep 2024 18:34:38 GMT</pubDate>
            <atom:updated>2024-09-24T18:34:38.815Z</atom:updated>
            <content:encoded><![CDATA[<p>When we doing code in mobile application, especially when we use Android Studio, sometimes we see this part of code.</p><pre>xmlns:tools=&quot;http://schemas.android.com/tools</pre><p>This part of code is auto generated by suggestion in Android Studio, and maybe we don’t have enough time to go deeper with that part of code. But, what is that actually?</p><p>Refer to the official documentation Android Studio, Android Studio provide a support of XML attributes with tools namespace. This support can help us as developer to enable design-time features and compile-time behaviors. Below is the explanation what this tools can do.</p><h3>Error handling attributes</h3><p>By using tools, we can ignore some lint error message, using ‘tools:ignore’. We can also specify the localization using ‘tools:local’ to ignore error misspelling. Lastly, we can specify the API level so this will stop warning you when some element is not available in some API level.</p><h3>Design Time</h3><p>This tools will define the characteristics that will visible only in Android Studio layout preview. For example, we can use ‘tools:visibility’ and set it to invisible to hide some view. We can also set the maximum item that will be display in the layout editor, for example RecyclerView, with hardcoded number using ‘tools:itemCount’.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d297c8c241b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Good Posture for Programmer]]></title>
            <link>https://medium.com/@michaelkahari.mk/good-posture-for-programmer-21a66d62908f?source=rss-24bc55634f37------2</link>
            <guid isPermaLink="false">https://medium.com/p/21a66d62908f</guid>
            <dc:creator><![CDATA[Marcellus Michael Herman Kahari]]></dc:creator>
            <pubDate>Mon, 23 Sep 2024 16:51:29 GMT</pubDate>
            <atom:updated>2024-09-23T16:51:29.794Z</atom:updated>
            <content:encoded><![CDATA[<p>When we doing coding, sometimes we do not care with our body posture, especially when we sitting in front of laptop for a long time. Having good posture is not just for make we look good in front of people, but it also related with health issue. Because, if we not make habit as maintain good posture, it can cause back pain and neck pain.</p><p>Then, how we should make good posture when we doing coding? We can do like the image below. A good sitting posture on chair should be straight back and not lean forward or lean backward.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wZu7fvze7dftY5Fh" /><figcaption>Posture for sitting position (<em>Moramarco Chiropractic)</em></figcaption></figure><p>Maintaining good posture maybe could be hard for us, especially when we too focused on our work. But, we can try another ways, for example, create alarm within 10 to 15 minutes to reminder us to fix our posture. By doing this, we can reduce chance of back pain and neck pain.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21a66d62908f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learn Cyber Security As Software Engineer]]></title>
            <link>https://medium.com/@michaelkahari.mk/cyber-security-df6f3e2642be?source=rss-24bc55634f37------2</link>
            <guid isPermaLink="false">https://medium.com/p/df6f3e2642be</guid>
            <dc:creator><![CDATA[Marcellus Michael Herman Kahari]]></dc:creator>
            <pubDate>Sun, 25 Aug 2024 04:59:32 GMT</pubDate>
            <atom:updated>2024-08-28T03:03:48.537Z</atom:updated>
            <content:encoded><![CDATA[<p>Learning about cyber security is what I like to do if I have free time. Because, as a software engineer, I believe that knowledge of cyber security would be one of the important things when we, as software developers, develop systems. Sometimes we don’t care about the security aspect when we develop the system (well, we have a lot of Jira tickets that need to be done first). I think the security aspect of a system is the responsibility of both software engineers and cyber security.</p><p>As engineers, we know more about the products or systems that we develop. There are some possibilities that the cybersecurity department will fail to test the system, and maybe they don’t know that the users can do that or something else. Also, learning basic cyber security will prevent us from basic exploitation, for example receiving input from users unsanitized that can lead to SQL Injection. If we learn about cyber security, we will know the best practices so it can prevent us from doing that thing.</p><p>In this article, I will tell you about my journey in cyber security.</p><h3>Hack The Box</h3><p>When I’m still in university, I like to learn individually about cyber security from Hack The Box (HTB) platforms, an online platforms that provide cyber security learning. I also love to do a little capture of the flag, individually or with my team. Even though I never won, doing this competition was refreshing for me from the jobs. The fields that I love to explore more are website exploitation and machine exploitation, which consist of Linux or Windows exploitation. I try to apply my learning by doing some practice on the Hack The Box platform and also on a real website (that I already have permission to it).</p><h3>SMT Program</h3><p>SMT (Security Manpower Training) program is a program held KISIA (Korea Information Security Industry Association) in South Korea. I joined this program, which consist of online training and offline training in South Korea. Fortunately, I get the chance to do offline training in South Korea. In this training, I learn a lot about cyber security, like web exploitation, OS exploitation, networking, and forensics.</p><h3>Mobile Application Exploitation</h3><p>I had one experience when doing mobile exploitation, and that was my university project. I found one vulnerability that can lead people to know other students’ sensitive data, and of course, I reported that to the lecturer. Maybe now the vulnerabilities are already patched (I don’t check it again after reporting).</p><h3>Part Time as Cyber Security Engineer</h3><p>In 2024, I do part-time as a junior cyber security engineer in an of IT service company. In this job, I do several jobs that are related to cyber security. For example, I create a procedure for ISO27001. Not only that, I also do pen testing. I do pen-testing for the internal company website and also the client website. I found several vulnerabilities in this pen testing. By doing this pen testing, I feel like I am implementing the knowledge that I get from all of my courses that I did before.</p><p>Learning cyber security would benefit us as software engineers. Because we can think about all the possibilities that hackers use to hack our system. For example, I ever faced a case when generating a PDF file, where the developer did not sanitize the input properly, only sanitizing the input in frontend. That is not best practice and can lead to several attacks. So, that’s why we as developers should know basic cyber security when we develop the software.</p><p>We don’t have to always follow all of the updates in cyber security. But, the least we can do is always update the software from our system. Because, most likely the previous version has any bugs that may have led the attacker to attack our system.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df6f3e2642be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JSCalc Walkthrough]]></title>
            <link>https://medium.com/@michaelkahari.mk/jscalc-walkthrough-bb5b0c5319b3?source=rss-24bc55634f37------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb5b0c5319b3</guid>
            <category><![CDATA[eval]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[rce]]></category>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[Marcellus Michael Herman Kahari]]></dc:creator>
            <pubDate>Tue, 16 Jan 2024 01:30:50 GMT</pubDate>
            <atom:updated>2024-01-16T01:30:50.006Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pyjK8Z59BZdorEsPRGLEKg.png" /></figure><p>In this challenge, we provided with source code of the website that uses the framework Node Js. The main feature of the website is a calculator. User can type their input and the website will calculate it for them.</p><h3>Discovery</h3><p>When we saw the source code, we saw that there is an endpoint <strong>/api/calculate </strong>that received formula from the request body and passed the value to the Calculator modules. There is no sanitization in this function, so let’s go to the Calculator modules.</p><p>Calculator modules are located in calculatorHelper. There is an eval function that receives user input and then returns the eval output that will be displayed on the client website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/1*h_mmy0zsBMAVeQl6NH2oQw.png" /></figure><p>From the above code, we can see that we will use the eval function to escalate our exploit to gain <strong>Remote Code Execution (RCE)</strong>. We need to note that our formula is located in function() which is provided by the code base.</p><h3>Exploitation</h3><p>I will try to run the code in my docker. To get the error output, I add the console log inside the catch block.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BDc2JLP70Rh_HuhxR2D8Og.png" /></figure><p>Well, our local website is ready. Firstly, I try to escape the function() that is provided by the code base using this input.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*80yrPE8jN-Bim8hDclDsjQ.png" /></figure><p>It gives us something went wrong. When we see the error log, we will notice that we need to comment on the closing function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9nEvI6Wa6l5dC5Zq1JYZMg.png" /></figure><p>We can add <strong>// </strong>to make the rest of the formula a comment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1PIDGN8Vo2OANU29QbRazA.png" /></figure><p>It give us the 10 output as we expected.</p><p>To read other files, we can use child_process as written in this GitHub <a href="https://github.com/aadityapurani/NodeJS-Red-Team-Cheat-Sheet">link</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*vdyZSvAyah3uOtqAAAOUGA.png" /></figure><p>Well, it gives us [Object object] return. When we see it in the network, we will notice that the output is not as we expected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K9YSQAmERllT5DcivETh4A.png" /></figure><p>We need to notice that the exec function is an Asynchronous function. You can find the details in this <a href="https://nodejs.org/api/child_process.html#child_processexeccommand-options-callback">link</a>. So, we need to make the output run synchronously. Fortunately, child_process provides us a function to exec synchronously, called execSync.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Na8t2m-ZZbv5xTIJU6lklw.png" /></figure><p>Whoops, it still shows us object output. When we see it in the network, it returns data with buffer type. So, we need to add the .toString() function, and all run well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3fg5qjFLZL1KH-6zdYDerg.png" /></figure><p>Finally, we can get the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QoU0iS2eKwTx9qbeMLs5AA.png" /></figure><h3>Mitigation</h3><ol><li>Don’t trust user input</li><li>Create proper sanitization before evaluating input from user</li></ol><p>If you have any feedback, please leave me a message.</p><h4>Source:</h4><ol><li><a href="https://nodejs.org/api/child_process.html#child_processexeccommand-options-callback">https://nodejs.org/api/child_process.html#child_processexeccommand-options-callback</a></li><li><a href="https://github.com/aadityapurani/NodeJS-Red-Team-Cheat-Sheet">https://github.com/aadityapurani/NodeJS-Red-Team-Cheat-Sheet</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb5b0c5319b3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>