Sep-28-2016, 11:31 AM
I'm very new to learning python, but as part of a wargames/learning challenge, may require me to brute force a PIN number password in an linux application (I don't even know if it's a 4-digit number or any characters, but that's another story)
Just trying to learn more Python as I go...
The application is run like this:
./application <4-digit code>
I found an example Python script online using "pexpect" that allows you to control other programs, so that made sense for my scenario since I want to run this specific binary so I'm working on customizing that script example.
I'm sure I have lots more coding to do but the current issue is that I just can't see what the script is doing. I know it's running because if I set a large (9999 instead of 10) it hangs so assume it's working but I'm not able to see the actual input/output on the screen.
What would I need to add in order for this to show me each login attempt and allow me to also see the "Wrong Answer" output from the application when I enter a wrong PIN?
Thanks
Just trying to learn more Python as I go...
The application is run like this:
./application <4-digit code>
I found an example Python script online using "pexpect" that allows you to control other programs, so that made sense for my scenario since I want to run this specific binary so I'm working on customizing that script example.
I'm sure I have lots more coding to do but the current issue is that I just can't see what the script is doing. I know it's running because if I set a large (9999 instead of 10) it hangs so assume it's working but I'm not able to see the actual input/output on the screen.
What would I need to add in order for this to show me each login attempt and allow me to also see the "Wrong Answer" output from the application when I enter a wrong PIN?
import pexpect as pe p = pe.spawn('/home/leviathan6/leviathan6') for i in range(10): p.send(str(i)) p.send('\n') p.expect(pe.EOF)Also, if there is something better than pexpect that I should consider in this case please let me know.
Thanks