Use sockets to attempt to join an IRC channel and talk with a bot
- Press the Clone or download button in the top right
- Copy the URL (link)
- Open the command line and change directory to where you wish to clone to
- Type 'git clone' followed by URL in step 2
$ git clone https://github.com/[user-name]/[repository]
More information can be found at https://help.github.com/en/articles/cloning-a-repository
- Press the Clone or download button in the top right
- Click open in desktop
- Choose the path for where you want and click Clone
More information can be found at https://help.github.com/en/desktop/contributing-to-projects/cloning-a-repository-from-github-to-github-desktop
- Download this GitHub repository
- Extract the zip archive
- Copy/ move to the desired location
This program has been written for Python 3 and has been tested with Python version 3.7.0 https://www.python.org/downloads/release/python-370/ on a Windows 10 PC.
To install Python, go to https://www.python.org/ and download the latest version.
- Open the .py file in IDLE
- Run by pressing F5 or by selecting Run> Run Module
- Read configuration data from a json file ('data.json'). In the form:
{
"host_url": "irc.hostname.org",
"protocol": "IRC",
"port": 6667,
"irc_channel": "#channel",
"bot_name": "bot_name",
"user_name": "user_name",
"user_password": "user_password"
}
- Gets a message in its raw from
getRawMessage()
- Takes a raw message and refines it (name, message)
getRefinedMessage(messageData)
- Starts an IRC connection, signs in and goes to the desired channel
- Ignore the welcome messages
You can add code to talk to the target bot deal with any responses and deal with them appropriately. For instance you may want to implement a 'chatbot' or answer challenge questions (in the case of root-me)
Send a private message to our target bot
irc.send(bytes("PRIVMSG "+ bot_name +" :"+ "my message here" +"\n", "UTF-8"))
Get a message from the bot
messageData = getRawMessage()
if (DEBUG):
print(messageData)
name, message = getRefinedMessage(messageData)
print(name, message)
MIT License Copyright (c) fredhappyface (See the LICENSE for more information.)