Coder Social home page Coder Social logo

Comments (6)

azazelm3dj3d avatar azazelm3dj3d commented on May 14, 2024 2

Hi, @ZeroDot1!

When importing the iocextract module, you don't need to specify the main method. The main() method is reserved for using the project as a command line interface (CLI) and is already configured without the need to import.

If you're trying to use the CLI, all you need to do is install the package from pip(x) and run the project directly from the terminal, like so:

iocextract -h

You do not need to write your own script to use the module. If you cannot locate your installation, your PATH may need to be configured for pip(x) installations.

I also noticed you installed the module using sudo. This means your script (or if you're using it as a CLI) may not be able to find the module since it's not installed for your local user.

I use a flavor of Arch Linux as one of my primary host systems and I've had no issues running this module in the past, so I don't think that would be the issue. It's most likely a local misconfiguration or permissions issue from using escalated privileges to install the module.

If you're still experiencing issues, feel free to let me know. Based on the information provided, I believe you may just need to update how you're using the module locally.

I would also recommend checking out the iocextract documentation here: https://inquest.readthedocs.io/projects/iocextract/en/latest/

If you would like to use it as a library, all you have to do is import the module. Here's an example:

import iocextract

def extract_content():
    content = \
    """
    Check out hxxps://inquest[.]net
    """

    for i in iocextract.extract_iocs(content):
        print(i)

if __name__ == '__main__':
    extract_content()

from iocextract.

ZeroDot1 avatar ZeroDot1 commented on May 14, 2024 1

Hi @azazelm3dj3d,

OK, I have just solved the problem, if there are leftover files from an on iocextract old installation in the system that are not deleted during the uninstallation, this error occurs.

Solution

sudo rm -rf /usr/bin/iocextract
$ pipx install iocextract --force

from iocextract.

ZeroDot1 avatar ZeroDot1 commented on May 14, 2024

Bildschirmfoto vom 2023-06-16 09-49-52

from iocextract.

ZeroDot1 avatar ZeroDot1 commented on May 14, 2024

Hi @azazelm3dj3d,

Thank you for your answer.
I try to use it as a CLI, but no matter what I try it doesn't work.

$ pipx install iocextract --force
⚠️  Note: iocextract was already on your PATH at /usr/bin/iocextract
  installed package iocextract 1.15.2, installed using Python 3.11.3
  These apps are now globally available
    - iocextract
done! ✨ 🌟 ✨
$ /usr/bin/iocextract -h
Traceback (most recent call last):
  File "/usr/bin/iocextract", line 5, in <module>
    from iocextract import main
ModuleNotFoundError: No module named 'iocextract'

from iocextract.

ZeroDot1 avatar ZeroDot1 commented on May 14, 2024
$ /usr/bin/iocextract --input 's.txt' --output '1.txt' --extract-ipv6s
Traceback (most recent call last):
  File "/usr/bin/iocextract", line 5, in <module>
    from iocextract import main
ModuleNotFoundError: No module named 'iocextract'

from iocextract.

ZeroDot1 avatar ZeroDot1 commented on May 14, 2024

Hi @inquestlabs From now on I use your opensource project for my opensource project, very good work, thank you.

#CoinBlockerLists Homepage: https://zerodot1.gitlab.io/CoinBlockerListsWeb/

from iocextract.

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.