PDA

Ver la versión completa : Emuladores De Tarjetas Monedero



AngelTR
20-12-2004, 19:48
No se si es el sitio adecuado para postear pero me encantaria intercambiar impresiones acerca de monederos elecrónicos, en concreto los universitarios, los que vienen con las tarjetas de estudiante. Suelen ser de Euro6000, Visa cash ó monedero 4B. Estoy desarrollando un emulador para piccard que todavia no funciona, solo marca saldo cuando lo metes en la maquina. Necesitaria gente q me ayudase a pinchar comunicaciones y a tratar de hayar los algoritmos para cifrar cietos comandos y asi poder crear un emualdor con cualquier nº de serie y/o saldo. Los protocolos que segun en leido mas se le parecen son los HMAC.

Puede que devidamente implementados funcionen en las cabinas. Quien se anima?

Sujerencias?

[email protected]

SxR
21-12-2004, 01:16
Yo me animo, comentame lo que tienes e intercambiamos opiniones.

celsxxx
02-01-2005, 21:51
YO TE PODRIA AYUDAR LO QUE NECESITAMOS ES ECHARLE UN VISTAZO AL CODIGO Y SI MARCA AGOTADO SOLO HAY QUE ALTERAR CIERTAS INSTRUCCIONES DEL PORG MANDAMELO Y TE REENVIO EL NEW [email protected] see you later!!!!

AngelTR
13-01-2005, 11:03
Os paso unos logs para que veais si vuestras cams hablan en el mismo idioma. Podeis Usar el winexplorer y el fichero de escript que a continuacion copio y pego (porque no se porque no me deja adjuntar ficheros).
--------------------------------------------------------------------
--INFO SOBRE PROTOCOLO DE FIRMA DEL COMANDO 8050 ------------

Message Authentication Code (MAC) - A symmetric cryptographic transformation of data that protects the sender and the recipient of the data against forgery by third parties.
MAC (Message Authentication Code): A specific type of message digest where the secret key is included as part of the fingerprint. Whereas a normal digest consists of a hash (data), the MAC consists of a hash(key + data). Contrast: The most common form is actually HMAC (hash MAC) that uses the algorithm hash(key + hash (key + data)). From Hacking-Lexicon

Signed Static Application Data, digital signature on critical app parameters for static data authentication ICC.
b ‘70’ or ‘79’ ‘93’ NI

--------------------------------------------------------------------
--LOGS ------------------------------------------------------------

LAS XXXX’s, las ZZZZ’s son datos personales que por motivos de seguridad no quiero hacer publicos


--------------------------------------------------------------------
LOG 1, EURO 6000, MAQUINA EXPENDEDORA DE COMIDA

00-> RESET
<- 3B 6F 00 00 00 66 4D 45 31 61 03 01 53 08 61 34 F0 90 00
01-> 00 B0 82 08 08
<- B0 04 30 03 10 37 07 69 03 90 00
02-> 00 A4 04 00 06
<- A4
03-> 50 20 00 FF 00 01
<- 61 2A
04-> 00 C0 00 00 2A
<- C0 6F 28 84 07 50 20 00 FF 00 01 01 A5 0C BF 0C 09 C1 03 50 20 93 C9
02 F0 00 83 02 2F 0A 80 02 02 28 85 03 38 12 80 86 02 20 00 90 00
05-> 00 B0 93 00 0B
<- B0 00 00 03 20 09 78 02 00 00 4E 20 90 00

-> DISPLAY : “8.00 €”
<- COMPRA DE 0,50 €
-> DISPLAY: “PAGANDO”

06-> 00 B0 91 00 14
<- B0 50 20 93 00 xx xx xx xx AA 07 11 AA 04 11 03 00 00 00 83 F0 00 90 00

07-> 00 B2 01 94 02
<- B2 02 11 90 00
08-> 80 50 01 00 1F
<- 50 50 20 93 00 xx xx xx xx 02 AA 11 30 00 00 03 20 09 78 02 83 00 02 11 XX XX XX XX 00 00 00 00 90 00
09-> 80 54 00 00 1C
<- 54
10-> 01 09 XX XX 00 00 00 01 00 00 00 32 09 78 02 91 F2 D9 0C AE XX XX XX XX 84 B0 50 19
<- 61 0C
11-> 00 C0 00 00 0C
<- C0 00 00 02 EE ZZ ZZ ZZ ZZ 00 00 00 00 90 00
-> DISPLAY: “7.50”

