Mots-clé : hack

JavaScript hacks

/*--------------------------------------*/
var loadjQuery = function(cb){
    var scr = document.createElement('script');
    scr.setAttribute('type', 'text/javascript');
    scr.setAttribute('src', 'https://code.jquery.com/jquery-3.3.1.min.js');
    if(scr.readyState){
       scr.onreadystatechange = function(){
           if(scr.readyState === 'complete' || scr.readyState === 'loaded'){
              scr.onreadystatechange = null;
              if(cb === 'function'){
                 args = [].slice.call(arguments, 1);
                 cb.apply(this, args);
              }
           }
       };
    } else {
        scr.onload = function(){
           if(typeof(cb) === 'function'){
              args = [].slice.call(arguments, 1);
              cb.apply(this, args);
           }
        };
    }

    var head = document.getElementsByTagName('head')[0];
    head.insertBefore(scr, head.firstChild);
}

loadjQuery(function() {
    $('body').empty();
    let getRandomInt = function (max) {
        return Math.floor(Math.random() * Math.floor(max));
    };
    let curr=getRandomInt(5000);
    let addNewAvatar=function() {
        $('body').append(
            $('<img />').attr(
                'src', 'https://avatars.githubusercontent.com/u/'+curr
            ).css({
                'max-width': '50px',
                'display': 'inline-block',
                'float': 'left',
                'margin': '0',
                'padding': '0'
            })
        );
        curr += (1+getRandomInt(3));
        setTimeout(addNewAvatar, 100);
    };
    setTimeout(addNewAvatar, 100);
});

/*--------------------------------------*/
var loadjQuery = function(cb){
    var scr = document.createElement('script');
    scr.setAttribute('type', 'text/javascript');
    scr.setAttribute('src', 'https://code.jquery.com/jquery-3.3.1.min.js');
    if(scr.readyState){
       scr.onreadystatechange = function(){
           if(scr.readyState === 'complete' || scr.readyState === 'loaded'){
              scr.onreadystatechange = null;
              if(cb === 'function'){
                 args = [].slice.call(arguments, 1);
                 cb.apply(this, args);
              }
           }
       };
    } else {
        scr.onload = function(){
           if(typeof(cb) === 'function'){
              args = [].slice.call(arguments, 1);
              cb.apply(this, args);
           }
        };
    }
    var head = document.getElementsByTagName('head')[0];
    head.insertBefore(scr, head.firstChild);
}

loadjQuery(function() {
    $('body').empty();
    $.ajax({
        type: 'get',
        url: 'https://api.magicthegathering.io/v1/cards?page=311'
    }).done(function(data) {
        for (var i=0; i<data.cards.length; i++) {
            $('body').append(
                $('<img />').attr('src', data.cards[i].imageUrl)
            );
        }
    });
});

Windows : les loopbacks. Impossible à surveiller

Si jamais vous faites un site Internet, que vous le mettez sur localhost et que vous lancez un navigateur, il se peut que, comme moi, vous ayez envie de voir exactement ce qui se passe.

Dans ce cadre, un « espion » parfait pour cela est wireshark (analyseur de trames réseau).

Après plusieurs minutes, voire heures, vous verrez que quelles que soient vos actions, rien ne se passe.
L’explication est simple : Windows, peu importe sa version, « coupe » les arrivées réseau si elles sont en loopback = sur localhost.

Un grand merci, encore une fois, pour Windows !

Toute l’explication est là.

Il faut utiliser un outil, RawCap, qui hacke un peu Windows et génère un fichier « .pcap » compatible avec Wireshark.

Sur Linux, vous n’aurez pas ce problème typique Windows

En ligne de commande, on peut faire le dump de tout le traffic, y compris le localhost.
Il vous suffit d’utiliser l’utilitaire tcpdump, exemple :

$
$ sudo tcpdump -vv -i lo port 8000
tcpdump: listening on lo, link-type EN10MB (Ethernet), capture size 262144 bytes

