• B правой части каждого сообщения есть стрелки и . Не стесняйтесь оценивать ответы. Чтобы автору вопроса закрыть свой тикет, надо выбрать лучший ответ. Просто нажмите значок в правой части сообщения.

Ошибка запуска dnschef. Vds Ubuntu 16

  • Автор темы Автор темы Zhacer
  • Дата начала Дата начала
  • Теги Теги
    dnschef

Zhacer

New member
11.05.2019
4
0
Vds Ubuntu 16.
Собственно говоря вот код ошибки:
Код:
root@vm632247:~/dnschef#  python dnschef.py

  File "dnschef.py", line 96

    log.error(f"{self.client_address[0]}: ERROR: invalid DNS request")

     SyntaxError: invalid syntax

Версия python
Код:
root@vm632247:~/dnschef# python -V

Python 2.7.12

root@vm632247:~/dnschef# python3 -V

Python 3.5.2
Прошу кто в теме помочь.
 
Последнее редактирование:
Решение
Before you can start using DNSChef, you must configure your machine to use a DNS nameserver with the tool running on it. You have several options based on the operating system you are going to use:

* **Linux** - Edit */etc/resolv.conf* to include a line on the very top with your traffic analysis host (e.g add "nameserver 127.0.0.1" if you are running locally). Alternatively, you can add a DNS server address using tools such as Network Manager. Inside the Network Manager open IPv4 Settings, select *Automatic (DHCP) addresses only* or *Manual* from the *Method* drop down box and edit *DNS Servers* text box to include an IP address with DNSChef running.

Добавь в самое начало /etc/resolv.conf строку nameserver 127.0.0.1

Либо попробуй...
Ну так ты запускаешь скрипт для python версии 3, системным Python версии 2.
Запускай третьим
python3 dnschef.py
 
Ну так ты запускаешь скрипт для python версии 3, системным Python версии 2.
Запускай третьим
python3 dnschef.py
Тоже самое
Код:
root@vm632247:~/dnschef# python3 dnschef.py
  File "dnschef.py", line 96
    log.error(f"{self.client_address[0]}: ERROR: invalid DNS request")
                                                                    ^
SyntaxError: invalid syntax
 
Before you can start using DNSChef, you must configure your machine to use a DNS nameserver with the tool running on it. You have several options based on the operating system you are going to use:

* **Linux** - Edit */etc/resolv.conf* to include a line on the very top with your traffic analysis host (e.g add "nameserver 127.0.0.1" if you are running locally). Alternatively, you can add a DNS server address using tools such as Network Manager. Inside the Network Manager open IPv4 Settings, select *Automatic (DHCP) addresses only* or *Manual* from the *Method* drop down box and edit *DNS Servers* text box to include an IP address with DNSChef running.

Добавь в самое начало /etc/resolv.conf строку nameserver 127.0.0.1

Либо попробуй запускать с гита
Python:
git clone https://github.com/iphelix/dnschef
cd dnschef/
pip install requirements.txt или pip3 install requirements.txt
pip install dnslib или pip3 install dnslib
./dnschef.py

И если не знаешь, для чего тебе нужен Python2, добавь alias в самый конец ~/.bashrc Большинство программ сейчас пишется исключительно для 3-ей версии
gedit ~/.bashrc alias python="python3"
 
Последнее редактирование:
Решение
Before you can start using DNSChef, you must configure your machine to use a DNS nameserver with the tool running on it. You have several options based on the operating system you are going to use:

* **Linux** - Edit */etc/resolv.conf* to include a line on the very top with your traffic analysis host (e.g add "nameserver 127.0.0.1" if you are running locally). Alternatively, you can add a DNS server address using tools such as Network Manager. Inside the Network Manager open IPv4 Settings, select *Automatic (DHCP) addresses only* or *Manual* from the *Method* drop down box and edit *DNS Servers* text box to include an IP address with DNSChef running.

Добавь в самое начало /etc/resolv.conf строку nameserver 127.0.0.1

Либо попробуй запускать с гита
Python:
git clone https://github.com/iphelix/dnschef
cd dnschef/
pip install requirements.txt или pip3 install requirements.txt
pip install dnslib или pip3 install dnslib
./dnschef.py

И если не знаешь, для чего тебе нужен Python2, добавь alias в самый конец ~/.bashrc Большинство программ сейчас пишется исключительно для 3-ей версии
gedit ~/.bashrc alias python="python3"
Странно теперь говорит что dnslib нету. Хотя как я понимаю он есть
Код:
root@vm632247:~/dnschef# pip install requirements.txt
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting requirements.txt
  ERROR: Could not find a version that satisfies the requirement requirements.txt (from versions: none)
ERROR: No matching distribution found for requirements.txt

root@vm632247:~/dnschef# pip install dnslib
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Requirement already satisfied: dnslib in /usr/local/lib/python2.7/dist-packages (0.9.10)

root@vm632247:~/dnschef# ./dnschef.py
Traceback (most recent call last):
  File "./dnschef.py", line 40, in <module>
    from dnslib import *
ModuleNotFoundError: No module named 'dnslib'
root@vm632247:~/dnschef#

Ответ @f22 помог устаранить проблему.
 
РЕШЕНИЕ
ВВОДИМ ПО ПОРЯДКУ
sudo apt install python3-dnslib
python3 dnschef.py

Vds Ubuntu 16.
Собственно говоря вот код ошибки:
Код:
root@vm632247:~/dnschef#  python dnschef.py

  File "dnschef.py", line 96

    log.error(f"{self.client_address[0]}: ERROR: invalid DNS request")

     SyntaxError: invalid syntax

Версия python
Код:
root@vm632247:~/dnschef# python -V

Python 2.7.12

root@vm632247:~/dnschef# python3 -V

Python 3.5.2
Прошу кто в теме помочь.
РЕШЕНИЕ
ВВОДИМ ПО ПОРЯДКУ
sudo apt install python3-dnslib
python3 dnschef.py
 

Вложения

  • Снимок экрана от 2020-12-27 19-16-05.png
    Снимок экрана от 2020-12-27 19-16-05.png
    67,9 КБ · Просмотры: 209
  • Снимок экрана от 2020-12-27 19-17-30.png
    Снимок экрана от 2020-12-27 19-17-30.png
    70,4 КБ · Просмотры: 205
  • Снимок экрана от 2020-12-27 19-17-56.png
    Снимок экрана от 2020-12-27 19-17-56.png
    70,3 КБ · Просмотры: 216
Мы в соцсетях:

Обучение наступательной кибербезопасности в игровой форме. Начать игру!