--------------------------------------------------------------------
LOG 2, EURO 6000, MAQUINA EXPENDEDORA DE COMIDA

00-> RESET
<- 3B 6F 00 00 00 66 4D 45 6F 44 03 03 53 08 61 04 F0 90 00
01-> 00 B0 82 08 08
<- B0 00 29 03 13 35 01 96 62 90 00
02-> 00 A4 04 00 06
<- A4

03-> 50 20 00 FF 00 01
<- 61 2A
04-> 00 C0 00 00 2A

<- C0 6F 28 84 07 50 20 00 FF 00 01 01 A5 0C BF 0C 09 C1 03 50 20 93 C9
02 F0 00 83 02 2F 0A 80 02 02 28 85 03 38 12 80 86 02 20 00 90 00
05-> 00 B0 93 00 0B
<- B0 00 00 02 D2 09 78 02 00 00 4E 20 90 00

-> DISPLAY : “7.22 €”
<- COMPRA DE 0,60 €
-> DISPLAY: “PAGANDO”

06-> 00 B0 91 00 14
<- B0 50 20 93 00 AA AA AA AA AA 09 30 AA 09 25 00 00 00 83 F0 00 90 00
07-> 00 B2 01 94 02
<- B2 02 11 90 00
08-> 80 50 01 00 1F
<- 50 50 20 93 00 AA AA AA AA 02 AA 09 30 00 00 02 D2 09 78 02 83 00 58 11 XX XX XX XX 00 00 00 00 90 00
09-> 80 54 00 00 1C
<- 54
10-> 01 09 XX XX 00 00 00 01 00 00 00 3C 09 78 02 8C 3B 08 BF 77 XX XX XX XX 84 B2 00 19
<- 61 0C
11-> 00 C0 00 00 0C
<- C0 00 00 02 96 ZZ ZZ ZZ ZZ 00 00 00 00 90 00

--------------------------------------------------------------------
-- COPY PASTE DE UN FICHERO DE ESCRIPT PARA EXTRAER DATOS SENSIBLES DE UN MONEDERO ORIGINAL -------

<EXTRAE.xvb>

'
' New VB Script File - Created 30/12/2004
'
Dim l_resp
Dim retardo
Dim saldo
Dim byte3dec
Dim byte4dec
Dim consumo
Dim clavepropia
Dim moneda
Dim caducidadmonedero
Dim activacion
Dim fso, f1
Dim SNH, SNL
Dim bytei, respuesta
Dim MAC
dim ContAbs8050
retardo = 240
consumo = 0


ahora=Replace(now, "/", "-")
ahora=Replace(ahora, ":",".")
ahora=Replace(ahora, " ","_")
sc.print(ahora)

