Code Monkey home page Code Monkey logo

Comments (24)

v1k1ngfr avatar v1k1ngfr commented on August 24, 2024 2

Fixed by @r3dp0int, thanks you !

from arsenal.

kib3rvo1n avatar kib3rvo1n commented on August 24, 2024 1

When you install the latest version of kali you will have the error as above. i tried to install with pip an manual but both does not fix it. dev.tty.legacy_tiocsti=1 is a fix for the kernel update problem and does not fix this error. The problem is in cursed module. I have to rebuild kali because its foobar now because of my current attempts to fix it, will try to find a fix when i'm up again.

from arsenal.

joblinours avatar joblinours commented on August 24, 2024

I have the same problem, I've been trying to solve it for 2 days and I still haven't found it. If I do, I'll let you know.

from arsenal.

injcristianrojas avatar injcristianrojas commented on August 24, 2024

It could also be a Python issue. In Kali it is version 3.11.6. In Fedora, 3.12.0.

Also, can I say that this tool should be in Kali's default repos? Any way to ask for inclusion?

from arsenal.

purpl3horse avatar purpl3horse commented on August 24, 2024

Same issue here on latest Kali Linux 2023.4 vm

from arsenal.

joblinours avatar joblinours commented on August 24, 2024

I have just run my kali on python 3.12, unfortunately no change on the result.

from arsenal.

v1k1ngfr avatar v1k1ngfr commented on August 24, 2024

Hi !
Thanks for reporting the issue, we will have a look at this error.

from arsenal.

trb143 avatar trb143 commented on August 24, 2024

Not an expert on curses but found this thread which may help find the fix.
https://www.mail-archive.com/[email protected]/msg1944374.html

from arsenal.

v1k1ngfr avatar v1k1ngfr commented on August 24, 2024

Hey !

Because of TIOCSTI patch applied recently on Linux Kernel, we need to re-implement some Arsenal functions (which can take some time).
Thanks @slasheur7 helping at troubleshooting this.

Here is a workaround, execute as root :
sysctl -w dev.tty.legacy_tiocsti=1

If you want this workaround to survive a reboot, add the following configuration to sysctl.conf file (root permission needed) :
echo "dev.tty.legacy_tiocsti=1" >> /etc/sysctl.conf

It works on the current Kali 2023.4 (python 3.11.7 and 3.12.1) and should also work on other Linux distro.

Of course there is security concern (ie : if you are not already root on your Linux). More information about TIOCTSI in the following kernel commit log :
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=83efeeeb3d04b22aaed1df99bc70a48fe9d22c4d

from arsenal.

joblinours avatar joblinours commented on August 24, 2024

Hello,

After testing your solution under kali 2023.4 and in python 3.11.7 the error has still not changed.

I will continue to try tomorrow but currently still the same error message 😁

from arsenal.

injcristianrojas avatar injcristianrojas commented on August 24, 2024

@joblinours what solution? Any specific commit?

from arsenal.

joblinours avatar joblinours commented on August 24, 2024

@injcristianrojas
the temporary solution proposed by @v1k1ngfr by adding the "dev.tty.legacy_tiocsti=1" attribute to /etc/sysctl.conf

from arsenal.

injcristianrojas avatar injcristianrojas commented on August 24, 2024

@joblinours the IOCTL issue is mentioned in the README. This ticket is for another issue.

from arsenal.

v1k1ngfr avatar v1k1ngfr commented on August 24, 2024

@injcristianrojas we are not able to reproduce your issue related to ncurses, could you give steps you followed ?

from arsenal.

trb143 avatar trb143 commented on August 24, 2024

@v1k1ngfr are you referring to the original issue or the "dev.tty.legacy_tiocsti=1" one?
If it is the original one I can confirm the issues. Arsenal works fine on my Fedora box but fails on my old Kali box and the new rebuild of my Kali box with no customizations. If you see the comment above this has also been found by the HG project but their fix did not seem to work for Arsenal.

from arsenal.

injcristianrojas avatar injcristianrojas commented on August 24, 2024

@v1k1ngfr sure. I'm running arsenal on Kali without a virtualenv or pip packages installed, on Kali 2023.4. Just installed it using pip install with deb-based dependencies installed. The error appears every time I exit arsenal, either due to Ctrl-C or when getting a command.

If you have any more questions, please let me know.

from arsenal.

purpl3horse avatar purpl3horse commented on August 24, 2024

@injcristianrojas we are not able to reproduce your issue related to ncurses, could you give steps you followed ?

Have you tried on the latest version of Kali Linux (2023.4?) I have tried on several machines that were recently upgraded. All give the same error reported by OP

from arsenal.

Bungie25 avatar Bungie25 commented on August 24, 2024

