Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kali 2018 issue #2

Open
5l1v3r1 opened this issue Apr 27, 2018 · 5 comments
Open

Kali 2018 issue #2

5l1v3r1 opened this issue Apr 27, 2018 · 5 comments

Comments

@5l1v3r1
Copy link

5l1v3r1 commented Apr 27, 2018

Hello i am having a problem like this:

Traceback (most recent call last):
File "rta.py", line 20, in
from recon.scraper import scraper
File "/root/RTA/recon/scraper/scraper.py", line 7, in
from twitter import OAuth
ImportError: cannot import name OAuth

@a0xnirudh
Copy link
Collaborator

The problem seems to exist because you haven't installed python twitter module. Can you try re-running python install.py and see if the installation is completing without any errors ?

You can also try to install twitter module manually: pip install twitter

@sealsec
Copy link

sealsec commented May 6, 2018

Running:
Linux kali 4.15.0-kali3-amd64 #1 SMP Debian 4.15.17-1kali1 (2018-04-25) x86_64 GNU/Linux

root@kali:~/RTA# python rta.py --url "security.com" -v -s -n

Getting the following:

Traceback (most recent call last):
File "rta.py", line 427, in
main()
File "rta.py", line 414, in main
scan.wp_scan(args.url)
File "rta.py", line 372, in wp_scan
dataid = collection.insert(data)
UnboundLocalError: local variable 'data' referenced before assignment

Doesn't handle an empty list well so:

At line 313 added data[]

Then at line 362 added:

if data is None:
continue
elif not data and isinstance(data, list):
continue
elif not isinstance(data, list):
continue

Ran it again:

Traceback (most recent call last):
File "rta.py", line 427, in
main()
File "rta.py", line 414, in main
scan.wp_scan(args.url)
File "rta.py", line 372, in wp_scan
dataid = collection.insert(data)
File "/usr/lib/python2.7/dist-packages/pymongo/collection.py", line 2941, in insert
check_keys, manipulate, write_concern)
File "/usr/lib/python2.7/dist-packages/pymongo/collection.py", line 633, in _insert
blk.execute(concern, session=session)
File "/usr/lib/python2.7/dist-packages/pymongo/bulk.py", line 414, in execute
raise InvalidOperation('No operations to execute')
pymongo.errors.InvalidOperation: No operations to execute

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:8834 0.0.0.0:* LISTEN 4140/nessusd
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 5052/mongod
tcp6 0 0 :::8834 :::* LISTEN 4140/nessusd

MongoDB is up, so whats the problem...

@a0xnirudh
Copy link
Collaborator

pymongo.errors.InvalidOperation: No operations to execute probably means the data variable you are trying to push into DB is empty so there is no operation to execute. You can try commenting out the insertion operation dataid = collection.insert(data) and run again.

@DragonTriesAgain
Copy link

python rta.py --url "security.com" -v -s -n

          ____          _   _____                         _                              _ 
         |  _ \ ___  __| | |_   _|__  __ _ _ __ ___      / \   _ __ ___  ___ _ __   __ _| |
         | |_) / _ \/ _` |   | |/ _ \/ _` | '_ ` _ \    / _ \ | '__/ __|/ _ \ '_ \ / _` | |
         |  _ <  __/ (_| |   | |  __/ (_| | | | | | |  / ___ \| |  \__ \  __/ | | | (_| | |
         |_| \_\___|\__,_|   |_|\___|\__,_|_| |_| |_| /_/   \_\_|  |___/\___|_| |_|\__,_|_|

Traceback (most recent call last):
File "rta.py", line 416, in
main()
File "rta.py", line 389, in main
recon = Recon()
File "rta.py", line 55, in init
self.scraper = scraper.Scraper()
File "/root/Desktop/RTA-master/recon/scraper/scraper.py", line 37, in init
self.collection.create_index([("url", DESCENDING), ("hostname", ASCENDING)], unique=True)
File "/usr/lib/python2.7/dist-packages/pymongo/collection.py", line 1754, in create_index
self.__create_index(keys, kwargs, session, **cmd_options)
File "/usr/lib/python2.7/dist-packages/pymongo/collection.py", line 1642, in __create_index
with self._socket_for_writes() as sock_info:
File "/usr/lib/python2.7/dist-packages/pymongo/collection.py", line 194, in _socket_for_writes
return self.__database.client._socket_for_writes()
File "/usr/lib/python2.7/dist-packages/pymongo/mongo_client.py", line 968, in _socket_for_writes
server = self._get_topology().select_server(writable_server_selector)
File "/usr/lib/python2.7/dist-packages/pymongo/topology.py", line 224, in select_server
address))
File "/usr/lib/python2.7/dist-packages/pymongo/topology.py", line 183, in select_servers
selector, server_timeout, address)
File "/usr/lib/python2.7/dist-packages/pymongo/topology.py", line 199, in _select_servers_loop
self._error_message(selector))
pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused

Do you know how to solve this?

@SeriyVol4ishe
Copy link

python rta.py --url "security.com" -v -s -n

          ____          _   _____                         _                              _ 
         |  _ \ ___  __| | |_   _|__  __ _ _ __ ___      / \   _ __ ___  ___ _ __   __ _| |
         | |_) / _ \/ _` |   | |/ _ \/ _` | '_ ` _ \    / _ \ | '__/ __|/ _ \ '_ \ / _` | |
         |  _ <  __/ (_| |   | |  __/ (_| | | | | | |  / ___ \| |  \__ \  __/ | | | (_| | |
         |_| \_\___|\__,_|   |_|\___|\__,_|_| |_| |_| /_/   \_\_|  |___/\___|_| |_|\__,_|_|

Traceback (most recent call last):
File "rta.py", line 416, in
main()
File "rta.py", line 389, in main
recon = Recon()
File "rta.py", line 55, in init
self.scraper = scraper.Scraper()
File "/root/Desktop/RTA-master/recon/scraper/scraper.py", line 37, in init
self.collection.create_index([("url", DESCENDING), ("hostname", ASCENDING)], unique=True)
File "/usr/lib/python2.7/dist-packages/pymongo/collection.py", line 1754, in create_index
self.__create_index(keys, kwargs, session, **cmd_options)
File "/usr/lib/python2.7/dist-packages/pymongo/collection.py", line 1642, in __create_index
with self._socket_for_writes() as sock_info:
File "/usr/lib/python2.7/dist-packages/pymongo/collection.py", line 194, in _socket_for_writes
return self.__database.client._socket_for_writes()
File "/usr/lib/python2.7/dist-packages/pymongo/mongo_client.py", line 968, in _socket_for_writes
server = self._get_topology().select_server(writable_server_selector)
File "/usr/lib/python2.7/dist-packages/pymongo/topology.py", line 224, in select_server
address))
File "/usr/lib/python2.7/dist-packages/pymongo/topology.py", line 183, in select_servers
selector, server_timeout, address)
File "/usr/lib/python2.7/dist-packages/pymongo/topology.py", line 199, in _select_servers_loop
self._error_message(selector))
pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused

Do you know how to solve this?

You need to run mongodb firts. I use docker to run rta, so its my few steps to run it successfully:

 FROM python:2.7-slim-stretch

ENV PYTHONUNBUFFERED=1

WORKDIR /wd

# Install mongodb
RUN apt-get update && apt-get install -y gnupg2 && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4 \
    && echo "deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/4.0 main" >> /etc/apt/sources.list.d/mongodb-org-4.0.list \
    && apt-get update \
    && apt-get install -y mongodb \
    && apt-get autoremove \
    && apt-get clean

After installation run service mongodb start in terminal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants