NegativeKarma.net Funny T Shirts Inc.

How to serve up files using IRC

Posted on March 18th, 2005 by fizzle in How To's

Sirius Satellite Radio Inc.

Well it is finally here, the “How to serve files using IRC” tutorial. This one is slightly more complex than the downloading with IRC tutorial, found here, but I will do my best to explain everything the best that I possibly can, to make it easy, once again, for the stupidest moron of a computer user to begin serving their own files! So lets get started.

First off, we must download the program that we will be using, and which I highly reccomend for file serving. It is called “Iroffer”, and is available free and open source to almost every single Operating system known to man, including windows. So to get that you need to venture on over here and download the windows binary for the latest version. If you are using linux or some other platform, I highly suggest you rethink what you’re doing running linux and reading this tutorial. Anywho, we will need to unzip that file into any directory as long as it does NOT have spaces. So: “c:iroffer” GOOD! :: “c:my stuffiroffer” NOT GOOD! Anyway, for the sake of this tutorial we will just assume you unzipped it to c:iroffer, so if you didn’t, just replace that with wherever you unzipped it to.

Now a lot of time (with winrar) it will want to create its own folder. So if you unzip it to c:iroffer, the actual files will be located in c:irofferiroffer1.3.b07 (the last part being the version number and will probably be different from what yours says). So just move all those files in iroffer1.3.b07 over to c:iroffer, then delete the iroffer1.3.b07. This is not necessary, but unless you enjoy typing out that extra folder name, Its suggested. OK! So you’ve got everything unzipped. Theres really only 2 files that you need to be concerned with, the first is iroffer.exe, the executable that runs the program, and then sample.config. The rest of the stuff you more than likely will never use, but KEEP IT ALL THERE! Anyway, here’s the deal. Iroffer is not a GUI (graphical user interface, eg: windows and buttons and cute little pictures and shit). It is run on a command line interface. That means you have to use MS-DOS to run it. So, what we’re first going to do is generate an administrator password, the password that you will use when adding packs, removing packs, telling the bot to send the file, etc etc (which you will do via IRC, on your own IRC program. Two seperate programs here, IRC, and iroffer. IRC is what YOU use, iroffer sits in the background where you cant see it, and when your bot is online (via iroffer), you get on IRC and /msg the bot and give it commands. This of course will all be explained in greater detail later.

OK. So lets get that admin password shall we? Iroffer uses encryption for the admin password, so you will need to open a command prompt (by going to Start menu > run > type “cmd” with no quotes). When the command prompt comes up, you will need to type the following exactly as it is (replacing the name of your iroffer directory if it is not the same): cd c:iroffer (and then hit enter).

So now you’re in the iroffer directory, and you will type: iroffer -c
That brings up a screen that says
iroffer v1.3.b10 [20050116225654] by PMG

Configuration File Password Generator

This will take a password of your choosing and encrypt it.
You should place the output this program generates in your config file.
You can then use your password you enter here over irc.

Your password must be between 5 and 8 characters
Please Enter Your Password: _

So you enter your password, and hit enter, and then enter it again, and hit enter again, and it generates you an encrypted password.

To use “password” as your password use the following in your config file:
adminpass InHUGkGdkifVo

Please dont be a moron and use “password” as your password. Ok, so once you have that encrypted password, SAVE IT SOMEWHERE. put it in a .txt file or something, or just keep that command prompt window open, because you will need it in just a moment.

Now here’s where things get kind of…well, not that complicated, as long as you follow these instructions explicitly you will be OK. If you dont and you fuck up, start all over again. Now we have to edit a big huge ass confusing file. Theres a WHOLE lot of things in this file, a lot of which we will not be concerned with and can just leave default. The file is commented with pretty good instructions on how to use it, what to edit, and what to edit it with. But I’m writing this tutorial so I’m gonna cover EVERYTHING from start to finish! So here we go, open up c:iroffersample.config with WORDPAD. Do NOT use notepad, notepad fucks everything up and makes it hard to read and all jumbled and shit. So fuck notepad, for once, USE WORDPAD. Ok, so heres how its gonna go down:

Do NOT Edit anything unless I tell you to, or unless you know EXACTLY what it’s going to do. I always encourage people to play with settings and stuff, but this is an exception. This program is very easy to break if you dont know what you’re doing. So get everything set up and working correctly, save a backup of it, and THEN play with stuff. I am not going to put in here every single line in the file, only the ones necessary for you to edit to get it working. So If you see “edit this line” in here, but dont immediately see that line in the file, just scroll down as it may be a ways down there. Anyway, lets get to editing!

##############################################################################
### - server information - ###
### List server/ports in the form “server irc.domain.com 6667″. Port is ###
### optional (default 6667) ###
### Multiple servers can be specified ###
server irc.efnet.net

Edit this line (just the last line, the one with no #’s) to the correct server you want the bot to connect to, such as irc.anope.org ;).

##############################################################################
### - channels (upto 50) - ###
### channel format: ###
### “channel [-plist ] [-plistoffset ] ###
### [-pformat ] [-key ] ” ###
### plist: time is number of minutes between plists. ###
### plistoffset: time is number of minutes to offset list ###
### pformat: full is normal and default if pformat is not used ###
### minimal is similar to full but removes some lines ###
### summary displays only a 2 line summary ###
### key: for +k channels, the key specified is used when joining ###
### using same or multiples of the same number plist time is recomended ###
#channel #chan01
#channel #chan02 -plist 14
#channel #chan03 -plist 28 -pformat minimal
#channel #chan04 -plist 14 -pformat summary -key thekey

This can be a bit confusing, so I’ll just tell you what I personally have it set to, and I like it just fine. Take the # sign off from the start of the line “channel #chan02 -plist14″. That is called “un-commenting”, which means the program is now going to look at that line for instructions. When there is a # sign, the program skips over that line as if it werent there. Ok, so edit #chan02 to the channel you are going to have your bot serving in. Such as #RiAA ;), and if you want to you can edit “14″, which is the number of minutes between sending an advertisement to the channel with all of your packets and stuff. 14 Is fine I would say.

##############################################################################
### - user information - ###
user_nick mybotDCC
user_realname My Bot
user_modes +i

edit “mybotDCC” to whatever you want your bots nick to be. Such as RiAA|PiMPBOT001 ;). You can edit “My Bot”, but normally windows takes over and it becomes whatever your computer name is, so editing that is kinda pointless.

##############################################################################
### - incoming TCP connections - ###
### If you are behind a firewall that you control and want to have iroffer ##
### use a specified range for tcp ports for incoming connections set ###
### tcpstartrange to the first port used (ports will be used from that ###
### number upwards as needed (usually 1 per transfer attempt). ###
### If undefined, incoming tcp ports are automatically choosen by the OS. ###
#tcprangestart 4000

THIS IS ONLY NECESSARY TO EDIT IF YOU HAVE A FIREWALL OR ROUTER!!!!!!!!! IT IS ABSOLUTELY NECESSARY IF THAT IS THE CASE, AND IROFFER WILL NOT WORK WITHOUT EDITING THIS, IF YOU HAVE A FIREWALL OR ROUTER!!!
If that IS the case, you will need to set up port forwarding using your firewall or router software. I will not offer help in this area, you will need to Read The F-ing Manual for your firewall or router, but when you DO find out how to set up port forwarding, set it up for ports 4000-4100, and then UNCOMMENT this line (remove the # from the line “tcprangestart 4000″.
I hope I explained that well enough. Routers fucking suck, and if you can’t figure out how to set up port forwarding for your router, you will be unable to use iroffer. Sorry guy. Otherwise, if you have no firewall or router, just skip this whole step.

##############################################################################
### - manual dcc ip translation - ###
### if you are behind a NAT (Network Address Translation) device which ###
### _does_ _not_ intercept and translate dcc commands but _does_ do port ###
### forwarding place the ip address of the NAT below if unsure, leave ###
### commented ###
### NOTE: You must use the IP address in x.x.x.x format not a DNS name. ###
#usenatip 123.456.789.123

AGAIN, IF YOU HAVE A FIREWALL OR ROUTER, YOU WILL NEED TO EDIT THIS LINE, IF YOU DO NOT HAVE A FIREWALL OR ROUTER, LEAVE IT ALONE!!
Ok, for you router lovers, what you must do here is first uncomment the “usenatip” line, then for the IP Address you will need to enter your PUBLIC IP address. Not the one your router gives you. Usually a NON-PUBLIC IP address starts with “192.168.x.x”, so if you see that, you know that that is NOT your public IP address. To find your IP address, you can go to Start menu > run > type “cmd” with no quotes, and in the command prompt type “ipconfig” with no quotes. Or you can /whois yourself on IRC. or you can use google. Theres plenty of ways to get your IP address. Find one, and find your PUBLIC IP address, and enter it here. Again, it is NOT a public IP address if it starts with 192.168, and you will need to use some method of getting your public IP address. Got it? God I hope so. Again, leave this alone if you do not have a firewall or router.

##############################################################################
### - maximum xdcc slots - ###

slotsmax 20

This line is for how many slots you will have available at one time (how many people can get stuff from your bot, at any given time.) 20 is quite a lot, I suggest no more than 2 or 3 on a regular cable connection, or more if you have a better than cable connection. Remember, its not how MANY people download from you, its how QUICKLY they download from you. More people=slower speeds for them. This isnt rocket science folks.

##############################################################################
### - Queue Information - ###
### Main Queue Size, set to 0 for no queue ###

queuesize 10

This is the size of your queue. It means you can have, in this case, up to 10 people waiting in queue at any given time. Raise it or lower it or put it to 0 I really dont care.

##############################################################################
### - max transfers per person - ###
### maximum transfers per person at a time ###
maxtransfersperperson 1

This is, obviously, how many downloads a single person can have at one time. I would keep it at 1.

##############################################################################
### - max queued items per person - ###
### maximum number of times a user can be in a queue simultaneously ###
maxqueueditemsperperson 2

This is how many items a single person can have in queue at the same time. I would keep it at 2

##############################################################################
### - add/chfile command helper directory - ###
### optional directory where iroffer will look after trying normal ###
### relative/absolute paths when using the add or chfile admin command. ###
### Add/chfile will first try to open the file using just the argument you ###
### provide to the command, and if that fails it will try again with ###
### filedir added to the front of the argument. ###
#filedir /home/me/files

You do not NEED to edit this, although I highly reccomend it. Basically what you can do here is save some time. I reccomend you put all the stuff you are going to offer for downloading into ONE single folder, and then set that folder here. It makes it a lot easier to send the bot the command to add that file, if you have it all in one place, and that place is set here. For example, adding a file to the bot WITHOUT this set goes like this: /msg yourbotname admin botpassword add c:mystufffordownloadfilesfilename.zip
But if you have this option set, you simply have to type: /msg yourbotname admin botpassword add filename.zip
Assuming the filename.zip is in the folder where you set up above, it will add it just the same as doing the first command. Its a time saver really. So if all your files are located in: c:my-files (again, dont use spaces in foldernames, it tends to break stuff), then the line above would be: filedir c:my files
Dont forget to uncomment it if youre going to edit it, and do not uncomment it if you’re not going to edit it.

##############################################################################
### - authorized download hosts - ###
### Specify who can download from this bot. Use *!*@* to allow anyone. ###
### Multiple hostmasks can be specified ###
### wild cards are: ###
### * = 0 or more characters, ? = 1 character, # = any positive integer ###
downloadhost *!*@*
#downloadhost *!~me@*.domain.com
#downloadhost *!me@192.168.10.#

This just specifies who is allowed to download stuff. Leave it alone to let everyone download from it.

##############################################################################
### - remote admin info - ###
### Remote commands can only be issued by a nick with a matching hostmask ###
### and knows the adminpass Remote commands are issued by dcc chat or by ###
### /msg nickDCC admin ‘adminpass’ ‘command’ adminhost’s are full ###
### hostmasks: nick!user@host don’t forget a “~” if you don’t use identd ###
### wild cards are: ###
### * = 0 or more characters, ? = 1 character, # = any positive integer ###
### For security, your adminpass must be stored in the config file ###
### encrypted. To generate an encrypted password run iroffer with the ###
### “-c” flag and follow the instructions. ###
adminpass add_your_encrypted_password_here
adminhost *!~me@*.domain.com
adminhost *!me@192.168.10.#

This is it! Almost done! Here we have the admin info. First, put your encrypted password where it says “add_your_encrypted_password_here”. Simple enough. If you lost it, open up a command prompt again and type: cd c:iroffer (hit enter, then type:) iroffer -c (then put your password in twice, then put the ENCRYPTED password here). OK!? Alright, next line. This is the admin host. If you and only you are going to administer this bot, set this to your host. You will need to /whois yourself on IRC, and find out what your host is, for example, if it says: Steven [Gerald@c210-49-108-214.frank1.vic.optusnet.com.au] (or something like that) when you whois yourself, the line for “adminhost” would go as follows: adminhost *!*@*.optusnet.com.au (and thats it!). It’s easiest to use only the last 2 parts of your host for this, as sometimes the first parts can change. So if you have comcast, it would be: adminhost *!*@*.comcast.net OK? awesome. If you plan on letting someone else admin the bot, or if you want to admin it from your friends house or some random shit, you will need to edit the second adminhost line with THEIR host, as well as yours above it. Sounds easy enough, no?

##############################################################################

### - upload directory - ###
### If you want iroffer to accept DCC transfers (upload) define one or ###
### more uploadhosts and define an uploaddir where files should be saved. ###
### uploadmaxsize if the maximum size in MB of any individual transfer, ###
### files over that size will be rejected (0 for no limit). ###
### wild cards are: ###
### * = 0 or more characters, ? = 1 character, # = any positive integer ###
### WARNING!! specify a directory used exclusivly for uploads. This will ###
### WARNING!! prevent users from creating/appending important files ###
#uploadhost *!~me@*.domain.com
#uploadhost *!me@192.168.10.#
#uploaddir /home/me/upload
#uploadmaxsize 10

This can be very useful, if you want people to be able to upload to your bot. If you want to allow everybody to upload to the bot, simply uncomment uploadhost, and add the following: *!*@*.*

If you want only specified people to be able to upload, simply edit it like you did above for the adminhost lines. For multiple people, use multiple lines. Dont forget to uncomment these if youre going to use them, and keep them commented if you’re not. If you are going to use it, you need to specify a folder to put all the things people upload. So, to make things real easy, you could make this folder the same folder that you (may have) used above, c:my-files (or whatever you called it), so that you dont have to type the whole path when adding a pack. Or you can use a different folder it doesnt matter. Uncomment uploaddir and set it to c:whateverhereisuploads
I would keep uploadmaxsize commented, cuz its pointless.

##############################################################################

### - periodic notify time - ###
### How often should iroffer notify users of queue/bandwidth status ###
### (in minutes). If not defined default is 5 minutes. Setting to 0 ###
### disables notification entirely. ###
#notifytime 5

If set, this will Let a person who is in queue how much time remaining on their queue, and is usually pretty accurate. Set it to notifytime 5 if you want it to let people know every 5 minutes, how long they have in queue. Set it higher or lower, or not at all, whatever you desire.

THATS IT! YOU’RE DONE EDITING!! Save the hell out of that file, and if you want, rename it. I will assume you renamed it bot.config, so if you did not, simply replace your config filename where you see bot.config in the coming paragraphs.

Now here is where you will probably want to connect to the irc server that your bot is going to connect to, and join the channel it is going to be in.

Ok, so, if all went well, you should be able to start up your bot right now and start adding packs to it! If all did’nt go well, you suck at life and should start over. OK, now we need to open that pesky command prompt again, Start menu > run > type “cmd” with no quotes. In the command prompt type “cd c:iroffer” with no quotes. Then, to start up your bot, simply type: iroffer -b bot.config

-b means it will run in the background (you can close the command prompt and it will still be running), and bot.config is the config file you wish the bot to use. If you want two seperate bots running with two seperate config files, simply type it again, using a different file for bot.config. Anyway, it will say something like:

Welcome to iroffer by PMG - http://iroffer.org/

Version 1.3.b10 [20050116225654]

** iroffer is distributed under the GNU General Public License.
** please see the README for more information.
** Starting up…
** Started on: 2005-02-15-15:53:23
** Loading bot.config …
** Checking for completeness of config file …
** You Are Running CYGWIN_NT-5.1 1.5.12(0.116/4/2) on a i686, Good
** Entering Background Mode
** All Commands must be issued by remote administration

If it gives you some kind of error, you fucked something up. Fix it. Anyway, go over to IRC now and wait for your bot to join! When you see your bot join, you are 75% there. Now, administering your bot! Everything you can do to your bot from here on out is done via IRC. Adding files, removing files, sending files to people in queue, all that good stuff (the complete list of commands and what they do can be found right here. Ok, I will cover just a few simple admin type things, such as adding packs. To add a pack (file) to your bot for people to download, simply type: /msg yourbotname admin adminpassword add filename.zip

What you actually type will be different, depending on a few things. first: yourbotname will be, dun dun dun, the actual nick of the bot that you set in the config file. adminpassword is the UNENCRYPTED password that you set using the command “iroffer -c” in the command prompt. everything after “add” is the file. If you didnt set up where to look for files automatically in the config, or if the file you’re trying to add is in another folder, you would type c:whereeverthatfileisfilename.zip after “add”. Thats it. It should say “added file whatever.zip to change description of the file yadda yadda”. If it said it couldnt find it or something, you messed up. One thing iroffer HATES is spaces. So if your file is: The Coolest Rap Album Ever.zip, you will need to rename it to The_Coolest_Rap_Album_ever.zip. And then do the add command again, and it should work. If it didnt, check the Spelling, the caps (it is case sensitive, meaning Rap is different from rap), and again check the folder names of everything. If it still doesnt add it, I dunno what to tell you, you must just suck. Next: chdesc command. All commands are the same, as far as how you tell them to the bot. Every command starts out with: /msg yourbotname admin yourbotpassword (command_here) other_stuff_here. So for the chdesc command, we simply type /msg yourbotname admin yourbotpassword chdesc 1 The Files Description

Descriptions CAN have spaces in them, and the “1″ means that you are changing the description for the first pack on your list. The description is simply what iroffer outputs to the channel with all your packs, the pack numbers, how many downloads there are, etc etc. It doesnt change the filename at all. To remove a pack, type: /msg yourbotname admin yourbotpassword remove 1 (1 being whatever number pack you wish to remove)

Thats really all I’m going to get into as far as commands go, the entire list can be found via the link up above^.

There is one last (optional) step, one that I like to add because it makes things easier. This will allow you to simply click on an icon to start up your iroffer bot, with the correct .config file, and will also allow you to make it so it starts up automatically every time windows starts, so you wont even have to click that icon. Simply go to “my computer”, then to c: drive, then to iroffer folder, or wherever you put it. Find iroffer.exe, right click it, and click “create shortcut”. Find the shortcut that it makes, and right click IT, and click “properties”. On the properties page it will say “target”, then a text box with the path and filename of iroffer. Simply change the “target” area to C:irofferiroffer.exe -b bot.config (or wherever you put the iroffer folder, and whatever you named your config file). Thats it. Click OK and double click the shortcut to make sure it worked. If it did the command prompt should pop up for a split second then go away, then you should see your bot join IRC!

To make it start your bot automatically when windows starts, simply go to c:documents and settingsyournamestart menuprogramsstartup and put the shortcut in there. This is using windows XP, the path may be different for other operating systems. And boom, every time windows starts up, your bot will start up with you not having to do ANYTHING. Simply use IRC to issue commands to your bot, and you have successfully set up your very own IRC FileServer! Congratulations. Questions, comments, hatemail, lovemail, gaymail, whatever else can be sent to 1fizzle[at]gmail.com. Dont be retarded, replace [at] with @.

Tags: , , ,

Leave a Reply