Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Okay, so I have a hardware device that I have to connect to using putty. The device is protected by a 4 digit password. So I know there are 10,000 combinations and I know the device takes 5 seconds between each wrong password. So it'll take approx. 13 hours to complete.

TL;DR

How can I enter every combination into a putty window? I was thinking like a macro of some sort. Because the device I'm connecting to is like a hyper-terminal vt100 connection.

Update: When I connect to the device, I can interface with some things. But when I press 'E' to edit the MAP on the device. it tells me to enter the 4 digit password.

share|improve this question
    
I don't know the answer, but: PuTTY suggests Windows, and Windows supports other freeware SSH clients as well. Such as Cygwin, which opens up a world of scripting. Any reason why you specifically want PuTTY? –  Arjan Sep 11 '10 at 19:14
    
It's the only way I know how to connect to this device :-( It uses HyperTerminal or a VT100 emulator. –  Kelbizzle Sep 11 '10 at 20:00
    
Ok, so not necessarily PuTTY then. What about some other emulator that allows for scripting itself? Or, in the old days, many terminal programs allowed for reading a file with commands, to set the connection details et al, or to fetch data. Such command files might not allow for true scripting (such as writing loops). But generating a single (but huge) command file with all 10,000 possibilities might be much easier than trying to script PuTTY? –  Arjan Sep 11 '10 at 20:51
    
Aha, your question actually mentioned that VT100; I totally missed that, and so did others given the answers. When people see PuTTY, they think SSH, I guess. Why not remove PuTTY from the question...? –  Arjan Sep 11 '10 at 20:54
1  
Yea, that makes sense. I went the single huge file route using autohotkey pastebin.ca/1938488 –  Kelbizzle Sep 11 '10 at 22:16

4 Answers 4

up vote 2 down vote accepted

This might help. This is interfacing ssh using python. http://www.linuxplanet.com/linuxplanet/tutorials/6618/1/ Shouldn't be difficult to learn if you know python. You can do it on cygwin.

How could i have forgotten expect???? Use autoexpect to generate a script and then use some scripting lanaguage to substitue different passwords and you're done.

share|improve this answer

Tera Term Pro is a terminal emulator that can connect to a serial port and has a macro language.

In Tera Term Pro, go to HelpIndexMACRO help to read about the macro language. Look at the example macro files (.ttl files) for examples.

Here's an example macro to get you started. Save the following text into a file named pinsearch.ttl. To start the macro, go to ControlMacro and open the pinsearch.ttl file. To pause or stop the macro, click on the MACRO window and use the Pause or End buttons.

for i 0 9999

  int2str i_text i
  strlen i_text
  len = result

  if len=1 then
    pin_text = "000"
  elseif len=2 then
    pin_text = "00"
  elseif len=3 then
    pin_text = "0"
  else
    pin_text = ""
  endif

  strconcat pin_text i_text

  send "E"
  wait "password?"

  send pin_text
  wait "ok" "wrong"

  if result=1 goto found_it

  wait "command?"

next

messagebox "Didn't find password" ""
end

:found_it
messagebox pin_text ""
end
share|improve this answer

You can likely accomplish this by writing an autohotkey script. Or, if you know another scripting language, write a bruteforcer in that. You may also be able to find some premade ssh bruteforcing tool somewhere that will let you define the keyspace as 4 char passwords, all digits.

share|improve this answer
    
I wast thinking this also. But I'm in no position to begin reading about writing a brute force script. I have found a couple of options but nothing to just simply enter 0000-9999 into a window, wait 5 seconds in between, and move to the next. –  Kelbizzle Sep 11 '10 at 20:01

There is a huge list of of password cracking tools at sectools.org/crackers.html

As for your situation, I suggest using THC Hydra (#3 on the sectools' list) which you can download from http://freeworld.thc.org/thc-hydra/

share|improve this answer
    
Hydra looked promising but the option i select for putty which is "serial" . –  Kelbizzle Sep 11 '10 at 20:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.