I need to run this program:
Luis@Windu /cygdrive/c/Temporal/Expect$ oclhashcat64 ../Test.hccap -m 2500 -a 3 ?d?d?d?d?d?d?d?d
oclHashcat v1.31 starting...
Device #1: Bonaire, 1024MB, 1050Mhz, 12MCU
Device #2: Tahiti, 3072MB, 900Mhz, 28MCU
Hashes: 1 hashes; 1 unique digests, 1 unique salts
Bitmaps: 8 bits, 256 entries, 0x000000ff mask, 1024 bytes
Applicable Optimizers:
* Zero-Byte
* Single-Hash
* Single-Salt
* Brute-Force
Watchdog: Temperature abort trigger set to 90c
Watchdog: Temperature retain trigger set to 80c
Device #1: Kernel D:\Programas\HashCat\OCLHashCat/kernels/4098/m02500.Bonaire_1573.4_1573.4 (VM).kernel (259320 bytes)
Device #1: Kernel D:\Programas\HashCat\OCLHashCat/kernels/4098/markov_le_v1.Bonaire_1573.4_1573.4 (VM).kernel (92404 bytes)
Device #1: Kernel D:\Programas\HashCat\OCLHashCat/kernels/4098/bzero.Bonaire_1573.4_1573.4 (VM).kernel (30496 bytes)
Device #2: Kernel D:\Programas\HashCat\OCLHashCat/kernels/4098/m02500.Tahiti_1573.4_1573.4 (VM).kernel (259428 bytes)
Device #2: Kernel D:\Programas\HashCat\OCLHashCat/kernels/4098/markov_le_v1.Tahiti_1573.4_1573.4 (VM).kernel (92388 bytes)
Device #2: Kernel D:\Programas\HashCat\OCLHashCat/kernels/4098/bzero.Tahiti_1573.4_1573.4 (VM).kernel (30492 bytes)
[s]tatus [p]ause [r]esume [b]ypass [q]uit =>
When this last line appears, I need some automated way to send the q key, so I will receive results like:
Session.Name...: oclHashcat
Status.........: Aborted
Input.Mode.....: Mask (?d?d?d?d?d?d?d?d) [8]
Hash.Target....: 101 (00:1f:5b:c2:fb:0c <-> 30:87:30:e0:0b:cd)
Hash.Type......: WPA/WPA2
Time.Started...: Sun Nov 16 06:41:17 2014 (11 secs)
Time.Estimated.: Sun Nov 16 06:54:56 2014 (13 mins, 28 secs)
Speed.GPU.#1...: 26537 H/s
Speed.GPU.#2...: 99510 H/s
Speed.GPU.#*...: 126.0 kH/s
Recovered......: 0/1 (0.00%) Digests, 0/1 (0.00%) Salts
Progress.......: 1413120/100000000 (1.41%)
Skipped........: 0/1413120 (0.00%)
Rejected.......: 0/1413120 (0.00%)
HWMon.GPU.#1...: 0% Util, 38c Temp, N/A Fan
HWMon.GPU.#2...: 98% Util, 44c Temp, 49% Fan
WARNING: Failed to restore default fan speed for gpu number: 1:
Started: Sun Nov 16 06:41:17 2014
Stopped: Sun Nov 16 06:41:28 2014
I am trying to to this using expect. This is the code:
spawn oclHashcat64.exe ../Test.hccap -m 2500 -a 3 ?d?d?d?d?d?d?d?d
expect "*tatus"
send "q\r"
close
exit
But it seems not to be working. This is the result:
Luis@Windu /cygdrive/c/Temporal/Expect
$ expect.exe Prueba02.expect
spawn oclHashcat64.exe ../Test.hccap -m 2500 -a 3 ?d?d?d?d?d?d?d?d
oclHashcat v1.31 starting...
Device #1: Bonaire, 1024MB, 1050Mhz, 12MCU
Device #2: Tahiti, 3072MB, 900Mhz, 28MCU
Hashes: 1 hashes; 1 unique digests, 1 unique salts
Bitmaps: 8 bits, 256 entries, 0x000000ff mask, 1024 bytes
Applicable Optimizers:
* Zero-Byte
* Single-Hash
* Single-Salt
* Brute-Force
Watchdog: Temperature abort trigger set to 90c
Watchdog: Temperature retain trigger set to 80c
Device #1: Kernel D:\Programas\HashCat\OCLHashCat/kernels/4098/m02500.Bonaire_1573.4_1573.4 (VM).kernel (259320 bytes)
Device #1: Kernel D:\Programas\HashCat\OCLHashCat/kernels/4098/markov_le_v1.Bonaire_1573.4_1573.4 (VM).kernel (92404 bytes)
Device #1: Kernel D:\Programas\HashCat\OCLHashCat/kernels/4098/bzero.Bonaire_1573.4_1573.4 (VM).kernel (30496 bytes)
Device #2: Kernel D:\Programas\HashCat\OCLHashCat/kernels/4098/m02500.Tahiti_1573.4_1573.4 (VM).kernel (259428 bytes)
Device #2: Kernel D:\Programas\HashCat\OCLHashCat/kernels/4098/markov_le_v1.Tahiti_1573.4_1573.4 (VM).kernel (92388 bytes)
Device #2: Kernel D:\Programas\HashCat\OCLHashCat/kernels/4098/bzero.Tahiti_1573.4_1573.4 (VM).kernel (30492 bytes)
[s]tatus [p]ause [r]esume [b]ypass [q]uit =>
Luis@Windu /cygdrive/c/Temporal/Expect$
As you can see, the expected line appears, but the second part does not, and the q is not sent, because the main process keeps alive:
Luis@Windu /cygdrive/c/Temporal/Expect$ ps -e | grep "hashcat" -i
1180 1 1180 6976 pty0 1000 07:51:13 /cygdrive/d/Programas/HashCat/OCLHashCat/oclHashcat64
Could someone tell me what am I doing wrong, please?
echo "q" | expect.exe Prueba02.expectnot work? – Rinzwind Nov 16 '14 at 07:18SSHconsole. – Sopalajo de Arrierez Nov 16 '14 at 22:29exp_internal 1to your expect script. This will turn on verbose mode. Warning: it is very verbose. You may find something in the verbose output that explains what is happening. ... ... ... But also, have you tried changingexpect "*tatus"toexpect "tatus"? It shouldn't make a difference, but I believe that you don't need the*. – G-Man Says 'Reinstate Monica' Nov 17 '14 at 21:54qkey. Maybe it some sort of flaw withOCLHashCat. – Sopalajo de Arrierez Nov 17 '14 at 23:24tatusinstead of*tatus. – Sopalajo de Arrierez Nov 17 '14 at 23:31q\r. (2) It doesn’t make any sense that the verbose output comes to a dead stop after receiving[s]tatus. I wonder whether it would make a difference if you saidexpect "*tatus*>", to try to force it to read up to the>prompt. (3) It might also help to sayexpect "*tatus*>" send "q\r"(all on the same line). (4) It looks like you’re using Cygwin under Windows. Why are you posting on Ask Ubuntu? – G-Man Says 'Reinstate Monica' Nov 18 '14 at 00:12expect "tatus*>, @G-Man. – Sopalajo de Arrierez Nov 18 '14 at 00:40expectline you suggest fails withusage: send [args] stringmessage, @G-Man – Sopalajo de Arrierez Nov 18 '14 at 00:40expect "*tatus*>" send "q\r"I meantexpect "*tatus*>" { send "q\r" }. – G-Man Says 'Reinstate Monica' Nov 18 '14 at 02:27|, but, maybe for that same reason, the external inputs don't work as they must. I mean: the program expects to fin data to process incoming through the pipe, not control keys. – Sopalajo de Arrierez Nov 18 '14 at 04:01expect.exe' to spawnoclHashcat64.exe`, AU seems to be a bad fit. You've given it over two days; it may be time to try Super User (or Unix & Linux, if you believe that's appropriate). – G-Man Says 'Reinstate Monica' Nov 18 '14 at 16:24