Et à partir de là il écoutera sur le port 8000. Lancez Chrome, allez sur localhost:8000 et là vous verrez :

(pour la note, même s’il n’y a pas de serveur, ce qui est le cas ici, il écoute et trace vraiment tout)

17:23:14.100160 IP6 (flowlabel 0x52956, hlim 64, next-header TCP (6) payload length: 40) ip6-localhost.44238 > ip6-localhost.8000: Flags [S], cksum 0x0030 (incorrect -> 0xfe61), seq 1512481496, win 43690, options [mss 65476,sackOK,TS val 3860198845 ecr 0,nop,wscale 7], length 0
17:23:14.100165 IP6 (flowlabel 0xe143c, hlim 64, next-header TCP (6) payload length: 20) ip6-localhost.8000 > ip6-localhost.44238: Flags [R.], cksum 0x001c (incorrect -> 0xe6c0), seq 0, ack 1512481497, win 0, length 0
17:23:14.100189 IP (tos 0x0, ttl 64, id 63584, offset 0, flags [DF], proto TCP (6), length 60)
localhost.43918 > localhost.8000: Flags [S], cksum 0xfe30 (incorrect -> 0x631e), seq 4099830766, win 43690, options [mss 65495,sackOK,TS val 1743693574 ecr 0,nop,wscale 7], length 0
17:23:14.100194 IP (tos 0x0, ttl 64, id 12132, offset 0, flags [DF], proto TCP (6), length 40)
localhost.8000 > localhost.43918: Flags [R.], cksum 0x7eb1 (correct), seq 0, ack 4099830767, win 0, length 0
17:23:14.153839 IP6 (flowlabel 0xc30e0, hlim 64, next-header TCP (6) payload length: 40) ip6-localhost.44242 > ip6-localhost.8000: Flags [S], cksum 0x0030 (incorrect -> 0xaa17), seq 1123880506, win 43690, options [mss 65476,sackOK,TS val 3860198859 ecr 0,nop,wscale 7], length 0
17:23:14.153847 IP6 (flowlabel 0xee9c9, hlim 64, next-header TCP (6) payload length: 20) ip6-localhost.8000 > ip6-localhost.44242: Flags [R.], cksum 0x001c (incorrect -> 0x9284), seq 0, ack 1123880507, win 0, length 0
17:23:14.153884 IP (tos 0x0, ttl 64, id 20755, offset 0, flags [DF], proto TCP (6), length 60)
localhost.43922 > localhost.8000: Flags [S], cksum 0xfe30 (incorrect -> 0x1c4e), seq 3564886671, win 43690, options [mss 65495,sackOK,TS val 1743693588 ecr 0,nop,wscale 7], length 0
17:23:14.153891 IP (tos 0x0, ttl 64, id 12140, offset 0, flags [DF], proto TCP (6), length 40)
localhost.8000 > localhost.43922: Flags [R.], cksum 0x37ef (correct), seq 0, ack 3564886672, win 0, length 0
17:23:19.161265 IP6 (flowlabel 0x606b8, hlim 64, next-header TCP (6) payload length: 40) ip6-localhost.44246 > ip6-localhost.8000: Flags [S], cksum 0x0030 (incorrect -> 0x1e75), seq 983670096, win 43690, options [mss 65476,sackOK,TS val 3860200111 ecr 0,nop,wscale 7], length 0
17:23:19.161281 IP6 (flowlabel 0xe0662, hlim 64, next-header TCP (6) payload length: 20) ip6-localhost.8000 > ip6-localhost.44246: Flags [R.], cksum 0x001c (incorrect -> 0x0bc6), seq 0, ack 983670097, win 0, length 0
17:23:19.161360 IP (tos 0x0, ttl 64, id 18581, offset 0, flags [DF], proto TCP (6), length 60)
localhost.43926 > localhost.8000: Flags [S], cksum 0xfe30 (incorrect -> 0xe872), seq 99211285, win 43690, options [mss 65495,sackOK,TS val 1743694840 ecr 0,nop,wscale 7], length 0
17:23:19.161372 IP (tos 0x0, ttl 64, id 13102, offset 0, flags [DF], proto TCP (6), length 40)
localhost.8000 > localhost.43926: Flags [R.], cksum 0x08f8 (correct), seq 0, ack 99211286, win 0, length 0

