threat9 / routersploit

Exploitation Framework for Embedded Devices
Other
12.12k stars 2.31k forks source link

Not working on android termux app after the latest update #445

Closed D4Vinci closed 6 years ago

D4Vinci commented 6 years ago

Steps to Reproduce (for bugs)

1.pip2 install -r requirements.txt or pip2 install paramiko

Your Environment

Current Behavior

In case of using python2

$ pip2 install paramiko
Collecting paramiko
  Using cached https://files.pythonhosted.org/packages/3e/db/cb7b6656e0e7387637ce850689084dc0b94b44df31cc52e5fc5c2c4fd2c1/paramiko-2.4.1-py2.py3-none-any.whl
Collecting bcrypt>=3.1.3 (from paramiko)
  Using cached https://files.pythonhosted.org/packages/f3/ec/bb6b384b5134fd881b91b6aa3a88ccddaad0103857760711a5ab8c799358/bcrypt-3.1.4.tar.gz
Collecting pyasn1>=0.1.7 (from paramiko)
  Using cached https://files.pythonhosted.org/packages/a0/70/2c27740f08e477499ce19eefe05dbcae6f19fdc49e9e82ce4768be0643b9/pyasn1-0.4.3-py2.py3-none-any.whl
Collecting pynacl>=1.0.1 (from paramiko)
  Using cached https://files.pythonhosted.org/packages/08/19/cf56e60efd122fa6d2228118a9b345455b13ffe16a14be81d025b03b261f/PyNaCl-1.2.1.tar.gz
    Complete output from command python setup.py egg_info:
    c/_cffi_backend.c:2:10: fatal error: 'Python.h' file not found
    #include <Python.h>
             ^~~~~~~~~~
    1 error generated.
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/data/data/com.termux/files/usr/tmp/pip-install-rfOtMn/pynacl/setup.py", line 251, in <module>
        "Programming Language :: Python :: 3.6",
      File "/data/data/com.termux/files/usr/lib/python2.7/site-packages/setuptools/__init__.py", line 128, in setup
        _install_setup_requires(attrs)
      File "/data/data/com.termux/files/usr/lib/python2.7/site-packages/setuptools/__init__.py", line 123, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/data/data/com.termux/files/usr/lib/python2.7/site-packages/setuptools/dist.py", line 513, in fetch_build_eggs
        replace_conflicting=True,
      File "/data/data/com.termux/files/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 774, in resolve
        replace_conflicting=replace_conflicting
      File "/data/data/com.termux/files/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1057, in best_match
        return self.obtain(req, installer)
      File "/data/data/com.termux/files/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1069, in obtain
        return installer(requirement)
      File "/data/data/com.termux/files/usr/lib/python2.7/site-packages/setuptools/dist.py", line 580, in fetch_build_egg
        return cmd.easy_install(req)
      File "/data/data/com.termux/files/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 673, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/data/data/com.termux/files/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 699, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/data/data/com.termux/files/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 884, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/data/data/com.termux/files/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1152, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "/data/data/com.termux/files/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1140, in run_setup
        raise DistutilsError("Setup script exited with %s" % (v.args[0],))
    distutils.errors.DistutilsError: Setup script exited with error: command 'aarch64-linux-android-clang' failed with exit status 1

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /data/data/com.termux/files/usr/tmp/pip-install-rfOtMn/pynacl/

In case of using python 3

