Python IRC bot will not join

I get an error

: irc.evilzone.org NOTICE AUTH: * Search for your hostname ...

: irc.evilzone.org NOTICE AUTH: * Your hostname was found (cached)

PING: 7091A8FB

: irc.evilzone.org 451 JOIN: You have not registered

: irc.evilzone.org 451 PRIVMSG: You are not registered

server = "irc.evilzone.org" # Server 
port = 6667 #port connect through IRC standard is :(6667 or 9999)
irc = socket.socket ( socket.AF_INET, socket.SOCK_STREAM )
irc.connect ( ( server, port ) )
print irc.recv ( 4096 )
nick = 'Piebot' #bots name
chan = 'test' #channel
version= "1.0" #current version
irc.send ( 'NICK Pizebot\r\n' ) 
irc.send ( 'USER Pizebot Pibot Pibot :Python IRC\r\n' )
irc.send ( 'JOIN #test\r\n' ) # YOU MUST CHANGE THE CHANNEL HERE AND BELOW!!
irc.send ( 'PRIVMSG #test :Hello World.\r\n' )

while True:
    readbuffer= irc.recv(4096)

    temp=string.split(readbuffer, "\n")
    Check = readbuffer.split(':')
    print readbuffer

Keeping in mind that some of the commands I use need a piece of code temp = string.split (readbuffer, "\ n"). But with code like this

network = 'irc.evilzone.org'
port = 6667
irc = socket.socket ( socket.AF_INET, socket.SOCK_STREAM )
irc.connect ( ( network, port ) )
print irc.recv ( 4096 )
irc.send ( 'NICK ipbot\r\n' )
irc.send ( 'USER ipbot completely real :Jxxx\r\n' )
irc.send ( 'JOIN #test\r\n' )
irc.send ( 'PRIVMSG #test:Oh Hai.\r\n' )
while True:
   data = irc.recv ( 4096 )

I can successfully connect to the channel, etc. Any idea?

+3
source share
5 answers

I see two possible reasons:

  • . , , ( JOIN). , ( NICK MODE - , , JOIN).
  • , , - , IRC-, PING. PING. PONG ( , PING). .
+6

, PING, , PING (, ). , NICK, PING, USER, PING , USER .

, NICK, USER.

PING :7091A8FB\r\n

PING, :

PONG :7091A8FB\r\n

: '\r\n , PONG, .

+5

"USER..." "JOIN...". , Bash. :

#!/bin/bash
(
echo NICK bashscript
echo USER bashscript 8 \* : Centreon Notifier
sleep 2
# echo 'JOIN #netops'
echo 'PRIVMSG #netops' $1
echo QUIT
) | nc 127.0.0.1 6667
+3

, , . telnet , :

NICK aaron
USER aaron ignored ignored :Aaron
PONG <number>

( "NICK" "PING" ; , "" .)

, MOTD . "JOIN # test-channel" , . , , , IRC.

 sec@irc:~/simple-irc-bot$ telnet 192.168.1.100 6667
 Trying 192.168.1.100...
 Connected to 192.168.1.100.
 Escape character is '^]'.
 NOTICE AUTH :*** Looking up your hostname
 NOTICE AUTH :*** Checking Ident
 NOTICE AUTH :*** Couldn't look up your hostname
 NICK TENOTICE AUTH :*** No ident response
 NICK testtest002
 PING :2153560274
 :loal.irc-server.com 461 TNICK USER :Not enough parameters
 USER test test 0 :sec
 PONG :2153560274
 :loal.irc-server.com 001 TNICK :Welcome IRC Network,
 :loal.irc-server.com 002 TNICK :Your host is loal.irc-server.com, running version u2.10.12.14

PONG: 2153560274 USER.

0

PING: 7091A8FB

, IRC.

() IRC NICK/USER, PING, , - DoS, IRC- .

:

PONG :7091A8FB

, PING. PING- , , , , ( ping)

, , ( , 001), JOIN/PRIVMSG/other.

0

Source: https://habr.com/ru/post/1733591/


All Articles