+ 3
TypeError In my code. (description)
code: import argparse, socket parser = argparse.ArgumentParser() parser.add_argument('--target', '-t', help='target') args = parser.parse_args() if args.target: udp = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) udp.send('message', (args.target, 80)) print "Packet sent" Error: File "send.py", line 8, in <module> udp.send('message', (args.target, 80)) TypeError: an integer is required
5 Antworten
+ 4
Hmm, okay. well, I don't really know python. i do notice you are using a send command, while all I found online was a sendto command
+ 2
well what is args.target? This is what I found online: sendto(MESSAGE, (UDP_IP, UDP_PORT))
+ 1
args.target is the target defined via command line arguements.
its supoosed to work like this:
root@kali:~# python2 send.py -t IP
+ 1
Ooh i am so stupidd i forgot haha i will try if that works
+ 1
Yep that was the problem....
I got used to using the send command because i was using tcp a lot in the past and with tcp you need the send command