bhavsec / reconspider

🔎 Most Advanced Open Source Intelligence (OSINT) Framework for scanning IP Address, Emails, Websites, Organizations.
GNU General Public License v3.0
2.09k stars 325 forks source link

Issue running setup.py #64

Open highrider0602 opened 2 years ago

highrider0602 commented 2 years ago

Describe the bug When i run the install command "python3 setup.py install" i get the following output

/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py:264: UserWarning: Unknown distribution option: 'console' warnings.warn(msg) error: Multiple top-level packages discovered in a flat-layout: ['core', 'plugins'].

To avoid accidental inclusion of unwanted files or directories, setuptools will not proceed with this build.

If you are trying to create a single distribution with multiple packages on purpose, you should not rely on automatic discovery. Instead, consider the following options:

  1. set up custom discovery (find directive with include or exclude)
  2. use a src-layout
  3. explicitly set py_modules or packages with a list of names.

To find more information, look for “package discovery” on setup tools docs. reconspidererror

To Reproduce Steps to reproduce the behavior: 1) run "python3 setup.py install" without the quotes of course 2.) see message described above

Expected behavior the install script to run without issue

Screenshots see attached image

Desktop (please complete the following information):

Additional context i apologize if this was already covered somewhere but i didn't see it, but if not then I'm hoping someone could lend some advice or suggestions my way for some help on this

ghost commented 1 year ago

Not the exact solution but following one of the comment in this answer and another issue which is similar to this, here. Downgrading the setuptools below 60 doesn't help much and adding the py_modules=[] as a keyword argument to the setup() function in setup.py, solves this error but now there is a new problem, (traceback, attribute error). Here is the pastebin.

We get the same error in the archlinux installation as well, doing a similar change in the archlinux by adding the py_modules=[] as a keyword argument to the setup() function in setup.py, solves the error but you get an error saying error: urllib3 2.0.0a2 is installed but urllib3<1.27,>=1.21.1 is required by {'requests'}, here is the pastebin for it, and installing the required version pip install urllib3==1.21.1 and removing the urllib3 from the install_requires in setup.py solves the issues and installation will be successful.

But doing the same on kali linux even though it is not necessary, it does not solve the issue.

vitfury commented 1 year ago

Same error on the latest Kali Linux. The workarounds described above do not work...

Herndl commented 1 year ago

The setuptools package shows some deprecation warning, and you should use pip and build instead of install.

I fixed the issue with first installing the required dependencies with:

pip3 install shodan requests prompt_toolkit wget beautifulsoup4 click urllib3 IP2proxy wget paramiko h8mail nmap pythonping whois gmplot pillow lxml tweepy

Next, I removed the setuptools parts from the setup.py file:

import os
import pip

fout = open("core/config.py", "w")

# Shodan.io API (https://developer.shodan.io/api)
fout.write("shodan_api = " + '"' + "e9SxSRCE1xDNS4CzyWzOQTUoE55KB9HX" + '"' + "\n")
fout.close()

fout = open("plugins/api.py", "w")

# NumVerify API (https://numverify.com/documentation)
fout.write("def phoneapis():"+ "\n")
fout.write("    api= "+ '"' + "ecf584dd7bccdf2c152fdf3f5595ba20" + '"' + "\n")

# IP Stack API (https://ipstack.com/documentation)
fout.write("    return str(api)"+ "\n")
fout.write("def ipstack():"+ "\n")
fout.write("    api="+ '"' +"406792616a740641c6a0588a0ee1c509"+ '"' + "\n")
fout.write("    return str(api)"+ "\n")

# Google Maps API (hhttps://developers.google.com/maps/documentation/places/web-service/get-api-key)
fout.write("def gmap():"+ "\n")
fout.write("    api="+ '"' +"AIzaSyBY9Rfnjo3UWHddicUrwHCHY37OoqxI478"+ '"' + "\n")
fout.write("    return str(api)"+ "\n")
fout.close()

try:
    import wget
except Exception as e:
    print(e)
    pip.main(['install','wget'])
    import wget

