Info BackTrack

Linux & Security Tutorial

./ranSERVER.py


Script python ini berfungsi untuk mencari jumlah alamat ip dan port yang terbuka secara acak.

penggunaanya:


python ranSERVER.py NUM

NUM : adalah jumlah alamat ip yang ingin anda hasilkan.


#!/usr/bin/python
# This was written for educational purpose and pentest only. Use it at your own risk.
# Author will be not responsible for any damage!
# !!! Special greetz for my friend sinner_01 !!!
# Toolname        : ranSERVER.py
# Coder           : baltazar a.k.a b4ltazar < b4ltazar@gmail.com>
# Version         : 0.1
# Greetz for rsauron and low1z, great python coders
# greetz for d3hydr8, r45c4l, fx0, Soul, MikiSoft, c0ax, b0ne and all members of ex darkc0de.com, ljuska.org

import sys, subprocess, socket, httplib, threading
from time import sleep
import random as ran

timeout = 5
socket.setdefaulttimeout(timeout)

def logo():
  print "n|---------------------------------------------------------------|"
  print "| b4ltazar[@]gmail[dot]com                                      |"
  print "|   04/2012     ranSERVER.py    v.0.1                           |"
  print "|    b4ltazar.wordpress.com     &      ljuska.org               |"
  print "|                                                               |"
  print "|---------------------------------------------------------------|n"

if sys.platform == 'linux' or sys.platform == 'linux2':
    subprocess.call("clear", shell=True)
    logo()
else:
    subprocess.call("cls", shell=True)
    logo()

if len(sys.argv) != 2:
    print "[!] Usage: python ranSERVER.py NUM"
    print "[!] Please visit b4ltazar.wordpress.com & ljuska.org"
    print "[!] Thx for using this script, now exiting!"
    sys.exit(1)

number = int(sys.argv[1])
port = int(80)

def randomIP():
    ran1 = ran.randrange(255) + 1
    ran2 = ran.randrange(255) + 1
    ran3 = ran.randrange(255) + 1
    ran4 = ran.randrange(255) + 1
    randIP = "%d.%d.%d.%d" % (ran1, ran2, ran3, ran4)
    return randIP

def srvscan(ip, e):
    try:
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        s.connect((ip, port))
        s.close()
        srvcheck(ip)
    except:
        pass

def srvcheck(ip):
    conn = httplib.HTTPConnection(ip, port)
    try:
        conn.request("HEAD", "/")
    except socket.timeout:
        print "n[-] Server Timeout", ip
    except(KeyboardInterrupt, SystemExit):
        print "[!] Now exiting, thx for using this script!"
        sys.exit(1)
    r1 = conn.getresponse()
    conn.close()
    server = r1.getheader('Server')
    xpoweredby = r1.getheader('x-powered-by')
    date = r1.getheader('date')
    if xpoweredby == None:
        print "n[+] Ip of server: "+ip
        print "[+] Server info: "+server
        print "[+] Server date: "+date
    else:
        print "n[+] Ip of server: "+ip
        print "[+] Server info: "+server
        print "[+] Xpoweredby: "+xpoweredby
        print "[+] Server date: "+date

if __name__ == "__main__":
    print "[!] There is %s random IP addresses for checking" % number
    print "[!] Port for checking: %s" % str(port)
    print "[!] Let's start ...n"

    for x in xrange(number):
        sleep(1)
        threading.Thread(target=srvscan, args=(randomIP(), 0)).start()
    sleep(3)
    print "n[!] Scanning finished!"
    print "[!] Please visit b4ltazar.wordpress.com & ljuska.org"

Artikel Terkait:

3 responses to “./ranSERVER.py

  1. renzrawk August 19, 2012 at 5:26 pm

    jadi ip terbuka itu buat apa yah bang ?

  2. renzrawk August 20, 2012 at 8:11 am

    oh gitu yah bang
    okey nice info yah bang

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: