Tiene buena pinta este tutorial c: estare pendiente de la segunda entrega.. Gracias por la iniciativa Sniffer

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ú
candidate_proxies = [#un array de proxys]
fichero = open(archivo_resultado,"a")
for i in range(2000000):
website = "http://asfsagasf.pe?id="+i
print " > Procesando ["+i+"]"
for proxy in candidate_proxies:
print "Trying HTTP proxy %s" % proxy
try:
f = urlopen(website,proxies={'http': proxy}).read()
break
except:
print "Trying next proxy ..."
try:
datos = re.search( "<meta name=\"Keywords\".*?content=\"([^\"]*)\"", f ).group(1)
except:
print " > Error intentando leer de la pagina "+i
datos = "Error en "+i
#continue
try:
fichero.write(datos+"\n")
except:
print " > Error intentando escribir el archivo ["+i+"]"
#continue
import os,datetime,shutil
dir_explorar = "/var/www/mysitio"
#Crea lista de imagenes
print "Creando listado de imagenes..."
img = []
p_img = []
for root, dirs, files in os.walk(dir_explorar):
for f in files:
ext = f.split(".")[-1]
if ext in ("jpg","gif","png","swf","jpeg","pdf"):
img.append(f)
p_img.append(os.path.join(root,f))
#Recorrer directorio para buscar las imagenes
print "Buscando en los archivos..."
en_uso = []
for root, dirs, files in os.walk(dir_explorar):
for f in files:
f = os.path.join(root,f)
ext = f.split(".")[-1]
if ext in ("php","tpl","js","css"):
#print "-buscando en",f
with open(f,"r") as file:
texto2 = file.read()
cont = 0
for i in img:
if (texto2.find(i) > 0):
en_uso.append(p_img[cont])
cont = cont+1
#Obtneer img en deshuso desde las img en uso e_e
print "Generando listado de archivos en deshuso..."
sin_uso = [a for a in p_img if a not in en_uso]
"""
file=open('resultado.log','a')
file.write('Resultado\n')
file.write('------------\n')
file.write('\n'.join(sin_uso))
file.close()
print "Busqueda Finalizada, se ha generado resultado.log"
"""
ruta = "respaldo_"+datetime.datetime.now().strftime("%Y%m%d_%p%I%M")
print "Moviendo los archivos en deshuso..."
if not os.path.isdir(ruta):
os.mkdir(ruta)
for arc in sin_uso:
shutil.move(arc, os.path.join(ruta,arc.split(os.sep)[-1]))
print "Buscada Finalizada, archivos movidos a", ruta
#include <iostream>
#include <string>
#include <cstring>
using namespace std;
class PlayFair{
private:
char matriz[5][5];
public:
string cifrado(string, int);
string descifrar(string);
int inMatriz(char);
void limpiaMatriz();
void setMatriz(string);
void showMatriz();
};
int main(){
string clave,msj;
PlayFair pf;
cout << "Cifrado PlayFair"<<endl<<endl;
cout << "introduce la clave > ";
//getline(cin,clave);
clave = "playfairexample";
cout <<endl;
pf.setMatriz(clave);
pf.showMatriz();
cout << endl;
cout << "introduce el mensaje a cifrar > ";
getline(cin,msj);
string cifrado = pf.cifrado(msj,1);
cout << "Mensaje cifrado : " << cifrado << endl;
cout << "Msj. descifrado : " << pf.cifrado(cifrado,2) << endl;
}
int PlayFair::inMatriz(char valor){
for(int i=0;i<5;i++){
for(int j=0;j<5;j++){
if(matriz[i][j] == valor){
return 1;
}
}
}
return 0;
}
void PlayFair::limpiaMatriz(){
for(int i=0;i<5;i++){
for(int j=0;j<5;j++){
matriz[i][j] = ' ';
}
}
}
void PlayFair::setMatriz(string clave){
PlayFair::limpiaMatriz();
int i=0;
int j=0;
//coloca la clave en la matriz
for(int a=0;a<clave.size();a++){
if(PlayFair::inMatriz(clave[a]) == 0)
matriz[i][j++] = tolower(clave[a]);
if (j==5){
j = 0;
i++;
}
}
char abc[26]={'a','b','c','d','e','f','g','h','i','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
//termina llenar la matriz con el abecedario
for(int a=0;a<26;a++){
if(PlayFair::inMatriz(abc[a]) == 0)
matriz[i][j++] = abc[a];
if (j==5){
j = 0;
if(i==5){
continue;
}
i++;
}
}
}
/*
Metodo cifrado -> tipo 1: cifrar, tipo 2: desifrar
*/
string PlayFair::cifrado(string msj, int tipo=1){
string result,msj2;
//Verifica que el mensaje este en la matriz, si 2 caracteres se repiten pone una 'x' en medio, y pasa a minusculas.
char ant;
for(int i=0;i<msj.size();i++){
for(int x=0;x<5;x++){
for(int y=0;y<5;y++){
if(matriz[x][y]==tolower(msj[i])){
if(msj[i]==ant){
msj2 += "x";
}
msj2 += tolower(msj[i]);
ant = tolower(msj[i]);
}
}
}
}
msj = msj2;
//Si el largo del mensaje es impar, agrega una 'x' al final.
if ((msj.size()%2)!=0){
msj += "x";
}
//Recorre el msj
for(int i=0;i<msj.size();i++){
int j= i+1;
int pos_x1 = 0;
int pos_y1 = 0;
int pos_x2 = 0;
int pos_y2 = 0;
int flag = 0;
int in_fila = 0;
// verifica caracteres en horizontal
for(int x=0;x<5;x++){
for(int y=0;y<5;y++){
if(matriz[x][y]== msj[i]){
pos_x1 = x;
if(tipo ==1){
if(y<4){
pos_y1 = y+1;
}
else{
pos_y1 = 0;
}
}
else{
if(y>0){
pos_y1 = y-1;
}
else{
pos_y1 = 4;
}
}
in_fila++;
}
if(matriz[x][y]== msj[j]){
pos_x2 = x;
if(tipo ==1){
if(y<4){
pos_y2 = y+1;
}
else{
pos_y2 = 0;
}
}
else{
if(y>0){
pos_y2 = y-1;
}
else{
pos_y2 = 4;
}
}
in_fila++;
}
}
if (in_fila == 2){
flag = 1;
}
in_fila = 0;
}
// verifica caracteres en vertical
if (flag==0){
for(int y=0;y<5;y++){
for(int x=0;x<5;x++){
if(matriz[x][y]== msj[i]){
pos_y1 = y;
if(tipo==1){
if(x<4){
pos_x1 = x+1;
}
else{
pos_x1 = 0;
}
}
else{
if(x>0){
pos_x1 = x-1;
}
else{
pos_x1 = 4;
}
}
in_fila++;
}
if(matriz[x][y]== msj[j]){
pos_y2 = y;
if(tipo==1){
if(x<4){
pos_x2 = x+1;
}
else{
pos_x2 = 0;
}
}
else{
if(x>0){
pos_x2 = x-1;
}
else{
pos_x2 = 4;
}
}
in_fila++;
}
}
if (in_fila == 2){
flag = 1;
}
in_fila = 0;
}
}
//verifica rectangulos
if (flag==0){
for(int x=0;x<5;x++){
for(int y=0;y<5;y++){
if(matriz[x][y]== msj[i]){
pos_x1 = x;
pos_y2 = y;
}
if(matriz[x][y]== msj[j]){
pos_x2 = x;
pos_y1 = y;
}
}
}
}
result += toupper(matriz[pos_x1][pos_y1]);
result += toupper(matriz[pos_x2][pos_y2]);
result += " ";
i++;
}
return result;
}
void PlayFair::showMatriz(){
//muestra la matriz
for(int i=0;i<5;i++){
for(int j=0;j<5;j++){
cout << PlayFair::matriz[i][j];
}
cout << endl;
}
}
import _md5
import hashlib
a1 = _md5.new("hola")
a2 = hashlib.md5("hola");
print a1,a2
cl_I funcion(long f, int y, int z){
cl_I x = f;
while(y <= z){
x = x * y;
y = y + 1;
}
return x;
}
drive_bitmask >>= 1
if drive_bitmask:#True
import ctypes
import time
print "is running.."
while(1):
drive_bitmask = ctypes.windll.kernel32.GetLogicalDrives()
for letter in range(65,91):
if drive_bitmask & 1:
unidad = chr(letter)+ u":\\"
if (ctypes.windll.kernel32.GetDriveTypeW(unidad)==2) :
print "se ha insertado",unidad
#hace algo
time.sleep(3600) #duerme un ratito
drive_bitmask >>= 1