Hello World
Ici on trouve de l'actu, des essais sur les technos de l'information, de l'étrange et pas mal de bazard...
Ce blog véhicule des images, quelques videos, des sons, du code et des outils.
Bon surf.
Ici on trouve de l'actu, des essais sur les technos de l'information, de l'étrange et pas mal de bazard...
Ce blog véhicule des images, quelques videos, des sons, du code et des outils.
Bon surf.
Et pour finir, le programme en lui meme.
Il reste deux ou trois petites choses à coder:
rem Prog
rem Bourrin: On charge le premier Ko du fichier en RAM
rem On taille large
rem C Rapide
dim fimg$(16382)
rem Tableau pour stocker la tentative
rem de decryptage
dim dimg$(16382)
rem Tableau copie
dim simg$(16382)
rem On tente le Brute Force
rem Par la suite: Input
try=1
color 7
cls
input "Filename :",infile$
open infile$ for BINARY as #1
rem Stats
print "File length--> ";lof(1);" Bytes"
rem On charge le fichier
idx=0
rem On notera le goto elegant :)
while not eof(1)
get$ #1,1,fimg$(idx)
idx=idx+1
if (idx>1024) then
rem Ach...
goto wexit:
end if
wend
wexit:
close (1)
print "Octets lus: ";idx-1
rem OK, le debut du fichier est charge
rem Analyse
rem Pas de crypto
cryptoalgo$="Aucun"
cryptokey=0
call detect
if (try=1) then
rem On fait une copie du tableau
rem simg$=original
for k=0 to idx-1
simg$(k)=fimg$(k)
next k
rem Essais avec differentes representations
rem des donnes.
rem Encodage Motorola
rem Base64
rem UUEncode
rem Essais avec des algos de crypto/scramble
rem triviaux.
rem On tente le brouillage XOR 8bits
cryptoalgo$="XOR"
for cryptokey=1 to 255
rem call xordecrypt(cryptokey)
for k=0 to idx-1
fimg$(k)=chr$(asc(simg$(k)) xor cryptokey)
next k
call detect
next cryptokey
rem Brouillage ADD
cryptoalgo$="ADD"
for cryptokey=1 to 127
for k=0 to idx-1
addtmp=asc(simg$(k))+cryptokey
if (addtmp>255) then
addtmp=addtmp-255
end if
fimg$(k)=chr$(addtmp)
next k
call detect
next cryptokey
rem Brouillage SUB
cryptoalgo$="SUB"
for cryptokey=1 to 127
for k=0 to idx-1
subtmp=asc(simg$(k))-cryptokey
if (subtmp<0) then
subtmp=subtmp+255
end if
fimg$(k)=chr$(subtmp)
next k
call detect
next cryptokey
rem Brouillage Right Shift
rem Brouillage Left Shift
rem Nibble Scrambling
end if
rem de try=1
print "Done"
end
Voila !
rem Procedures
sub detect
rem Executables
id=FNpattern20(0,1,&h4D,&h5A,"DOS Executable")
rem Archives
id=FNpattern20(0,1,&h60,&hEA,"ARJ Archive")
id=FNpattern30(3,4,5,&h6C,&h68,&h35,"LHA Archive")
id=FNpattern30(0,1,2,&h41,&h52,&h43,"ARC Archive (?)")
id=FNpattern30(0,1,2,&h5A,&h4F,&h4F,"ZOO Archive")
id=FNpattern30(0,1,2,&h1F,&h8B,&h08,"GunZip Archive")
id=FNpattern40(0,1,2,3,&h30,&h37,&h30,&h37,"TAR or CPIO Unix Archive")
rem Images
id=FNpattern20(0,1,&h42,&h4D,"BMP Image")
id=FNpattern40(0,1,2,3,&h47,&h49,&h46,&h38,"GIF Image")
id=FNpattern30(0,1,2,&h0A,&h05,&h01,"PCX Image")
id=FNpattern4(0,1,2,3,&h0A,&h05,&h01,&h08,"PCX Image")
id=FNpattern4(0,1,2,3,&h4A,&h46,&h49,&h46,"JPEG Image")
rem Sons
id=FNpattern40(0,1,2,3,&h52,&h49,&h46,&h46,"WAV Sound Header (RIFF)")
id=FNpattern40(0,1,2,3,&h2E,&h73,&h6E,&h64,"AU Sound Header")
rem Videos
id=FNpattern40(0,1,2,3,&h00,&h00,&h01,&hB3,"Mpeg Video Header")
id=FNpattern3(0,1,2,&h00,&h11,&hAF,"FLI Video Header")
rem Compilos
id=FNpattern4(0,1,2,3,&h23,&h69,&h6E,&h63,"C Source Code (include)")
id=FNpattern4(0,1,2,3,&h6F,&h2E,&h68,&h3E,"C Source Code (<*io.h>)")
id=FNpattern20(0,1,&h4C,&h01,"Obj(ect) File")
id=FNpattern4(32,33,38,39,&h54,&h55,&h42,&h41,"Borland Turbo Basic")
id=FNpattern4(8,9,10,12,&h42,&h47,&h49,&h44,"Borland BGI Driver")
id=FNpattern4(0,1,8,9,&h42,&h6F,&h49,&h6E,"Borland Copyright")
id=FNpattern30(0,1,2,&h54,&h50,&h55,"Turbo Pascal Unit")
rem Images Disque et Cartouches
id=FNpattern4(0,1,2,3,&h5F,&h62,&h61,&h63,"Super Nintendo ROM Dump ?")
id=FNpattern4(0,1,8,12,&h45,&h41,&h43,&h39,"Megadrive ROM [.SMD] ?")
rem Appels Systeme
rem Game Datas
id=FNpattern40(0,1,2,3,&h50,&h57,&h41,&h44,"ID Software WAD File")
id=FNpattern40(0,1,2,3,&h50,&h41,&h43,&h4B,"Quake Archive (PACK)")
rem Mots/Phonemes/Syllables/n-uplets
rem Fran‡ais Anglais Allemand Espagnol
id=FNpattern4(0,1,2,3,&h6D,&h61,&h69,&h73,"<mais>")
id=FNpattern4(0,1,2,3,&h70,&h6F,&h75,&h72,"<pour>")
id=FNpattern4(0,1,2,3,&h61,&h76,&h65,&h63,"<avec>")
id=FNpattern4(0,1,2,3,&h73,&h61,&h6E,&h73,"<sans>")
id=FNpattern4(0,1,2,3,&h68,&h74,&h74,&h70,"<http>")
id=FNpattern4(0,1,2,3,&h68,&h74,&h6D,&h6C,"<html>")
id=FNpattern4(0,1,2,3,&h6D,&h61,&h69,&h6C,"<mail>")
id=FNpattern4(0,1,2,3,&h2E,&h6A,&h70,&h67,"<.jpg>")
id=FNpattern4(0,1,2,3,&h75,&h73,&h65,&h72,"<user>")
id=FNpattern4(0,1,2,3,&h70,&h61,&h73,&h73,"<pass>")
id=FNpattern4(0,1,2,3,&h63,&h6F,&h64,&h65,"<code>")
id=FNpattern4(0,1,2,3,&h64,&h61,&h74,&h61,"<data>")
id=FNpattern4(0,1,2,3,&h66,&h69,&h6C,&h65,"<file>")
end sub
sub cryptocheck
shared cryptokey,cryptoalgo$
if (cryptokey>0) then
color 15
print "Algo de Cryptage: ";cryptoalgo$;" ";
print "Clef: ";cryptokey
color 7
end if
end sub
Encore du Turbo Basic, cette fois pour essayer de détecter des types de fichiers en se basant sur des structures de données et headers connus (style commande file d'Unix).
La touche en plus étant de voir si il n'y a pas un brouillage (Xor/Add/Sub) du fichier d'origine.
Pour ça rien de tel qu'un Brutal Force.
Par contre: Plein de faux positifs, il faut faire le tri des patates...
rem Obscure File Analyzer
rem Franck Balmer
rem 22 Avril 2007
rem Max 16k
rem Flag Identification
id=0
pshift=512
rem pshift=128
rem Flags ID particuliers
rem isexe=0
rem Fonctions
DEF FNpattern20 (off1,off2,val1,val2,mesg$)
shared fimg$()
local pidx,check1
check1=0
pidx=0
if ((fimg$(pidx+off1)=chr$(val1)) and (fimg$(pidx+off2)=chr$(val2))) then
check1=1
color 10
print mesg$;" (Offset[FiXed]=";pidx;" -2 Bytes Signature, be carefull-)"
color 7
call cryptocheck
end if
FNpattern20=check1
END DEF
DEF FNpattern2 (off1,off2,val1,val2,mesg$)
shared fimg$()
local pidx,check1
check1=0
for pidx=0 to pshift
if ((fimg$(pidx+off1)=chr$(val1)) and (fimg$(pidx+off2)=chr$(val2))) then
check1=1
color 2
print mesg$;" (Offset=";pidx;" -2 Bytes Signature, be carefull-)"
color 7
call cryptocheck
goto fin2:
end if
next pidx
fin2:
FNpattern2=check1
END DEF
DEF FNpattern30 (off1,off2,off3,val1,val2,val3,mesg$)
shared fimg$()
local pidx,check1,check2,check3
check1=0:check2=0:check3=0
pidx=0
if ((fimg$(pidx+off1)=chr$(val1)) and (fimg$(pidx+off2)=chr$(val2))) then
check1=1
end if
if (fimg$(pidx+off3)=chr$(val3)) then
check2=1
end if
if ((check1=1) and (check2=1)) then
check3=1
color 10
print mesg$;" (Offset[FiXed]=";pidx;"-3 Bytes Signature)"
color 7
call cryptocheck
end if
FNpattern30=check3
END DEF
DEF FNpattern3 (off1,off2,off3,val1,val2,val3,mesg$)
shared fimg$()
local pidx,check1,check2,check3
check1=0:check2=0:check3=0
for pidx=0 to pshift
if ((fimg$(pidx+off1)=chr$(val1)) and (fimg$(pidx+off2)=chr$(val2))) then
check1=1
end if
if (fimg$(pidx+off3)=chr$(val3)) then
check2=1
end if
if ((check1=1) and (check2=1)) then
check3=1
color 10
print mesg$;" (Offset=";pidx;"-3 Bytes Signature)"
color 7
call cryptocheck
goto fin3:
end if
next pidx
fin3:
FNpattern3=check3
END DEF
DEF FNpattern40 (off1,off2,off3,off4,val1,val2,val3,val4,mesg$)
shared fimg$()
local pidx,check1,check2,check3
check1=0:check2=0:check3=0
pidx=0
if ((fimg$(pidx+off1)=chr$(val1)) and (fimg$(pidx+off2)=chr$(val2))) then
check1=1
end if
if ((fimg$(pidx+off3)=chr$(val3)) and (fimg$(pidx+off4)=chr$(val4))) then
check2=1
end if
if ((check1=1) and (check2=1)) then
check3=1
color 26
print mesg$;" (Offset[FiXed]=";pidx;"-4 Bytes Signature,[very]good)"
color 7
call cryptocheck
end if
FNpattern40=check3
END DEF
DEF FNpattern4 (off1,off2,off3,off4,val1,val2,val3,val4,mesg$)
shared fimg$()
local pidx,check1,check2,check3
check1=0:check2=0:check3=0
for pidx=0 to pshift
if ((fimg$(pidx+off1)=chr$(val1)) and (fimg$(pidx+off2)=chr$(val2))) then
check1=1
end if
if ((fimg$(pidx+off3)=chr$(val3)) and (fimg$(pidx+off4)=chr$(val4))) then
check2=1
end if
if ((check1=1) and (check2=1)) then
check3=1
color 26
print mesg$;" (Offset=";pidx;"-4 Bytes Signature, good)"
color 7
call cryptocheck
goto fin4:
end if
next pidx
fin4:
FNpattern4=check3
END DEF
Pour qu' eMule lance des recherches et des téléchargements toute seule, comme une grande:
use "emule.search.dec"
int x=82;
int y=28;
string recherche1="linux tutorial pdf";
Sleep(10);
eMule.Search.Paramètres.Paramètres.Edit1.SetText(recherche1);
eMule.Search.Paramètres.Paramètres.Démarrer.Click();
Sleep(30);
eMule.Search._327701.SysListView321.MouseClick(0,x,y,3);
Sleep(4);
y=y+18;
eMule.Search._327701.SysListView321.MouseClick(0,x,y,3);
Sleep(4);
y=y+18;
eMule.Search._327701.SysListView321.MouseClick(0,x,y,3);
Sleep(4);
y=y+18;
eMule.Search._327701.SysListView321.MouseClick(0,x,y,3);
Sleep(4);
y=28;
string recherche2="ratiatum kazaa";
Sleep(10);
eMule.Search.Paramètres.Paramètres.Edit1.SetText(recherche2);
eMule.Search.Paramètres.Paramètres.Démarrer.Click();
Sleep(30);
eMule.Search._327701.SysListView321.MouseClick(0,x,y,3);
Sleep(4);
y=y+18;
eMule.Search._327701.SysListView321.MouseClick(0,x,y,3);
Sleep(4);
y=y+18;
eMule.Search._327701.SysListView321.MouseClick(0,x,y,3);
Sleep(4);
y=y+18;
eMule.Search._327701.SysListView321.MouseClick(0,x,y,3);
Sleep(4);
y=28;
string recherche3="commodore 64 tips";
Sleep(10);
eMule.Search.Paramètres.Paramètres.Edit1.SetText(recherche3);
eMule.Search.Paramètres.Paramètres.Démarrer.Click();
Sleep(30);
eMule.Search._327701.SysListView321.MouseClick(0,x,y,3);
Sleep(4);
y=y+18;
eMule.Search._327701.SysListView321.MouseClick(0,x,y,3);
Sleep(4);
y=y+18;
eMule.Search._327701.SysListView321.MouseClick(0,x,y,3);
Sleep(4);
y=y+18;
eMule.Search._327701.SysListView321.MouseClick(0,x,y,3);
Sleep(4);
L'include emule.search.dec ayant été obtenu par désignation de l'écran de recherche grace à l'outil phantom appelé WinDR, sans modif manuelle du .dec.
On a vraiment l'impression que l'Ordi est en prise de main à distance. Ben non c'est juste un Bot...
Avec un soft comme ShareAza, c'est moins simple.
Ah, j'allais oublier, pilotage des plus simple de NewsReactor pour faire un AutoGrab de ses NewsGroups préférés:
(Fonctionnement capricieux par contre...)
use "nreactor.dec"
Sleep(20);
NewsReactor._File._Autograb.Select();
#Never Mind
On peut difficilement faire plus court !
Juste pour des tests, "(de)cryptage" par les opérations logiques:
Rem Logical (De)crypter
Rem 8 bits
Rem Mini Tools Serie
Rem Franck Balmer
Rem May 2007
Rem Constantes
outfile$="dlogic.out"
Rem Prog
input "Fichier :",infile$
print "Operation Logique :"
print "1->AND"
print "2->OR"
print "3->XOR"
input "Choix :",logical
input "Clef :",clef
open infile$ for BINARY as #1
open outfile$ for BINARY as #2
longueur=lof(1)
idx=1
while not eof(1)
rem Lecture 1 Octet
get$ #1,1,octet1$
rem DeScramble
select case logical
case 1
octet2$=chr$(asc(octet1$) and clef)
case 2
octet2$=chr$(asc(octet1$) or clef)
case 3
octet2$=chr$(asc(octet1$) xor clef)
case else
rem Copie simple
octet2$=octet1$
end select
rem Ecritue 1 Octet
put$ #2,octet2$
wend
close(2)
close(1)
end
| Novembre 2009 | ||||||||||
| L | M | M | J | V | S | D | ||||
| 1 | ||||||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 | ||||
| 9 | 10 | 11 | 12 | 13 | 14 | 15 | ||||
| 16 | 17 | 18 | 19 | 20 | 21 | 22 | ||||
| 23 | 24 | 25 | 26 | 27 | 28 | 29 | ||||
| 30 | ||||||||||
|
||||||||||
Commentaires