Google Hack ce fameux outil de recherche sur internet est depuis peu détecté comme un virus, (car correspondant à un outil potentiel de hack) j'ai recoder (très simplement) l'outil en y ajoutant des liens que j'affectionne et des extensions supplémentaires.
La taille de l'exécutable passe aussi de 2mo (original) a 20ko ...
Pour utiliser l'exécutable, renommer WSearch_V0.1.ex en WSearch_V0.1.exe
toutes vos remarques sont les bienvenues.
Source / Exemple :
//------------------------------------------------------------------------------
// Projet WSearch : Recherhche via google
// Auteur : Hanteville Nicolas
// Fichier : main.c
// Version : 0.2
// Date de modification : 16/04/2008
// Description : module de recherche automatique sur internet
// Environnement : compatiblité DEVCPP / VISUAL C++ / BORLAND C++ 5.x
//------------------------------------------------------------------------------
#define _WIN32_WINNT 0x0500
#define _WIN32_IE 0x0500
#include <windows.h>
#include <commctrl.h>
//------------------------------------------------------------------------------
#define NOM_APPLI "WSearch_V0.2_Hanteville_Nicolas" //titre de la fenêtr + classe
#define A 100 //id de l'icone interne
#define MSB_BOUTON 1000 //msg duy bouton
#define TAILLE_MAX_URL 1024 //taille maximum de l'url (url total = TAILLE_MAX_URL*2 + saisies)
#define TAILLE_MAX_TITRE 256
#define TAILLE_MAX_CMD 3*TAILLE_MAX_URL+2
#define NB_MAX_URLS 128 //nombre maximum d'urls enregistrés
//------------------------------------------------------------------------------
#define SP_SEPARATEUR "---------------------------------"
#define CONF "CONFIGURATION"
/*
Information:
Il suffit d'ajouter maintenant directement dans le fichier ini les url
la partie début présente l'url avant la chaine de recherche
la partie fin représente l'url après la chaine de recherche
si la partie début a pour texte '-' il n peut pas être traité
(après vous mettez le titre que vous voulez c'est que pour l'affichage)
//------------------------------------------------------------------------------
typedef struct
{
char DebutUrl[TAILLE_MAX_URL+1];
char FinUrl[TAILLE_MAX_URL+1];
}url;
//------------------------------------------------------------------------------
url MesUrls[NB_MAX_URLS];
HWND Hbouton;
HWND HComboBox;
HWND HText;
HINSTANCE Hinst;
//------------------------------------------------------------------------------
//******************************************************************************
//titre d'un item
char* TitreItem(unsigned short id, char *titre,int size)
{
titre[0]=0;
COMBOBOXEXITEM item;
item.mask = CBEIF_TEXT;
item.iItem = id;
item.pszText = titre;
item.cchTextMax = size;
item.iImage = 0;
item.iSelectedImage=0;
item.iOverlay=0;
item.iIndent=0;
item.lParam=id;
SendMessage(HComboBox, CBEM_GETITEM,0, (LPARAM)&item);
return titre;
}
//******************************************************************************
//ajout d'items
void AjouterItem(unsigned short id,char* debut, char*fin, char *titre)
{
if (id<NB_MAX_URLS)
{
strncpy(MesUrls[id].DebutUrl,debut,TAILLE_MAX_URL);
strncpy(MesUrls[id].FinUrl,fin,TAILLE_MAX_URL);
COMBOBOXEXITEM item;
item.mask = CBEIF_TEXT;
item.iItem = id;
item.pszText = titre;
item.cchTextMax = strlen(titre);
item.iImage = 0;
item.iSelectedImage=0;
item.iOverlay=0;
item.iIndent=0;
item.lParam=id;
//ajout a la comboboxEx
SendMessage(HComboBox, CBEM_INSERTITEM,0, (LPARAM)&item);
}
}
//******************************************************************************
//fct de chargement des urls
DWORD WINAPI Chargement(LPVOID lParam)
{
char tmpTitre1[TAILLE_MAX_TITRE+1],tmpTitre2[TAILLE_MAX_TITRE+1],tmpTitre3[TAILLE_MAX_TITRE+1];
char tmp_bloc1[TAILLE_MAX_URL+1],tmp_bloc2[TAILLE_MAX_URL+1],tmp_bloc3[TAILLE_MAX_TITRE+1];
char tmpcout[256];
//répertoire courant
char Emplacement[MAX_PATH];
GetCurrentDirectory(MAX_PATH - 1, Emplacement);
strcat(Emplacement,"\\conf.ini\0");
//nombre d'éléments
tmpcout[0]=0;
GetPrivateProfileString(CONF,"COUNT","0",tmpcout,255,Emplacement);
int i,count = atoi(tmpcout);
if(count>0)
{
for (i=0;i<=count;i++)
{
sprintf(tmpTitre1,"URL_DEBUT%02d",i);
sprintf(tmpTitre2,"URL_FIN%02d",i);
sprintf(tmpTitre3,"TITRE%02d",i);
GetPrivateProfileString(CONF,tmpTitre1,"",tmp_bloc1,TAILLE_MAX_URL,Emplacement);
GetPrivateProfileString(CONF,tmpTitre2,"",tmp_bloc2,TAILLE_MAX_URL,Emplacement);
GetPrivateProfileString(CONF,tmpTitre3,"",tmp_bloc3,TAILLE_MAX_TITRE,Emplacement);
//ajout d'items
AjouterItem(i,tmp_bloc1,tmp_bloc2,tmp_bloc3);
}
//sélection du premier choix
SendMessage(HComboBox,CB_SETCURSEL,(WPARAM )0,(LPARAM )0);
}else
{
//si aucun choix on ajoute les choix par défaut
//remplissage des urls + structure
AjouterItem(count++,"
http://www.google.com/search?q=-inurl%3A%28htm%7Chtml%7Cphp%29+intitle%3A%22index+of%22+%2B%22last+modified%22+%2B%22parent+directory%22+%2Bdescription+%2Bsize+%2B%28.mp3%7C.wma%7C.ogg%29+%22","%22","Musiques: mp3,wma,ogg");
AjouterItem(count++,"
http://www.google.com/...","%22","Livres: pps,ppt,odt,doc,rtf,rar,zip,cbz,cbr,pdf,chm,hlp");
AjouterItem(count++,"
http://www.google.com/...","%22","Videos: avi,flv,wmv,mpg,mpeg,nsc,mov,rm,rmvb,mkv");
AjouterItem(count++,"
http://images.google.com/images?q=","\0","Images");
AjouterItem(count++,"
http://www.google.com/search?q=-inurl%3A%28htm%7Chtml%7Cphp%29+intitle%3A%22index+of%22+%2B%22last+modified%22+%2B%22parent+directory%22+%2Bdescription+%2Bsize+%2B%28.ico%7C.cur%29+%22","%22","Curseurs: ico,cur");
AjouterItem(count++,"
http://www.google.com/search?q=","+site%3Ahttp%3A%2F%2Fwww.searchfreefonts.com%2Ffont+OR+site%3Awww.dafont.com+OR+site%3Ahttp%3A%2F%2Fwww.searchfreefonts.com%2F+++-comments+-categories.php+-comment.php","Font: police de caractère");
AjouterItem(count++,"
http://www.google.com/search?q=-inurl%3A%28htm%7Chtml%7Cphp%29+intitle%3A%22index+of%22+%2B%22last+modified%22+%2B%22parent+directory%22+%2Bdescription+%2Bsize+%2B%28.srt%7C.sub%29+%22","%22","Sous-titres: sub,srt");
AjouterItem(count++,"
http://www.google.com/search?q=-inurl%3A%28htm%7Chtml%7Cphp%29+intitle%3A%22index+of%22+%2B%22last+modified%22+%2B%22parent+directory%22+%2Bdescription+%2Bsize+%2B%28.exe%7C.rar%7C.zip%7C.msi%29+%22","%22","Applications: exe,zip,rar,msi");
AjouterItem(count++,"
http://www.google.com/search?q=","&btnG=Search&q=%28&q=bigupload.com%2Fd+%7C&q=filefactory.com%2Ffile+%7C&q=dl-1.free.fr+%7C&q=gigasize.com%2Fget.php+%7C&q=d01.megashares.com%2F%3Fd01+%7C&q=megaupload.com%2F%3Fd+%7C&q=rapidshare.com%2Ffiles+%7C&q=rapidshare.de%2Ffiles+%7C&q=rapidupload.com%2Fd.php+%7C&q=sendspace.com%2Ffile+%7C&q=sexuploader.com%2F%3Fd+%7C&q=uploading.com%2F%3Fget+%7C&q=uploadport.com%2Frequest%2F%3Ffid+%7C&q=zupload.com%2Fdownload.php+%7C&q=%29","Direct download");
AjouterItem(count++,"-","\0",SP_SEPARATEUR);
AjouterItem(count++,"
http://www.google.com/search?q=","&btnG=Search&q=filetype%3Atorrent","Peer to Peer: torrent (google)");
AjouterItem(count++,"
http://thepiratebay.org/search/","/0/99/0","Peer to Peer: torrent (thepiratebay)");
AjouterItem(count++,"
http://www.mininova.org/search/?search=","\0","Peer to Peer: torrent (mininova)");
AjouterItem(count++,"-","\0",SP_SEPARATEUR);
AjouterItem(count++,"
http://www.google.com/search?q=link%3A","\0","Outils: lien (url)");
AjouterItem(count++,"
http://www.google.com/addurl?q=","&dqq=","Outils: ajout de lien (url)");
AjouterItem(count++,"
http://www.google.com/search?q=related%3","\0","Outils: lien raconté (url)");
AjouterItem(count++,"
http://www.google.com/search?q=site%3","\0","Outils: index lien (url)");
AjouterItem(count++,"-","\0",SP_SEPARATEUR);
AjouterItem(count++,"
http://www.google.com/search?q=intitle%3A%22Index+of%22+passwords+modified+site%3A","\0","Hack mdp: intitle");
AjouterItem(count++,"
http://www.google.com/search?q=allinurl%3Aauth_user_file.txt+site%3A","\0","Hack mdp: allinurl,auth_user_file.txt");
AjouterItem(count++,"
http://www.google.com/search?q=inurl%3Apasslist.txt&btnG=Search+site%3A","\0","Hack mdp: inurl,passlist.txt");
AjouterItem(count++,"
http://www.google.com/search?q=%22%23+-FrontPage-%22+inurl%3Aservice.pwd+site%3A","\0","Hack mdp: FrontPage,inurl,service.pwd");
AjouterItem(count++,"
http://www.google.com/search?q=intitle%3A%22Index+of%22+config.php+site%3A","\0","Hack mdp: intitle,Index of,config.php");
AjouterItem(count++,"
http://www.google.com/search?q=%22http%3A%2F%2F*%3A*%40%22","\0","Hack mdp: http");
AjouterItem(count++,"-","\0",SP_SEPARATEUR);
AjouterItem(count++,"
http://www.google.com/translate?langpair=fr|en&u=","\0","Proxy: traduction");
AjouterItem(count++,"
http://www.google.com/gwt/n?u=http%3A%2F%2F","%2F","Proxy: cache");
AjouterItem(count++,"
http://web.archive.org/web/*/","\0","Proxy: cache (url)");
AjouterItem(count++,"-","\0",SP_SEPARATEUR);
AjouterItem(count++,"
http://groups.google.fr/groups/search?hl=fr&q=","&qt_s=Rechercher+des+groupes","News groupe");
AjouterItem(count++,"
http://blogsearch.google.fr/blogsearch?q=","&um=1&hl=fr&imgsz=icon&ie=UTF-8&sa=N&tab=gb","Blog");
AjouterItem(count++,"
http://maps.google.fr/maps?f=q&hl=fr&q=","&btnG=Recherche+Google+Maps","Google Map");
AjouterItem(count++,"
http://www.google.fr/search?q=recette+","\0","Recette de cuisine");
AjouterItem(count++,"
http://fr.wikipedia.org/wiki/","","Encyclopédie: Wikipedia");
AjouterItem(count++,"-","\0",SP_SEPARATEUR);
AjouterItem(count++,"
http://www.cdiscount.com/search/","/sa-10.html","Achat: Cdiscount");
AjouterItem(count++,"
http://www.grosbill.com/catv2.cgi?recherche=","&x=0&y=0&mode=recherche","Achat: Grosbill");
AjouterItem(count++,"
http://www.priceminister.com/?action=se&kw=","&category=sa&submitbtn=","Achat: Priceminister");
AjouterItem(count++,"
http://www.surcouf.com/Recherche/ResultatRecherche.aspx?search=","\0","Achat: Surcouf");
AjouterItem(count++,"
http://www.ldlc.com/navigation/recherche2.html?motcle=","\0","Achat: Ldlc");
AjouterItem(count++,"
http://search.rueducommerce.fr/shared/recherche/index.cfm?recherche=","&prix=&trix=1&typetrix=DESC&bound=20&schcid=","Achat: RueDuCommerce");
AjouterItem(count++,"
http://www3.fnac.com/search/quick.do?Origin=FnacAff&text=","&category=all&x=0&y=0","Achat: FNAC");
AjouterItem(count++,"
http://search.ebay.fr/search/search.dll?query=","&MfcISAPICommand=GetResult&ht=1&ebaytag1=ebayreg&srchdesc=n&maxRecordsReturned=30000&maxRecordsPerPage=500&SortProperty=MetaEndSort","Achat: Ebay");
AjouterItem(count++,"
http://www.amazon.fr/s/url=search-alias%3Daps&field-keywords=","&Go.x=13&Go.y=10&Go=Go","Achat: Amazone");
AjouterItem(count++,"
http://www.alapage.com/-/MultiRecherche?choix=fulltext&ap=1&pos=2&cat=&default=Recherche&fulltext=","&type=0","Achat: Alapage");
AjouterItem(count++,"
http://www.google.com/search?q=","&btnG=Search&q=%28&q=cdiscount.com+%7C&q=grosbill.com+%7C&q=priceminister.com+%7C&q=surcouf.com+%7C&q=ldlc.com+%7C&q=rueducommerce.fr+%7C&q=fnac.com+%7C&q=ebay.fr+%7C&q=amazon.fr+%7C&q=alapage.com+%7C&q=%29","Achat: Tous");
AjouterItem(count++,"-","\0",SP_SEPARATEUR);
AjouterItem(count++,"
http://www.google.com/translate_dict?q=","&hl=fr&langpair=en%7Cfr","Traduction: Anglais->Français");
AjouterItem(count++,"
http://www.google.com/translate_dict?q=","&hl=fr&langpair=fr%7Cen","Traduction: Français->Anglais");
AjouterItem(count++,"
http://www.google.com/translate?u=http%3A%2F%2F","&langpair=en%7Cfr&hl=fr&ie=UTF8","Traduction: Anglais->Français (URL)");
AjouterItem(count++,"-","\0",SP_SEPARATEUR);
AjouterItem(count++,"
http://search.msdn.microsoft.com/Default.aspx?locale=en-US&Query=","&Brand=msdn","Programmation: MSDN");
AjouterItem(count++,"
http://www.cppfrance.com/recherche.aspx?r=","\0","Programmation: CPPfrance");
AjouterItem(count++,"
http://www.google.com/custom?hl=fr&cof=S%3Ahttp%3A%2F%2Fwww.developpez.com%3BL%3Ahttp%3A%2F%2Fwww.developpez.com%2Ftemplate%2Flogo.gif%3B&domains=developpez.com%3Bdeveloppez.net&q=","&btnG=Rechercher&sitesearch=developpez.com","Programmation: Développez");
AjouterItem(count++,"
http://www.codeproject.com/info/search.aspx?artkw=","\0","Programmation: Codeproject");
AjouterItem(count++,"-","\0",SP_SEPARATEUR);
AjouterItem(count++,"
http://www.animenfo.com/search.php?query=","&queryin=anime_titles&action=Go&option=keywords","Anime/Manga: animenfo");
AjouterItem(count++,"
http://www.bedetheque.com/index.php?R=1&RechTexte=","&btRecherche=OK&RechSerie=&RechAuteur=&RechEditeur=&RechCollection=&RechStyle=&RechDL=&RechISBN=","Bds: bedetheque");
//sélection du premier choix
SendMessage(HComboBox,CB_SETCURSEL,(WPARAM )0,(LPARAM )0);
//enregistrement dans le fichier ini
tmpcout[0]=0;
count--;
WritePrivateProfileString(CONF,"COUNT",itoa(count,tmpcout,10),Emplacement);
while(count>-1)
{
sprintf(tmpTitre1,"URL_DEBUT%02d",count);
sprintf(tmpTitre2,"URL_FIN%02d",count);
sprintf(tmpTitre3,"TITRE%02d",count);
WritePrivateProfileString(CONF,tmpTitre1,MesUrls[count].DebutUrl,Emplacement);
WritePrivateProfileString(CONF,tmpTitre2,MesUrls[count].FinUrl,Emplacement);
WritePrivateProfileString(CONF,tmpTitre3,TitreItem(count,tmp_bloc3,TAILLE_MAX_TITRE+1),Emplacement);
count--;
}
}
return 0;
}
//******************************************************************************
//fct de traitement
DWORD WINAPI Exec(LPVOID lParam)
{
unsigned int id = (unsigned int)lParam;
char tmpcommande[TAILLE_MAX_CMD];
char tmp[TAILLE_MAX_URL+1];
EnableWindow(Hbouton,0);
//récupération de la recherche
tmp[0]=0;
GetWindowText(HText,tmp,TAILLE_MAX_URL);
if(MesUrls[id].DebutUrl[0]!='-')//le caractère --- spécifie un titre
{
//si un espace on converti par un +
char *t = tmp;
while(*t)
{
if (*t==' ')*t='+';
}
//création de la requête
snprintf(tmpcommande,TAILLE_MAX_CMD,"%s%s%s",MesUrls[id].DebutUrl,tmp,MesUrls[id].FinUrl);
//exécution
ShellExecute(NULL,"Open",tmpcommande, NULL, NULL, SW_SHOWNORMAL);
}
EnableWindow(Hbouton,1);
return 0;
}
//******************************************************************************
//gestion des messages
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
if (message == WM_COMMAND && (LOWORD(wParam) == MSB_BOUTON || LOWORD(wParam) == IDOK) || message==WM_KEYDOWN && wParam == VK_RETURN)
{
CreateThread(0,0,Exec,(LPVOID)SendMessage(HComboBox,CB_GETCURSEL,(WPARAM )0,(LPARAM )0),0,0);
}
else if (message == WM_DESTROY)PostQuitMessage (0);
else return DefWindowProc (hwnd, message, wParam, lParam);
return 0;
}
//******************************************************************************
//création de la fenêtre principale
int WINAPI WinMain (HINSTANCE hThisInstance,HINSTANCE hPrevInstance,LPSTR lpszArgument,int nFunsterStil)
{
MSG messages;
WNDCLASS wincl;
HWND hwnd;
INITCOMMONCONTROLSEX icex;
icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
icex.dwICC = ICC_USEREX_CLASSES;
InitCommonControlsEx(&icex);
wincl.style = CS_HREDRAW | CS_VREDRAW;
wincl.lpfnWndProc = WindowProcedure;
wincl.cbClsExtra = 0;
wincl.cbWndExtra = 0;
wincl.hInstance = Hinst = hThisInstance;
wincl.lpszMenuName = "";
wincl.lpszClassName = NOM_APPLI;
wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
//chargement des icones (via les ressources)
wincl.hIcon = (HICON)LoadIcon(hThisInstance, MAKEINTRESOURCE(A));
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
//on crée la classe (on l'enregistre)
if(!RegisterClass(&wincl)) return FALSE;
//création de la fenêtre
hwnd = CreateWindow(NOM_APPLI,NOM_APPLI,WS_OVERLAPPED| WS_SYSMENU,CW_USEDEFAULT, CW_USEDEFAULT, 400, 100,0, 0, hThisInstance, 0);
if (!hwnd) return FALSE;
//création des éléments
Hbouton = CreateWindow("BUTTON","Rechercher",WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON ,290,45,90 ,23 , hwnd, (HMENU )MSB_BOUTON, hThisInstance, NULL);
HText = CreateWindow("EDIT", "",WS_BORDER |WS_CHILD |WS_VISIBLE|ES_LEFT ,10,9, 370, 23, hwnd, NULL, hThisInstance, NULL);
HComboBox= CreateWindow(WC_COMBOBOXEX,"",CBS_DROPDOWN | CBS_DROPDOWNLIST | CBS_SIMPLE | WS_CHILD | WS_OVERLAPPED | WS_VISIBLE,10,45, 260, 200, hwnd, NULL, hThisInstance, NULL);
CreateThread(0,0,Chargement,0,0,0);
//afficher la fenêtre
ShowWindow (hwnd, nFunsterStil);
UpdateWindow(hwnd);
//appliquer le focus par défaut sur l'item
SetFocus(HText);
while (GetMessage (&messages, NULL, 0, 0))
{
if (!IsDialogMessage(hwnd, &messages))
{
TranslateMessage(&messages);
DispatchMessage(&messages);
}
}
return messages.wParam;
}
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.