Sam Agnew bidouille le bon vieux Zelda à la PyCon 2017

Je vous laisse découvrir qui est Sam Agnew, mais dans la vidéo :

  • il fait un peu de LUA pour hacker et analyser le code de Zelda ;
  • il met en place le fait de discuter entre twitter et le code qui écrit en direct dans Zelda ;
  • cela écrit en direct dans Zelda pendant qu’on joue !

Enorme. Et en plus vous verrez du code sur comment lire les notifications twitter en quelques lignes de Python

vim – astuces

Vim

Séparation par fenêtres

:split Split horizontal
:vsplit Split vertical
:res XX Hauteur fenêtre = XX lignes
:vertical resize XX Largeur fenêtre courante = XX caractères
:30winc > Vertical : 30 caractères à droite
:30winc < Vertical : 30 caractères à gauche
:30winc + Horizontal : 30 caractères à droite
:30winc - Horizontal : 30 caractères à gauche
30[CTRL]W > Décaler de 30 caractères à droite
30[CTRL]W < Décaler de 30 caractères à gauche

Macros

:%s/\%(^ *\)\@<= /\&nbsp;/g Remplacer tous les espaces de début par &nbsp;

Une vulnérabilité critique affectant Windows Server 2003 ne sera pas corrigée

C’est bien, je vais enfin avoir l’argument massue pour tous ceux qui critiquent Linux : une faille critique sur Windows Server 2003 qui permet de devenir maître du système à distance ne sera jamais corrigée.

Je vous rappelle qu’on paie pour une license, et que la sécurité fait partie des choses pour lesquelles on paie (on paie en partie pour les mises à jour et ces dernières corrigent les bogues et problèmes de sécurité).

Il suffira donc juste d’avoir le programme qui permet d’exploiter cette faille et si on veut être méchant, on le pourra !

Tout est expliqué ici : sur developpez.com

Mots clés de tentatives de hack

Voici tous les mots clés les plus essayés afin de trouver des failles sur mes sites Web 

