Comments (6)
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.
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.
from iocextract.
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.
$ /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.
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)
- Fails to parse this url correctly HOT 3
- Failed to extract the URLs from this tweet HOT 6
- base64 strings HOT 2
- Binary Extraction HOT 1
- Extracting URLs that have been base64 encoded HOT 2
- 'https' scheme values defanged as HXXPS are refanged as 'http' HOT 3
- PyPi License Mismatch HOT 1
- catastrophic backtracking in BACKSLASH_URL_RE HOT 2
- extract_unencoded_url is too greedy when parsing Windows command lines HOT 4
- Improve documentation
- Improve extraction for non-defanged URLs HOT 6
- Review documentation HOT 1
- URL is not extracted correctly HOT 1
- module 'iocextract' has no attribute 'refang_url' HOT 2
- Add the function --extract-domains and --extract-subdomains HOT 2
- BUG: --extract-ipv4s does not work HOT 3
- Add a function to import directly from a server and extract IOCs. HOT 2
- how do I add a ioc_type label with the output? HOT 1
- Found IPs being parsed as URLs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iocextract.