Same issue
└─ a [ 5:52pm 1 ⨯ ]
Traceback (most recent call last):
File "/usr/lib/python3.11/curses/init.py", line 94, in wrapper
return func(stdscr, *args, **kwds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/r3dkn33/.local/lib/python3.11/site-packages/arsenal/modules/gui.py", line 382, in run
curses.endwin()
_curses.error: endwin() returned ERR

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/r3dkn33/.local/bin/arsenal", line 8, in
sys.exit(main())
^^^^^^
File "/home/r3dkn33/.local/lib/python3.11/site-packages/arsenal/app.py", line 185, in main
App().run()
File "/home/r3dkn33/.local/lib/python3.11/site-packages/arsenal/app.py", line 64, in run
self.start(args, cheatsheets)
File "/home/r3dkn33/.local/lib/python3.11/site-packages/arsenal/app.py", line 71, in start
cmd = gui.run(cheatsheets)
^^^^^^^^^^^^^^^^^^^^
File "/home/r3dkn33/.local/lib/python3.11/site-packages/arsenal/modules/gui.py", line 827, in run
wrapper(self.cheats_menu.run)
File "/usr/lib/python3.11/curses/init.py", line 101, in wrapper
endwin()
_curses.error: endwin() returned ERR

Followed these steps to install on most recent version of Kali

python3 -m pip install arsenal-cli
added this alias a='arsenal' to .zshrc

sudo sysctl -w dev.tty.legacy_tiocsti=1    

from arsenal.

r3dp0int avatar r3dp0int commented on August 24, 2024

For testing purposes: if you comment out the three occurrences of endwin() in gui.py, along with the endwin() call in the wrapper function of curses' __init__.py, Arsenal begins to work again correctly with no errors.

from arsenal.

Bungie25 avatar Bungie25 commented on August 24, 2024

Just to confirm are these the locations?

/home/r3dkn33/.local/lib/python3.11/site-packages/arsenal/modules/gui.py
/usr/lib/python3.11/curses/__init__.py

If they are the correct locations. the output after running arsenal is

Traceback (most recent call last):
File "/home/r3dkn33/.local/bin/arsenal", line 8, in <module>                                                                                                  

sys.exit(main())
         ^^^^^^

File "/home/r3dkn33/.local/lib/python3.11/site-packages/arsenal/app.py", line 185, in mainApp().run()
File "/home/r3dkn33/.local/lib/python3.11/site-packages/arsenal/app.py", line 64, in run self.start(args, cheatsheets)
File "/home/r3dkn33/.local/lib/python3.11/site-packages/arsenal/app.py", line 161, in start self.prefil_shell_cmd(cmd)
File "/home/r3dkn33/.local/lib/python3.11/site-packages/arsenal/app.py", line 178, in prefil_shell_cmd
fcntl.ioctl(stdin, termios.TIOCSTI, c)
OSError: [Errno 5] Input/output error

from arsenal.

purpl3horse avatar purpl3horse commented on August 24, 2024

Just to confirm are these the locations?

/home/r3dkn33/.local/lib/python3.11/site-packages/arsenal/modules/gui.py
/usr/lib/python3.11/curses/__init__.py

If they are the correct locations. the output after running arsenal is

Traceback (most recent call last):
File "/home/r3dkn33/.local/bin/arsenal", line 8, in <module>                                                                                                  

sys.exit(main())
         ^^^^^^

File "/home/r3dkn33/.local/lib/python3.11/site-packages/arsenal/app.py", line 185, in mainApp().run()
File "/home/r3dkn33/.local/lib/python3.11/site-packages/arsenal/app.py", line 64, in run self.start(args, cheatsheets)
File "/home/r3dkn33/.local/lib/python3.11/site-packages/arsenal/app.py", line 161, in start self.prefil_shell_cmd(cmd)
File "/home/r3dkn33/.local/lib/python3.11/site-packages/arsenal/app.py", line 178, in prefil_shell_cmd
fcntl.ioctl(stdin, termios.TIOCSTI, c)
OSError: [Errno 5] Input/output error

You have the correct locations, to solve that last error run this:
sudo sysctl -w dev.tty.legacy_tiocsti=1

from arsenal.

purpl3horse avatar purpl3horse commented on August 24, 2024

For testing purposes: if you comment out the three occurrences of endwin() in gui.py, along with the endwin() call in the wrapper function of curses' __init__.py, Arsenal begins to work again correctly with no errors.

Confirmed. I edited those 2 files in the following locations:

/home/user/.local/lib/python3.11/site-packages/arsenal/modules/gui.py
/usr/lib/python3.11/curses/__init__.py

from arsenal.

Bungie25 avatar Bungie25 commented on August 24, 2024

sudo sysctl -w dev.tty.legacy_tiocsti=1

Perfect thank you - confirmed as working

from arsenal.

r3dp0int avatar r3dp0int commented on August 24, 2024

I think I've come up with the correct solution, I'll issue a pull request soon.

from arsenal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.