A friendly tour of the core files and database tables, and why knowing them helps you find malware. We'll use a restaurant to keep it easy to remember.
Tur santai ke core files dan tabel database, plus kenapa memahaminya membantu kamu menemukan malware. Kita pakai analogi restoran biar gampang diingat.
Use the arrow keys or the buttons below to move through the slides.Pakai tombol panah keyboard atau tombol di bawah buat pindah slide.
Every WordPress site is built from two parts that work together: files that hold the code, and a database that holds your content and settings.
Setiap situs WordPress terdiri dari dua bagian yang kerja bareng: files yang berisi kode, dan database yang menyimpan konten serta settings kamu.
wp-config.php, index.php.wp-config.php, index.php.wp_posts and wp_users.wp_posts dan wp_users.
Good to know: database tables usually start with wp_. That prefix is set in wp-config.php and can be different on some sites.
Perlu tahu: tabel database biasanya diawali wp_. Prefix ini diatur di wp-config.php dan bisa beda di beberapa situs.
Four files run in a chain on every visit. Three more handle settings rules, logins and scheduled chores.
Empat file jalan berantai di setiap kunjungan. Tiga lainnya ngurus aturan server, login, dan tugas terjadwal.
wp-config.php and uses it to connect to the database.wp-config.php dan memakainya buat connect ke database.DB_NAME, DB_USER, DB_PASSWORD, DB_HOST), security keys, table prefix, debug switches.DB_NAME, DB_USER, DB_PASSWORD, DB_HOST), security keys, table prefix, saklar debug./about-us), redirects and security rules./about-us), redirects, dan aturan keamanan.index.php), someone unlocks the kitchen (wp-load.php with the keys from wp-config.php), the crew sets up (wp-settings.php), and the meal is served.index.php), seseorang buka dapur (wp-load.php pakai kunci dari wp-config.php), kru bersiap (wp-settings.php), lalu makanan disajikan.Tip: always back up wp-config.php and .htaccess before editing. One typo can break the whole site.Tip: selalu backup wp-config.php dan .htaccess sebelum diedit. Satu typo bisa bikin seluruh situs rusak.
Two tables answer two questions: "How is this site set up?" (wp_options) and "Who has an account?" (wp_users).
Dua tabel ini menjawab dua pertanyaan: "Situs ini di-setting gimana?" (wp_options) dan "Siapa saja yang punya akun?" (wp_users).
option_name and an option_value.option_name unik dan option_value.yes means WordPress loads it on every page. Too many large ones can slow your site.yes artinya WordPress me-load option itu di setiap halaman. Terlalu banyak yang besar bisa bikin situs lambat.wp_usermeta.wp_usermeta.wp_options is the settings board in the office (name, address, opening hours). wp_users is the staff and guest list.wp_options itu papan settings di kantor (nama, alamat, jam buka). wp_users itu daftar staf dan tamu.Despite the name, wp_posts holds almost every kind of content. A column called post_type tells them apart.
Walau namanya begitu, wp_posts menyimpan hampir semua jenis konten. Kolom post_type yang membedakannya.
post · blog postblog post
page · static pagehalaman statis
attachment · media filefile media
revision · older versionversi lama
nav_menu_item · menu itemitem menu
product · plugin types, e.g. WooCommercetipe dari plugin, mis. WooCommerce
Columns to know: post_title, post_content, post_status, post_name, post_author, post_parent. Don't use guid as a real link, because it can change.Kolom penting: post_title, post_content, post_status, post_name, post_author, post_parent. Jangan pakai guid sebagai link asli, karena bisa berubah.
| Other tablesTabel lainnya | What they storeIsinya |
|---|---|
wp_comments, wp_commentmeta | Comments (author, content, status) and plugin extras like ratingsComments (author, isi, status) dan tambahan plugin seperti ratings |
wp_terms, wp_term_taxonomy, wp_term_relationships, wp_termmeta | Categories and tags: the names, their type, which posts they apply to, and extra detailsCategories dan tags: namanya, jenisnya, post mana yang memakainya, dan detail tambahan |
wp_postmeta | Extra data for posts and pages: custom fields, SEO titles, layout settingsData tambahan untuk posts dan pages: custom fields, SEO title, layout settings |
wp_links | Old "Blogroll" feature, mostly unused todayFitur lama "Blogroll", sekarang hampir nggak dipakai |
wp_posts is one big filing cabinet with menus, flyers, photos and old drafts, and post_type is the label on each folder. The meta tables are sticky notes with extra details.wp_posts itu satu lemari arsip besar berisi menu, brosur, foto, dan draft lama, dan post_type itu label di tiap map. Tabel meta itu sticky notes berisi detail tambahan.Redirects, spam, pop-ups and defacement all have to run from somewhere. If you know where each file sits in the loading chain, you know where to look first.
Redirects, spam, pop-ups, dan defacement pasti jalan dari suatu tempat. Kalau kamu tahu posisi tiap file di rantai loading, kamu tahu harus cek di mana dulu.
Look for injected or obfuscated code and unexpected redirect rules. Check in this order. Tap each one as you go.Cari injected atau obfuscated code dan redirect rules yang nggak wajar. Cek sesuai urutan ini. Tap satu-satu saat kamu cek.
index.phpThe entry point that runs on every visit, so injected code here fires on every page.index.phpEntry point yang jalan di setiap kunjungan, jadi kode injeksi di sini aktif di semua halaman..htaccessServer rules. Look for unexpected redirect rules sending visitors to unknown domains..htaccessAturan server. Cari redirect rules yang nggak wajar dan mengarahkan pengunjung ke domain asing..js filesRedirects and pop-ups are often injected into JavaScript..jsRedirects dan pop-ups sering diselipkan ke JavaScript./wp-content/themes/[active-theme]/Loaded on every page, so site-wide pop-ups, redirects and defacement often live here./wp-content/themes/[active-theme]/Di-load di setiap halaman, jadi pop-ups, redirects, dan defacement di seluruh situs sering ada di sini..html / .htm filesOnly if one specific static page redirects, was replaced, or a phishing/spam page appeared..html / .htmHanya kalau satu halaman statis tertentu redirect, diganti, atau muncul halaman phishing/spam.index.php), rewrite the house rules so guests get sent to a rival restaurant (.htaccess), or slip flyers into every menu (theme and .js). You inspect the places every guest passes first.index.php), menulis ulang aturan restoran supaya tamu diarahkan ke restoran saingan (.htaccess), atau menyelipkan brosur ke semua menu (theme dan .js). Kamu periksa tempat yang dilewati semua tamu dulu.When the files don't explain the symptom, start from the symptom and go straight to the table that matches it.
Kalau files nggak menjelaskan gejalanya, mulai dari gejala lalu langsung ke tabel yang cocok.
| SymptomGejala | Start atMulai dari | Strong evidence looks likeBukti kuat berupa |
|---|---|---|
| Spam pages on Google, injected spamSpam pages di Google, spam content | wp_posts( post_title, post_content)(post_title, post_content) | Spam posts the customer never created. Record post IDs and URLsSpam posts yang nggak pernah dibuat customer. Catat post ID dan URL |
| Redirect to an unknown domainRedirect ke domain asing | wp_options( siteurl, home, theme options)(siteurl, home, theme options) | The same malicious domain as in the redirect. Record option name and valueDomain berbahaya yang sama dengan redirect-nya. Catat option name dan value |
| JavaScript in posts or pagesJavaScript di posts atau pages | wp_posts → wp_postmeta | Unexpected external URLs or scripts tied to the infected post. Record post ID and valueURL eksternal atau script yang nggak wajar dan terkait post yang kena. Catat post ID dan value |
| Unknown administratorAdministrator asing | wp_users, wp_usermeta | Unrecognized admin, unexpected email or unexplained elevated privileges, confirmed unauthorized by the customerAdmin asing, email aneh, atau privileges naik tanpa alasan, dan customer konfirmasi itu tidak sah |
| Malware returns after cleanupMalware muncul lagi setelah cleanup | All of the aboveSemua di atas | Also run the persistence checks in the Reinfection page, step 4Jalankan juga persistence checks di halaman Reinfection, step 4 |
How to open it: Websites → Dashboard → Databases → Management (or phpMyAdmin) → pick the affected website's database → Enter phpMyAdmin. Check the table prefix first.Cara bukanya: Websites → Dashboard → Databases → Management (atau phpMyAdmin) → pilih database website yang terdampak → Enter phpMyAdmin. Cek table prefix dulu.
wp_options) being changed. Spam pages are flyers slipped into the filing cabinet (wp_posts). An unknown admin is a stranger added to the staff list (wp_users).wp_options) yang diganti. Spam pages itu brosur yang diselipkan ke lemari arsip (wp_posts). Admin asing itu orang asing yang ditambahkan ke daftar staf (wp_users).Label every finding before you act. The label decides what you do next.
Kasih label ke setiap temuan sebelum bertindak. Label itu menentukan langkah berikutnya.
| ClassKelas | ExampleContoh | What to doYang dilakukan |
|---|---|---|
| Strong evidenceBukti kuat | Spam posts the customer didn't create; a redirect in wp_optionsSpam posts yang bukan dibuat customer; redirect di wp_options | Record the detailsCatat detailnya |
| Potential compromisePotensi compromise | Unknown admin with administrator rightsAdmin asing dengan hak administrator | Confirm with the customerKonfirmasi ke customer |
| InconclusiveBelum meyakinkan | A long encoded value in plugin settingsValue panjang yang encoded di plugin settings | Don't call it malware without more evidenceJangan sebut malware tanpa bukti tambahan |
| UnresolvedBelum terselesaikan | Scanner is clean, symptom continuesScanner bersih, gejala masih ada | Keep investigating database and filesLanjut investigasi database dan files |
If the customer confirms an admin is unauthorized, send a KoPilot action to demote or delete the user. Warn them first that deleting a user also deletes its posts. Removing the user alone is not a cleanup, so keep investigating.Kalau customer konfirmasi admin itu tidak sah, kirim KoPilot action untuk demote atau delete user. Kasih tahu dulu bahwa menghapus user juga menghapus post-nya. Menghapus user saja bukan cleanup, jadi lanjut investigasi.
Internal wiki pages: Database malware · Close-out · ReinfectionHalaman internal wiki: Database malware · Close-out · Reinfection