$ python3 -m pip install -r requirements.txt
Requirement already satisfied: future>=0.16.0 in /data/data/com.termux/files/usr/lib/python3.6/site-packages (from -r requirements.txt (line 1)) (0.16.0)
Requirement already satisfied: requests>=2.9.1 in /data/data/com.termux/files/usr/lib/python3.6/site-packages (from -r requirements.txt (line 2)) (2.18.4)
Collecting paramiko>=1.16.0 (from -r requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/3e/db/cb7b6656e0e7387637ce850689084dc0b94b44df31cc52e5fc5c2c4fd2c1/paramiko-2.4.1-py2.py3-none-any.whl
Collecting pysnmp>=4.3.2 (from -r requirements.txt (line 4))
  Using cached https://files.pythonhosted.org/packages/8c/50/e0a25150f07f1fc142f9fbf42d652230567c4289d594ead4558986c95ef9/pysnmp-4.4.4-py2.py3-none-any.whl
Collecting pycrypto==2.6.1 (from -r requirements.txt (line 5))
  Using cached https://files.pythonhosted.org/packages/60/db/645aa9af249f059cc3a368b118de33889219e0362141e75d4eaf6f80f163/pycrypto-2.6.1.tar.gz
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /data/data/com.termux/files/usr/lib/python3.6/site-packages (from requests>=2.9.1->-r requirements.txt (line 2)) (1.22)
Requirement already satisfied: certifi>=2017.4.17 in /data/data/com.termux/files/usr/lib/python3.6/site-packages (from requests>=2.9.1->-r requirements.txt (line 2)) (2018.4.16)
Requirement already satisfied: idna<2.7,>=2.5 in /data/data/com.termux/files/usr/lib/python3.6/site-packages (from requests>=2.9.1->-r requirements.txt (line 2)) (2.6)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /data/data/com.termux/files/usr/lib/python3.6/site-packages (from requests>=2.9.1->-r requirements.txt (line 2)) (3.0.4)
Collecting pyasn1>=0.1.7 (from paramiko>=1.16.0->-r requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/a0/70/2c27740f08e477499ce19eefe05dbcae6f19fdc49e9e82ce4768be0643b9/pyasn1-0.4.3-py2.py3-none-any.whl
Collecting bcrypt>=3.1.3 (from paramiko>=1.16.0->-r requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/f3/ec/bb6b384b5134fd881b91b6aa3a88ccddaad0103857760711a5ab8c799358/bcrypt-3.1.4.tar.gz
Collecting cryptography>=1.5 (from paramiko>=1.16.0->-r requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/ec/b2/faa78c1ab928d2b2c634c8b41ff1181f0abdd9adf9193211bd606ffa57e2/cryptography-2.2.2.tar.gz
Collecting pynacl>=1.0.1 (from paramiko>=1.16.0->-r requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/08/19/cf56e60efd122fa6d2228118a9b345455b13ffe16a14be81d025b03b261f/PyNaCl-1.2.1.tar.gz
    Complete output from command python setup.py egg_info:
    c/_cffi_backend.c:2:10: fatal error: 'Python.h' file not found
    #include <Python.h>
             ^~~~~~~~~~
    1 error generated.
    Traceback (most recent call last):
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/unixccompiler.py", line 118, in _compile
        extra_postargs)
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/ccompiler.py", line 909, in spawn
        spawn(cmd, dry_run=self.dry_run)
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/spawn.py", line 36, in spawn
        _spawn_posix(cmd, search_path, dry_run=dry_run)
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/spawn.py", line 159, in _spawn_posix
        % (cmd, exit_status))
    distutils.errors.DistutilsExecError: command 'aarch64-linux-android-clang' failed with exit status 1

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 172, in run
        cmd = self.call_command('install_lib', warn_dir=0)
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 158, in call_command
        self.run_command(cmdname)
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/command/install_lib.py", line 11, in run
        self.build()
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/command/install_lib.py", line 107, in build
        self.run_command('build_ext')
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 78, in run
        _build_ext.run(self)
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/command/build_ext.py", line 339, in run
        self.build_extensions()
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
        self._build_extensions_serial()
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
        self.build_extension(ext)
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 199, in build_extension
        _build_ext.build_extension(self, ext)
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension
        depends=ext.depends)
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/ccompiler.py", line 574, in compile
        self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/unixccompiler.py", line 120, in _compile
        raise CompileError(msg)
    distutils.errors.CompileError: command 'aarch64-linux-android-clang' failed with exit status 1

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/sandbox.py", line 154, in save_modules
        yield saved
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "/data/data/com.termux/files/usr/tmp/easy_install-vsu07t95/cffi-1.11.5/setup.py", line 240, in <module>
        distclass=Distribution,
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/__init__.py", line 129, in setup
        return distutils.core.setup(**attrs)
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/core.py", line 163, in setup
        raise SystemExit("error: " + str(msg))
    SystemExit: error: command 'aarch64-linux-android-clang' failed with exit status 1

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 1138, in run_setup
        run_setup(setup_script, args)
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/sandbox.py", line 253, in run_setup
        raise
      File "/data/data/com.termux/files/usr/lib/python3.6/contextlib.py", line 99, in __exit__
        self.gen.throw(type, value, traceback)
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/data/data/com.termux/files/usr/lib/python3.6/contextlib.py", line 99, in __exit__
        self.gen.throw(type, value, traceback)
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/sandbox.py", line 166, in save_modules
        saved_exc.resume()
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/sandbox.py", line 141, in resume
        six.reraise(type, exc, self._tb)
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/_vendor/six.py", line 685, in reraise
        raise value.with_traceback(tb)
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/sandbox.py", line 154, in save_modules
        yield saved
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "/data/data/com.termux/files/usr/tmp/easy_install-vsu07t95/cffi-1.11.5/setup.py", line 240, in <module>
        distclass=Distribution,
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/__init__.py", line 129, in setup
        return distutils.core.setup(**attrs)
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/core.py", line 163, in setup
        raise SystemExit("error: " + str(msg))
    SystemExit: error: command 'aarch64-linux-android-clang' failed with exit status 1

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/data/data/com.termux/files/usr/tmp/pip-install-0swzxdi9/pynacl/setup.py", line 251, in <module>
        "Programming Language :: Python :: 3.6",
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/__init__.py", line 128, in setup
        _install_setup_requires(attrs)
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/__init__.py", line 123, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/dist.py", line 513, in fetch_build_eggs
        replace_conflicting=True,
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 774, in resolve
        replace_conflicting=replace_conflicting
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1057, in best_match
        return self.obtain(req, installer)
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1069, in obtain
        return installer(requirement)
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/dist.py", line 580, in fetch_build_egg
        return cmd.easy_install(req)
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 673, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 699, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 884, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 1152, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "/data/data/com.termux/files/usr/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 1140, in run_setup
        raise DistutilsError("Setup script exited with %s" % (v.args[0],))
    distutils.errors.DistutilsError: Setup script exited with error: command 'aarch64-linux-android-clang' failed with exit status 1

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /data/data/com.termux/files/usr/tmp/pip-install-0swzxdi9/pynacl/
$

Expected Behavior

working !!

lucyoa commented 6 years ago

We do not support Python2 nor Android operating system. That being said, it seems you are missing python3-dev package:

c/_cffi_backend.c:2:10: fatal error: 'Python.h' file not found
    #include <Python.h>
             ^~~~~~~~~~
    1 error generated.
D4Vinci commented 6 years ago

I could install the requirments now after the command

pkg install libcrypt-dev python-dev

you can add that to the Readme.md file to make users able to run it on android

sane4tsu commented 6 years ago

Thank's bro D4Vinci ,now working on my android

D4Vinci commented 6 years ago

no problem bro ❤

code-ddicted commented 6 years ago

i have tried all the above steps . still returning a missing module error that 'future' is missing while whe i run "pip2 install -r requirements.txt" i see future is available. help

Predator2143 commented 6 years ago

You need to run: pip install future

Secr3ts commented 5 years ago

If you are a termux user, you'll need to install Xeffyr's OpenSSL Release. Here are the links Aarch64:

openssl_1.1.1-2_aarch64.deb.gz openssl-dev_1.1.1-2_aarch64.deb.gz openssl-tool_1.1.1-2_aarch64.deb.gz

Arm:

openssl_1.1.1-2_arm.deb.gz openssl-dev_1.1.1-2_arm.deb.gz openssl-tool_1.1.1-2_arm.deb.gz

Just unzip it with $ gunzip

and install it with $ dpkg -i

Secr3ts commented 5 years ago

Hope this can help

Secr3ts commented 5 years ago

Oops I forgot links!!!

Secr3ts commented 5 years ago

https://github.com/termux/termux-packages/issues/2847 thee you go

BrightGhostYT commented 5 years ago

It is royally pissing me off right now keeps saying can't find file for python 3 well I installed python and put me at python (3.7.0) and the version I need for what I am doing is 2.7.9 well since I have 3.7 shouldn't I ve able to run the command but it keeps saying sorry need 2.7.9

Secr3ts commented 5 years ago

run: $ Python2 rsf. py

Secr3ts commented 5 years ago

Or try setting Python2 as python in ~/. bashrc

Jarvisjeffery1 commented 2 years ago

Screenshot_20220519-224128

How can I resolve this

Jarvisjeffery1 commented 2 years ago

I'm always stock here

Romsyfda commented 6 months ago

Traceback (most recent call last): File "/storage/emulated/0/ramexfour/ramexfour.py", line 6702, in File "/storage/emulated/0/ramexfour/ramexfour.py", line 6401, in main_menu File "/storage/emulated/0/ramexfour/ramexfour.py", line 414, in ramexadder ValueError: invalid literal for int() with base Help me