sensepost / birp Goto Github PK
View Code? Open in Web Editor NEWBig Iron Recon & Pwnage
Big Iron Recon & Pwnage
Any chance you could get this working on windows ?
Probably have to write the getch keymap and then
x3270 not supported on Windows warning error
Can tn5250 emulator be supported by birp ?
Hello,
I have stumbled upon the Birp recently, and it looks promising, probably could be really helpful in the pentest I am struggling now. However I tried to compile your patch with few versions of x3270 from back of 2018 and it looks like dependencies and bunch of stuff isn't going to work the easy way.
Did you manage to build the tool recently? Which version of x3270 have you used?
Did you port py3270 to python 3?
I compiled birp and x3270 on kali and on BlackArch with same result. I get the folowing stack trace :
Traceback (most recent call last):
File "birp.py", line 544, in menu(em, history)
File "birp.py", line 469, in menu interactive(em,history)
File "birp.py", line 180, in interactive if not em.is_connected(): File "/usr/lib/python2.7/site-packages/py3270/init.py", line 328, in is_connected self.exec_command(b'ignore') File "/usr/lib/python2.7/site-packages/py3270/init.py", line 291, in exec_command c.execute() File "/usr/lib/python2.7/site-packages/py3270/init.py", line 69, in execute return self.handle_result(result.decode('ascii')) File "/usr/lib/python2.7/site-packages/py3270/init.py", line 87, in handle_result raise CommandError(msg.decode('ascii')) py3270.CommandError: Unknown action: ignore
The files have been moved in the new version of x3270 (3.5ga11 stable (26. June 2017)) So the patch doesn't work straight forward.
I'm not sure all the lines are correctly patched, I'll check that tomorrow.
I am a developer for the ArchAssault project, we would like to add this to our repo but I noticed its missing a license. Can you please add a license and add a tag as well?
error while compiling the patched binary x3270
When starting birp up, it crashes.
$ ./birp.py
[+] Big Iron Recon & Pwnage (BIRP) by @singe
[+] Manual target selection chosen.
[+] Slowdown is : 0
[+] Attack platform : Darwin
Traceback (most recent call last):
File "./birp.py", line 529, in
(em,history) = startup()
File "./birp.py", line 515, in startup
em = WrappedEmulator(visible=True,delay=results.sleep)
File "/Users/jfbethlehem/Code/mainframe/birp-master/py3270wrapper.py", line 10, in init
Emulator.init(self, visible)
File "/Library/Python/2.7/site-packages/py3270/init.py", line 224, in init
self.app = app or self.create_app(visible)
File "/Library/Python/2.7/site-packages/py3270/init.py", line 236, in create_app
return x3270App()
File "/Library/Python/2.7/site-packages/py3270/init.py", line 105, in init
self.spawn_app()
File "/Library/Python/2.7/site-packages/py3270/init.py", line 113, in spawn_app
stderr=subprocess.PIPE,
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 709, in init
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1326, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Greetings! I love the work you have done with birp. I have been toting around a jumble of half-polished Ruby scripts to accomplish similar things, but I'm very impressed with what you already have working in birp.
One thing I've run into is that sometimes I get errors and crashes from unrecognized characters as birp is translating from x3270 into Python, etc. For example:
Hitting Enter, any of the PF/PA keys, or Ctrl-u will record a transaction.
Traceback (most recent call last):
File "birp.py", line 544, in <module>
menu(em, history)
File "birp.py", line 469, in menu
interactive(em,history)
File "birp.py", line 206, in interactive
print screen.colorbuffer.decode("utf-16").encode("utf-8")
File "/usr/lib/python2.7/encodings/utf_16.py", line 16, in decode
return codecs.utf_16_decode(input, errors, True)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2219' in position 24: ordinal not in ran
So far, I am working around this with the following small change:
$ git diff
diff --git a/birp.py b/birp.py
index 0ffff33..006c591 100755
--- a/birp.py
+++ b/birp.py
@@ -203,7 +203,7 @@ def interactive(em,history):
logger('Enter entered',kind='info')
elif key == getch.KEY_CTRLr: # Ctrl-r print screen
screen = update_screen(em,screen)
- print screen.colorbuffer
+ print screen.colorbuffer.encode("ascii", "ignore")
logger('Screen refreshed',kind='info')
elif key == getch.KEY_CTRLu: # Ctrl-u manually push transaction
screen = update_screen(em,screen)
The same occurs when I save a screen as a transaction, and I'm not sure that just ignoring character transcription errors is the "right thing to do".
Have you run into this in your testing?
Thanks!
It looks like with py3270 using the lastest git src.
[+] Big Iron Recon & Pwnage (BIRP) by @singe
[+] Manual target selection chosen.
[+] Slowdown is : 0
[+] Attack platform : Linux
Traceback (most recent call last):
File "./birp.py", line 528, in
(em,history) = startup()
File "./birp.py", line 514, in startup
em = Emulator(visible=True,delay=results.sleep)
File "/home/spirit/packages/birp-git/src/birp/py3270wrapper.py", line 9, in init
EmulatorBase.init(self, visible)
File "/usr/lib/python2.7/site-packages/py3270/init.py", line 205, in init
raise Exception("EmulatorBase has been replaced by Emulator. See readme.rst.")
Exception: EmulatorBase has been replaced by Emulator. See readme.rst.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.