Set fso = CreateObject("Scripting.FileSystemObject") ' Creo un fichero de texto para guardar el log.
Set f1 = fso.CreateTextFile("C:\" & ahora & "_Extrae_Datos_Criticos.txt", True)' Le pongo nombre segun el S/N


Sub Main()

Sc.Verbose = TRUE


Sc.reset()
Sc.delay(retardo)

' COMANDO 01
Escribe("00 B0 82 08 08")
RespuestaAlLog()
clavepropia=(HexString(Sc.getbyte(1),2)&" "& HexString(Sc.getbyte(2),2)&" "& HexString(Sc.getbyte(3),2)&" "& HexString(Sc.getbyte(4),2)&" "& HexString(Sc.getbyte(5),2)&" "& HexString(Sc.getbyte(6),2)&" "& HexString(Sc.getbyte(7),2)&" "& HexString(Sc.getbyte(8),2) )

' COMANDO 02
Escribe("00 A4 04 00 06")
RespuestaAlLog()

' COMANDO 03
Escribe("50 20 00 FF 00 01")
RespuestaAlLog()

' COMANDO 04
Escribe("00 C0 00 00 2A")
RespuestaAlLog()

' COMANDO 05
Escribe("00 B0 93 00 0B")
RespuestaAlLog()
saldo=((Sc.getbyte(3)*256+ Sc.getbyte(4))/100)
moneda=(HexString(Sc.getbyte(5),2)&" "& HexString(Sc.getbyte(6),2)&" "& HexString(Sc.getbyte(7),2) )

' COMANDO 06
Escribe("00 B0 91 00 14")
RespuestaAlLog()
SNH=(HexString(Sc.getbyte(1),2)& HexString(Sc.getbyte(2),2)& HexString(Sc.getbyte(3),2)& HexString(Sc.getbyte(4),2) )
SNL=(Sc.getbyte(5)*256*256*256+ Sc.getbyte(6)*256*256+Sc.getbyte(7)*256+sc.getbyte (8))
caducidadmonedero= (HexString(Sc.getbyte(11),2)&"/"& HexString(Sc.getbyte(10),2)&"/20"& HexString(Sc.getbyte(9),2) )
activacion = (HexString(Sc.getbyte(14),2)&"/"& HexString(Sc.getbyte(13),2)&"/20"& HexString(Sc.getbyte(12),2) )

' COMANDO 07
Escribe("00 B2 01 94 02")
RespuestaAlLog()

' COMANDO 08
Escribe("80 50 01 00 1F")
RespuestaAlLog()
ContAbs8050=Sc.getbyte(22)
MAC=(HexString(Sc.getbyte(24),2)&" "& HexString(Sc.getbyte(25),2)&" "& HexString(Sc.getbyte(26),2)&" "& HexString(Sc.getbyte(27),2))

sc.Msgbox("[Datos no firmados]"&vbcr&" Clave propia: 0x"& clavepropia &vbcr&" Caducidad Monedero: "&caducidadmonedero & vbcr & " Activación Monedero: " & activacion & vbcr &" Nº Serie: "& SNH & " " & SNL & vbcr &" Saldo: " & saldo & " €" &vbcr&" Mondeda: 0x"&moneda&vbcr&vbcr&"[Instrucción firmada 8050] "&vbcr&" Contador: 0x"& Hexstring(ContAbs8050,2)& " ("&ContAbs8050&" decimal)"&vbcr&" Firma MAC: 0x"&MAC )

f1.writeline("__________________________________________________ ________________")
f1.writeline(" Clave propia: 0x" & clavepropia)
f1.writeline(" Caducidad Monedero: "& caducidadmonedero)
f1.writeline(" Activación Monedero: " & activacion)
f1.writeline(" Nº Serie Chip: " & SNH& " " & SNL)
f1.writeline(" Saldo: " & saldo & " €")
f1.writeline(" Cont8050's: " & ContAbs8050)
f1.writeline(" MAC com 08: " & MAC )
f1.writeline("")
f1.write(" Instrucción 8050:")
RespuestaAlLog()
f1.writeline("__________________________________________________ ________________")

f1.close

End Sub


'------------------------------------------------------
public Function HexString(ThisNumber, Length)
Dim RetVal
Dim CurLen
'
' Convert a integer to a hex string and
' pad it with the desired number of zeros
'
RetVal = Hex(ThisNumber)
CurLen = Len(RetVal)

If CurLen < Length Then
RetVal = String(Length - CurLen, "0") & RetVal
End If

HexString = RetVal
End Function
'------------------------------------------------------
public Function Escribe(comando)
dim mult_retardo

f1.writeline("-> "&comando)

Sc.Write(comando) ' ESCRIBO COMANDO
sc.delay(retardo) ' ESPERO Q ENTRE RESP
l_resp=sc.Bytesinbuffer ' MIDO LON RESP
Sc.read (l_resp) ' LEO BUFFER CON LON RESP

Escribe = TRUE
End Function
'------------------------------------------------------
public Function RespuestaAlLog

f1.write("<- ")
For bytei=1 to l_resp
f1.write((HexString(sc.getbyte(bytei-1),2)))
next
f1.writeline("")

RespuestaAlLog=TRUE
End Function
'------------------------------------------------------

--------------------------------------------------------------------
--------------------------------------------------------------------

Si alguien tiene una tarjeta universitaria que hable el mismo idioma que la mia (EURO6000), disponga de maquinas expendedoras con tarjetero para probar y ganas, ya sabeis. Tengo una beta de codigo para Silvercard que emula una consumicion a la perfeccion, la unica pega esque necesitas extraer los datos criticos con el escript y luego meterlos a la eeprom del pic, osea q te estafas a ti mismo. Necesito informacion para poder firmar los comandos 8050 que genere con nº's de serie aleatorios y saldos tb aleatorios para asi tener el emulador perfecto.

Espero sugerencias. ;)

periko1985
22-02-2005, 17:43
A mi tambien me gustaria ayudar tengo una tarjeta inteligente universitaria que es de la Universidad de extremadura y habla el lenguaje de la tuya...Podiamos probar este proyecto y tambien me podias echar un cable para emular las tarjetas de la red de autobuses urbanos.se podria hacer?
contestame cuanto antes