123flashchat.php 99billdo.php abf_js.php aboutinfo.php
about.php account.php acc.php add.cgi.php
add_link.php addpost_newpoll.php addressbook.php add_rss.php
addsite.php addvip.php ad_main.php adminhead.php
admin.loudmouth.php admin.php agenda2.php3 agenda.php3
ains_main.php ajouter.php akocomments.php annonce.php
announcements.php anzagien.php api.php archive.php
artlist.php athena.php auth.cookie.inc.php authenticate.php
auth.header.inc.php auth.sessions.inc.php auto_check_renewals.php autoindex.php
b2verifauth.php bb_admin.php BE_config.php bild.php
bingoserver.php3 block.php bp_ncom.php bp_news.php
buddy.php builddb.php calcul-page.php calendar.php
cal.func.php cart_content.php cart.php catalogshop.php
challenge.php change_preferences2.php chat.php checkout.php
CheckUpload.php ch_readalso.php circ.php classified.php
classified_right.php class.mysql.php clearinfo.php clear.php
click.php client.php cls_fast_template.php cn_config.php
comments.php common.inc.php common.php config.inc.php
config.inc.php3 config.php configuration.php configuration.php.bak
configuration.php.old confirmUnsubscription.php conf.php connect.php
connexion.php contacts.php content.php convert-date.php
corpo.php CoupleDB.php cp2.php crea.php
create_file.php creat_news_all.php cron.php cross.php
custom_vars.php datei.php debugger.php defaults_setup.php
defines.php depouilg.php3 development.php dfcode.php
dialog.php digg.php direct.php displayCategory.php
display.php dix.php3 dosearch.php download.php
dp_logs.php editor.php edit.php editprofile.php
editsite.php email_subscribe.php environment.php errors.php
es_custom_menu.php es_desp.php eshow.php es_offer.php
eventcal2.php.php event.php eventscroller.php examplefile.php
example.php ezusermanager_pwd_forgott.php faq.php fcring.php
feed.php Flickrclient.php fonctions_racine.php footer.inc.php
footer.php form.php forum.php frame.php
ftp.php function.inc.php function.php functions_mod_user.php
functions.php fusebox5.php galerie.php games.php
genepi.php generate.php gen_m3u.php getpage.php
get_session_vars.php global.php graph.php gruppen.php
header.inc.php header.php head.php hello_sir.php
helperfunction.php help.php help_text_vars.php hioxBannerRotate.php
hioxRandomAd.php hioxstats.php hioxupdate.php home1.php
home2.php home.php hsList.php iframe.php
i_head.php image.php importinfo.php import.php
i_nav.php inc_group.php include.php inc_manager.php
inc_newgroup.php.php inc_smb_conf.php inc_user.php index1.php
index2.php indexinfo.php indexk.php index.php
index.php3 info.php inhalt.php initialize.php
initiate.php init.php in.php install.php
ip.inc.php joinus.php jscript.php latestposts.php
latex.php lib.editor.inc.php libsecure.php license.php
linkadmin.php link_main.php list.php ListRecords.php
loader.php load_lang.php load_phplib.php login.php
login.php3 log.php maguz.php main.inc.php
mainpage.php main.php main_prepend.php mamboleto.php
manage_songs.php master.php mcf.php member.php
members_help.php menu.php menu.php3 middle.php
migrateNE2toNE3.php minica_down.php mini-pub.php mitglieder.php
MOD_forum_fields_parse.php modules.php movie_cls.php msDb.php
mysave.php naboard_pnr.php network_module_selector.php newsadmin.php
newsarchive.php news.php newticket.php noticias.php
nukebrowser.php online.php owimg.php3 page.php
param_editor.php photo_comment.php php121db.php php4you.php
phpCards.header.php phphtml.php php-include-robotsservices.php phpMyChat.php3
phpunity-postcard.php ping.php playlist.php plus.php
p-news.php pollvote.php pop.php popup_window.php
portfolio.php port.php prepare.php prepend.php
preview.php principal.php print.php process.php
profil.php protection.php qte_web.php quickie.php
quick_reply.php random2.php rdf.php reactivate.php
readmore.php read.php recent.php rechnung.php
reconfig.php redirect.php register.php releasenote.php
rempass.php report.php reset.php robotstats.inc.php
rpc.php rss2.php rss.php run.php
s01.php s02.php s03.php s04.php
save.php saveserver.php searchbot.php search.php
search_wA.php self_adherent.php services.php settings.php
settings_sql.php shopping_cart.php shoutbox.php show_archives.php
show.php signin.php sinagb.php sinapis.php
sitemap.xml.php slogin_lib.inc.php smarty.php smilies.php
social_game_play.php song.php source.php spellcheckwindowframeset.php
start.php stats.php stphpapplication.php stphpbtnimage.php
stphpform.php strload.php str.php styles.php
submit_abuse.php submit_comment.php subscp.php tags.php
taxonservice.php template_csv.php template.php themes.php
thumbnail.php timedifference.php toolbar.loudmouth.php toplist.php
top.php track.php ubbt.inc.php unavailable.php
unsubs.php upload_local.php upload_multi.php upload.php
up.php user_language.php user_new_2.php user.php
validate.php viewforum.php view_func.php view.php
viewtopic.php visible_count_inc.php visitor.php volume.php
votebox.php vote.php warn.php war.php
watermark.php window.php worldpay_notify.php wp-cache-phase1.php
wp-config.bak.php wp-config.php wp-config.php.bak wp-config.php.old
wp-login.php wptable-tinymce.php xarg_corner_bottom.php xarg_corner.php
xarg_corner_top.php xmlrpc.php xt_counter.php zipndownload.php

Python et autohotkey : exemple concret

C’est en cherchant des airs connus que je suis tombé sur ce site : http://www.mutopiaproject.org/ qui recense toutes les compositions tombées dans le domaine publique, qui a généré en automatique des fichiers midi en conséquence, et, surtout, qui a utilisé un logiciel du domaine publique extrêmement performant qui a constitué toutes les partitions.
Comme il y en a des centaines, et que tout est organisé de la même façon, je me suis fait un « aspirateur » de ces compositions, et puis, une fois aspirées, je me suis généré un fichier AutoHotKey (cf http://www.autohotkey.com/), logiciel tout simplement extraordinaire avec lequel on peut simuler en script absolument tout ce qu’on veut sous Windows : souris et clavier. J’ai donc « préposté » tous les articles que vous pouvez voir, et j’en fais apparaître un sur deux « réellement » à moi. Comme ça je fais d’une pierre deux coups : je promeus un site extrêmement bien fait et gratuit, et j’alimente mon blog (ces articles se sont étalés sur quatre mois).

Peut-être que cela vous donnera des idées ? 😉

Hacks : crack mots de passe Windows, Wifi et autres

Si vous parlez un petit peu Anglais, alors cette vidéo est faite pour vous :
Elle vous explique comment cracker les mots de passe Windows, comment utiliser le Wifi, collecter les paquets et les analyser afin de les cracker et de se faire une clé vous donnant l’accès au réseau, etc.
Tout est là, amusez vous bien :

Windows Vista / Seven : fichier hosts introuvable : la solution

Vous n’arrivez pas à ouvrir le fichier hosts pour y rajouter ce que vous voulez ?
Très simple pourtant… quand on connait l’astuce !

Tout d’abord, si vous essayez d’ouvrir le fichier hosts, il faut aller dans le dossier
[disque:][répertoire windows]\system32\drivers\etc
en général, comme pour moi c’est :
C:\Windows\system32\drivers\etc
Mais si vous essayez d’ouvrir, vous allez voir que le répertoire n’existe pas !
En fait il est caché, il est invisible :
Windows dossier etc invisible

Il vous suffit juste de taper à la main « etc », comme si vous saviez qu’il était la :
Windows dossier etc invisible et il faut taper etc

Et de la même façon, le fichier hosts est invisible :
Windows fichiers hosts invisible

Il vous suffit juste de taper à la main « hosts », comme si vous saviez qu’il était la :
Windows fichier hosts invisible et il faut taper hosts

Ensuite, une fois que vous l’aurez ouvert dans votre éditeur favori (beaucoup utilisent Notepad++, moi c’est Pspad, mais c’est la même chose dirons-nous), vous ne pourrez pas sauvegarder tant que vous n’aurez pas modifié les autorisations. Comment faire ? C’est très simple, le résumé en image :

Windows comment modifier les autorisations du fichier hosts

Explication : il faut cliquer avec le bouton droit sur le fichier, choisir « propriétés », puis changer les autorisations, et mettre « contrôle total » pour tous les utilisateurs.

Attention, c’est assez dangereux, cela signifie que tout le monde peut écrire dedans, et si vous installez un virus, il pourra écrire dedans, comme tout le monde.

A vous de voir, mais je n’ai jamais eu, en 17 ans de développement, de virus… enfin il faut dire que j’utilise Linux 50 % du temps aussi !

Comme d’habitude, j’espère avoir apporté un peu de savoir à la communauté et que je vous aurai évité de perdre du temps dans des choses inutiles !