sensepost / birp

Big Iron Recon & Pwnage
124 stars 33 forks source link

Exception probably handling non-ascii charaters #7

Open federicodotta opened 6 years ago

federicodotta commented 6 years ago

Hi!

during my last activity on mainframe Birp crashed several times with this Exception in different CICS pages:

Traceback (most recent call last):

  File "birp.py", line 545, in <module>
    menu(em, history)
  File "birp.py", line 470, in menu
    interactive(em,history)
  File "birp.py", line 202, in interactive
    trans = exec_trans(em,history,'enter')
  File "birp.py", line 107, in exec_trans
    em.exec_command('Wait(1,3270Mode)') #Capture the whole 3270 screen
  File "/usr/local/lib/python2.7/dist-packages/py3270-0.3.5-py2.7.egg/py3270/__init__.py", line 299, in exec_command
    c.execute()
  File "/usr/local/lib/python2.7/dist-packages/py3270-0.3.5-py2.7.egg/py3270/__init__.py", line 77, in execute
    return self.handle_result(result.decode('ascii'))
  File "/usr/local/lib/python2.7/dist-packages/py3270-0.3.5-py2.7.egg/py3270/__init__.py", line 95, in handle_result
    raise CommandError(msg.decode('ascii'))
py3270.CommandError: Wait: Timed out

I think it may be an issue related with non-ascii characters, but I'm not sure.

The problem is that when this exception arise Birp and X3270 terminal crash, losing all non-saved data.

Thank you a lot for your great work!

Federico

ShariqueS commented 5 years ago

Hi @sensepost, I am having the same issue, Birp keep crashing in an interactive mode on a bland screen. if Mainframe returned a blank screen application crash with the same error message as mentioned by @federicodotta.

ShariqueS commented 5 years ago

Ok, I put a temporary fix in py3270/py3270/init.py#95

        #raise CommandError(msg.decode('ascii'))
        return

This error happens when application receive a 'self.data' as ‘Wait: Timed out’ due to response screen is blank or takes some time return.

Need to do further investigation to find the permanent fix.

andres123456789883u249 commented 2 years ago

Hi, did you ever find a permanent fix?