Upgrade Skill Di ITBOX Jadi Lebih Hemat
Special Diskon 50%
Sampai 16 November 2026!
Hari
Jam
Menit
Detik
GARUDABOX

How to abuse this race condition?help me coach williams and yohanes..i’m stuck

Beranda › Forums › Mempelajari Teknik Hacking Tingkat Pemula › How to abuse this race condition?help me coach williams and yohanes..i’m stuck

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #46629
    [email protected]
    Participant

      saya adalah seorang limiteduser (1000) bukan root, dan ada sebuah servis yang berjalan pada server (root akses), dengan source code sbb :
      func main() {
      if len(os.Args) != 3 {
      fmt.Println(“Usage: backupmachine <path file sumber> <path file tujuan>”)
      } else {
      if _, err := os.Stat(os.Args[2]); err == nil {
      fmt.Println(“Cannot replace existing file…”)
      } else if errors.Is(err, os.ErrNotExist) {
      copy(os.Args[1], os.Args[2])
      fmt.Println(“Copying…”)
      time.Sleep(3 * time.Second)
      err = os.Chmod(os.Args[2], 0000)
      if err != nil {
      fmt.Println(err)
      } else {
      fmt.Println(“Success!”)
      }
      } else {
      fmt.Println(“Wut??”)
      }

      }
      }
      dari source code tersebut terdapat celah race condition selama 3 detik sebelum permission file hasil copyan dengan menggunakan binary servis tersebut berubah menjadi 0000

      krn limiteduser kita tidak bisa menggunakan cp atau mv dan hanya bisa menggunakan servis binary backupmachine sbgmn source code diatas

      pertanyaan : langkah/syntax apa yang harus sy pakai untuk mendapatkan file target pada folder root tanpa perlu privesc?

      thanks 4 the answer coach 🙂

      #46639
      Coach Williams
      Moderator

        hmmmm saya asumsi ini soal CTF. sekilas saya baca mungkin bisa coba kombinasikan symlink, “&” yang bisa mengeksekusi beberapa program sekaligus dan while loop di linux bisa coba ikutin referensi ini https://g0blin.co.uk/smashthetux-vulnhub-writeup/#0x07

        #46642
        [email protected]
        Participant

          yup CTF coach,hehe..thnx coach williams finally solved, coachnya canggih euy 🙂

        Viewing 3 posts - 1 through 3 (of 3 total)
        • You must be logged in to reply to this topic.
        Shopping cart0
        There are no products in the cart!
        Continue shopping