# ip2 Location Database (https://lite.ip2location.com/database/px8-ip-proxytype-country-region-city-isp-domain-usagetype-asn-lastseen?lang=en_US)
url="https://www.ip2location.com/download?token=hg5uYe2Jvri4R7P1j8b71Pk8dnvIU2M6A9jz2tvcVtGx8ZK2UPQgzr6Hk3cV68oH&file=PX8LITEBIN"
print('\nDownloading IP2PROXY-IP-PROXYTYPE-COUNTRY-REGION-CITY-ISP-DOMAIN-USAGETYPE-ASN-LASTSEEN.BIN...')
filepath=os.getcwd()+"/plugins/"
wget.download(url,out=filepath)
print('\nDownload Finished')

import zipfile
print('\nExtracting Files')
with zipfile.ZipFile(filepath+"IP2PROXY-LITE-PX8.BIN.ZIP","r") as zip_ref:
    zip_ref.extract("IP2PROXY-LITE-PX8.BIN",filepath)

print("\nInstallation Successfull")
print("\n\nNote: APIs included in ReconSpider are FREE and having limited & restricted usage per month, Please update the current APIs with New APIs in setup.py file, and re-install once done.")
print("\nWarning: Not updating the APIs can result in not showing the expected output or it may show errors.")

Now you can run the setup.py again to download the remaining parts: sudo python3 setup.py, and the setup should be completed.

lonewolf-jock commented 1 year ago

─# pip3 install reconspider.py ERROR: Could not find a version that satisfies the requirement reconspider.py (from versions: none)
ERROR: No matching distribution found for reconspider.py

lonewolf-jock commented 1 year ago

└─# python3 reconspider.py


_ \ / /_ || | /____ | _// _/ \/ \ / \ ___ \__ | |/ |/ _ \ | | \ /\ _( <_> ) | \ / \ |> > / // \ _/| | \/ |__| /\ >_ >__/|| / /____ / /|_ |\ >| \/ \/ \/ \/ \/|| \/ \/

Traceback (most recent call last): File "/home/lonewolf/reconspider/reconspider.py", line 38, in from core import repl_prompt File "/home/lonewolf/reconspider/core/init.py", line 1, in from .repl_prompt import File "/home/lonewolf/reconspider/core/repl_prompt.py", line 4, in from plugins.censys import censys_ip File "/home/lonewolf/reconspider/plugins/init.py", line 1, in from .censys import File "/home/lonewolf/reconspider/plugins/censys.py", line 2, in from requests import get File "/usr/lib/python3/dist-packages/requests/init.py", line 43, in import urllib3 File "/usr/local/lib/python3.10/dist-packages/urllib3/init.py", line 8, in from .connectionpool import ( File "/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py", line 29, in from .connection import ( File "/usr/local/lib/python3.10/dist-packages/urllib3/connection.py", line 39, in from .util.ssl_ import ( File "/usr/local/lib/python3.10/dist-packages/urllib3/util/init.py", line 3, in from .connection import is_connection_dropped File "/usr/local/lib/python3.10/dist-packages/urllib3/util/connection.py", line 3, in from .wait import wait_for_read File "/usr/local/lib/python3.10/dist-packages/urllib3/util/wait.py", line 1, in from .selectors import ( File "/usr/local/lib/python3.10/dist-packages/urllib3/util/selectors.py", line 14, in from collections import namedtuple, Mapping ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/init.py)

StudentZero1 commented 1 year ago

sudo python3 setup.py

pip3 seem to have a depracated nmap version and will not install it, installing it using sudo apt install nmap or pip install nmap does not resolve the issue since when running the setup again it does not see it and will give the following message : \ Searching for nmap Reading https://pypi.org/simple/nmap/ No local packages or working download links found for nmap error: Could not find suitable distribution for Requirement.parse('nmap')

GitXpresso commented 1 month ago

sudo python3 setup.py

pip3 seem to have a depracated nmap version and will not install it, installing it using sudo apt install nmap or pip install nmap does not resolve the issue since when running the setup again it does not see it and will give the following message : \ Searching for nmap Reading https://pypi.org/simple/nmap/ No local packages or working download links found for nmap error: Could not find suitable distribution for Requirement.parse('nmap')

Here's a link for your problem https://stackoverflow.com/questions/58478745/python-3-does-not-recognize-nmap-module-what-am-i-doing-wrong-here if the nmap command doesn't work