MSc Dissertation IRC distributed bot lending platform: The Loufiz project High speed networks and distributed systems Oxford Brookes MSc dissertation Subject: IRC distributed bot lending platform The Loufiz project Dissertation Supervisor: Faye Mitchell Field code: DSD Module N°: P08797 September 2003 Student N°: 02053526 Guillaume Tournand guillaume@tournand.com Guillaume Tournand <guillaume@tournand.com> September 2003 1/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Statement of originality Except for those parts in which it is explicitly stated to the contrary, this project is my own work. It has not been submitted for any degree at this or any other academic or professional institution. TOURNAND Guillaume Oxford, September 2003 Signature Regulations Governing the Deposit and Use of Master of Science Dissertations for the department of Computing, Oxford Brookes University - - - The "top" copies of projects / dissertations submitted in fulfillment of Master of Science course requirements shall normally be kept by the Department. The author shall sign a declaration agreeing that the project / dissertation be available for reading and photocopying at the discretion of the Head of Department in accordance with 4 below. The Head of School shall safeguard the interests of the author by requiring persons who consult the project / dissertation to sign a declaration acknowledging the author's copyright. Permission for any one other than the author to reproduce or photocopy any part of the project / dissertation must be obtained from the Head of Department who will give his / her permission for such reproduction only to an extent which he / she considers to be fair and reasonable. I agree that this dissertation may be available for reading and photocopying at the discretion of my Head of School in accordance with regulations 3 and 4 above.* *The words in bold may be deleted by the author. TOURNAND Guillaume Oxford, September 2003 Signature Guillaume Tournand <guillaume@tournand.com> September 2003 2/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Abstract IRC (Internet Relay Chat), part of the instant messaging family, is becoming more and more popular. However, we will see that this protocol faces some conception issues, leading to an unreliable security. The Loufiz project has been created to provide a service free of advertisements and free of charge to address this lack of reliability by lending distributed bots to IRC chat rooms, and helping their owner to maintain internal stability. In addition, the provided service does not require technical knowledge, and is usable by any end-user without jeopardizing the security of the servers hosting these services, or taking the IRC network situation from bad to worse with unwanted congestion or overload. This is achieved by setting up a web interface which eases and automates the flows between the users and the IRC bots. In order to avoid automation leading to unwanted results, decisions are left to administrators and their related consequences are transparently automated by the bot lending platform. Furthermore, the data exchanged between the web client’s browser and the web server are secured by using the SLL encryption, and the scalable bot lending platform allows the easy addition or removal of resources. Chapter one provides a definition of IRC with some historical facts and outlines the causes of the problem this project addresses. Chapters two and three respectively outline the design and implementation of the project. Chapter four analyses two years of service delivery. The appendices hold the source codes of the project, published under the BSD license. Guillaume Tournand <guillaume@tournand.com> September 2003 3/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Acknowledgements The completion of this project has involved several persons to whom I am more than grateful for the help they have provided. I would like to take the opportunity to thank those who made it possible: - My family – for their permanent support - Jean-Marc Amiaud – for development advices and server hosting - Sébastien Bonnaire – for support and server hosting - Benoît Capelle – for his web design flair - Yan Gaillard – for the translation of the web texts - Daniel Harris – for the correction of the English version of the web texts - Alexander Maassen – for TCL realizations - Ludovic Ruault de Beaulieu – for server hosting - Morgan Rue – for the corrections to the English of the manuscript - Craig Shue – for TCL realizations and share of bot lending experience Although my main duty was to implement and maintain the platform, I also managed a core team of helpers who used the web interface to administer the project on my behalf. They had the important duty of being in contact daily with our users on IRC. Special thanks to them for their commitment to this task, as well as their muchappreciated skills for spotting bugs and feedback: - Michael Boisvert - Laurence Guillorit - Simon Lanoie - Emmanuel Magnier - Pierre-Luc Tremblay Finally, thanks to Faye Mitchell, my dissertation Supervisor, for her advice and guidelines for the completion of this document. Guillaume Tournand <guillaume@tournand.com> September 2003 4/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Contents Abstract ......................................................................................... 3 Acknowledgements ....................................................................... 4 Contents ........................................................................................ 5 List of figures ................................................................................. 7 1 Presentation ............................................................................... 9 1.1 IRC definition ........................................................................ 9 1.1.1 The IRC servers ............................................................ 10 1.1.2 The chat rooms ............................................................. 11 1.2 The IRC bots....................................................................... 12 1.3 IRC history .......................................................................... 12 1.4 The problem........................................................................ 13 1.5 The solution ........................................................................ 15 2 Conception / design.................................................................. 17 2.1 The botnet........................................................................... 21 2.1.1 General bots behavior................................................... 21 2.1.2 The service provided..................................................... 22 2.1.3 The concept of logical bots group ................................. 22 2.1.4 The identical accounts’ ident problem........................... 25 2.1.5 Botnet security .............................................................. 25 2.1.6 Hosts’ security............................................................... 26 2.2 The database...................................................................... 27 2.2.1 Data organisation .......................................................... 27 2.2.2 Data groups .................................................................. 28 2.3 The web interface ............................................................... 35 2.3.1 Global design ................................................................ 35 2.3.2 Usage description ......................................................... 36 2.3.3 User side pages ............................................................ 36 2.3.4 Administration module pages........................................ 37 2.4 Scheduled programs........................................................... 38 2.4.1 Database to botnet updates.......................................... 38 2.4.2 Botnet monitoring .......................................................... 38 2.4.3 Botnet’s server lists update........................................... 38 2.4.4 Blacklist synchronization............................................... 39 2.4.5 Daily channel log........................................................... 39 Guillaume Tournand <guillaume@tournand.com> September 2003 5/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 2.4.6 The servers’ backup...................................................... 40 3 Realization................................................................................ 41 3.1 The botnet........................................................................... 41 3.1.1 The bot software ........................................................... 41 3.1.2 The home channel problem .......................................... 41 3.1.3 At operating system level.............................................. 41 3.1.4 Eggdrops’ extra scripts ................................................. 43 3.2 The database...................................................................... 44 3.3 The web interface ............................................................... 45 3.3.1 Secure communications................................................ 46 3.3.2 The files organization.................................................... 46 3.3.2.1 User side ................................................................. 46 3.3.2.2 Administrator side.................................................... 47 3.3.2.3 The include/ folder................................................... 47 3.3.3 Screenshots of the web interface.................................. 48 3.3.3.1 User side ................................................................. 48 3.3.3.2 Administrator side.................................................... 59 3.4 Scheduled programs........................................................... 72 3.4.1 Database to botnet updates.......................................... 72 3.4.2 Botnet monitoring .......................................................... 73 3.4.3 Botnet’s server lists update........................................... 74 3.4.4 Blacklist synchronization............................................... 76 3.4.5 Daily channel log........................................................... 76 3.4.6 The servers’ backup...................................................... 76 4 Analysis .................................................................................... 77 References .................................................................................. 80 Appendix A The botnet ................................................................ 81 Appendix B The database ......................................................... 219 Appendix C The web interface .................................................. 236 Appendix D The scheduled programs ....................................... 449 Guillaume Tournand <guillaume@tournand.com> September 2003 6/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project List of figures Figure 1.1: The IRC network ................................................................................................... 10 Figure 1.2: The IRC split.......................................................................................................... 13 Figure 1.3: Distributed IRC network........................................................................................ 15 Figure 2.1: The Loufiz domain ................................................................................................ 18 Figure 2.2: Global platform view............................................................................................. 19 Figure 2.3: The botnet .............................................................................................................. 21 Figure 2.4: The logical bot group............................................................................................. 23 Figure 2.5: Expansion of the logical bot group........................................................................ 24 Figure 2.6: Web form processing............................................................................................. 35 Figure 2.7: Domain backup...................................................................................................... 40 Figure 3.1: The eggdrop/ shared folder.................................................................................... 42 Figure 3.2: The eggdrop home folder....................................................................................... 42 Figure 3.3: The language swap ................................................................................................ 45 Figure 3.4: Identifier creation................................................................................................... 48 Figure 3.5: Eggdrops request ................................................................................................... 49 Figure 3.6: The FAQ – question............................................................................................... 49 Figure 3.7: The FAQ - answer ................................................................................................. 50 Figure 3.8: Web links to other bot lending projects on Undernet. ........................................... 50 Figure 3.9 :Web links to partners’ websites displaying the Loufiz project’s banner............... 51 Figure 3.10: User login............................................................................................................. 52 Figure 3.11: Eggdrops request follow up ................................................................................. 53 Figure 3.12: Eggdrops request follow up for the channel #fairfax .......................................... 53 Figure 3.13: Identifier administration ...................................................................................... 54 Figure 3.14: Channel administration........................................................................................ 55 Figure 3.15: List of the accesses grantable to registered users on the protected channels....... 56 Figure 3.16: The lent eggdrops’ information ........................................................................... 57 Figure 3.17: Password and identifier retrieval ......................................................................... 58 Figure 3.18: Eggdrop withdrawal, or transfer ownership to another registered user............... 58 Figure 3.19: Administration index ........................................................................................... 59 Figure 3.20: Review eggdrops requests ................................................................................... 60 Figure 3.21: List of the registered users................................................................................... 61 Figure 3.22: List of the protected channels .............................................................................. 62 Figure 3.23 Monitoring of the protected channels ................................................................... 63 Figure 3.24: The users’ comments ........................................................................................... 64 Figure 3.25: Update the list of other bot lending projects on Undernet................................... 65 Figure 3.26: Update the web links of the partners of the Loufiz project ................................. 65 Figure 3.27: List of the project’s administrators ...................................................................... 66 Figure 3.28: Reasons of eggdrops request refusal.................................................................... 66 Figure 3.29: Add or remove administrators ............................................................................ 67 Figure 3.30: Blacklist edition ................................................................................................... 68 Figure 3.31: Database search and purge protected channels.................................................... 69 Figure 3.32: Administrators’ mail traffic selection.................................................................. 69 Figure 3.33: The bots’ channels check..................................................................................... 70 Figure 3.34: The user list deletion and reconstruction ............................................................. 71 Figure 3.35: The big brother monitoring.................................................................................. 71 Guillaume Tournand <guillaume@tournand.com> September 2003 7/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Figure 4.1: Graph of the distribution of activity over 2.5 years............................................... 77 Figure 4.2: ambt.loufiz.com uptime ......................................................................................... 79 Guillaume Tournand <guillaume@tournand.com> September 2003 8/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 1 Presentation 1.1 IRC definition The IRC (Internet Relay Chat) protocol was first defined by the RFC 1459, and then updated by the RFC 2810, 2811, 2812 and 2813. An IRC network (often worldwide) is a structure of servers interconnected to each others. Each server accepts connections from clients, and clients thus connected are able to exchange messages online in real time (chat) with other users connected to the network. The main objective of these servers is to relay the messages from the sender to the receiver(s). Because IRC implements the communication system of one-to-one or one-tomany, there can be many receivers to a single message. The one-to-one communication: - The private message, the most frequently used. The notice, used to send a string to another user, but can also be used to send a string to many users simultaneously. The DCC (Direct Connection Chat), where a communication channel is opened between 2 users and future messages are not relayed through the IRC network, but uses this direct communication channel. The one-to-many communication: - The chat room (also called channel) that users can join and chat with other users present in this room. The notice, which can have as destination a whole channel, or part of their members. The most popular IRC networks are EFnet (http://www.efnet.net/), Undernet (http://www.undernet.org/), IRCnet (http://www.ircnet.org/), DALnet (http://www.dal.net/) and NewNet (http://www.newnet.net/). They provide this chat service free of charge. One of the most popular IRC clients for Microsoft (http://www.mirc.com/) and Xchat (http://www.xchat.org/) for UNIX. Guillaume Tournand <guillaume@tournand.com> Windows September 2003 is mIRC 9/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 1.1.1 The IRC servers Each IRC server is hosted on high speed connections, often by Internet Service Providers (ISP). Its installation and maintenance is performed by an IRC administrator, who selects a team who will ensure the server is properly connected to the rest of the IRC network. The members of this team are called IRC operators. The IRC server is a process running on an UNIX server; its related settings are stored in a configuration file. One of these settings defines the list of the other IRC servers this server will be able to connect to, or will accept connection from. Furthermore, connections to these servers can be automatically (re-)created. The configuration file also defines the maximum number of connections the server will accept, and defines the “connection classes”. These connection classes are a sub division of the maximum number of connections, and are generally set so that the simultaneous connections to the server will be predominantly from the geographical neighborhood. Figure 1.1: The IRC network Guillaume Tournand <guillaume@tournand.com> September 2003 10/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project During the establishment of the connection between a client and a server, the server gathers some information from the client: - The nickname of the user. It is defined by the user and cannot be currently used in the IRC network. - The ident of the user. As the nickname, this information is set by the user, in the IRC client program. - The hostname. This information is found by querying the DNS server of the user’s Internet Service Provider (ISP). If no answer is received within a given amount of time, the IP address of the connection is used instead of the hostname. These data creates a string: the nickname!ident@hostname. Once connected, the only part the user can change in this string is the nickname. Each user can define specific modes for his current connection. Depending on the modes set, the server will send more or less information to the IRC client. An example of an IRC mode used later in this document is the deaf mode (+d), where the server does not send to the client the chat messages sent by other users in the chat rooms. 1.1.2 The chat rooms The chat rooms (or channels) are the virtual places users join to chat together. A channel is defined by a name (up to 200 characters) and begins with the ‘#’ character. Additionally each channel has a topic, which is a string of characters viewable by anyone, often used to describe the channel purpose and / or activity. Different modes can be set for each channel. These modes are used to define or limit the behavior of users in the channels. For example the channel mode “+n” prevents users not present in the channel sending messages to the channel. If a user joins an empty channel, he creates it and thus is granted the channel operator status. Of course, if the channel is not empty, no specific privileges are granted to the joiner. Channel operators have their name prefixed by the ‘@’ character, and have as duty the moderation and administration of the channel. Channel moderation: channel operators can kick and / or ban any unwanted user from their chat room. Channel administration: channel operators have access to change the channel modes, and grant or revoke this privilege to another user. However granting this privilege is delicate since the grantor can have his privileges revoked by the granted; and once revoked there is nothing he can do by himself to get this privilege back. For this reason the IRC network often offers services (free of charge) to allow the founder of a channel to register it. Guillaume Tournand <guillaume@tournand.com> September 2003 11/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 1.2 The IRC bots The bots are IRC clients performing a set of pre-defined functions triggered at users’ command. IRC bots very often hold a user list, and prior to perform any function, the user will have to authenticate to the bot. The nickname!ident@hostname of each user acts as login, and the bot’s user list holds passwords bound to nickname!ident@hostname masks. These masks are made of wildcards to take under account the possible changes of the users’ nicknames or IP. I.e: for the nickname!ident@hostname Nolderise!Groumf@hn-32-106.brookes.ac.uk, the following mask will apply: *!*Groumf@*.ac.uk. 1.3 IRC history The first version of IRC was developed by Jarkko Oikarinen in the late 1980s. A single IRC network was created at this time, and quickly became total anarchy. Because many administrators of this unique network had different visions of its future, the big net was split in smaller nets. In 1993, the Undernet IRC network (http://www.undernet.org/) was founded. It is on this network the Loufiz project provides its services. Undernet has a channel registration service: Cservice (http://cservice.undernet.org/), and lend a bot called X on registered channels. This bot is hosted in a dedicated IRC server. Guillaume Tournand <guillaume@tournand.com> September 2003 12/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 1.4 The problem As we can see in figure 1.2, some parts of the IRC networks are often linked together by a single server and / or a single connection. If one of this server or connection is overloaded, the queue of data that has to be send from one side of the network to the other slowly goes through. At user’s level, it is called “lag”, which is a perceptible increase of latency. A sub protocol in the IRC protocol: the Client To Client Protocol (CTCP) provides a functionality to users to find out how long data takes to go from their IRC client to another: the CTCP ping. When the lag becomes too large, the overloaded link breaks, splitting the IRC network in two parts. Figure 1.2: The IRC split In such situations, the two sides of the IRC network evolve independently and for security reasons, when they are rejoined, the newest changes are discarded, and the oldest kept. I.e.: users 2 and 3 are part of #channel before the split with user 3 as operator of the channel. When the split occurs, if user 2 disconnects from the IRC server A and connects to the other side of the split, for example to IRC server D, he will creates the channel and be granted channel operator status on it, but this privilege will be revoked at network’s rejoin. Guillaume Tournand <guillaume@tournand.com> September 2003 13/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Nevertheless, this is not sufficient. A Canadian team: the Rectum Crew (http://www.rectumcrew.clan.st/) understood that channels are more vulnerable during these splits. One of their attacks is to do as user 2 did, but they also flood the connection of user 3, causing its link to the IRC network to breakdown, and they keep the operator privileges at network’s rejoin. Such an attack is called a take-over. In addition, during splits, registered channels cannot use the bot lent by Cservice. Experience proved that these daily lags, even short can be a problem for many users. If some users stay connected to IRC almost all day long idling, some do not have internet connection at home and connect to IRC in Cyber cafes. Since the time they spend on IRC is not free, they expect the provided services to be operational from the time they join the channel to the moment they disconnect. Additionally, if this user wants to change the channel’s topic to pass a message to his friends, he will require the operator status on this channel, and will not be able to request it until the split will ends. Finally, there is the opless channel problem. As it names states, it is channel without any operators, consequently with no way to moderate or administrate the chat room. Many causes can lead to such a situation, the most frequent one of which is when a chat room has few operators and their connection fails, disconnecting them from the IRC network. On rejoin, because the channel is not empty, they are not granted the operator status. Registering the channel by the IRC service can be a solution, but such a registration process takes weeks. During this time the channel is exposed to this potential problem. To regain the operator status on an opless channel, there are only 2 options: - Plan A: every member of the chat room leaves the channel, and the first one to rejoin gains the operator status. This request synchronization between users and is difficult to perform: since the network is worldwide all the chat room members may not be in the same time zone. - Plan B: request to an IRC operators to grant the channel operator status to a channel member. Because of the many daily requests IRC operators quickly became fed up with performing it, leaving users with no other choice than plan A. Guillaume Tournand <guillaume@tournand.com> September 2003 14/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 1.5 The solution A solution to this problem could have been taken at the design level of the IRC protocol: instead of having some parts of the network depending on a single link and / or server, each server could be connected simultaneously to other IRC servers, creating a distributed IRC network. Furthermore with such an evolution, each IRC server would not act as a hub, but as a switch, being able to route data to the appropriate part of the network; and in so doing, spare some valuable bandwidth. Figure 1.3: Distributed IRC network However such a solution has not been implemented yet, so a curative solution has to be found. The solution to provide reliability above this unreliable layer is distributed bot lending, where the administration of the bots is done through a multilingual interface, so that the security of the servers will not be jeopardized. As we saw, this service will potentially interest both channels registered by the IRC network’s services or not. Nevertheless, the service is not provided to replace the IRC services, but be used as a complement. During the development, we have to keep in mind that more security does not make something more secure, but better management does. Guillaume Tournand <guillaume@tournand.com> September 2003 15/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project The administration interface will have to be scalable and structured to facilitate its use (some users being young), and to allow several people to work on it simultaneously. Besides this structured aspect will allow anyone to take over its administration. The lent bots will have as their only duty keeping the operator status, and give it back to authenticated users, at their request. They should implement as few functions as possible to avoid giving grip to possible network attacks. Since the service will be provided above the IRC network layer, it is important that all the bots are identified by the network and recognized by the IRC services the network provides. Besides, since the delivered service will be free of charge, it will have to rely on virtually no billing services. Finally, all the data flows have to be carefully thought so that this free system will not become victim of its success, and that all registration processes can be completed within 24 hours. To achieve this, flows have to be automated as much as possible, but all decisions have to be done by human processing. These decisions have to be summed up to a couple of mouse clicks; the application of the decisions will be automated. This will avoid automated processes to lead to undesirable results. Guillaume Tournand <guillaume@tournand.com> September 2003 16/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 2 Conception / design The very first step in the design of the project will be to set a domain name and the basic services associated: DNS, mail, web. Domain setup The domain name is registered with Gandi (http://www.gandi.net/) for 12€ per year, and represent the only fees of the project. Our servers are computers of roughly 5 years old, given away by people or companies willing to get rid of them. They are freely hosted, often by companies, and all have a public IP. The operating system installed on these hosts has to be as open as possible for future convenience regarding design, development and implementation; therefore all servers run either BSD or Linux. Their security has to be as strong as possible since all future layers will rely on it; so several steps are taken: - All our servers run the SSH daemon (Secure Shell), allowing system administrators to take remote access of the server through an encrypted tunnel. - Each server has its sets of firewall rules, filtering the incoming traffic for the hosted services. When bots will be deployed among the servers, the administration ports they open will be filtered as well, so that only known IPs could connect to. - Each server runs an IDS (Intrusion Detection System) to prevent as much as possible threats of (distributed) denial of service - (d)dos. However if the attack overflows the physical link, the server cannot do anything about it, and actions to stop it have to be taken upstream (generally at internet service provider level). The domain services are attributed to the hosts according to figure 2.1. For additional reliability, the DNS and MX services are distributed amongst separate hosts. As shown in figure 2.1, server’s hardware is really old. Any component failure will bring the entire server down and spare parts will be hard to find. To take under account any sudden failure and an important mean time to repair, 5 servers will be permanently used, and one will be kept as spare. Finally, all hosts synchronize their local clock using the network time protocol (NTP) once a day. Guillaume Tournand <guillaume@tournand.com> September 2003 17/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Figure 2.1: The Loufiz domain Guillaume Tournand <guillaume@tournand.com> September 2003 18/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Global interface view As stated in the presentation chapter, the interface will be used to administrate the resources, while their use will happen through IRC; as shown in figure 2.2. Figure 2.2: Global platform view In order to make data flows easier to manage, all updates resulting from user’s data administration, and requiring to be dispatched to the botnet will be stored in a common database’s table. Guillaume Tournand <guillaume@tournand.com> September 2003 19/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project This queue of instructions will then be processed by a separate program and dispatched through the botnet. When the data of the database and the botnet are identical, “the state of convergence” is achieved. The link between the database and the bots will be “incremental”; this means that updates will be sent to the botnet assuming that its data matches the database’s one before the update. An obvious problem can occur if for any reason a previous update has not been taken into account, and has broken the state of convergence. Because of that a dual approach has to be used: - Preventive: all updates will have to wait for an acknowledgement. - Curative: a system has to be developed to re-build the whole data in the bots according to the database. From now on, we can split the design/conceptualization in 5 fields: - The botnet - The database - The web interface - The link between the database and the botnet - The scheduled programs – mainly for database or botnet updates Because this project will be a non-profit organization, it benefits from a wide choice of free software. These 5 fields have to be developed and implemented while bearing in mind that choices made should not lead to be bound to any software, and the software swap (i.e.: replacing the eggdrop bots by energymech bots) should be achieved with as little effort as possible. Guillaume Tournand <guillaume@tournand.com> September 2003 20/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 2.1 The botnet 2.1.1 General bots behavior Bot processes are run from a host, and connect to a defined list of IRC servers. All parameters of the bot are stored in its associated configuration file. The user list and the channel list are often saved in 2 distinct files and read at bot runtime. Additionally they open an administration port accessible through telnet. Finally these bots can be connected together (creating a botnet) by defining a hub bot (the other bots are “leaf” bots) where other bots connect to. This allows 3 features (as illustrated in figure 2.3 below): - The leaf bots automatically (re-)connect to the hub bot. - The user list is shared to the entire botnet. - The administration port of the hub bot will be the single point of input, and commands can be dispatched through the botnet by the hub bot. Figure 2.3: The botnet Guillaume Tournand <guillaume@tournand.com> September 2003 21/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 2.1.2 The service provided The objective of the service provided is to keep the channel operator status. This status is lost if the bot(s) are simultaneously disconnected. The causes of disconnection are the following: - The client crashes or reboot; since our hosts are old hardware, sudden crashes have to be taken into account. - The server crashes or reboots; very seldom. - The link goes down; what is here called the link is the ability to send data from one end to the other. This relies on all the equipment that data packets have to go through. This can be down without prior notice for many reasons and for variable periods of time. These causes highlight the fact that distribution of the delivered service is the key to achieve the objectives. This distribution is reached by the following: - The lent bots will have to be on separate hosts. - The lent bots will have to be connected to different IRC servers. 2.1.3 The concept of logical bots group Lending 2 bots per channel, would still not be enough: although it might appear sufficient, some “extreme” situations (i.e.: a provider having troubles routing traffic while the other host’s link faces a breakdown long enough to disconnect the hosted bots from the IRC network) will result in a massive loss of operator status, and would be called “bad luck” even if predictable and not that seldom. Lending 3 bots appear to be a safe choice where the loss of operator status would only happen if the 3 hosts/links face trouble at the same time. In order to make sure the bots will be connected to different IRC servers, and will stay this way; we need to split the list of the IRC servers in 3 lists. One extra point has to be taken under account: each IRC server classifies all incoming connection to a “connection class”. These connection classes are defined by the IRC server’s configuration file, using IP addresses and hostnames. The maximum number of connections a server can handle are split amongst these classes. For example, if an IRC server is installed in Paris and can handle a maximum of 10.000 simultaneous connections; his admin will make a connection class for French users (users whose hostnames ends with “.fr”) and set this class to use 8.000 of the connections. However when this limit is reached, no French user will be able to connect (the error message will be: “connection class is full”), even if the IRC server has not reach the 10.000 simultaneous connections. This means that the possible connections to each IRC server are configured to favour connections from close/neighbor geographical clients. Because of that, the split of the IRC network server list will have to result in 3 “fair” lists, where each server will be bound to a distance coefficient from the hosts. The figure 2.4 shows the design of such a repartition, leading to the logical bots group. Guillaume Tournand <guillaume@tournand.com> September 2003 22/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Figure 2.4: The logical bot group Of course each host will not each run a single eggdrop process. IRC networks are set to allow a certain number of connections per host. Furthermore, some IRC networks prefer to have “idented” users and increase the number of maximum number of connections per host if these connections respond to ident request (as stated in RFC 1413). This ident response is checked once at connection time: in order to determine the ident@host of the user during his connection to IRC, the IRC server tries to connect to the port 113 of the client’s computer to get the user’s ident. Therefore, all our bots will have to answer to these requests. Guillaume Tournand <guillaume@tournand.com> September 2003 23/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project On the chosen IRC network (Undernet) 4 connections per host are accepted, so the expansion of the bot group concept to our 5 servers’ case is described in the figure 2.5 below. Figure 2.5: Expansion of the logical bot group In figure 2.5, two bots are kept for the administration purposes of the IRC based home channel of the project (bot 1 from host 1, and bot 4 from host 5). Their connection range is the whole IRC network; one of them will be the hub bot of the botnet, and the other will run various scripts to fulfill future IRC-based project management needs, and will not be linked to the botnet. Guillaume Tournand <guillaume@tournand.com> September 2003 24/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 2.1.4 The identical accounts’ ident problem When a user triggers a bot’s function using an IRC command, the bot matches the ident@host masks from its accounts’ list against the user’s ident@host in order to find out which account applies to him. This acts as a login, and the password sent in the command will confirm the user’s identity, or not. However, a problem occurs if several accounts’ ident@host masks overlaps each others, and apply to a single user. For example, each of the following masks: *!*name@resolved.provider.com *!*username@*.provider.com *!*e@*.com applies to this ident@host : nick!username@resolved.provider.com, and the bot might bind it to an inappropriate account. Solution: - The account creation process will make sure no account already uses the new account’s ident. - Registered users will not be able to change their ident once defined. - Because users can be idented or not (depending if they sent a proper reply to the ident request), 2 masks will be created for each host: o *!ident@host – when the IRC client has sent a proper ident reply. o *!~ident@host – when the IRC client has not sent a proper ident reply. 2.1.5 Botnet security The bots will be configured to address to what is required for their regular use only. Since their goal is to keep the channel operator status, they will only respond to registered users’ command, and deny all direct communication attempt (DCC, CTCP). The point here is to avoid giving rise to a possible attack based on flooding. Additionally, except the hub bot, the entire botnet will run in deaf mode (when using this IRC mode, the server does not send the traffic of the channels the bot has join) in order to guarantee our users’ channel privacy and spare bandwidth. Guillaume Tournand <guillaume@tournand.com> September 2003 25/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 2.1.6 Hosts’ security The administrations ports opened by the bots’ processes will be filtered by the host’s firewall, and will prevent any connection attempt, except for the domain’s IPs. Each bot process should run under a separate account; and for convenience reasons this account should only hold the bot’s specific files: configuration, user, channel and log files. All the files the bots would have in common (executables, documentation, scripts …) should be shared in a common folder. This will reduce the amount of work required for each future upgrade: the upgrade will only be done for the shared files, not for each process. According to the RFC 1459, the maximum number of channels each client may be a part is 10. On Undernet, some servers are set to enforce this limit, some other have raised it up to 20. In order to make sure our bots will be able to join all the channels they are asked for, they will be configured to use the RFC value. Guillaume Tournand <guillaume@tournand.com> September 2003 26/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 2.2 The database 2.2.1 Data organisation Database design requires the listing of all the different data we will have to store and work with. Then, we have to split these different data in groups so that independently inflating information defines a group. Finally, identify and list what attributes each group holds, and build database tables with them. All data duplication should be avoided by implementing the “foreign key” system provided by databases to bind a set of data to another. So we will work on data references and not data values. In order to use the “foreign key”, we have to be able to select any row from any table using a unique identifier for each entry. Again, databases provide such functionality: the “primary key”. It is an integer starting from 1 and increased automatically by 1 each time a new entry is added to the table; this integer is then bound to each of the table’s entry, and is its reference. The final data organization gives a scalable result, where entries can be easily added, removed, modified, found and bound together. Dates will to be stored in Unixtime format (the number of seconds since the 1st January 1970). It might sound not convenient to have to convert this integer to a human readable date at each display, but this conversion allows more flexibility regarding the date’s display (DD/MM/YYYY or M/D/YY …), and all manipulations between dates are based on integers, they become easy. This listing might look a bit rough and the next parts of the design and conceptualization will give a better vision of the data flows. Guillaume Tournand <guillaume@tournand.com> September 2003 27/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 2.2.2 Data groups IRC servers Will hold the known IRC servers of the IRC network where services will be provided. Fields: - Name : the fully qualified domain name (fqdn) - Port - Distance coefficient - Server group - Enabled – Boolean Bots Will hold information of the botnet’s bots Fields: - Name - Username - Hosts - IP - Port - Server group - Bot group - Cservice password - Primary key of the hub - Creation date - Monitoring report of the IRC server it’s connected to - Date/time of the monitoring report - Enabled – Boolean The data of this table will be modified if changes are made in the structure of the botnet (i.e.: add / remove bots). Guillaume Tournand <guillaume@tournand.com> September 2003 28/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Registered users Fields: - Registration date - IP used for registration process - Gender - Family name - Surname - Birth date - City - Country - Mail address - Username - Hosts - Password - Nickname - Number of logins - Number of instructions sent to the botnet - Date of last modification - Date of last login - IP of last login - Date of password recovery - Used language An entry is added when the user’s registration form is validated, and will be automatically removed when it has no channel privileges and has not been used for a certain amount of time. Channels in registration process An entry is added at “bot request” form validation, and remains in this table until a project administrator reviews it. Once accepted, the entry is moved to the registered channels’ table. If refused it is moved in the refused or purged channels’ table. Fields: - Channel name - Owner : primary key of the registered user - Request date - Comment - Report output – report of a probe send to the requesting channel for users and operators count Guillaume Tournand <guillaume@tournand.com> September 2003 29/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Possible reasons to refuse a channel application Storing these reasons in a table will allow us to treat the applications flow more easily than having to type a reason each refusal. Additionally it reduces the risk of mistakes. Fields: - Description (French) - Description (English) - Full text (French) - Full text (English) Registered channels An entry is added each time a channel application is accepted. When the channel leaves this registration state, the entry is moved to the “refused or purged channels” table for archive purposes. Fields: - Channel name - Owner : primary key of the registered user - Bot group - Support date - Request date Accesses grantable to users on channels Fields: - Level - Short description (French) - Short description (English) - Long description (French) - Long description (English) - Enabled – Boolean Accesses granted to users on channels At each channel registration, this table will be created and will hold the accesses data for the new registered channel. Fields: - Primary key of the registered user - Primary key of the access Guillaume Tournand <guillaume@tournand.com> September 2003 30/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Possible reasons of purging a channel Fields: - Description (French) - Description (English) - Full text (French) - Full text (English) Purged or refused channels Here will be stored all data from rejected applications or purged channels, for archive purposes. The obsolete entries will be deleted after a given amount of time. Fields: - Channel name - Owner : primary key of the registered user - Request date - Support date - Refusal date - Purge date - Reason of refusal : primary key of this reason - Reason of purge : primary key of this reason - Wait – If the refused application will have to wait 24H before re-applying Blacklist This table will store all channels with which the project has faced any kind of problem (which are often resources abuses) and do not want to see application from any more. It will act as a channel’s problem logger and administrators will be able to add or remove channels from this list. Fields: - Channel name - Date of blacklisting - Nick of the administrator who added it - Reason - Primary key to the source of blacklist - Enabled – Boolean Guillaume Tournand <guillaume@tournand.com> September 2003 31/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Sources of blacklist Since the blacklist holds a list of mainly resources abusers, the best for this data source is be to be shared and synchronized amongst other bot lending project. The “sources of blacklist” table holds the different projects members part of this share. Field: - Project name Administrators of the project Fields: - Primary key of the registered user - Primary key to the administrator’s tasks/level table - Date of entrance - Mail requests – Boolean : to receive new requests through mail - Mail purges – Boolean : to receive channel purges through mail - Mail logs – Boolean : to receive daily channel activity log through mail Tasks/levels of the administrators Project administrators will have different duties, and by that will have to access different sections of the administration module. Their access and task description will be stored here. Fields: - Access level - Task description (French) - Task description (English) Users’ comments Each bot request form will have a “comment” field to enable users to drop notes. These notes will be visible at requests’ review and then be saved in this table for archive purposes. Fields: - Primary key of the registered user - Channel name - Date of comment - Comment Guillaume Tournand <guillaume@tournand.com> September 2003 32/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Botnet monitoring This table will store the data of the botnet monitoring tool. The data will then be displayed through the web interface. Fields: - Channel name - Number of bots reported present - Number of bots reported as operators - Number of users reported by bot 1 - Insufficient users since (if applicable) - Number of users reported by bot 2 - Insufficient users since (if applicable) - Number of users reported by bot 3 - Insufficient users since (if applicable) - Cservice registered channel? - Since how long is the channel registered by Cservice (if applicable) - Accesses for the lent bots on the Cservice’s bot - Since how long are accesses incorrect (if applicable) - Date of last update Available bots’ commands on IRC It will be the documentation of the different commands the bots will respond to. Fields: - Command name - Syntax - Example - Description (French) - Description (English) - Enabled – Boolean Guillaume Tournand <guillaume@tournand.com> September 2003 33/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project The FAQ The list of the Frequently Asked Questions will act as a knowledge base. Fields: - Question (French) - Question (English) - Answer (French) - Answer (English) - Order – to define a specific display order - Group – to group questions/answers by categories Botnet updates These updates will be stored as botnet instructions in a common table and dispatched by a separate program, acting as a communication channel between the database and the botnet. Fields: - Date - Primary key of the registered user requesting this instruction - Botnet command - Ack Links to other bot lending projects Fields: - Bot lending home channel - Web site - Order – to define a specific display order Links to web partners Fields: - Url of the partner’s website - Banner location - Description Guillaume Tournand <guillaume@tournand.com> September 2003 34/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 2.3 The web interface Its main purpose will be to orchestrate transparently administration’s data flows. With the use of visual advantages of web pages the web interface’s use has to be designed to be easy (some users may be only 10 years old), where technical knowledge of UNIX, IRC or bots would not be required – even for the administration module. Because the web interface will be viewable worldwide, it should be readable in multiple languages. Therefore the design has to implement a solution to easily add/remove languages. Finally, since it will handle authentication before entering administration areas, the communication flows have to be secure. 2.3.1 Global design Data input / edition will be done through web forms and the inputted content will be checked before any action is taken. (See figure 2.6 below) Figure 2.6: Web form processing If some updates require to be forked to the botnet, the web-interface “translates” the updates as botnet instructions and stores them in a defined table. The future of these instructions is covered at the next sub-chapter. Each web-user’s visit will be bound to a session. This session will hold information regarding its selected language as well as authentication data for the administration of the lent resources. All the displayed text will be stored in distinct files depending on the text language. Which file will be required to generate the web page before its display will be determined by the user’s session. Communications will be encapsulated in SSL (the same system used for web-banking transactions), ensuring strong encryption between the web client and server. Guillaume Tournand <guillaume@tournand.com> September 2003 35/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 2.3.2 Usage description Before using the web interface, each user will have to register by filling up a web form asking some personal data (i.e. name, country, nickname, ident@host, password …). If no error is detected, the user’s account is added in the database and the botnet; the registration process ends with the display of a unique identifier number (given by the database’s primary key of the users’ table), prefixed by a common static string (for example: LZ-42), which will then be requested for all future interaction with the web interface. This approach gives a flexibility advantage, where a profile will be able to make several actions (like bots request) without having to input his personal data every time. In order to define the project’s scope and to protect its members, some conditions of service have to be written. The creation of an identifier implies the acceptance of these conditions by the user. 2.3.3 User side pages - - The conditions of service Identifier creation Bots request – will send a mail to the project administrators Requests follow up, where the state of each bot request will be viewable Send password or identifier through mail – in case forgotten List of the IRC commands usable with the lent bots Data administration, modifiable according to each user’s privileges ƒ Profile (or identifier) administration ƒ Channel administration ƒ Lent bots information Bot withdrawal, or ownership transfer to another registered user FAQ (frequently asked questions) – as a knowledge base Guillaume Tournand <guillaume@tournand.com> September 2003 36/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 2.3.4 Administration module pages This module will allow administrators to modify any dataset; therefore the code in common on the user side and on the administration module will be shared in a folder and included by the 2 sides. Additionally, all duties have to be automated as much as possible, but critical decisions should always be left for human processing and ideally sum up these decisions to mouse clicks. The authentication for this module will use the Apache web server sessions. - View project’s resources at glance – ability to anticipate/detect problems Review the bots requests List of the registered users List of the registered channels List of the blacklisted channels, and forms to add/remove entries Users’ profile and channels administration Monitoring of the botnet, with the possibility to purge channels marked as red for too long with a single click. Search a channel, a user or a bot in the database Purge a channel – will send a mail to the project administrators Add or remove web links Rebuilt the botnet’s channel and user lists according to the database. A program will connect to the botnet (using telnet), and check the channels each bot is present on. It will then delete the botnet’s user list and rebuilt it Add or remove an administrator. Several administrator’s tasks can be chosen, each one is bound to an access level giving access to some extra pages, depending on the administrator’s duty. Adding an administrator will perform the following : • Modify the Apache access file of the administration module. • Grant global operator access in the botnet. • Create a mail address nick@loufiz.com. • Add the mail address in the distribution list eggdrops@loufiz.com. Additionally a tool for server monitoring with web display could be installed. Guillaume Tournand <guillaume@tournand.com> September 2003 37/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 2.4 Scheduled programs These programs will be run at scheduled intervals at the operating system level. 2.4.1 Database to botnet updates. The program does not go further if another instance is already running. It will connect to the database and fetch the content of table holding the instructions needed to be dispatched in the botnet. If data is present, it connects to the botnet using telnet and for each entry: - Send the instruction to the botnet. - Wait for an acknowledgement or timeouts after a defined amount of time. - If the acknowledgement received matches the one expected - which is defined in the table, in a column - the database’s entry is deleted. Otherwise, it will be tried again at next execution. - Wait for a defined amount of time before sending the next instruction. This will prevent flood. 2.4.2 Botnet monitoring The program does not go further if another instance is already running. It will connect to the botnet using telnet, and determine which bot(s) are presently connected to the botnet. For each bot: - Detects on which channels it is present on. - Find out if the bot is op or not on each channel. - Find out how many users are present on the channels. - If a channel is registered to Cservice, are the accesses properly set for the lent bots? Since these information can be found only by questioning Cservice, it will be done using their SOAP interface first, and if unsuccessful using IRC. All these data will then be stored in a defined table, in the database. Additionally, if a channel has a problem (i.e.: an insufficient amount of users), a timestamp will be set in order to find out since how long the problem remains. This will then be used to purge channels marked as problematic for too long. 2.4.3 Botnet’s server lists update Since IRC networks are maintained by volunteers and the servers hosted for free by companies, the map of the IRC network often changes. Therefore the bots’ server list will have to be adapted to reflect the revision of the IRC network. It could be done by hand, but this operation will require to regularly check the IRC website to find out if some changes have been done or not, and if required to modify each bot’s configuration file. This duty will be split in 2 programs. Guillaume Tournand <guillaume@tournand.com> September 2003 38/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project One program will fetch the IRC network’s webpage holding the list of their servers, and match them against those stored in the database. If some servers have been added, they are added to the database, but set as inactive. A mail will then be sent to the administrator, stating which servers have been removed from the IRC network and should be removed from the database, and which one have been added to the database and should be bound to a logical group and set as active. Until the administrator connects to the database to commit the change, nothing will be done. A copy of the second program is run for each bot and fetches a webpage (hosted in our web server) listing the active IRC servers of the database. The configuration file of the bot is then rebuilt according to the fetched page and the bot process is rehashed. 2.4.4 Blacklist synchronization Because this list holds the channels having abused our resources, it is best to share it with other bot lending projects in order to avoid them to face a similar situation. Each bot lending project willing to synchronize their list will have to publish it using a webpage, protected by a password. The program will fetch each page, compare their entries with the database, and add them if required. The removal of each entry is done using the web interface, and in order not to add removed entries, they are set as inactive in the database. 2.4.5 Daily channel log This program sends the log of the home IRC channel, each day, to the project’s administrators willing to receive it. The selection to receive it or not is done through the profile administration, using the web interface. It connects to the database and find out which administrators have set their profile to receive this mail and send them the log file of the hub bot. By doing this, each administrator will have the option of being aware of the channel activity, even when absent. Guillaume Tournand <guillaume@tournand.com> September 2003 39/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 2.4.6 The servers’ backup As we have seen, our servers are old. Therefore the case of hardware failure has to be seriously taken into account. To face such a scenario, the worst case has been imagined: the complete loss of a server. To recover from such a loss, the best is to plan scheduled backups of each server and copy these backups on separate servers. Figure 2.7: Domain backup Step 1: each server compresses all its configuration and data files in an archive. Step 2: these archives are copied to ns2.loufiz.com. Step 3: the received archives on ns2.loufiz.com are compressed in a single file, and then copied to ns1.loufiz.com. Guillaume Tournand <guillaume@tournand.com> September 2003 40/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 3 Realization 3.1 The botnet 3.1.1 The bot software The eggdrop software (http://www.eggheads.org/) has been chosen because this program is a mature, widely used distribution and its high flexibility allows users to make it run separate TCL (Tool Common Language) scripts in order to add new functionalities to the bot, or permits a better integration with the IRC network and its related services. Several websites are search engines for scripts developed and published by third parties (i.e.: http://www.egghelp.org/). The eggdrop version used is v1.6.13. 3.1.2 The home channel problem Eggdrops require that a “home channel” is hard coded in the configuration file; the other channels and their associated records are added / removed in a separate file (the channel file). This leads to a situation where all the bots are parked in a channel, and by that decreasing the maximum number of channels each bot can join to 9. The solution is to set the home channel as “inactive” in the configuration file: the bot still has the record of this channel but does not join it. With this solution, each logical bots group can protect up to 10 channels. In our case, because we have 6 logical groups, we can protect up to 60 channels; and the project is set as full when this amount is reached. A sample configuration file of the hub and a leaf bot can be found in the appendix A of this document. 3.1.3 At operating system level As stated in the design section, each bot runs in a separate user account. Additionally, each bot process is checked at scheduled intervals using the UNIX crontab system. This checkup is performed by botchk.sh, provided with the eggdrop distribution, and ensures that the bot process is properly running. If not, it will run it. BSD operating systems provide a nice feature to enforce internal security: the fake ident responses. Because each bot process requires answering to RFC 1413 ident requests, it usually replies the user name of the account, revealing by that the account name. By using the fake ident, answers to ident requests are still valid, but can be arbitrarily defined. As detailed in the design part, the different bot processes on each server is set to share as much common files as possible, in order to ease the update procedures. Guillaume Tournand <guillaume@tournand.com> September 2003 41/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Figure 3.1 below shows the eggdrop/ folder holding the common files as well as the home directory of the eggdrops’ accounts. Figure 3.1: The eggdrop/ shared folder For security reasons, all eggdrop accounts are bound to a group (eggdrops) and the shared files are owned by a dedicated account (eggdrops). Figure 3.2 lists the content of the files located in each eggdrop’s home directory, which are its configuration, channels’ and users’ files as well as their related backup files. Additionally it holds the log folder of the eggdrop process and the botchk shell script. Figure 3.2: The eggdrop home folder Guillaume Tournand <guillaume@tournand.com> September 2003 42/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 3.1.4 Eggdrops’ extra scripts A copy of these scripts can be found in the appendix A of this document. x.tcl: This script has been developed by Alexander Maassen aka Outsider from another bot lending project on Undernet (Key2peace / http://www.key2peace.org/) for the Loufiz project. It ensures a good integration of each bot with the Cservice bot (named X) by allowing our eggdrops to authenticate to X, and perform several operations their access level allows (remove a ban set on a bot, request operator status and make X invite the bot in the desired channel). Special care has also been taken to ensure each bot will not flood X with multiple requests. reop_bot.tcl: This script has also been developed by Alexander Maassen aka Outsider for the Loufiz project, to allow each bot to give back the operator status to another bot of the botnet. identhost.tcl: This script has also been developed by Alexander Maassen aka Outsider for the Loufiz project. When triggered using a defined channel message, it sends via notice the ident@host of the user who triggered it. Its purpose is to help users who have no clue of what their ident@host is, to fill up the identifier creation web form. loufiz_newapp.tcl: This script has been developed by Craig Shue aka Shoey (IRC operator on Undernet) from another bot lending project on Undernet (Acetone / http://www.acetone.org/), for the Loufiz project; in order to take a snapshot of each channel requesting eggdrops. It makes the hub bot join the requesting channel and discovers how many users are present, making a difference between “real” users and clones (several connections made from a single IP), and find out how many users are operator of this channel. The result is then sent to the project administrators on IRC, and displayed in the hub bot’s telnet administration interface (also called “the partyline”). The command and the associated result are sent and retrieved by using the scheduled updates from database to the botnet. bnusers: In order to dispatch instructions from the hub to the leaf bots, a script (which can be downloaded from eggdrop related websites) called bnusers is loaded in each bot. This script is declined in 2 flavors: a master script (bnusers_master.tcl) loaded in the hub; and a slave script (bnusers_slave.tcl) loaded in each leaf. greetd.tcl: This script sends a greeting via notice to all users joining the channel. It is used, in addition of the channel’s topic, to give them the website address. It can be downloaded from eggdrop related websites. weeder2000.tcl: This script has been developed by Julien Breviere aka Nighty (IRC operator on Undernet), and can be downloaded here: http://www.bluesmoke.org/irc/tcl/weeder2000/. It is loaded on the bot not linked to the botnet, to ease the administration of the project’s home channel. Its basic functionalities allow project’s administrators to make the bot perform several actions, triggered by channel messages (i.e.: change topic, kick / ban unwanted users …). Guillaume Tournand <guillaume@tournand.com> September 2003 43/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 3.2 The database The chosen database is MySQL (http://www.mysql.com/), which has the advantage of being widely spread and well integrated with / by other free software. The MySQL version used is 3.23.36. In order to ease the administration of the database, phpMyAdmin (http://www.phpmyadmin.net/ - a web suite for database management) has been installed. The listing of the tables and their syntax does not represent a big interest. They have been created according to the design, and their SQL code can be found in the appendix B of this document. Guillaume Tournand <guillaume@tournand.com> September 2003 44/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 3.3 The web interface The website uses CSS (Cascade Style Sheets), which are files located in a custom folder (defining the font, background …); defining a global new look for the website display is doable by these files modification. The dynamic content is displayed by the web interface by using the PHP language (Hypertext Preprocessor http://www.php.net/). Its benefits of a good interoperability with databases (like MySQL) and an easy integration with the Apache web server (http://www.apache.org/). The PHP version used is 4.2.1. The language set by default for the website is defined by the language of the web browser: if the language of the browser is French the language will be set as French, English otherwise. Swapping language is done very conveniently by clicking on the desired language flag (see picture below). The displayed page will refresh with the new selected language. This click sets a new value to the language variable in the PHP session, and refreshes the page. Because every page includes the text to display from a shared folder (the name of the folder corresponds to the language variable), changing the current language does not send the visitor back to the home page of the website. Figure 3.3: The language swap Each web form is displayed by a PHP page and its validation sends all input to the associated PHP page, which checks, process the input, and displays the result as seen in the design section. The check section of the pages ensures that all mandatory fields of the form have been filled up, that no “illegal” characters have been written (for example a channel name can not contain any space), that the user performing the operation has enough access to perform this operation, and that no other concurrent entry already exist in the database (for example to prevent a user to apply for a channel the project already protects). The conditions of services set to define the projects scope and limits can be found in the appendix C of this document, as well as the PHP source code of the website. Guillaume Tournand <guillaume@tournand.com> September 2003 45/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 3.3.1 Secure communications The secure communications between the users’ browser and the web server are provided by the SSL encryption. The setup of such a system requires a valid SSL certificate, which is often not given for free. Yet, a website (http://www.freessl.com/) provides such certificates for free, certificates having a maximum lifetime of 1 (one) year. 3.3.2 The files organization The PHP files are split in folders following this organization: 3.3.2.1 User side The pages requiring user authentication for security reasons (the administration of identifier, channel or view the eggdrops information), found the authentication data in the PHP session, which are stored there at login. - - - eggdrop/ holds the pages to : o View the conditions of service. o Create an identifier. o Make a bots request. o View the FAQ. o View the command list for the eggdrops. o View the links to other websites. eggdrop/admin/ holds the users’ administration pages to: o Follow up the eggdrops requests. o Log in. o Administrate their identifier. o Administrate their channels. o List of accesses grantable to registered users on their channels. o View the lent eggdrops’ information. o Log out. eggdrop/admin/pass_perdu/ holds the pages to send via mail the user’s password and their identifier when forgotten. eggdrop/admin/retrait/ holds the pages to withdraw the lent eggdrops from their channel, or transfer ownership to another registered user. Guillaume Tournand <guillaume@tournand.com> September 2003 46/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 3.3.2.2 Administrator side The admin/ folder, and all the sub-folders, are protected by the Apache session, causing a popup to appear when trying to access the folder, and generating a web error 401 if the authentication is incorrect. The access file protecting this folder is generated by using the “htpasswd” command. - - - admin/ holds the project administration pages to : o Review eggdrops requests. o List all the channels protected by the project. o List all the registered users. o View the monitoring of the eggdrops, and purge with a click the channels having problems for too long. o View the comments written by users at eggdrops request. o Update web links. o List the administrators of the project. o View the list of the possible reasons to refuse an eggdrops request. admin/admin_management/ holds the pages to list / add / remove project administrators. admin/blacklist/ holds the pages to list / add / remove channels from the blacklist. admin/management/ holds the pages to : o Search a user, a channel or an eggdrop in the database. o Administrate any identifier. o Administrate any protected channel. o Purge any protected channel. admin/perl/ holds the page to rebuilt the botnet’s channels and users list according to the database. 3.3.2.3 The include/ folder Because many pages performs very identical operations based on identical input, on the User and Administrator side, their common PHP codes is shared in a folder (the include/ folder), and are included when required. A logical link to the include/ folder is created in each of the previous listed folders, and it holds the shared PHP code to: - Log out. - Administrate an identifier. - Administrate a channel. - View the eggdrops’ information. - Purge a channel. Besides, this folder stores the PHP pages holding shared functions amongst the web pages, global website scope defined variables (i.e.: the IP, login and password to the database), the CSS files, and of course the different languages of texts displayed in the web pages (here English and French). For security reasons, to prevent running the PHP code from this folder, all files names begins with “.ht”. The Apache web server sends a web error 401 to anyone trying to remotely access these files. Guillaume Tournand <guillaume@tournand.com> September 2003 47/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 3.3.3 Screenshots of the web interface 3.3.3.1 User side Prior to create an identifier, the conditions of service are displayed. Going any further will imply that the user accepts them. Figure 3.4: Identifier creation In order to help users with their ident@host, the page detects which IP the user is connecting from and fills up the host part of the ident@host. Guillaume Tournand <guillaume@tournand.com> September 2003 48/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Figure 3.5: Eggdrops request The FAQ (Frequently Asked Questions) As said in the design section of this document, the FAQ acts as a knowledge base. In our case, it holds more than 50 questions and their related answers. Figure 3.6: The FAQ – question Guillaume Tournand <guillaume@tournand.com> September 2003 49/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Figure 3.7: The FAQ - answer Figure 3.8: Web links to other bot lending projects on Undernet. Guillaume Tournand <guillaume@tournand.com> September 2003 50/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Figure 3.9 :Web links to partners’ websites displaying the Loufiz project’s banner. Guillaume Tournand <guillaume@tournand.com> September 2003 51/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Figure 3.10: User login Guillaume Tournand <guillaume@tournand.com> September 2003 52/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Figure 3.11: Eggdrops request follow up Figure 3.12: Eggdrops request follow up for the channel #fairfax Guillaume Tournand <guillaume@tournand.com> September 2003 53/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Figure 3.13: Identifier administration When clicked, the links stating the channel names allow the user to administer these channels. Guillaume Tournand <guillaume@tournand.com> September 2003 54/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Figure 3.14: Channel administration The link on the channel name is an IRC link: it uses the IRC protocol to make an IRC client running on the user’s computer joining this channel. IRC links have this syntax: irc://irc.server.com/channel_name. Because this screenshot has been taken from the administration side of the website, all identifiers are displayed as web links (linking to the identifier administration page). On the user side, the only link pointing to the identifier administration is the own user’s identifier; the other identifiers are displayed as plain text. As well, the link “Monitoring of this channel” is not displayed on the user side. Clicking on the “Access list” link pops up the list of accesses grantable to registered users on the protected channels; figure 3.15 is a screenshot of this pop up. Finally the links on the eggdrop names permits the user to view the details of the lent eggdrops. Guillaume Tournand <guillaume@tournand.com> September 2003 55/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Figure 3.15: List of the accesses grantable to registered users on the protected channels These accesses are taken from a database’s table: op_levels, which mean that adding or removing an access from this list is done by adding or removing a row of this table. Guillaume Tournand <guillaume@tournand.com> September 2003 56/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Figure 3.16: The lent eggdrops’ information This screenshot has been taken on the administration side; therefore all channel names are web links to administrate the different channels. These links are displayed as plain text on the user side if the user has no access to administrate the channels. For security reasons, the password of the eggdrop on Cservice, its IP address, and port number are hidden on the user side. Guillaume Tournand <guillaume@tournand.com> September 2003 57/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Figure 3.17: Password and identifier retrieval Figure 3.18: Eggdrop withdrawal, or transfer ownership to another registered user Guillaume Tournand <guillaume@tournand.com> September 2003 58/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 3.3.3.2 Administrator side Figure 3.19: Administration index The percentage of the project use is calculated as follow: Number of channels currently protected × 100 Maximum number of channels that can be protected Knowing that each logical bots group can join up to 10 channels, our 6 logical bots groups can protect up to 60 channels. When the project is full (its reaches 100% use), no more eggdrops request can be done through the web interface, and an instruction is inserted in the botnet’s instruction table to change the home channel topic and notify IRC users about it. In order to view at a glance which eggdrops are connected to the IRC network, connected eggdrops’ names are displayed in blue, disconnected ones in red. Guillaume Tournand <guillaume@tournand.com> September 2003 59/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Figure 3.20: Review eggdrops requests The web links on the channel name, and identifier respectively points to the channel and identifier administration pages. The rejection sliding menu displays the different reasons of rejecting an eggdrops request. The validation sliding menu displays the logical eggdrops groups which have not reach their maximum number of 10 channels These sliding menus’ records are taken from tables of the database, meaning that adding / removing items in these menus is easily done by adding / removing entries in these tables. The “ignore for 24H” checkbox, checked by default, does not permit a user to re-apply for this channel before 24 hours, if the application is rejected. The “ident@host warning” checkbox is used to warn a user that chances are that his ident@host has not been properly set, if the application is accepted. Guillaume Tournand <guillaume@tournand.com> September 2003 60/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Figure 3.21: List of the registered users Guillaume Tournand <guillaume@tournand.com> September 2003 61/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Figure 3.22: List of the protected channels Guillaume Tournand <guillaume@tournand.com> September 2003 62/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Figure 3.23 Monitoring of the protected channels This table allows administrators to see at a glance if some protected channels are experiencing problems, meaning that their state is against our conditions of service. If it has been in this way for too long (the concept of “too long” is defined by variables in the PHP code), a button “purge” appears on the right hand side, as we can see for the channel #exes; clicking on this button automatically purges the channel. The web link on the channel name links to the administration of the channel, while the link on the language column is an IRC link. The language is displayed here to inform administrators what language they should be expecting to speak if they join this channel. Each field has to be read from left to right. With #exes as example, it states: - The language set in the owner’s profile is English. - The 3 eggdrops answered during the monitoring of this channel. - 0 eggdrops are operator of this channel, since 16 hours. - Eggdrop 1 found 8 users present in the channel. o The amount of user detected by eggdrop 1 is below 10 users since 0 days. - Same users report for eggdrops 2 and 3. - X (the official Cservice bot) is present in the channel, meaning that the channel is registered by Cservice. This has not changed since 2 days. o Because it is registered, the accesses for the lent eggdrops have been checked to be properly set on X; here the 3 accesses have been properly set. - This row has been updated the 30th August 2003 at 20H00. Guillaume Tournand <guillaume@tournand.com> September 2003 63/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Figure 3.24: The users’ comments Guillaume Tournand <guillaume@tournand.com> September 2003 64/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Figure 3.25: Update the list of other bot lending projects on Undernet Figure 3.26: Update the web links of the partners of the Loufiz project Guillaume Tournand <guillaume@tournand.com> September 2003 65/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Figure 3.27: List of the project’s administrators Figure 3.28: Reasons of eggdrops request refusal Guillaume Tournand <guillaume@tournand.com> September 2003 66/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Figure 3.29: Add or remove administrators Adding an administrator transparently performs the following: - Add an instruction for the botnet to give global operator access for the identifier. - Perform a shell level command to add his login in the Apache file, in order to grant him access in the administration section of the website. - Creates an e-mail nick@loufiz.com by using a shell level command. - Add the created e-mail in the eggdrops@loufiz.com mailing list. Removing an administrator, of course, performs the opposite. Guillaume Tournand <guillaume@tournand.com> September 2003 67/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Figure 3.30: Blacklist edition As we can see, blacklist entries come from both the Acetone and the Loufiz bot lending projects. The web form just above the list allows administrators to filter which entries will be displayed, entering the channel name or the admin who added the channel in the blacklist. Guillaume Tournand <guillaume@tournand.com> September 2003 68/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Figure 3.31: Database search and purge protected channels Project administrator’s identifier special feature Project administrators can select (by editing their identifier) what kind of mail traffic they want to receive. For example, the figure 3.32 shows the selection LZ-6 made: Figure 3.32: Administrators’ mail traffic selection Furthermore, to allow project administrator to easily filter incoming mail from the Loufiz project, each mail’s subject begins with “[www.loufiz.com]”. Guillaume Tournand <guillaume@tournand.com> September 2003 69/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Rebuilding the botnet’s channel and user list according to the database This rebuilt is performed by a dynamic Perl page (http://www.perl.org/), which runs only if no other instance are already running, connects to the hub bot, dynamically detects which bots are currently connected to the botnet, check the channels each bot is on, and make correction if necessary. Then it erases the entire shared user list, re-creates it and closes the connection to the botnet. This is the curative solution to a possible loss of convergence between the botnet and the database. The page displays the current state of the operation by using http push and pull. This system allows a web server to keep a connection opened while sending chunks of information to the web browser, until the task is complete. The result is a webpage where text is displayed step by step, allowing the administrators to follow the remote operation in real time. At system level, the task is achieved by a forked process of the web server. This also ensure that if the web user closes his browser (or get disconnected), the operation will continue and complete. Figure 3.33: The bots’ channels check Guillaume Tournand <guillaume@tournand.com> September 2003 70/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Figure 3.34: The user list deletion and reconstruction Servers’ monitoring To have a web display (publicly viewable) of the current state of the servers, Big Brother (http://www.bb4.com/) has been installed. It has the advantage to be easy to set up, and its simplicity makes it highly customizable. Figure 3.35: The big brother monitoring Guillaume Tournand <guillaume@tournand.com> September 2003 71/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 3.4 Scheduled programs The chosen language to develop these programs is Perl (http://www.perl.org/), for many reasons. First of all, this language benefits from a very wide community, whose work provides many modules that can be used to perform specific tasks. In other words, there is no need to re-invent the wheel at each step of the development. These modules and their associated documentations can be found at http://cpan.perl.org/. Moreover this language implements regular expressions (Regexp). This advantageous functionality allows programs to be able to distinguish and work on specified strings from a text; for example a program able to locate all the numbers in a text. Finally programs built with this language can be run at shell level or through a web page (as we saw in the previous sub-chapter). Being able to run programs at shell level permits easy debug stages, where debug messages are displayed at shell level. The Perl version used is 5.005_03. The source codes of these programs can be found in the appendix D of this document. 3.4.1 Database to botnet updates. This program requires the following Perl modules: - DBI, in order to connect to a database. - Net::Telnet, which provides easy support to create and use telnet connections. In order to prevent 2 instances running simultaneously, the program checks if a PID file exists (a file holding the process identifier number of the other instance) at startup and stops if it finds it. Otherwise, it creates this file and will delete it before ending. The program connects to the database and fetches the content of the table holding the instructions generated by the web interface for the botnet, in the order they have been inputted in the table. If some instructions are present, it connects to the hub bot of the botnet via telnet, and for each instruction: - Send it through the telnet connection. - Wait for an acknowledgement defined by the “Ack” field of the table for 25 seconds before timeout. There are 2 flavors for the acknowledgements: either it is like “task done”, or “task has already been done”. - If the acknowledgement has been successfully received within the 25 seconds, the instruction is removed from the table. - Finally it waits 1 second before sending the next instruction, in order to prevent flood. This program is set to run every minute. Guillaume Tournand <guillaume@tournand.com> September 2003 72/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 3.4.2 Botnet monitoring This program requires the following Perl modules: - DBI, in order to connect to a database. - Net::Telnet, which provides easy support to create and use telnet connections. - SOAP:Lite, to connect to a remote SOAP server. SOAP (Simple Object Access Protocol) allows program to summon and manipulate remote objects. These objects are encapsulated in XML. In order to prevent 2 instances running simultaneously, the program checks if a PID file exists at startup and stops if it finds it. Otherwise, it creates this file and will delete it before ending. It connects to the botnet and finds out which bots are presently connected to the botnet. This list of bots is found by parsing the result of the “.bots” command. It connects to each bot found and save the result of each “.status” command. Example of this output from the eggdrop Lespaul : I am Lespaul, running eggdrop v1.6.13: 180 users (mem: 192k) Online for 174 days, 16:35 (background) CPU 119:15 cache hit 20.3% Admin: Nolderise <nolderise@loufiz.com> Config file: lespaul/lespaul.conf OS: FreeBSD 4.3-RELEASE Tcl library: /usr/local/lib/tcl8.3 Tcl version: 8.3.3 (header version 8.3.3) Channels: #Loufiz, #loufiz-demo, #bisligtrivia, #velez, #lecentral, #lamontagne(need-op), #senegal, #kitaro, #hibaru, #pointblank Online as: Lespaul!Lespaul@LesPaul.users.undernet.org (http://www.loufiz.com/ #Loufiz) Server mesa.az.us.undernet.org:6667 (connected for 16 days) #Loufiz : channel is set +inactive #bisligtrivia: 33 members, enforcing "+n" (greet) #velez : 35 members, enforcing "+n" (greet) #lecentral: 29 members, enforcing "+n" (greet) #lamontagne: 7 members, enforcing "+n" (greet) #senegal : 15 members, enforcing "+n" (greet) #kitaro : 10 members, enforcing "+n" (greet) #hibaru : 17 members, enforcing "+n" (greet) #pointblank: 18 members, enforcing "+n" (greet) With this single output, we have the following information: - On which IRC server the bot is presently connected (in red). If the bot is disconnected, “no server currently” is displayed instead of the server’s name. This data is immediately stored in the eggdrops table. - The list of the channels the bot is present on (in blue), and whether it is op or not; channels where the bot is not op have “(need-op)” after the channel name (i.e.: #lamontagne). - The amount of users in each channel. These data are extracted from the output, and for each channel it requests to Cservice whether the channel is registered by them or not. To achieve this, it first tries to use their SOAP interface, and if unsuccessful it repeats the request by using the IRC protocol. This SOAP part has been developed to spare bandwidth. Guillaume Tournand <guillaume@tournand.com> September 2003 73/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project If the channel is registered by Cservice, the program checks that the accesses set on X for the lent bots have been set according to our conditions of service. Again, it tries with SOAP first, an if unsuccessful with IRC. The answer is awaited for 20 seconds before the request times out. To avoid flooding, a pause of 15 seconds is performed between 2 requests. For each channel, it stores the data in the database, and checks if the following fields match our conditions of service: - If the bots have the operator status or not. - If there are more than 10 users present in the channel. - If the accesses have been properly set for the lent bots on X (only if the channel is registered by Cservice). If a field does not match our condition of service, its associated time field is not set to the current time. This allows finding out through the web interface since how long a channel experiences a problem and taking action if the situation has remained the same for too long. This program is set to run every hour. 3.4.3 Botnet’s server lists update As explained in the design section, this task is split in 2 programs: one updating the database’s entries of the Undernet’s IRC servers, and another one updating each bot’s server list. Update of the database: This program requires the following Perl module: - DBI, in order to connect to a database. It fetches the Undernet’s webpage listing the active IRC servers of the network, extracts the data, and matches them against the entries of the database. It adds the new IRC server(s) to the database, but sets them as inactive. It then sends a mail to the administrator to warn him that changes have been found in the IRC network map. The administrator has to connect to the database, bind the new server(s) to a logical IRC server group and marks the entry as active. If some servers have been removed, the administrator has to set the obsolete entries as inactive. This program is set to run every week. Guillaume Tournand <guillaume@tournand.com> September 2003 74/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Update of the bots’ server list: This program requires no specific module One instance of this program is run for every bot’s process. It fetches a web page hosted by the web server which lists the active IRC servers of the database, extracts these data, and rebuilt the bot’s configuration file according to these extracted data. Then it rehashes the bot’s process with a shell level command (kill –HUP <pid of the bot process>) to make it take under account the updates. This program is set to run every week. However, the theory of the design did not take into account a possible cause of problem: de-linked Undernet’s IRC server having their entry in the Undernet’s DNS rebound to another active server. If an eggdrop is connected to this server when its configuration file is rebuilt, it will not disconnect from the server and connect to a new one, but remains connected, very probably to an incorrect IRC server logical group. Therefore a third program has been developed to check if each bot is connected to an IRC server which belongs to its IRC server logical group. Checkup of the IRC servers each bot is connected to: This program requires the following Perl module: - DBI, in order to connect to a database. Because the monitoring of the eggdrops updates the field of the eggdrops’ table holding the name of the IRC server each eggdrop is connected to, the program only has to match the name of the server against the name of the servers belonging to the eggdrop’s IRC server logical group. If this name is not present in the list, it sends a mail to the administrator. This program is set to run every hour. Guillaume Tournand <guillaume@tournand.com> September 2003 75/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 3.4.4 Blacklist synchronization This program requires the following Perl module: - DBI, in order to connect to a database. Each bot lending project publishes their blacklist on web pages, hosted by their respective web servers. The program fetches this page, and extracts the data from it. These data are matched against the database’s entries and it only adds the absent entries; it is up to each bot lending project to remove the unwanted entries. To avoid removed entries being added at next synchronization, they are not deleted from the table, but marked as inactive. This program is set to run every 15 minutes. 3.4.5 Daily channel log This program requires the following Perl module: - DBI, in order to connect to a database. The program fetches the list of administrators who have set to receive this daily mail, and their e-mail addresses. It then sends the content of the daily log file generated by the hub bot to each of the fetched mail addresses. This program is set to run every day. 3.4.6 The servers’ backup The backup of the servers is performed by a set of 2 programs developed in shell language (SH). The first program is run on each server and realizes the steps 1 and 2 explained in the design section: it creates an archive (a compressed file using the tar program) of the configuration and data files and copies them into ns2.loufiz.com. The copy is realized using the FTP protocol (File Transfer Protocol). The second program is run on ns2.loufiz.com and performs the third step of the backup strategy, which is to create an archive of the copied archives and transfer the resulting file to ns1.loufiz.com. Before performing any archiving operation, the archive generated by the previous instance of the backup is saved; this allows keeping the backups of the previous and present state. Additionally, the content of the database is dumped in SQL syntax, in a text file, daily. These two programs are set to run every week. Guillaume Tournand <guillaume@tournand.com> September 2003 76/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project 4 Analysis This project has been a great opportunity to practice theoretical knowledge learned during my engineering studies in computer science: many interesting technologies (TCP/IP, Web, mail, DNS, FTP, IRC, SSH, SSL, database, SOAP) and development languages (SH, Perl, PHP, HTML, SQL) are part of this project. Furthermore, I also had a first experience managing a team of administrators spread worldwide, having never met, and having different languages, ages and cultures. This rewarding experience gave me the pleasure to witness the creation of a community around this project, on IRC: if many users were only visible at the bot request time, some expressed their gratitude by giving part of their free time helping other users in order to keep the spirit of the project alive. 2.5 years of services delivery Figure 4.1: Graph of the distribution of activity over 2.5 years Phase 1 (2001): platform installation and integration with its surrounding environment. Phase 2 (2002): the project becomes more and more popular and trustful, thanks to partners displaying the banner on their websites and word of mouth. Phase 3 (2003): regular activity. During these 2.5 years of activity: - 700 protected channels. - 2200 bots requests. - 2500 registered users. - Bots ran on full use 80% of the time. - Never have had any problem requesting help of operators of the IRC network, nor draw their attention to ourselves. Guillaume Tournand <guillaume@tournand.com> September 2003 77/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Citizens from the following countries have used our services: - Argentina Australia Austria Belgium Brazil Bulgaria Canada Chile Colombia Cyprus Denmark Estonia Finland France Germany Greece Hungary Iceland Indonesia Israel Italy Japan Latvia Lithuania Luxembourg Malaysia Mauritius Mexico Netherlands New Zealand Norway Pakistan Philippines Poland Portugal Romania Russian Federation Seychelles Singapore Slovenia Spain Sweden Switzerland Turkey United Kingdom U.S.A. Yugoslavia Guillaume Tournand <guillaume@tournand.com> September 2003 78/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project The servers also surprised me by their stability in spite of their advanced age, as shown in figure 4.1 below. Figure 4.2: ambt.loufiz.com uptime The other bot lending projects Gathering data about the organization of other bot lending projects on Undernet is not an easy matter: for some reasons their administrators do not want to give away information about the internal organization of their project. However, an external view reveals that only very few bot lending projects have chosen to develop an interface which orchestrates the different flows. If they did, the interface is at IRC level, done using TCL scripts, binding them to the eggdrop technology, and missing the visual advantages of the web. Paradoxically almost all the other projects hold an entire team of developers. Finally, none of the other projects offers distributed bot lending projects by implementing the concept of logical bot groups, and they usually only lend one or two bots per channels. I am confident that the release of this document will help other bot lending projects. Future expansion of the project Since a single server hosts the database, the web server and the botnet’s hub, it represents the single point of failure of the platform. Yet if this server experiences problems, the platform will still operates; the service will still be delivered, but no updates could be sent: the platform’s configuration will be frozen at the state it was when this server crashed. Ideally the operating system of this server should be distributed amongst several servers’ hardware, creating one virtual server hosted by a cluster of servers. This HAC (High Availability Cluster) could then host the different services. Guillaume Tournand <guillaume@tournand.com> September 2003 79/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project References - - [01] The Internet Engineering Task Force: http://www.ietf.org/ o RFC 1459 (May 1993) o RFC 2810 (April 2000) o RFC 2811 (April 2000) o RFC 2812 (April 2000) o RFC 2813 (April 2000) [02] Eggdrop distribution development: http://www.egghead.org/ [03] Shaye Lennox, Eggdrop support: http://www.egghelp.org/ [04] Undernet IRC network: http://www.undernet.org/ [05] Apache open source web server: http://www.apache.org/ [06] MySQL open source database: http://www.mysql.com/ [07] The phpMyAdmin project: http://www.phpmyadmin.net/ [08] PHP documentation and resources: http://www.php.net/ [09] Perl documentation and resources: http://www.perl.org/ [10] Perl modules documentation: http://cpan.perl.org/ [11] Big Brother monitoring documentation: http://www.bb4.com/ Guillaume Tournand <guillaume@tournand.com> September 2003 80/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Appendix A The botnet Guillaume Tournand <guillaume@tournand.com> September 2003 81/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project The hub bot configuration file #! /usr/home/eggdrops/adam # ^- set that to the directory eggdrop is in ie "#! /home/lamest/egg/eggdrop" # # $Id: eggdrop.complete.conf,v 1.27 2001/01/31 05:34:23 guppy Exp $ # # this config file includes all possible options you can # use to configure your bot properly. # be sure that you know what you are doing! # # more detailed descriptions of all those settings can be found in # doc/settings/ ##### GENERAL STUFF ##### # the username the bot uses, this is only used if identd isn't working # on the machine the bot is running on. set username "Ad4m" # who's running this bot? set admin "Nolderise <nolderise@loufiz.com>" # what IRC network are you on? this is just info to share with others on # your botnet, for human curiosity only. set network "Undernet" # what timezone is your bot in? # The timezone string specifies the name of the timezone and # must be three or more alphabetic characters. # ex. Central European Time(UTC+1) could be "CET" set timezone "CET" # offset specifies the time value to be added to the local time # to get Coordinated Universal Time (UTC aka GMT). # The offset is positive if the local timezone is west of the # Prime Meridian and negative if it is east. # The value(hours) must be between 0 and 24 # ex. if the timezone is UTC+1 the offset is -1 set offset "-1" # If you dont want to use the timezone setting for scripting # purpose only but instead everywhere possible (new) then # uncomment the next line. #set env(TZ) "$timezone $offset" # if you're using virtual hosting (your machine has more than 1 IP), you # may want to specify the particular IP to bind to. you can specify # either by hostname or by IP. you may also want to set the hostname # here if eggdrop has trouble detecting it when it starts up. (it will # let you know if it has trouble -- trust me.) #set my-hostname "virtual.host.com" #set my-ip "99.99.0.0" # if you want to have your eggdrop messages displayed in another language # change the below command to match your preferences. An alternative would # be to set the environment variabel EGG_LANG to that value. #addlang "english" ##### LOG FILES ##### # you can specify how many log files you can have upto. at midnight every # day, the old log files are renamed and a new log file begins. by default, # the old one is called "(logfilename).yesterday", and any logfiles before # yesterday are erased. Guillaume Tournand <guillaume@tournand.com> September 2003 82/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # events are logged by certain categories -- this way you can specify # exactly what kind of events you want sent to various logfiles. the # events are: # m private msgs/ctcps to the bot # k kicks, bans, mode changes on the channel # j joins, parts, netsplits on the channel # p public chatter on the channel # s server connects/disconnects/notices # b information about bot linking and userfile sharing # c commands people use (via msg or dcc) # x file transfers and file-area commands # r (if use-console-r defined) EVERYTHING sent to the bot by the server # o other: misc info, errors -- IMPORTANT STUFF # w wallops: msgs between IRCops (be sure to set the bot +w in init-server) # There are others, but you probably shouldnt log them, it'd be rather # unethical ;) # maximum number of logfiles to allow - this can be increased if needed # (don't decrease this) set max-logs 5 # maximum size of your logfiles, set this to 0 to disable. # this only works if you have keep-all-logs 0 (OFF) # this value is in KiloBytes, so '550' would mean cycle logs when # it reaches the size of 550 KiloBytes. set max-logsize 50000 # write the logfiles and check the size every minute # (if max-logsize is enabled) instead of every 5minutes as before. # This could be good if you have had problem with the # logfile filling your quota or hdd or if you log +p # and publish it on the web and wants more uptodate info. # If you are concerned with resources keep the default setting 0. # (although I haven't noticed anything) set quick-logs 0 # each logfile also belongs to a certain channel. events of type 'k', 'j', # and 'p' are logged to whatever channel they happened on. most other # events are currently logged to every channel. you can make a logfile # belong to all channels by assigning it to channel "*". there are also # five user-defined levels ('1'..'5') which are used by Tcl scripts. # in 'eggdrop.log' put private msgs/ctcps, commands, misc info, and # errors from any channel: logfile mkjsbco * "adam/logs/eggdrop.log" # in 'lame.log' put joins, parts, kicks, bans, and mode changes from #lamest: logfile jkp #loufiz "adam/logs/loufiz.log" # [0/1] timestamp entries in the log file? (generally a good idea) set log-time 1 # [0/1] keep logfiles for more than 48 hours -- instead of being called # "(logfilename).yesterday", the log files are named by the current date, # and kept around forever (eventually your directory might get full, so # be careful with this!) set keep-all-logs 0 # if keep-all-logs is 1, this setting will define the suffix of the logfiles. # The default will result in a suffix like "04May2000". "%Y%m%d" will produce # the often used yyyymmdd format. Read the strtime manpages for more options. # NOTE: On systems which don't support strftime, the default format will # be used _always_. set logfile-suffix ".%d%b%Y" # once a day the logfiles are switched out and started fresh -# this specifies when that should happen (in military time) # [note that a leading 0 will make Tcl think this is an octal value, Guillaume Tournand <guillaume@tournand.com> September 2003 83/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # something you probably don't want.] set switch-logfiles-at 300 # [0/1] enable quiet saves? "Writing user file..." and "Writing channel file ..." # will not be logged if this option is enabled. set quiet-save 0 # this is the default console mode -- what masters will see automatically # when they dcc chat with the bot (masters can alter their own console # flags once they connect, though) -- it uses the same event flags as # the log files # (note that the console channel is automatically set to your "primary" # channel -- the one you defined first in this file. masters can change # their console channel with the '.console' command, however.) set console "mkcobxs" ##### FILES AND DIRECTORIES ##### # the userfile: where user records are stored set userfile "adam/Adam.user" # [0/1] do you want the userlist to be sorted when saving set sort-users 0 # where the help files can be found (and there are plenty) set help-path "help/" # a good place to temporarily store files (ie: /tmp) set temp-path "/tmp" # the MOTD is displayed when people dcc chat to the bot. # type '.help set motd' in DCC CHAT for tons of motd options. set motd "text/motd" # holds the banner displayed on telnet connections set telnet-banner "text/banner" # Specifies what permissions the user, channel and notes files should be set # to. The octal values are the same as for the chmod system command. # # u g o u g o u g o # 0600 rw------- 0400 r-------- 0200 -w------- u - user # 0660 rw-rw---- 0440 r--r----- 0220 -w--w---- g - group # 0666 rw-rw-rw- 0444 r--r--r-- 0222 -w--w--w- o - others # # Most users will want to leave the permissions set to 0600, to ensure # maximum security. set userfile-perm 0644 ##### BOTNET ##### # you probably shouldn't deal with this until reading 'botnet.doc' or # something. you need to know what you're doing. # if you want to use a different nickname on the botnet than you use on # IRC, set it here: #set botnet-nick "LlamaBot" # what telnet port should this bot answer? # NOTE: if you are running more than one bot on the same machine, you will # want to space the telnet ports at LEAST 5 apart... 10 is even better # if you would rather have one port for the botnet, and one for normal # users, you will want something like this instead: #listen 3333 bots #listen 4444 users # NOTE: there are more options listed for the listen command in # doc/tcl-commands.doc Guillaume Tournand <guillaume@tournand.com> September 2003 84/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project listen 42000 all # [0/1] This setting will drop telnet connections not matching a known host # It greatly improves protection from IRCOPs, but makes it impossible # for NOIRC bots to add hosts or have NEW as a valid login set protect-telnet 1 # [0/1] This setting will make the bot ignore DCC chat requests which appear to # have bogus information on the grounds that the user may have been trying # to make the bot connect to somewhere that will get it into trouble, or # that the user has a broken client (like mIRC tends to do), in which case # the connect wouldn't work anyway. It's suggested that you turn this on. set dcc-sanitycheck 1 # and a timeout value for ident lookups would help (seconds) set ident-timeout 5 # [0/1] users with the +o (global or channel op) flag will still need the +p # (party line) flag to join the dcc chat party line? set require-p 1 # [0/1] allow people to telnet in, type 'NEW', and become a new user? # (If you set this to 1, you must set protect-telnet 0) set open-telnets 0 # [0/1] Display 'Nickname.' instead of identifying ourselves when people # telnet in. Set to 1 to only display Nickname. # (useful if someone portscans your machine, they wont know we're here) set stealth-telnets 1 # [0/1] Display a banner when people telnet in. set use-telnet-banner 0 # how long (in seconds) should i wait for a connect (dcc chat, telnet, # relay, etc) before it times out? set connect-timeout 15 # number of messages / lines from a user on the partyline (dcc, telnet) before # they are considered to be flooding (and therefore get booted) set dcc-flood-thr 3 # how many telnet connection attempt in how many seconds from the same # host constitutes a flood? set telnet-flood 5:60 # [0/1] apply telnet flood protection for everyone? # set this to 0 if you want to exempt +f users from telnet flood protection set paranoid-telnet-flood 1 # how long should I wait (seconds) before giving up on hostname/address # lookup? (you might want to increase this if you are on a slow network). set resolve-timeout 15 ##### MORE ADVANCED STUFF ##### # are you behind a firewall? uncomment this and specify your socks host #set firewall "proxy:178" # or, for a Sun "telnet passthru" firewall, set it this way # (does anyone besides Sun use this?) #set firewall "!sun-barr.ebay:3666" # if you have a NAT firewall (you box has an IP in one of the following # ranges: 192.168.0.0-192.168.255.255, 172.16.0.0-172.31.255.255, # 10.0.0.0-10.255.255.255 and your firewall transparently changes your # address to a unique address for your box.) or you have IP masquerading # between you and the rest of the world, and /dcc chat,/ctcp chat or # userfile shareing aren't working. Enter your outside IP here. Guillaume Tournand <guillaume@tournand.com> September 2003 85/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # Do not enter anything for my-ip or my-hostname. #set nat-ip "127.0.0.1" # if you want all dcc file transfers to use a particular portrange either # because you're behind a firewall, or for other security reasons, set it # here. #set reserved-portrange 2010:2020 # temporary ignores will last how many minutes? set ignore-time 15 # this setting affects what part of the hour the 'hourly' calls occur # on the bot, this includes such things as note notifying, # You can change that here (for example, "15" means to # notify every hour at 15 minutes past the hour) # this now includes when the bot will save its userfile set hourly-updates 00 # if compiled with owner, the following user(s) will ALWAYS have the # owner (+n) flag (You really should change this default) set owner "Nolderise , LZ-SYS" # who should I send a note to when I learn new users? set notify-newusers "$owner" # what flags should new users get as a default? # check '.help whois' on the partyline (dcc chat, telnet) for tons of # options. set default-flags "" # what user-defined fields should be displayed in a '.whois'? # this will only be shown if the user has one of these xtra fields # you might prefer to comment this out and use the userinfo1.0.tcl script # which provides commands for changing all of these. set whois-fields "url birthday" # [0/1/2] allow people from other bots (in your bot-net) to boot people off # your bot's party line? # values: # 0 - allow *no* outside boots # 1 - allow boots from sharebots # 2 - allow any boots set remote-boots 1 # [0/1] if you don't want people to unlink your share bots from remote bots # set this to 0 set share-unlinks 0 # [0/1] die on receiving a SIGHUP? # The bot will save it's userfile when it receives a SIGHUP signal # with either setting. set die-on-sighup 0 # [0/1] die on receiving a SIGTERM? # The bot will save it's userfile when it receives a SIGTERM signal # with either setting. set die-on-sigterm 1 # to enable the 'tcl' and 'set' command (let owners directly execute # Tcl commands)? - a security risk!! # If you select your owners wisely, you should be okay enabling these. # to enable, comment these two lines out # (In previous versions, this was enabled by default in eggdrop.h) unbind dcc n tcl *dcc:tcl #unbind dcc n set *dcc:set # [0/1/2] only let permanent owners use .tcl/.set if bound? then set it to 1 # moreover only let permanent owners use .dump? then set it to 2 Guillaume Tournand <guillaume@tournand.com> September 2003 86/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # (the people must set the $owner variable) set must-be-owner 2 # comment the following line out to add the 'simul' command (owners can # manipulate other people on the party line). # Please select owners wisely! Use this command ethically! #unbind dcc n simul *dcc:simul # maximum number of dcc connections you will allow - you can increase this # later, but never decrease it, 50 seems to be enough for everybody set max-dcc 50 # this setting is so that people can't send fake ports to your bot when # they try to dcc it. irc clients should never use a port below 1024 and # well 65535 is the highest port possible. this setting is used for telnet # too. set dcc-portrange 1024:65535 # [0/1] add the 'dccsimul' tcl command (needed by certain scripts like # action.fix.tcl) set enable-simul 1 # [0/1] allow +d & +k users to use commands bound as -|- ? set allow-dk-cmds 1 # If a bot connects which already seems to be connected, I wait # dupwait-timeout seconds before I check again and then finally reject # the bot. This is useful to stop hubs from rejecting bots that actually # have already disconnected from another hub, but the disconnect information # has not yet spread over the botnet due to lag. set dupwait-timeout 5 ########## MODULES ########## # below are various settings for the modules available with eggdrop, # PLEASE EDIT THEM CAREFULLY, READ THEM, even if you're an old hand # at eggdrop, lots of things have changed slightly # this is the directory to look for the modules in, if you run the # bot in the compilation directories you will want to set this to "" # if you use 'make install' (like all good kiddies do ;) this is a fine # default, otherwise, use your head :) set mod-path "modules/" #### DNS MODULE ##### # this module provides asynchronous dns support. This will avoid long # periods where the bot just hangs there, waiting for a hostname to # resolve, which often let it timeout on all other connections. loadmodule dns ##### CHANNELS MODULE ##### # this next module provides channel related support for the bot, without # it, it will just sit on irc, it can respond to msg & ctcp commands, but # that's all loadmodule channels # the chanfile: where dynamic channel settings are stored set chanfile "adam/Adam.chan" # temporary bans will last how many minutes? if set to 0, bot never removes # them. set ban-time 0 # temporary exemptions (+e modes) will last how many minutes? if set to 0, Guillaume Tournand <guillaume@tournand.com> September 2003 87/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # bot never removes them. This is an IRCNET feature. The bot will check the # exempts every X minutes, but will not remove the exempt if a ban is set on # the channel that matches that exempt. Once the ban is removed then the # exempt will be removed the next time the bot checks. set exempt-time 0 # temporary invitations (+I modes) will last how many minutes? if set to # 0, bot never removes them. This is an IRCNET feature. The bot will check the # invites every X minutes, but will not remove them if the channel is +i. Once # the channel is -i then the bot will remove then invite mode next time it # checks this counter set invite-time 0 # [0/1] expire bans/exempts/invites set by other opped bots on the channel? # set force-expire 0 # [0/1] share user greets with other bots on the channel if sharing user data? set share-greet 1 # [0/1] allow users to store an info line? set use-info 1 # these settings are used as default values when you # .+chan #chan or .tcl channel add #chan # look in the section above for explanation on every option set global-flood-chan 0:0 set global-flood-deop 0:0 set global-flood-kick 0:0 set global-flood-join 0:0 set global-flood-ctcp 0:0 set global-flood-nick 0:0 set global-aop-delay 5:30 set global-idle-kick 0 set global-chanmode "+n" set global-stopnethack-mode 0 set global-revenge-mode 3 set global-chanset { -autoop -autovoice -bitch +cycle -dontkickops +dynamicbans +dynamicexempts +dynamicinvites +enforcebans +greet +inactive -nodesynch +protectfriends -protectops -revenge -revengebot -secret -seen +shared +statuslog +userbans +userexempts +userinvites } # do this for each channel you wish to sit on: # NOTE: for some reason Tcl won't let you put comments inside { } -- so # don't try it, cos it'll mess up your channel definition channel add #Loufiz { chanmode "+nt" idle-kick 0 stopnethack-mode 2 revenge-mode 3 aop-delay 5:30 need-op { } need-invite { } need-key { } Guillaume Tournand <guillaume@tournand.com> September 2003 88/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project need-unban { } need-limit { } flood-chan 5:10 flood-deop 3:10 flood-kick 3:10 flood-join 5:60 flood-ctcp 3:60 flood-nick 5:60 } # the things inside the { } are CHANNEL OPTIONS -- they can be set within # the "channel add" command, or by using a "channel set" command as in the # examples below. they list all the options you can set for a channel. # chanmode # what modes will be enforced? '+' modes will always be kept on, '-' modes # will always be kept off # idle-kick # kick channel members after how many minutes of being idle? # (leave out to disable, or set to 0) # stopnethack-mode # de-op anyone who enters the channel with serverops # 0 turn off, # 1 isoptest (allow serverop if registered op), # 2 wasoptest (allow serverop if op before split) # 3 allow serverop if isop or wasop # 4 allow serverop if isop and wasop # 5 if channel -bitch: see stopnethack-mode 3 # if channel +bitch: see stopnethack-mode 1 # 6 if channel -bitch: see stopnethack-mode 2 # if channel +bitch: see stopnethack-mode 4 # revenge-mode # defines how the bot should punish bad users when revenging. # default is 1. # 0 for deop # 1 for deop and +d # 2 for deop, +d and kick # 3 for deop, chattr +d, kick and ban # aop-delay (minimum:maximum) # for autoop and autovoice # aop-delay 0 no autoopdelay # aop-delay x or aop-delay x:x x sec. autoopdelay # aop-delay x:y random delay # if a autoopped user joined during a other delayed autoop is pending, # the bot will sent both autoop based on the last-joined-user-delay-time, # probable in only one line. # need-op # script to run (if any) when the bot needs to be op'd on this channel # need-invite # script to run (if any) when the bot gets locked out of the channel # because the channel is +i # need-key # script to run (if any) when the bot gets locked out of the channel # because it doesn't have the channel key # need-unban # script to run (if any) when the bot gets banned from this channel # need-limit # script to run (if any) when the bot gets locked out of the channel # because the channel limit is full # flood-chan (number:seconds) # how many channel messages in hom many seconds is a flood # not specifying or using number = 0 will not check chan floods! # flood-ctcp (number:seconds) # how many channel messages in hom many seconds is a flood Guillaume Tournand <guillaume@tournand.com> September 2003 89/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # not specifying or using number = 0 will not check ctcp floods! # flood-deop (number:seconds) # how many deops in how many seconds is a mass de-op # not specifying or using number = 0 will not check de-op floods! # flood-kick (number:seconds) # how many kicks in how many seconds is a mass kick? # not specifying or using number = 0 will not check mass kicks! # flood-join (number:seconds) # how many joins/nick changes in how many seconds is a join flood? # not specifying or using number = 0 will not check join floods! # note that "need-op", "need-invite", etc, are limited to 120 characters, # so if you want to so something more complicated, just write a proc, # and make them call your proc. # there are also a lot of options that can be turned on or off for each # channel. to turn an option on, put a + in front of it. to turn it off, # put a - in front of it. ie, to have auto-op, put: # +autoop # to turn it off, put: # -autoop # when a ban is set, kick people who are on the channel and match the # new ban? (ie, they were on the channel before the ban) channel set #Loufiz +enforcebans # only activate bans on the channel when necessary? (this keeps the # channel's ban list from getting excessively long. the bot still remem# bers every ban, but it only activates a ban on the channel when it sees # someone join who matches that ban.) channel set #Loufiz +dynamicbans # allow bans to be made by users directly? (if turned off, the bot will # require all bans to be made through the bot's console) channel set #Loufiz +userbans # only activate exempts on the channel when necessary? (this keeps the # channel's exempt list from getting excessively long. the bot still # remembers every exempt, but it only activates a exempt on the channel # when it sees a ban set matching the exempt. The exempt remains active # on the channel for as long as the ban is still active. channel set #Loufiz +dynamicexempts # allow exempts to be made by users directly? (if turned off, the bot will # require all exempts to be made through the bot's console) channel set #Loufiz +userexempts # only activate invites on the channel when necessary? (this keeps the # channel's invite list from getting excessively long. the bot still # remembers every invite, but the invites are only activated when the # channel is set to invite only and a user joins aftre requesting an # invite. Once set the invite remains until the channel goes to -i channel set #Loufiz +dynamicinvites # allow invites to be made by users directly? (if turned off, the bot will # require all invites to be made through the bot's console) channel set #Loufiz +userinvites # op users with the +o (op) flag as soon as they join the channel? # (hint: this is a BAD IDEA) channel set #Loufiz -autoop # only let users with +o (op) flag be channel ops? channel set #Loufiz -bitch # say a user's info line when they join the channel? channel set #Loufiz +greet Guillaume Tournand <guillaume@tournand.com> September 2003 90/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # re-op a user with the +o (op) flag if they get deopped? channel set #Loufiz -protectops # re-op a user with the +f (friend) flag if they get deopped? channel set #Loufiz +protectfriends # log the channel status line every 5 minutes? (some people think # it's annoying; i think it's neat) channel set #Loufiz +statuslog # remember people who deop/kick/ban bots, valid ops or friends, and punish them? # users with +f (friend) flag are exempt from revenge channel set #Loufiz +revenge # this works similar to revenge, but it triggers only for valid bots and # allows the deop or kick of an op or friend channel set #Loufiz +revengebot # voice users with +v (voice) flag when they join the channel? channel set #Loufiz -autovoice # prevent this channel from being listed on the botnet? (for paranoid # people) channel set #Loufiz -secret # share user channel info for this channel? channel set #Loufiz +shared # cycle the channel when it becomes op-less? channel set #Loufiz +cycle # do you want the bot not to be able to kick +o flag users ? # letting them kick-flood for instance, to protect the channel agaisnt # clone attacks channel set #Loufiz -dontkickops # prevents the bot from joining the channel (or makes it leave the channel # if it is already there). # Can be useful to make the bot leave a channel without loosing it's # settings (flood settings, all these "channel set" settings), user flags # for this channel, bans for this channel, and without affecting any # sharing channel set #Loufiz -inactive # respond to seen requests in the channel? (seen module must be loaded) channel set #Loufiz -seen # allow non-ops to perform channel modes? (Stops bot from # fighting with services such as ChanServ) channel set #Loufiz +nodesynch # here's a shorter example: #channel add #botcentral { # chanmode "+mntisl 1" # idle-kick 1 #} #channel set #botcentral +bitch +enforcebans -greet +revenge ##### SERVER MODULE ##### # this provides the core server support (removing this is equivalent to # the old NO_IRC define) loadmodule server # [0/1/2/3/4/5] What is your network? # 0 = Efnet (non +e/+I hybrid), 1 = IRCnet, 2 = Undernet, 3 = Dalnet, # 4 = Efnet +e/+I hybrid, 5 = Others Guillaume Tournand <guillaume@tournand.com> September 2003 91/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project set net-type 2 ##### variables: # the nick of the bot, that which it uses on IRC, and on the botnet # unless you specify a sperate botnet-nick set nick "Ad4m" # an alternative nick to use if the nick specified by 'set nick' is # unavailable. All '?' characters will be replaced by a random number. set altnick "Ad4m_" # what to display in the real-name field for the bot set realname "http://www.loufiz.com/ - #Loufiz" # script to run (if any) when first connecting to a server set init-server { putserv "MODE $botnick +ix-wsd" } # if no port is specified on a .jump, which port should I use? set default-port 6667 # the server list -- the bot will start at the first server listed, and cycle # through them whenever it's disconnected # (please note: you need to change these servers to YOUR network's servers) set servers { london.uk.eu.undernet.org:6667 surrey.uk.eu.undernet.org:6667 geneva.ch.eu.undernet.org:6667 amsterdam.nl.eu.undernet.org:6667 diemen.nl.eu.undernet.org:6667 ede.nl.eu.undernet.org:6667 graz.at.eu.undernet.org:6667 graz2.at.eu.undernet.org:6667 stockholm.se.eu.undernet.org:6667 oslo.no.eu.undernet.org:6667 montreal.qu.ca.undernet.org:6667 princeton.nj.us.undernet.org:6667 losangeles.ca.us.undernet.org:6667 mesa.az.us.undernet.org:6667 washington.dc.us.undernet.org:6667 elsene.be.eu.undernet.org:6667 atlanta.ga.us.undernet.org:6667 fairfax.va.us.undernet.org:6667 lelystad.nl.eu.undernet.org:6667 sanjose.ca.us.undernet.org:6667 bucharest.ro.eu.undernet.org:6667 helsinki.fi.eu.undernet.org:6667 lidingo.se.eu.undernet.org:6667 milan.it.eu.undernet.org:6667 } # [0/1] if the bot's nickname is changed (for example, if the intended # nickname is already in use) keep trying to get the nick back? set keep-nick 1 # [0/1] use /ison instead of /trace to see if our botnick is free or being # used? (note: some irc admins, look for excessive use of /trace) set use-ison 1 # [0/1] if this is set, a leading '~' on user@hosts WON'T be stripped off set strict-host 1 # [0/1] Squelch the error message when rejecting a DCC CHAT or SEND? # Normally it tells the DCC user that the CHAT or SEND has been rejected # because they don't have access, but sometimes IRC server operators # detect bots that way. set quiet-reject 1 Guillaume Tournand <guillaume@tournand.com> September 2003 92/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # [0/1] answer lower case ctcp's (non rfc compliant) # mIRC will do this, most other clients will NOT set lowercase-ctcp 0 # answer HOW MANY stacked ctcp's at once set answer-ctcp 3 # setting any of the following with howmany == 0 will turn them off # how many msgs in how many seconds from the same host constitutes a flood? set flood-msg 5:60 # how many CTCPs in how many seconds? set flood-ctcp 3:60 # [0/1] even if all the servers are down, cycle forever and keep trying to # connect? set never-give-up 1 # [0/1] If this setting is 0 then the eggdrop keeps a seperate list of the names # irc servers call themselves, retaining what you entered in the config file. # setting it to 1 will cause the bot to replace your entry with what # the server actually calls itself set strict-servernames 0 # number of seconds to wait between each server connect (0 = no wait) # useful for preventing ircu throttling # setting this too low could make your server admins *very* unhappy set server-cycle-wait 60 # how many seconds to wait for a response when connecting to a server # before giving up and moving on? set server-timeout 15 # if the number of servers on the net gets below this number, it will # jump to a new server (ie, it will assume it's on the losing end of a # netsplit) -- set to 0 to turn off # [most irc networks use TS or ND now, so it's to your advantage to turn # this off] set servlimit 0 # [0/1] check for stoned servers? (i.e. Where the server connection has # died, but eggdrop hasn't been notified yet). set check-stoned 1 # [0/1] enable console mode 'r'? this mode shows every raw message from the # server to owners with console 'r' selected -- will take a bit more # cpu. # NOTE: This is a large security hole, allowing people to see mis-sent # messages to the bot containing passwords # This is now restricted to +n users only. Please choose your owners with care. set use-console-r 1 # [0/1] enable logging of all information sent *to* a server, via console mode 'v' # NOTE: This is a large security hole, allowing people to see passwords. # This is now restricted to +n users only. Please choose your owners with care. set debug-output 0 # [0/1] exit if the server sends a ERROR message? set serverror-quit 1 # maximum number of lines to queue to the server. # if you're going to dump large chunks of text to people over irc, you # will probably want to raise this -- most people are fine at 300 though set max-queue-msg 300 # [0/1] trigger bindings for ignored users? set trigger-on-ignore 0 # [0/1] allow a msg being twice in a queue? Guillaume Tournand <guillaume@tournand.com> September 2003 93/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project set double-mode 0 set double-server 0 set double-help 0 # [0/1/2] do you want the bot to optimize the kicking queues? Set to 2 if you # want the bot to change queues if somebody parts or changes nickname. # ATTENTION: Setting 2 is very CPU intensive set optimize-kicks 1 ##### SERVER MODULE - net-type 5 specific features (other networks) ##### # [0/1] some nets use umode +r to mean a restricted connection. If this is your # case, and you want your bot to leave restricted servers and jump to the # next one on his server list, then set it to 1. # Automatically set to 0 for net-type 0/2/3/4, set to 1 for net-type 1. # Only use this if you set net-type 5 #set check-mode-r 1 # This variable sets the maximum nick length allowed on the network. Most # only support 9. The maximum supported by eggdrop is 32. #set nick-len 9 ##### CTCP MODULE ##### # this provides the normal ctcp replies that you'd expect *RECOMMENDED* loadmodule ctcp # several variables exist to better blend your egg in. they are # ctcp-version, ctcp-finger, and ctcp-userinfo. you can use set # to set them to values you like. # [0/1/2] 0: normal behavior. 1: bot ignores all CTCPs, except for CTCP # CHATs & PINGs requested by +o flag users. 2: bot doesn't answer more # than C CTCPs in S seconds. C/S are defined by the set flood-ctcp C:S (cf # server module) set ctcp-mode 1 ##### IRC MODULE ##### # this module provides ALL NORMAL IRC INTERACTION, if you want the normal # join & maintain channels stuff, this is the module. loadmodule irc # [0/1] define this if you want to bounce all server bans set bounce-bans 1 # [0/1] define this if you want to bounce all the server modes set bounce-modes 0 # If there are more than max-bans active bans on a channel, then the # bot won't try to put more bans. Thus it won't flood the irc server. # ircd 2.9.5 allows 20 bans. ircd 2.10 allows 30 bans (max). set max-bans 20 # There is a global limit for +b/+e/+I modes. This limit is set to 30 on # 2.10 irc servers. set max-modes 30 # [0/1] Do you want the bot to kick for control character/ctcp avalanches # to a channel? # Remember that if it does, as it won't ban them, it can be at the origin # of a nice kick-flood set kick-fun 1 # [0/1] Do you want the bot to ban for control character/ctcp avalanches Guillaume Tournand <guillaume@tournand.com> September 2003 94/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # to a channel? # Can prevent the above described kick-flood, but can also fill the banlist set ban-fun 1 # [0/1] let users introduce themselves to the bot via 'hello'? set learn-users 0 # time (in seconds) to wait for someone to return from a netsplit set wait-split 3600 # time (in seconds) that someone must have been off-channel before # re-displaying their info set wait-info 180 # this is the maximum number of bytes to send in the arguments to mode's # sent to the server, most servers default this to 200, so it should # be sufficient set mode-buf-length 200 # many irc ops check for bots that respond to 'hello'. you can change this # to another word by uncommenting the following two lines, and changing # "myword" to the word you want to use instead of 'hello' (it must be a # single word) # novice users are not expected to understand what these two lines do; they # are just here to help you. for more information on 'bind', check the file # 'tcl-commands.doc' unbind msg - hello *msg:hello #bind msg - myword *msg:hello # Many takeover attempts occur due to lame users blindy /msg ident'n to # the bot without checking if the bot is the bot. # We now unbind this command by default to discourage them unbind msg - ident *msg:ident unbind msg - addhost *msg:addhost unbind msg - pass *msg:pass unbind msg - halfop *msg:halfop # If you or your users use many different hosts and wants to # be able to add it by /msg'ing you need to remove the # unbind ident line above or bind it to another word. #bind msg - myidentword *msg:ident # [0/1] If you are so lame you want the bot to display peoples info lines, even # when you are too lazy to add their chanrecs to a channel, set this to 1 # *NOTE* This means *every* user with an info line will have their info # display on EVERY channel they join (provided they have been gone longer than # wait-info) set no-chanrec-info 0 ##### IRC MODULE - net-type 1 specific features (IRCnet) ##### # Don't modify the following settings if you don't use IRCnet. The defaults following # values are harmless for you. # [0/1] define this if you want to bounce all server exemptions (+e modes) # * This is an IRCNET feature set bounce-exempts 0 # [0/1] define this if you want to bounce all server invitations (+I modes) # * This is an IRCNET feature set bounce-invites 0 # If there are more than max-exempts active +e modes on a channel, then # the bot won't try to put more exemptions. Thus it won't flood the irc # server. Only 2.10 servers are concerned by these +e modes. # * This is an IRCNET feature set max-exempts 20 Guillaume Tournand <guillaume@tournand.com> September 2003 95/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # If there are more than max-invites active +I modes on a channel, then # the bot won't try to put more invitations. Thus it won't flood the irc # server. Only 2.10 irc servers are concerned by these +I modes. # * This is an IRCNET feature set max-invites 20 # The following lines should be left uncommented unless the default values # are being over-ridden. By default exempts and invites are on for IRCnet # and hybrid EFnet, but off for all other networks. This behaviour can be # modified by the following 2 flags. If you're network doesn't support e/I # modes then you'll be unable to use these features. # # [0/1] Do you want to enable exempts? # set use-exempts 0 # [0/1] Do you want to use invites? # set use-invites 0 # [0/1] Prevent mixing normal modes and +I/+e invite modes? # At the moment (Sep/1999), IRCnet servers do not allow mixing those modes, # so leave this flag set to 1. The servers will probably change their # behaviour in the future, so you should first check before accepting the # default. set prevent-mixing 1 ##### IRC MODULE - net-type 5 specific features (other networks) ##### # kick-method defines how kicks (when enforcing bans) should be made: # 0 = kick all nicks at once in one command # X = kick X users at a time # # Automatically set by net-type: # net-type 0, 2, 3 & 4 sets this to 1 # net-type 1 sets this to 4 # # If you use net-type 5, you must set this yourself (default is 1) #set kick-method 1 # some networks allow you to stack lots of channel modes into one # line. # they're all guaranteed to support at least 3, so that's the default, # but if you know your network supports more, you may want to adjust # this value. this value must be less than or equal to 6. # Automatically set to 4 for net-type 0/4, set to 3 for net-type 1, set to # 6 for net-type 2/3. # Only use this if you set net-type 5 #set modes-per-line 3 # [0/1] Some networks don't include the +l limit and +k or -k key modes # in the modes-per-line (see above) limitation. Set include-lk to 0 for # those networks. # Automatically set to 1 for net-type 1/2/3, set to 0 for net-type 0/4. # Only use this if you set net-type 5. #set include-lk 1 # [0/1] use ircu2.10.01 specific /who requests, therefore only asking for # exactly what's needed # Automatically set to 0 for net-type 0/1/3/4, set to 1 for net-type 2. # Only use this if you set net-type 5 #set use-354 0 # [0/1] use rfc 1459 compliant string matching routines? # All networks apart from Dalnet comply with rfc 1459, so you should only # disable it on Dalnet or networks which use Dalnet's code. #set rfc-compliant 1 ##### TRANSFER MODULE ##### Guillaume Tournand <guillaume@tournand.com> September 2003 96/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # uncomment this line to load the transfer module, this provides # dcc send/get support and bot userfile transfer support (not sharing) loadmodule transfer ##### variables: # set maximum number of simultaneous downloads to allow for each user set max-dloads 1 # set the block size for dcc transfers (ircII uses 512 bytes, but admits # that may be too small -- 1024 is standard these days) # set this to 0 to use turbo-dcc (recommended) set dcc-block 0 # [0/1] copy files into the /tmp directory before sending them? this is # useful on most systems for file stability. (someone could move a file # around while it's being downloaded, and mess up the transfer.) but if # your directories are NFS mounted, it's a pain, and you'll want to set # this to 0. If you are low on disk space, you may want to set this to 0. set copy-to-tmp 1 # time (in seconds) that a dcc file transfer can remain inactive # before being timed out set xfer-timeout 30 ##### SHARE MODULE ##### # this provides the userfile sharing support # (this requires the channels & transfer modules) loadmodule share ##### variables: # [0/1] When two bots get disconnected this flag allows them to create # a resync buffer which saves all changes done to the userfile during # the disconnect. So, when they reconnect, they will not have to transfer # the complete user file, but instead, just send the resync buffer. # If you have problems with this feature please tell us. Take a look at # doc/BUG-REPORT first though. set allow-resync 0 # this specifies how long to hold another bots resync data for before # flushing it set resync-time 900 # [0/1] when sharing user lists, DONT ACCEPT global flag changes from other bots? # NOTE: the bot will still send changes made on the bot, it just wont accept # any global flag changes from other bots set private-global 0 # when sharing user lists, if private-global isn't set, which global flag # changes from other bots should be ignored ? #set private-globals "mnot" # [0/1] when sharing user lists, DON'T ACCEPT any userfile changes from other # bots? # NOTE: paranoid people should use this feature on their hub bot - this # will force all +host/+user/chpass/etc. changes to be made via the hub set private-user 1 # [0/1] this setting makes the bot discard it's own bot records in favor of # the ones sent by the hub. Note: This only works with hubs that are v1.5.1 # _or higher_. set override-bots 1 ##### COMPRESS MODULE ##### Guillaume Tournand <guillaume@tournand.com> September 2003 97/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # The compress module provides support for file compression. This allows the # bot to transfer compressed user files and therefore save a significant # amount of bandwidth, especially on very active hubs. loadmodule compress # [0/1] allow compressed sending of user files. The user files # are compressed with the compression level defined in `compress-level'. set share-compressed 1 # [0-9] default compression level used. set compress-level 9 ##### FILESYSTEM MODULE ##### # uncomment this line to load the file system module, this provides # an area withing the bot where you can store files #loadmodule filesys # this is the 'root' directory for the file system (set it to "" if you # don't want a file system) set files-path "" # if you want to allow uploads, set this to the directory uploads should be # put into set incoming-path "" # [0/1] alternately, you can set this, and uploads will go to the current # directory that a user is in set upload-to-pwd 0 # eggdrop creates a '.filedb' file in each subdirectory of your dcc area, # to keep track of its own file system info -- if you can't do that (like # if the dcc path isn't owned by yours) or you just don't want it to do # that, specify a path here where you'd like all the database files to # be stored instead (otherwise, just leave it blank) set filedb-path "" # set maximum number of people that can be in the file area at once # (0 to make it effectively infinite) set max-file-users 20 # maximum allowable file size that will be received, in K # (default is 1024K = 1M). 0 makes it effectively infinite. set max-filesize 1024 ##### NOTES MODULE ##### # this provides support for storing of notes for users from each other # notes between currently online users is supported in the core, this is # only for storing the notes for later retrieval, direct user->user notes # are built-in loadmodule notes # the notefile: where private notes between users are stored set notefile "adam/Adam.notes" # maximum number of notes to allow to be stored for each user # (to prevent flooding) set max-notes 50 # time (in days) to let stored notes live before expiring them set note-life 60 # [0/1] allow users to specify a forwarding address for forwarding notes # to another bot set allow-fwd 1 Guillaume Tournand <guillaume@tournand.com> September 2003 98/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # [0/1] set this to 1 if you want the bot to let people know hourly if they # have any notes set notify-users 1 # [0/1] set this to 1 if you want the bot to let people know on join if they # have any notes set notify-onjoin 1 ##### CONSOLE MODULE ##### # this module provides storage of console settings when you exit the bot # (or .store) loadmodule console ##### variables: # [0/1] save users console settings automatically? (otherwise they have to use # .store) set console-autosave 1 # [0-99999] if a user doesn't have any console settings saved, which channel # do you want them automatically put on? set force-channel 0 # [0/1] display a user's global info line when they join a botnet channel? set info-party 0 ##### WOOBIE MODULE ##### # this serves absolutely no purpose and is for demonstrative # purposes only #loadmodule woobie ##### SEEN MODULE ##### # this module provides seen commands via msg, on channel or via # dcc, similar to the various scripts #loadmodule seen ##### BLOWFISH MODULE ##### ##### IF YOU DONT READ THIS YOU MAY RENDER YOUR USERFILE USELESS LATER # Choose your encryption method now, 'cause once you do, it ain't # changing 'til you get a new userfile, capish? At the moment, there # is only one encryption option: blowfish # uncomment this line to load blowfish, the encryption module # for the bot, it will not start without it loaded and commented out # to make sure you read the whole config file # this is checkmodule, because during .restart the module will already # be loaded checkmodule blowfish ##### ASSOC MODULE ##### # uncomment this line to load assoc support, i.e naming channels on # the botnet loadmodule assoc ##### WIRE MODULE ##### Guillaume Tournand <guillaume@tournand.com> September 2003 99/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # this module provides all the standard .wire commands via dcc. # it's an encrypted partyline communication tool, compatible with wire.tcl # uncomment this line to load it loadmodule wire ##### SCRIPTS ##### # X username/pass set cmasterhnd "ad4m" set cmasterpwd "XFdsNDER" # these are some commonly loaded (and needed) scripts. source scripts/alltools.tcl source scripts/action.fix.tcl # use this for tcl and eggdrop downwards compatibility source scripts/compat.tcl # This script provides many useful minor informational commands # (like setting users url's, email address, etc). You can modify # it to add extra entries, you might also want to modify help/userinfo.help # and help/msg/userinfo.help to change the help files. source scripts/userinfo.tcl loadhelp userinfo.help source scripts/bnusers_master.tcl source scripts/x.tcl source scripts/greetd.tcl source scripts/identhost.tcl source scripts/loufiz_newapp.tcl source scripts/reop_bot.tcl Guillaume Tournand <guillaume@tournand.com> September 2003 100/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project The leaf bot configuration file #! /usr/home/eggdrops/zildjian # ^- set that to the directory eggdrop is in ie "#! /home/lamest/egg/eggdrop" # # $Id: eggdrop.complete.conf,v 1.27 2001/01/31 05:34:23 guppy Exp $ # # this config file includes all possible options you can # use to configure your bot properly. # be sure that you know what you are doing! # # more detailed descriptions of all those settings can be found in # doc/settings/ ##### GENERAL STUFF ##### # the username the bot uses, this is only used if identd isn't working # on the machine the bot is running on. set username "Zildjian" # who's running this bot? set admin "Nolderise <nolderise@loufiz.com>" # what IRC network are you on? this is just info to share with others on # your botnet, for human curiosity only. set network "Undernet" # what timezone is your bot in? # The timezone string specifies the name of the timezone and # must be three or more alphabetic characters. # ex. Central European Time(UTC+1) could be "CET" set timezone "CET" # offset specifies the time value to be added to the local time # to get Coordinated Universal Time (UTC aka GMT). # The offset is positive if the local timezone is west of the # Prime Meridian and negative if it is east. # The value(hours) must be between 0 and 24 # ex. if the timezone is UTC+1 the offset is -1 set offset "-1" # If you dont want to use the timezone setting for scripting # purpose only but instead everywhere possible (new) then # uncomment the next line. #set env(TZ) "$timezone $offset" # if you're using virtual hosting (your machine has more than 1 IP), you # may want to specify the particular IP to bind to. you can specify # either by hostname or by IP. you may also want to set the hostname # here if eggdrop has trouble detecting it when it starts up. (it will # let you know if it has trouble -- trust me.) #set my-hostname "virtual.host.com" #set my-ip "99.99.0.0" # if you want to have your eggdrop messages displayed in another language # change the below command to match your preferences. An alternative would # be to set the environment variabel EGG_LANG to that value. #addlang "english" ##### LOG FILES ##### # you can specify how many log files you can have upto. at midnight every # day, the old log files are renamed and a new log file begins. by default, # the old one is called "(logfilename).yesterday", and any logfiles before # yesterday are erased. Guillaume Tournand <guillaume@tournand.com> September 2003 101/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # events are logged by certain categories -- this way you can specify # exactly what kind of events you want sent to various logfiles. the # events are: # m private msgs/ctcps to the bot # k kicks, bans, mode changes on the channel # j joins, parts, netsplits on the channel # p public chatter on the channel # s server connects/disconnects/notices # b information about bot linking and userfile sharing # c commands people use (via msg or dcc) # x file transfers and file-area commands # r (if use-console-r defined) EVERYTHING sent to the bot by the server # o other: misc info, errors -- IMPORTANT STUFF # w wallops: msgs between IRCops (be sure to set the bot +w in init-server) # There are others, but you probably shouldnt log them, it'd be rather # unethical ;) # maximum number of logfiles to allow - this can be increased if needed # (don't decrease this) set max-logs 5 # maximum size of your logfiles, set this to 0 to disable. # this only works if you have keep-all-logs 0 (OFF) # this value is in KiloBytes, so '550' would mean cycle logs when # it reaches the size of 550 KiloBytes. set max-logsize 50000 # write the logfiles and check the size every minute # (if max-logsize is enabled) instead of every 5minutes as before. # This could be good if you have had problem with the # logfile filling your quota or hdd or if you log +p # and publish it on the web and wants more uptodate info. # If you are concerned with resources keep the default setting 0. # (although I haven't noticed anything) set quick-logs 0 # each logfile also belongs to a certain channel. events of type 'k', 'j', # and 'p' are logged to whatever channel they happened on. most other # events are currently logged to every channel. you can make a logfile # belong to all channels by assigning it to channel "*". there are also # five user-defined levels ('1'..'5') which are used by Tcl scripts. # in 'eggdrop.log' put private msgs/ctcps, commands, misc info, and # errors from any channel: logfile mkjsbco * "zildjian/logs/eggdrop.log" # in 'lame.log' put joins, parts, kicks, bans, and mode changes from #lamest: # [0/1] timestamp entries in the log file? (generally a good idea) set log-time 1 # [0/1] keep logfiles for more than 48 hours -- instead of being called # "(logfilename).yesterday", the log files are named by the current date, # and kept around forever (eventually your directory might get full, so # be careful with this!) set keep-all-logs 0 # if keep-all-logs is 1, this setting will define the suffix of the logfiles. # The default will result in a suffix like "04May2000". "%Y%m%d" will produce # the often used yyyymmdd format. Read the strtime manpages for more options. # NOTE: On systems which don't support strftime, the default format will # be used _always_. set logfile-suffix ".%d%b%Y" # once a day the logfiles are switched out and started fresh -# this specifies when that should happen (in military time) # [note that a leading 0 will make Tcl think this is an octal value, # something you probably don't want.] set switch-logfiles-at 300 Guillaume Tournand <guillaume@tournand.com> September 2003 102/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # [0/1] enable quiet saves? "Writing user file..." and "Writing channel file ..." # will not be logged if this option is enabled. set quiet-save 0 # this is the default console mode -- what masters will see automatically # when they dcc chat with the bot (masters can alter their own console # flags once they connect, though) -- it uses the same event flags as # the log files # (note that the console channel is automatically set to your "primary" # channel -- the one you defined first in this file. masters can change # their console channel with the '.console' command, however.) set console "mkcobxs" ##### FILES AND DIRECTORIES ##### # the userfile: where user records are stored set userfile "zildjian/Zildjian.user" # [0/1] do you want the userlist to be sorted when saving set sort-users 0 # where the help files can be found (and there are plenty) set help-path "help/" # a good place to temporarily store files (ie: /tmp) set temp-path "/tmp" # the MOTD is displayed when people dcc chat to the bot. # type '.help set motd' in DCC CHAT for tons of motd options. set motd "text/motd" # holds the banner displayed on telnet connections set telnet-banner "text/banner" # Specifies what permissions the user, channel and notes files should be set # to. The octal values are the same as for the chmod system command. # # u g o u g o u g o # 0600 rw------- 0400 r-------- 0200 -w------- u - user # 0660 rw-rw---- 0440 r--r----- 0220 -w--w---- g - group # 0666 rw-rw-rw- 0444 r--r--r-- 0222 -w--w--w- o - others # # Most users will want to leave the permissions set to 0600, to ensure # maximum security. set userfile-perm 0644 ##### BOTNET ##### # you probably shouldn't deal with this until reading 'botnet.doc' or # something. you need to know what you're doing. # if you want to use a different nickname on the botnet than you use on # IRC, set it here: #set botnet-nick "LlamaBot" # what telnet port should this bot answer? # NOTE: if you are running more than one bot on the same machine, you will # want to space the telnet ports at LEAST 5 apart... 10 is even better # if you would rather have one port for the botnet, and one for normal # users, you will want something like this instead: #listen 3333 bots #listen 4444 users # NOTE: there are more options listed for the listen command in # doc/tcl-commands.doc listen 42010 all Guillaume Tournand <guillaume@tournand.com> September 2003 103/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # [0/1] This setting will drop telnet connections not matching a known host # It greatly improves protection from IRCOPs, but makes it impossible # for NOIRC bots to add hosts or have NEW as a valid login set protect-telnet 1 # [0/1] This setting will make the bot ignore DCC chat requests which appear to # have bogus information on the grounds that the user may have been trying # to make the bot connect to somewhere that will get it into trouble, or # that the user has a broken client (like mIRC tends to do), in which case # the connect wouldn't work anyway. It's suggested that you turn this on. set dcc-sanitycheck 1 # and a timeout value for ident lookups would help (seconds) set ident-timeout 5 # [0/1] users with the +o (global or channel op) flag will still need the +p # (party line) flag to join the dcc chat party line? set require-p 1 # [0/1] allow people to telnet in, type 'NEW', and become a new user? # (If you set this to 1, you must set protect-telnet 0) set open-telnets 0 # [0/1] Display 'Nickname.' instead of identifying ourselves when people # telnet in. Set to 1 to only display Nickname. # (useful if someone portscans your machine, they wont know we're here) set stealth-telnets 1 # [0/1] Display a banner when people telnet in. set use-telnet-banner 0 # how long (in seconds) should i wait for a connect (dcc chat, telnet, # relay, etc) before it times out? set connect-timeout 15 # number of messages / lines from a user on the partyline (dcc, telnet) before # they are considered to be flooding (and therefore get booted) set dcc-flood-thr 3 # how many telnet connection attempt in how many seconds from the same # host constitutes a flood? set telnet-flood 5:60 # [0/1] apply telnet flood protection for everyone? # set this to 0 if you want to exempt +f users from telnet flood protection set paranoid-telnet-flood 1 # how long should I wait (seconds) before giving up on hostname/address # lookup? (you might want to increase this if you are on a slow network). set resolve-timeout 15 ##### MORE ADVANCED STUFF ##### # are you behind a firewall? uncomment this and specify your socks host #set firewall "proxy:178" # or, for a Sun "telnet passthru" firewall, set it this way # (does anyone besides Sun use this?) #set firewall "!sun-barr.ebay:3666" # if you have a NAT firewall (you box has an IP in one of the following # ranges: 192.168.0.0-192.168.255.255, 172.16.0.0-172.31.255.255, # 10.0.0.0-10.255.255.255 and your firewall transparently changes your # address to a unique address for your box.) or you have IP masquerading # between you and the rest of the world, and /dcc chat,/ctcp chat or # userfile shareing aren't working. Enter your outside IP here. # Do not enter anything for my-ip or my-hostname. #set nat-ip "127.0.0.1" Guillaume Tournand <guillaume@tournand.com> September 2003 104/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # if you want all dcc file transfers to use a particular portrange either # because you're behind a firewall, or for other security reasons, set it # here. #set reserved-portrange 2010:2020 # temporary ignores will last how many minutes? set ignore-time 15 # this setting affects what part of the hour the 'hourly' calls occur # on the bot, this includes such things as note notifying, # You can change that here (for example, "15" means to # notify every hour at 15 minutes past the hour) # this now includes when the bot will save its userfile set hourly-updates 00 # if compiled with owner, the following user(s) will ALWAYS have the # owner (+n) flag (You really should change this default) set owner "Nolderise" # who should I send a note to when I learn new users? set notify-newusers "$owner" # what flags should new users get as a default? # check '.help whois' on the partyline (dcc chat, telnet) for tons of # options. set default-flags "" # what user-defined fields should be displayed in a '.whois'? # this will only be shown if the user has one of these xtra fields # you might prefer to comment this out and use the userinfo1.0.tcl script # which provides commands for changing all of these. set whois-fields "url birthday" # [0/1/2] allow people from other bots (in your bot-net) to boot people off # your bot's party line? # values: # 0 - allow *no* outside boots # 1 - allow boots from sharebots # 2 - allow any boots set remote-boots 1 # [0/1] if you don't want people to unlink your share bots from remote bots # set this to 0 set share-unlinks 0 # [0/1] die on receiving a SIGHUP? # The bot will save it's userfile when it receives a SIGHUP signal # with either setting. set die-on-sighup 0 # [0/1] die on receiving a SIGTERM? # The bot will save it's userfile when it receives a SIGTERM signal # with either setting. set die-on-sigterm 1 # to enable the 'tcl' and 'set' command (let owners directly execute # Tcl commands)? - a security risk!! # If you select your owners wisely, you should be okay enabling these. # to enable, comment these two lines out # (In previous versions, this was enabled by default in eggdrop.h) unbind dcc n tcl *dcc:tcl #unbind dcc n set *dcc:set # [0/1/2] only let permanent owners use .tcl/.set if bound? then set it to 1 # moreover only let permanent owners use .dump? then set it to 2 # (the people must set the $owner variable) set must-be-owner 2 Guillaume Tournand <guillaume@tournand.com> September 2003 105/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # comment the following line out to add the 'simul' command (owners can # manipulate other people on the party line). # Please select owners wisely! Use this command ethically! #unbind dcc n simul *dcc:simul # maximum number of dcc connections you will allow - you can increase this # later, but never decrease it, 50 seems to be enough for everybody set max-dcc 50 # this setting is so that people can't send fake ports to your bot when # they try to dcc it. irc clients should never use a port below 1024 and # well 65535 is the highest port possible. this setting is used for telnet # too. set dcc-portrange 1024:65535 # [0/1] add the 'dccsimul' tcl command (needed by certain scripts like # action.fix.tcl) set enable-simul 1 # [0/1] allow +d & +k users to use commands bound as -|- ? set allow-dk-cmds 1 # If a bot connects which already seems to be connected, I wait # dupwait-timeout seconds before I check again and then finally reject # the bot. This is useful to stop hubs from rejecting bots that actually # have already disconnected from another hub, but the disconnect information # has not yet spread over the botnet due to lag. set dupwait-timeout 5 ########## MODULES ########## # below are various settings for the modules available with eggdrop, # PLEASE EDIT THEM CAREFULLY, READ THEM, even if you're an old hand # at eggdrop, lots of things have changed slightly # this is the directory to look for the modules in, if you run the # bot in the compilation directories you will want to set this to "" # if you use 'make install' (like all good kiddies do ;) this is a fine # default, otherwise, use your head :) set mod-path "modules/" #### DNS MODULE ##### # this module provides asynchronous dns support. This will avoid long # periods where the bot just hangs there, waiting for a hostname to # resolve, which often let it timeout on all other connections. loadmodule dns ##### CHANNELS MODULE ##### # this next module provides channel related support for the bot, without # it, it will just sit on irc, it can respond to msg & ctcp commands, but # that's all loadmodule channels # the chanfile: where dynamic channel settings are stored set chanfile "zildjian/Zildjian.chan" # temporary bans will last how many minutes? if set to 0, bot never removes # them. set ban-time 0 # temporary exemptions (+e modes) will last how many minutes? if set to 0, # bot never removes them. This is an IRCNET feature. The bot will check the # exempts every X minutes, but will not remove the exempt if a ban is set on Guillaume Tournand <guillaume@tournand.com> September 2003 106/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # the channel that matches that exempt. Once the ban is removed then the # exempt will be removed the next time the bot checks. set exempt-time 0 # temporary invitations (+I modes) will last how many minutes? if set to # 0, bot never removes them. This is an IRCNET feature. The bot will check the # invites every X minutes, but will not remove them if the channel is +i. Once # the channel is -i then the bot will remove then invite mode next time it # checks this counter set invite-time 0 # [0/1] expire bans/exempts/invites set by other opped bots on the channel? # set force-expire 0 # [0/1] share user greets with other bots on the channel if sharing user data? set share-greet 1 # [0/1] allow users to store an info line? set use-info 1 # these settings are used as default values when you # .+chan #chan or .tcl channel add #chan # look in the section above for explanation on every option set global-flood-chan 0:0 set global-flood-deop 0:0 set global-flood-kick 0:0 set global-flood-join 0:0 set global-flood-ctcp 0:0 set global-flood-nick 0:0 set global-aop-delay 5:30 set global-idle-kick 0 set global-chanmode "+n" set global-stopnethack-mode 0 set global-revenge-mode 3 set global-chanset { -autoop -autovoice -bitch +cycle -dontkickops +dynamicbans +dynamicexempts +dynamicinvites +enforcebans +greet -inactive -nodesynch +protectfriends -protectops -revenge -revengebot -secret -seen +shared +statuslog +userbans +userexempts +userinvites } # do this for each channel you wish to sit on: # NOTE: for some reason Tcl won't let you put comments inside { } -- so # don't try it, cos it'll mess up your channel definition channel add #Loufiz { chanmode "+nt" idle-kick 0 stopnethack-mode 2 revenge-mode 3 aop-delay 5:30 need-op { } need-invite { } need-key { } need-unban { } need-limit { } Guillaume Tournand <guillaume@tournand.com> September 2003 107/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project flood-chan 5:10 flood-deop 3:10 flood-kick 3:10 flood-join 5:60 flood-ctcp 3:60 flood-nick 5:60 } # the things inside the { } are CHANNEL OPTIONS -- they can be set within # the "channel add" command, or by using a "channel set" command as in the # examples below. they list all the options you can set for a channel. # chanmode # what modes will be enforced? '+' modes will always be kept on, '-' modes # will always be kept off # idle-kick # kick channel members after how many minutes of being idle? # (leave out to disable, or set to 0) # stopnethack-mode # de-op anyone who enters the channel with serverops # 0 turn off, # 1 isoptest (allow serverop if registered op), # 2 wasoptest (allow serverop if op before split) # 3 allow serverop if isop or wasop # 4 allow serverop if isop and wasop # 5 if channel -bitch: see stopnethack-mode 3 # if channel +bitch: see stopnethack-mode 1 # 6 if channel -bitch: see stopnethack-mode 2 # if channel +bitch: see stopnethack-mode 4 # revenge-mode # defines how the bot should punish bad users when revenging. # default is 1. # 0 for deop # 1 for deop and +d # 2 for deop, +d and kick # 3 for deop, chattr +d, kick and ban # aop-delay (minimum:maximum) # for autoop and autovoice # aop-delay 0 no autoopdelay # aop-delay x or aop-delay x:x x sec. autoopdelay # aop-delay x:y random delay # if a autoopped user joined during a other delayed autoop is pending, # the bot will sent both autoop based on the last-joined-user-delay-time, # probable in only one line. # need-op # script to run (if any) when the bot needs to be op'd on this channel # need-invite # script to run (if any) when the bot gets locked out of the channel # because the channel is +i # need-key # script to run (if any) when the bot gets locked out of the channel # because it doesn't have the channel key # need-unban # script to run (if any) when the bot gets banned from this channel # need-limit # script to run (if any) when the bot gets locked out of the channel # because the channel limit is full # flood-chan (number:seconds) # how many channel messages in hom many seconds is a flood # not specifying or using number = 0 will not check chan floods! # flood-ctcp (number:seconds) # how many channel messages in hom many seconds is a flood # not specifying or using number = 0 will not check ctcp floods! # flood-deop (number:seconds) Guillaume Tournand <guillaume@tournand.com> September 2003 108/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # how many deops in how many seconds is a mass de-op # not specifying or using number = 0 will not check de-op floods! # flood-kick (number:seconds) # how many kicks in how many seconds is a mass kick? # not specifying or using number = 0 will not check mass kicks! # flood-join (number:seconds) # how many joins/nick changes in how many seconds is a join flood? # not specifying or using number = 0 will not check join floods! # note that "need-op", "need-invite", etc, are limited to 120 characters, # so if you want to so something more complicated, just write a proc, # and make them call your proc. # there are also a lot of options that can be turned on or off for each # channel. to turn an option on, put a + in front of it. to turn it off, # put a - in front of it. ie, to have auto-op, put: # +autoop # to turn it off, put: # -autoop # when a ban is set, kick people who are on the channel and match the # new ban? (ie, they were on the channel before the ban) channel set #Loufiz +enforcebans # only activate bans on the channel when necessary? (this keeps the # channel's ban list from getting excessively long. the bot still remem# bers every ban, but it only activates a ban on the channel when it sees # someone join who matches that ban.) channel set #Loufiz +dynamicbans # allow bans to be made by users directly? (if turned off, the bot will # require all bans to be made through the bot's console) channel set #Loufiz +userbans # only activate exempts on the channel when necessary? (this keeps the # channel's exempt list from getting excessively long. the bot still # remembers every exempt, but it only activates a exempt on the channel # when it sees a ban set matching the exempt. The exempt remains active # on the channel for as long as the ban is still active. channel set #Loufiz +dynamicexempts # allow exempts to be made by users directly? (if turned off, the bot will # require all exempts to be made through the bot's console) channel set #Loufiz +userexempts # only activate invites on the channel when necessary? (this keeps the # channel's invite list from getting excessively long. the bot still # remembers every invite, but the invites are only activated when the # channel is set to invite only and a user joins aftre requesting an # invite. Once set the invite remains until the channel goes to -i channel set #Loufiz +dynamicinvites # allow invites to be made by users directly? (if turned off, the bot will # require all invites to be made through the bot's console) channel set #Loufiz +userinvites # op users with the +o (op) flag as soon as they join the channel? # (hint: this is a BAD IDEA) channel set #Loufiz -autoop # only let users with +o (op) flag be channel ops? channel set #Loufiz -bitch # say a user's info line when they join the channel? channel set #Loufiz +greet # re-op a user with the +o (op) flag if they get deopped? channel set #Loufiz -protectops Guillaume Tournand <guillaume@tournand.com> September 2003 109/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # re-op a user with the +f (friend) flag if they get deopped? channel set #Loufiz +protectfriends # log the channel status line every 5 minutes? (some people think # it's annoying; i think it's neat) channel set #Loufiz +statuslog # remember people who deop/kick/ban bots, valid ops or friends, and punish them? # users with +f (friend) flag are exempt from revenge channel set #Loufiz +revenge # this works similar to revenge, but it triggers only for valid bots and # allows the deop or kick of an op or friend channel set #Loufiz +revengebot # voice users with +v (voice) flag when they join the channel? channel set #Loufiz -autovoice # prevent this channel from being listed on the botnet? (for paranoid # people) channel set #Loufiz -secret # share user channel info for this channel? channel set #Loufiz +shared # cycle the channel when it becomes op-less? channel set #Loufiz +cycle # do you want the bot not to be able to kick +o flag users ? # letting them kick-flood for instance, to protect the channel agaisnt # clone attacks channel set #Loufiz -dontkickops # prevents the bot from joining the channel (or makes it leave the channel # if it is already there). # Can be useful to make the bot leave a channel without loosing it's # settings (flood settings, all these "channel set" settings), user flags # for this channel, bans for this channel, and without affecting any # sharing channel set #Loufiz -inactive # respond to seen requests in the channel? (seen module must be loaded) channel set #Loufiz -seen # allow non-ops to perform channel modes? (Stops bot from # fighting with services such as ChanServ) channel set #Loufiz +nodesynch # here's a shorter example: #channel add #botcentral { # chanmode "+mntisl 1" # idle-kick 1 #} #channel set #botcentral +bitch +enforcebans -greet +revenge ##### SERVER MODULE ##### # this provides the core server support (removing this is equivalent to # the old NO_IRC define) loadmodule server # [0/1/2/3/4/5] What is your network? # 0 = Efnet (non +e/+I hybrid), 1 = IRCnet, 2 = Undernet, 3 = Dalnet, # 4 = Efnet +e/+I hybrid, 5 = Others set net-type 2 Guillaume Tournand <guillaume@tournand.com> September 2003 110/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project ##### variables: # the nick of the bot, that which it uses on IRC, and on the botnet # unless you specify a sperate botnet-nick set nick "Zildjian" # an alternative nick to use if the nick specified by 'set nick' is # unavailable. All '?' characters will be replaced by a random number. set altnick "Zildjian_" # what to display in the real-name field for the bot set realname "http://www.loufiz.com/ - #Loufiz" # script to run (if any) when first connecting to a server set init-server { putserv "MODE $botnick +dix-ws" } # if no port is specified on a .jump, which port should I use? set default-port 6667 # the server list -- the bot will start at the first server listed, and cycle # through them whenever it's disconnected # (please note: you need to change these servers to YOUR network's servers) set servers { geneva.ch.eu.undernet.org:6667 graz.at.eu.undernet.org:6667 graz2.at.eu.undernet.org:6667 princeton.nj.us.undernet.org:6667 mesa.az.us.undernet.org:6667 fairfax.va.us.undernet.org:6667 lidingo.se.eu.undernet.org:6667 milan.it.eu.undernet.org:6667 } # [0/1] if the bot's nickname is changed (for example, if the intended # nickname is already in use) keep trying to get the nick back? set keep-nick 1 # [0/1] use /ison instead of /trace to see if our botnick is free or being # used? (note: some irc admins, look for excessive use of /trace) set use-ison 1 # [0/1] if this is set, a leading '~' on user@hosts WON'T be stripped off set strict-host 1 # [0/1] Squelch the error message when rejecting a DCC CHAT or SEND? # Normally it tells the DCC user that the CHAT or SEND has been rejected # because they don't have access, but sometimes IRC server operators # detect bots that way. set quiet-reject 1 # [0/1] answer lower case ctcp's (non rfc compliant) # mIRC will do this, most other clients will NOT set lowercase-ctcp 0 # answer HOW MANY stacked ctcp's at once set answer-ctcp 3 # setting any of the following with howmany == 0 will turn them off # how many msgs in how many seconds from the same host constitutes a flood? set flood-msg 5:60 # how many CTCPs in how many seconds? set flood-ctcp 3:60 # [0/1] even if all the servers are down, cycle forever and keep trying to # connect? set never-give-up 1 # [0/1] If this setting is 0 then the eggdrop keeps a seperate list of the names # irc servers call themselves, retaining what you entered in the config file. Guillaume Tournand <guillaume@tournand.com> September 2003 111/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # setting it to 1 will cause the bot to replace your entry with what # the server actually calls itself set strict-servernames 0 # number of seconds to wait between each server connect (0 = no wait) # useful for preventing ircu throttling # setting this too low could make your server admins *very* unhappy set server-cycle-wait 60 # how many seconds to wait for a response when connecting to a server # before giving up and moving on? set server-timeout 15 # if the number of servers on the net gets below this number, it will # jump to a new server (ie, it will assume it's on the losing end of a # netsplit) -- set to 0 to turn off # [most irc networks use TS or ND now, so it's to your advantage to turn # this off] set servlimit 0 # [0/1] check for stoned servers? (i.e. Where the server connection has # died, but eggdrop hasn't been notified yet). set check-stoned 1 # [0/1] enable console mode 'r'? this mode shows every raw message from the # server to owners with console 'r' selected -- will take a bit more # cpu. # NOTE: This is a large security hole, allowing people to see mis-sent # messages to the bot containing passwords # This is now restricted to +n users only. Please choose your owners with care. set use-console-r 1 # [0/1] enable logging of all information sent *to* a server, via console mode 'v' # NOTE: This is a large security hole, allowing people to see passwords. # This is now restricted to +n users only. Please choose your owners with care. set debug-output 0 # [0/1] exit if the server sends a ERROR message? set serverror-quit 1 # maximum number of lines to queue to the server. # if you're going to dump large chunks of text to people over irc, you # will probably want to raise this -- most people are fine at 300 though set max-queue-msg 300 # [0/1] trigger bindings for ignored users? set trigger-on-ignore 0 # [0/1] allow a msg being twice in a queue? set double-mode 0 set double-server 0 set double-help 0 # [0/1/2] do you want the bot to optimize the kicking queues? Set to 2 if you # want the bot to change queues if somebody parts or changes nickname. # ATTENTION: Setting 2 is very CPU intensive set optimize-kicks 1 ##### SERVER MODULE - net-type 5 specific features (other networks) ##### # [0/1] some nets use umode +r to mean a restricted connection. If this is your # case, and you want your bot to leave restricted servers and jump to the # next one on his server list, then set it to 1. # Automatically set to 0 for net-type 0/2/3/4, set to 1 for net-type 1. # Only use this if you set net-type 5 #set check-mode-r 1 Guillaume Tournand <guillaume@tournand.com> September 2003 112/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # This variable sets the maximum nick length allowed on the network. Most # only support 9. The maximum supported by eggdrop is 32. #set nick-len 9 ##### CTCP MODULE ##### # this provides the normal ctcp replies that you'd expect *RECOMMENDED* loadmodule ctcp # several variables exist to better blend your egg in. they are # ctcp-version, ctcp-finger, and ctcp-userinfo. you can use set # to set them to values you like. # [0/1/2] 0: normal behavior. 1: bot ignores all CTCPs, except for CTCP # CHATs & PINGs requested by +o flag users. 2: bot doesn't answer more # than C CTCPs in S seconds. C/S are defined by the set flood-ctcp C:S (cf # server module) set ctcp-mode 1 ##### IRC MODULE ##### # this module provides ALL NORMAL IRC INTERACTION, if you want the normal # join & maintain channels stuff, this is the module. loadmodule irc # [0/1] define this if you want to bounce all server bans set bounce-bans 1 # [0/1] define this if you want to bounce all the server modes set bounce-modes 0 # If there are more than max-bans active bans on a channel, then the # bot won't try to put more bans. Thus it won't flood the irc server. # ircd 2.9.5 allows 20 bans. ircd 2.10 allows 30 bans (max). set max-bans 20 # There is a global limit for +b/+e/+I modes. This limit is set to 30 on # 2.10 irc servers. set max-modes 30 # [0/1] Do you want the bot to kick for control character/ctcp avalanches # to a channel? # Remember that if it does, as it won't ban them, it can be at the origin # of a nice kick-flood set kick-fun 1 # [0/1] Do you want the bot to ban for control character/ctcp avalanches # to a channel? # Can prevent the above described kick-flood, but can also fill the banlist set ban-fun 1 # [0/1] let users introduce themselves to the bot via 'hello'? set learn-users 0 # time (in seconds) to wait for someone to return from a netsplit set wait-split 3600 # time (in seconds) that someone must have been off-channel before # re-displaying their info set wait-info 180 # this is the maximum number of bytes to send in the arguments to mode's # sent to the server, most servers default this to 200, so it should # be sufficient set mode-buf-length 200 Guillaume Tournand <guillaume@tournand.com> September 2003 113/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # many irc ops check for bots that respond to 'hello'. you can change this # to another word by uncommenting the following two lines, and changing # "myword" to the word you want to use instead of 'hello' (it must be a # single word) # novice users are not expected to understand what these two lines do; they # are just here to help you. for more information on 'bind', check the file # 'tcl-commands.doc' unbind msg - hello *msg:hello #bind msg - myword *msg:hello # Many takeover attempts occur due to lame users blindy /msg ident'n to # the bot without checking if the bot is the bot. # We now unbind this command by default to discourage them unbind msg - ident *msg:ident unbind msg - addhost *msg:addhost unbind msg - pass *msg:pass unbind msg - halfop *msg:halfop # If you or your users use many different hosts and wants to # be able to add it by /msg'ing you need to remove the # unbind ident line above or bind it to another word. #bind msg - myidentword *msg:ident # [0/1] If you are so lame you want the bot to display peoples info lines, even # when you are too lazy to add their chanrecs to a channel, set this to 1 # *NOTE* This means *every* user with an info line will have their info # display on EVERY channel they join (provided they have been gone longer than # wait-info) set no-chanrec-info 0 ##### IRC MODULE - net-type 1 specific features (IRCnet) ##### # Don't modify the following settings if you don't use IRCnet. The defaults following # values are harmless for you. # [0/1] define this if you want to bounce all server exemptions (+e modes) # * This is an IRCNET feature set bounce-exempts 0 # [0/1] define this if you want to bounce all server invitations (+I modes) # * This is an IRCNET feature set bounce-invites 0 # If there are more than max-exempts active +e modes on a channel, then # the bot won't try to put more exemptions. Thus it won't flood the irc # server. Only 2.10 servers are concerned by these +e modes. # * This is an IRCNET feature set max-exempts 20 # If there are more than max-invites active +I modes on a channel, then # the bot won't try to put more invitations. Thus it won't flood the irc # server. Only 2.10 irc servers are concerned by these +I modes. # * This is an IRCNET feature set max-invites 20 # The following lines should be left uncommented unless the default values # are being over-ridden. By default exempts and invites are on for IRCnet # and hybrid EFnet, but off for all other networks. This behaviour can be # modified by the following 2 flags. If you're network doesn't support e/I # modes then you'll be unable to use these features. # # [0/1] Do you want to enable exempts? # set use-exempts 0 # [0/1] Do you want to use invites? # set use-invites 0 # [0/1] Prevent mixing normal modes and +I/+e invite modes? Guillaume Tournand <guillaume@tournand.com> September 2003 114/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # At the moment (Sep/1999), IRCnet servers do not allow mixing those modes, # so leave this flag set to 1. The servers will probably change their # behaviour in the future, so you should first check before accepting the # default. set prevent-mixing 1 ##### IRC MODULE - net-type 5 specific features (other networks) ##### # kick-method defines how kicks (when enforcing bans) should be made: # 0 = kick all nicks at once in one command # X = kick X users at a time # # Automatically set by net-type: # net-type 0, 2, 3 & 4 sets this to 1 # net-type 1 sets this to 4 # # If you use net-type 5, you must set this yourself (default is 1) #set kick-method 1 # some networks allow you to stack lots of channel modes into one # line. # they're all guaranteed to support at least 3, so that's the default, # but if you know your network supports more, you may want to adjust # this value. this value must be less than or equal to 6. # Automatically set to 4 for net-type 0/4, set to 3 for net-type 1, set to # 6 for net-type 2/3. # Only use this if you set net-type 5 #set modes-per-line 3 # [0/1] Some networks don't include the +l limit and +k or -k key modes # in the modes-per-line (see above) limitation. Set include-lk to 0 for # those networks. # Automatically set to 1 for net-type 1/2/3, set to 0 for net-type 0/4. # Only use this if you set net-type 5. #set include-lk 1 # [0/1] use ircu2.10.01 specific /who requests, therefore only asking for # exactly what's needed # Automatically set to 0 for net-type 0/1/3/4, set to 1 for net-type 2. # Only use this if you set net-type 5 #set use-354 0 # [0/1] use rfc 1459 compliant string matching routines? # All networks apart from Dalnet comply with rfc 1459, so you should only # disable it on Dalnet or networks which use Dalnet's code. #set rfc-compliant 1 ##### TRANSFER MODULE ##### # uncomment this line to load the transfer module, this provides # dcc send/get support and bot userfile transfer support (not sharing) loadmodule transfer ##### variables: # set maximum number of simultaneous downloads to allow for each user set max-dloads 1 # set the block size for dcc transfers (ircII uses 512 bytes, but admits # that may be too small -- 1024 is standard these days) # set this to 0 to use turbo-dcc (recommended) set dcc-block 0 # [0/1] copy files into the /tmp directory before sending them? this is # useful on most systems for file stability. (someone could move a file # around while it's being downloaded, and mess up the transfer.) but if # your directories are NFS mounted, it's a pain, and you'll want to set # this to 0. If you are low on disk space, you may want to set this to 0. Guillaume Tournand <guillaume@tournand.com> September 2003 115/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project set copy-to-tmp 1 # time (in seconds) that a dcc file transfer can remain inactive # before being timed out set xfer-timeout 30 ##### SHARE MODULE ##### # this provides the userfile sharing support # (this requires the channels & transfer modules) loadmodule share ##### variables: # [0/1] When two bots get disconnected this flag allows them to create # a resync buffer which saves all changes done to the userfile during # the disconnect. So, when they reconnect, they will not have to transfer # the complete user file, but instead, just send the resync buffer. # If you have problems with this feature please tell us. Take a look at # doc/BUG-REPORT first though. set allow-resync 0 # this specifies how long to hold another bots resync data for before # flushing it set resync-time 900 # [0/1] when sharing user lists, DONT ACCEPT global flag changes from other bots? # NOTE: the bot will still send changes made on the bot, it just wont accept # any global flag changes from other bots set private-global 0 # when sharing user lists, if private-global isn't set, which global flag # changes from other bots should be ignored ? #set private-globals "mnot" # [0/1] when sharing user lists, DON'T ACCEPT any userfile changes from other # bots? # NOTE: paranoid people should use this feature on their hub bot - this # will force all +host/+user/chpass/etc. changes to be made via the hub set private-user 0 # [0/1] this setting makes the bot discard it's own bot records in favor of # the ones sent by the hub. Note: This only works with hubs that are v1.5.1 # _or higher_. set override-bots 1 ##### COMPRESS MODULE ##### # The compress module provides support for file compression. This allows the # bot to transfer compressed user files and therefore save a significant # amount of bandwidth, especially on very active hubs. loadmodule compress # [0/1] allow compressed sending of user files. The user files # are compressed with the compression level defined in `compress-level'. set share-compressed 1 # [0-9] default compression level used. set compress-level 9 ##### FILESYSTEM MODULE ##### # uncomment this line to load the file system module, this provides # an area withing the bot where you can store files #loadmodule filesys Guillaume Tournand <guillaume@tournand.com> September 2003 116/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # this is the 'root' directory for the file system (set it to "" if you # don't want a file system) set files-path "" # if you want to allow uploads, set this to the directory uploads should be # put into set incoming-path "" # [0/1] alternately, you can set this, and uploads will go to the current # directory that a user is in set upload-to-pwd 0 # eggdrop creates a '.filedb' file in each subdirectory of your dcc area, # to keep track of its own file system info -- if you can't do that (like # if the dcc path isn't owned by yours) or you just don't want it to do # that, specify a path here where you'd like all the database files to # be stored instead (otherwise, just leave it blank) set filedb-path "" # set maximum number of people that can be in the file area at once # (0 to make it effectively infinite) set max-file-users 20 # maximum allowable file size that will be received, in K # (default is 1024K = 1M). 0 makes it effectively infinite. set max-filesize 1024 ##### NOTES MODULE ##### # this provides support for storing of notes for users from each other # notes between currently online users is supported in the core, this is # only for storing the notes for later retrieval, direct user->user notes # are built-in loadmodule notes # the notefile: where private notes between users are stored set notefile "zildjian/Zildjian.notes" # maximum number of notes to allow to be stored for each user # (to prevent flooding) set max-notes 50 # time (in days) to let stored notes live before expiring them set note-life 60 # [0/1] allow users to specify a forwarding address for forwarding notes # to another bot set allow-fwd 1 # [0/1] set this to 1 if you want the bot to let people know hourly if they # have any notes set notify-users 1 # [0/1] set this to 1 if you want the bot to let people know on join if they # have any notes set notify-onjoin 1 ##### CONSOLE MODULE ##### # this module provides storage of console settings when you exit the bot # (or .store) loadmodule console ##### variables: # [0/1] save users console settings automatically? (otherwise they have to use # .store) Guillaume Tournand <guillaume@tournand.com> September 2003 117/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project set console-autosave 1 # [0-99999] if a user doesn't have any console settings saved, which channel # do you want them automatically put on? set force-channel 0 # [0/1] display a user's global info line when they join a botnet channel? set info-party 0 ##### WOOBIE MODULE ##### # this serves absolutely no purpose and is for demonstrative # purposes only #loadmodule woobie ##### SEEN MODULE ##### # this module provides seen commands via msg, on channel or via # dcc, similar to the various scripts #loadmodule seen ##### BLOWFISH MODULE ##### ##### IF YOU DONT READ THIS YOU MAY RENDER YOUR USERFILE USELESS LATER # Choose your encryption method now, 'cause once you do, it ain't # changing 'til you get a new userfile, capish? At the moment, there # is only one encryption option: blowfish # uncomment this line to load blowfish, the encryption module # for the bot, it will not start without it loaded and commented out # to make sure you read the whole config file # this is checkmodule, because during .restart the module will already # be loaded checkmodule blowfish ##### ASSOC MODULE ##### # uncomment this line to load assoc support, i.e naming channels on # the botnet loadmodule assoc ##### WIRE MODULE ##### # this module provides all the standard .wire commands via dcc. # it's an encrypted partyline communication tool, compatible with wire.tcl # uncomment this line to load it loadmodule wire ##### SCRIPTS ##### # X username/pass set cmasterhnd "zildjian" set cmasterpwd "bdymrIHL" # these are some commonly loaded (and needed) scripts. source scripts/alltools.tcl source scripts/action.fix.tcl # use this for tcl and eggdrop downwards compatibility source scripts/compat.tcl Guillaume Tournand <guillaume@tournand.com> September 2003 118/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # This script provides many useful minor informational commands # (like setting users url's, email address, etc). You can modify # it to add extra entries, you might also want to modify help/userinfo.help # and help/msg/userinfo.help to change the help files. source scripts/userinfo.tcl loadhelp userinfo.help source scripts/bnusers_slave.tcl source scripts/x.tcl source scripts/reop_bot.tcl Guillaume Tournand <guillaume@tournand.com> September 2003 119/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project The tcl scripts X.tcl # Copyright (c) 2003, Alexander Maassen <outsider@key2peace.org> All rights # reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # - Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # - Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # - Neither the name of the Loufiz project nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ## To make this work correctly have the bot registered and enter the following ## parameters into your BOTCONFIG ! ## set cmasterhnd "<the bots handle in cmaster>" ## set cmasterpwd "<the handles password>" set cmasterbot "X" set cmastersvr "channels.undernet.org" set cmasterhis "users.undernet.org" ## bindings bind need - * cmaster_needflags bind notc - "*You are not allowed to be opped on*" cmaster_lowban bind notc - "*AUTHENTICATION SUC*" cmaster_gotlogin bind time - "* * * * *" cmaster_checklogin bind evnt - init-server cmaster_serverinit # define new channel mode setudef flag cmaster # removes the token because auth'd on X proc cmaster_gotlogin { nick host hand args dest } { global cmasterbot cmasterlog if {[string tolower $nick] != [string tolower $cmasterbot]} {return 0} unset cmasterlog } # it checks the login proc cmaster_checklogin {a b c d e} { global cmasterlog foreach chan [channels] { channel set $chan +cmaster } if {[info exists cmasterlog]} { cmaster_serverinit blah } } Guillaume Tournand <guillaume@tournand.com> September 2003 120/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # remove the small bans < 75 proc cmaster_lowban { nick host hand args dest } { global cmasterbot botnick cmasterlog if {[string tolower $nick] != [string tolower $cmasterbot]} {return 0} if {[info exists cmasterlog]} { return 0 } set chan [lindex $args 8] putserv "PRIVMSG $cmasterbot :unban $chan $botnick" } # you need something, here you'll get it proc cmaster_needflags {chan type} { global cmastersvr cmasterbot cm_req home botnick cmasterlog if {![channel get $chan cmaster]} { return 0 } if {[info exists cm_req($chan)]} { return 0 } if {[info exists cmasterlog]} { return 0 } switch $type { op { if {![onchan $cmasterbot $chan]} { return 0 } putserv "PRIVMSG $cmasterbot :OP $chan" } unban { putserv "PRIVMSG $cmasterbot :UNBAN $chan $botnick" } invite { putserv "PRIVMSG $cmasterbot :INVITE $chan" } key { cmaster_needflags $chan invite } limit { cmaster_needflags $chan invite } } set cm_req($chan) 1 timer 1 "unset cm_req($chan)" } # we try to login to X proc cmaster_serverinit {args} { global cmasterbot cmastersvr cmasterhnd cmasterpwd botnick cmasterlog putserv "PRIVMSG $cmasterbot@$cmastersvr :LOGIN $cmasterhnd $cmasterpwd" # to make sure the bot has the +x mode putserv "MODE $botnick +x" set cmasterlog 1 } putlog "X Support loaded." Guillaume Tournand <guillaume@tournand.com> September 2003 121/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project reop_bots.tcl # Copyright (c) 2003, Alexander Maassen <outsider@key2peace.org> All rights # reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # - Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # - Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # - Neither the name of the Loufiz project nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. bind mode - *-o* prot_deop proc prot_deop {nick host hand chan mdechg dnick} { set dhand [nick2hand $dnick $chan] if {[matchattr $dhand a] && [matchattr $dhand b] && [matchattr $dhand o] && [matchattr $dhand f]} { pushmode $chan +o $dnick } } Guillaume Tournand <guillaume@tournand.com> September 2003 122/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project identhost.tcl # Copyright (c) 2003, Alexander Maassen <outsider@key2peace.org> All rights # reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # - Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # - Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # - Neither the name of the Loufiz project nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. bind pub - .ident@host genhost proc genhost {nick uhost handle chan args} { set temp [string range [lindex [split $uhost @] 0] [expr [string length [lindex [split $uhost @] 0]] - 10] e] regsub -all ~ $temp "" temp if {[string match *.users.undernet.org [string tolower $uhost]]} { putserv "NOTICE $nick :Your ident@host is: *!*$temp@[lindex [split $uhost @] 1]" }{ set uhost [lindex [split $uhost !] [expr [llength [split $uhost !]] -1]] putserv "NOTICE $nick :Your ident@host is: *!*$temp@[lindex [split [maskhost *!*@[lindex [split $uhost @] 1]] @] 1]" } } Guillaume Tournand <guillaume@tournand.com> September 2003 123/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project loufiz_newapp.tcl # Copyright (c) 2003, Craig Shue <shoey@acetone.org> All rights # reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # - Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # - Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # - Neither the name of the Loufiz project nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # The following is a bind to make .newapp <channel> function bind dcc - newapp newapp # This procedure will cause the bot to join the channel, wait 5 second # and then begin scanning proc newapp {handle idx args} { set channel "#[lindex $args 0]" channel add $channel -inactive utimer 10 "scan_of_app $channel" } proc scan_of_app {channel} { set chantoadd $channel global botnick # Initial channel values: set ops 0 set voices 0 set otherusers 0 set clones 0 set run 0 set newapp_total_users 0 foreach i [chanlist $channel] { if {$i == $botnick} { continue } set stop "no" foreach j [array names runlist] { if {[string match "*[string tolower [lindex [split [getchanhost $i $chantoadd] @] 1]]" "$runlist($j)"]} { incr clones set stop "yes" } } if {$stop == "no"} { incr run set runlist($run) "*[string tolower [lindex [split [getchanhost $i $chantoadd] @] 1]]" if {[isop $i $channel]} { incr ops } Guillaume Tournand <guillaume@tournand.com> September 2003 124/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if {[isvoice $i $channel] && ![isop $i $channel]} { incr voices } if {![isvoice $i $channel] && ![isop $i $channel]} { incr otherusers } } } # Completed scanning. Removing the channel in 10 seconds: # utimer 10 "channel remove $channel" channel remove $channel # Now, inform the staff in #loufiz of the application: # we define the used variables incr newapp_total_users $ops incr newapp_total_users $voices incr newapp_total_users $otherusers set newapp_text "for $channel: $ops ops, $voices voices, $clones clones, and $otherusers modless users. Total : $newapp_total_users users." putlog "Eggdrops request $newapp_text Scan complete." foreach i [chanlist #loufiz] { if { ([isvoice $i #loufiz] && ![isop $i #loufiz]) || ([isop $i #loufiz]) && ($i != $botnick) } { puthelp "notice $i :Eggdrops request $newapp_text" } } } Guillaume Tournand <guillaume@tournand.com> September 2003 125/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project bnusers_master # This script is made for controlling your botnet # either one-bot-only or all-at-time. # This script contains NO parts from nettools.tcl or # any equivalent script. This has been made totally # by my self. # If any bugs are found, contact me on # cmouse@fiiu.org or QuakeNET channel #teddybears # On bug report bot version and other relevant information # on your bot and botnet is needed. # Also the error message, if provided, is needed. # VERSION HISTORY # v4.0 # Added .bnchan to make channel operations # v3.1 # Added .bnhelp and .bnrestart # Unified the not enough parameter strings # v3.0 # Added .bndie, .bnjoin, .bnpart and .bnchanset # Fixed minor mistakes # v2.0 # Fixed bug in .bnsay which gave TCL error # Added .bnrehash, .bnbotattr # Fixed minor typos # v1.0 # Here it starts. =) # MASTER SIDE # IMPORTANT! THIS MUST NOT BE changeme! # This is the one of the most important # fake msg preventers since we can't see # the hostmask. If not changed the script # WILL NOT start set cipher "cipherkey" # Allow bot adding[1/0] set allow(ab) 1 # Allow user adding[1/0] set allow(au) 1 # Allow deleting of users[1/0] set allow(du) 1 # Allow hostlist editing[1/0] set allow(hl) 1 # Allow user mode changes[1/0] set allow(ca) 1 # Allow password changing[1/0] set allow(cp) 1 # Allow channel say[1/0] set allow(say) 1 # Allow msg'ing[1/0] set allow(msg) 1 # Allow channel joining/parting[1/0] set allow(ac) 1 # Allow channel mode set(chanmode, +bitch, -autop, etc.)[1/0] set allow(cset) 1 Guillaume Tournand <guillaume@tournand.com> September 2003 126/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # Allow channel commanding(op, deop etc.) set allow(ccmd) 1 # Allow rehash[1/0] default is OFF (0) set allow(rhh) 1 # Allow restart[1/0] default is OFF (0) this drops your bot off the IRC # Restricted to permanent owners only set allow(rst) 1 # Allow die[1/0] default/recommended is OFF (0) # BE CAREFUL WHO YOU GIVE PERMANENT OWNER RIGHTS!!! # This command can kill your ENTIRE botnet set allow(die) 1 # Do not touch anything below if {$cipher=="changeme"} { putlog "BOTNET user handler" putlog "$owner is a idiot who can't read english!" putlog "CHANGE THE BOTNET CIPHER!" return 0 } bind bot - "bnrp" bn_rreply bind bot - "bnr" bn_reply bind dcc n "+bnbot" bn_addbot bind dcc n "+bnuser" bn_adduser bind dcc n "-bnuser" bn_deluser bind dcc n "+bnhost" bn_addhost bind dcc n "-bnhost" bn_delhost bind dcc n "bnchattr" bn_chattr bind dcc n "bnbotattr" bn_botattr bind dcc n "bnpasswd" bn_passwd bind dcc n "bnsay" bn_say bind dcc n "bnmsg" bn_msg bind dcc m "bnjoin" bn_join bind dcc m "bnpart" bn_part bind dcc n "bnchanset" bn_chanset bind dcc n "bnchan" bn_chancmd bind dcc n "bnrehash" bn_rehash bind dcc n "bndie" bn_die bind dcc n "bnrestart" bn_restart bind dcc n "bnhelp" bn_help proc bn_dec {strn} { global cipher set rep [decrypt $cipher $strn] return $rep } proc bn_enc {strn} { global cipher set rep [encrypt $cipher $strn] return $rep } proc bn_rreply {from cmd args} { set args [string trim $args "{}"] putlog "$from: $args" return 0 Guillaume Tournand <guillaume@tournand.com> September 2003 127/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project } proc bn_reply {from cmd args} { set args [bn_dec $args] putlog "$from: $args" return 0 } proc bn_transmit {target idx transmit} { set target [string trim $target "{}"] foreach bot [bots] { lappend blist [string tolower $bot] } set target [string tolower $target] if {[lsearch $blist $target]>-1} { putbot $target "bnrq $transmit" putidx $idx "Request sent to $target" return 0 } if {$target==""} { putidx $idx "Define all or bot name" return 0 } if {$target!="all"} { putidx $idx "No $target online" return 0 } foreach bot $blist { putbot $bot "bnrq $transmit" } putidx $idx "Sent request to all bots. Lets see what happens..." return 0 } proc bn_addbot {handle idx args} { global allow set args [string trim [string trim $args "{"] "}"] set args [split $args " "] set arg(1) "" set arg(2) "" set arg(3) "" set arg(4) "" set n 0 foreach argu $args { incr n set arg($n) $argu } if {$arg(4)==""} {set arg(4) ""} if {($arg(2)=="")||($arg(3)=="")} { putidx $idx "Not enough arguments: .+bnbot targetbot bot address ?hostmask?" return 0 } bn_transmit $arg(1) $idx [bn_enc "bnrq addbot $arg(2) $arg(4) $arg(3)"] putcmdlog "#$handle# +bnbot($arg(1)) $arg(2) ..." set arg(1) [string tolower $arg(1)] if {$arg(1)!="all"} { return 0 } if {!($allow(ab))} { putidx $idx "Bot adding failed. Not allowed" return 0 } set rsp [addbot $arg(2) $arg(4)] if {!($rsp)} { putidx $idx "Bot adding failed. Entry already exists" return 0 } setuser $arg(2) HOSTS "$arg(3)" putidx $idx "Bot $arg(2) added with hostmask $arg(3) and address $arg(4)" return 0 Guillaume Tournand <guillaume@tournand.com> September 2003 128/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project } proc bn_adduser {handle idx args} { global allow set args [string trim [string trim $args "{"] "}"] set args [split $args " "] set arg(1) "" set arg(2) "" set arg(3) "" set arg(4) "" set n 0 foreach argu $args { incr n set arg($n) $argu } if {($arg(2)=="")||($arg(3)=="")} { putidx $idx "Not enough arguments: .+bnuser bot user hostmask" return 0 } bn_transmit $arg(1) $idx [bn_enc "bnrq adduser $arg(2) $arg(3)"] putcmdlog "#$handle# +bnuser($arg(1)) $arg(2) ..." set arg(1) [string tolower $arg(1)] if {$arg(1)!="all"} { return 0 } if {!($allow(au))} { putidx $idx "User adding failed. Not allowed" return 0 } set rsp [adduser $arg(2) $arg(3)] if {!($rsp)} { putidx $idx "User adding failed. Entry already exists" return 0 } setuser $arg(2) HOSTS "$arg(3)" putidx $idx "Added $arg(2) to user database with hostmask $arg(3) as user" return 0 } proc bn_deluser {handle idx args} { global allow set args [string trim [string trim $args "{"] "}"] set args [split $args " "] set arg(1) "" set arg(2) "" set arg(3) "" set n 0 foreach argu $args { incr n set arg($n) $argu } if {$arg(2)==""} { putidx $idx "Not enough arguments: .-bnuser bot user" return 0 } bn_transmit $arg(1) $idx [bn_enc "bnrq deluser $arg(2)"] putcmdlog "#$handle# -bnuser $arg(2)" set arg(1) [string tolower $arg(1)] if {$arg(1)!="all"} { return 0 } if {!($allow(du))} { putidx $idx "User adding failed. Not allowed" return 0 } if {[matchattr $arg(2) "+n"]} { putidx $idx "You cannot remove owner!" return 0 } set rsp [deluser $arg(2)] if {!($rsp)} { putidx $idx "User deleting failed. No such user" Guillaume Tournand <guillaume@tournand.com> September 2003 129/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project return 0 } putidx $idx "User $arg(2) deleted" return 0 } proc bn_addhost {handle idx args} { global allow set args [string trim [string trim $args "{"] "}"] set args [split $args " "] set arg(1) "" set arg(2) "" set arg(3) "" set n 0 foreach argu $args { incr n set arg($n) $argu } if {($arg(2)=="")||($arg(3)=="")} { putidx $idx "Not enough arguments: .+bnhost bot user hostmask" return 0 } bn_transmit $arg(1) $idx [bn_enc "bnrq addhost $arg(2) $arg(3)"] putcmdlog "#$handle# bnaddhost $arg(2) ..." set arg(1) [string tolower $arg(1)] if {$arg(1)!="all"} { return 0 } if {!($allow(hl))} { putidx $idx "No hostlist editing for you." return 0 } if {![validuser $arg(2)]} { putidx $idx "No such user" return 0 } set hostlist [getuser $arg(2) HOSTS] if {[lsearch -exact $hostlist $arg(3)]>-1} { putidx $idx "$arg(1) has that host already." return 0 } setuser $arg(2) HOSTS $arg(3) putidx $idx "Host $arg(3) added to $arg(2)" } proc bn_delhost {handle idx args} { global allow set args [string trim [string trim $args "{"] "}"] set args [split $args " "] set arg(1) "" set arg(2) "" set arg(3) "" set n 0 foreach argu $args { incr n set arg($n) $argu } if {($arg(2)=="")||($arg(3)=="")} { putidx $idx "Not enough arguments: .-bnhost bot user hostmask" return 0 } bn_transmit $arg(1) $idx [bn_enc "bnrq delhost $arg(2) $arg(3)"] putcmdlog "#$handle# -bnhost $arg(2) ..." set arg(1) [string tolower $arg(1)] if {$arg(1)!="all"} { return 0 } if {!($allow(hl))} { putidx $idx "No hostlist editing for you." return 0 } if {![validuser $arg(2)]} { Guillaume Tournand <guillaume@tournand.com> September 2003 130/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project putidx $idx "No such user" return 0 } set hostlist [getuser $arg(2) HOSTS] if {[lsearch -exact $hostlist $arg(3)]==-1} { putidx $idx "$arg(2) doesn't have that host." return 0 } delhost $arg(2) $arg(3) putidx $idx "Host $arg(3) deleted from $arg(2)" return 0 } proc bn_chattr {handle idx args} { global allow set args [string trim [string trim $args "{"] "}"] set args [split $args " "] set n 0 set arg(1) "" set arg(2) "" set arg(3) "" set arg(4) "" foreach argu $args { incr n set arg($n) $argu } if {$arg(2)==""} { putidx $idx "Not enough arguments: .bnchattr bot user ?modes? ?channel?" return 0 } if {$arg(4)==""} { set arg(4) "global" if {[string range $arg(3) 0 0]=="#"} { set $arg(3) "" } } if {$arg(3)==""} { bn_transmit $arg(1) $idx [bn_enc "bnrq giveattr $arg(2) $arg(4)"] set arg(1) [string tolower $arg(1)] if {$arg(1)!="all"} { putcmdlog "#$handle# bnchattr $arg(2) $arg(4)" return 0 } if {!($allow(ca))} { putidx $idx "No mode viewing/changing for you." } else { if {$arg(3)=="global"} { putidx $idx "$arg(2) modes: [chattr $arg(2)]" } else { putidx $idx "$arg(2) modes: [chattr $arg(2) $arg(4)]" } } putcmdlog "#$handle# bnchattr $arg(2) $arg(4)" return 0 } bn_transmit $arg(1) $idx [bn_enc "bnrq chattr $arg(2) $arg(3) $arg(4)"] set arg(1) [string tolower $arg(1)] if {$arg(1)!="all"} { putcmdlog "#$handle# bnchattr ($arg(4)) $arg(2) $arg(3)" return 0 } if {!($allow(ca))} { putidx $idx "No mode viewing/changing for you." } else { if {$arg(4)=="global"} { putidx $idx "$arg(2) modes: [chattr $arg(2) $arg(3)]" } else { putidx $idx "$arg(2) modes: [chattr $arg(2) $arg(3) $arg(4)]" } } Guillaume Tournand <guillaume@tournand.com> September 2003 131/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project putcmdlog "#$handle# bnchattr ($arg(4)) $arg(2) $arg(3)" return 0 } proc bn_botattr {handle idx args} { global allow set args [string trim [string trim $args "{"] "}"] set args [split $args " "] set n 0 set arg(1) "" set arg(2) "" set arg(3) "" set arg(4) "" foreach argu $args { incr n set arg($n) $argu } if {$arg(2)==""} { putidx $idx "Not enough arguments: .bnbotattr targetbot bot ?modes? ?channel?" return 0 } if {$arg(4)==""} { set arg(4) "global" if {[string range $arg(3) 0 0]=="#"} { set arg(3) "" } } if {$arg(3)==""} { bn_transmit $arg(1) $idx [bn_enc "bnrq giveattr $arg(2)"] set arg(1) [string tolower $arg(1)] if {$arg(1)!="all"} { putcmdlog "#$handle# bnbotattr $arg(2) $arg(4)" return 0 } if {!($allow(ca))} { putidx $idx "No mode viewing/changing for you." } else { if {$arg(3)=="global"} { putidx $idx "$arg(2) modes: [botattr $arg(2)]" } else { putidx $idx "$arg(2) modes: [botattr $arg(2) $arg(4)]" } } putcmdlog "#$handle# bnbotattr $arg(2)" return 0 } if {$arg(4)==""} {set arg(4) "global"} bn_transmit $arg(1) $idx [bn_enc "bnrq botattr $arg(2) $arg(3) $arg(4)"] set arg(1) [string tolower $arg(1)] if {$arg(1)!="all"} { putcmdlog "#$handle# bnbotattr ($arg(4)) $arg(2) $arg(3)" return 0 } if {!($allow(ca))} { putidx $idx "No mode viewing/changing for you." } else { if {$arg(4)=="global"} { putidx $idx "$arg(2) modes: [botattr $arg(2) $arg(3)]" } else { putidx $idx "$arg(2) modes: [botattr $arg(2) $arg(3) $arg(4)]" } } putcmdlog "#$handle# bnbotattr ($arg(4)) $arg(2) $arg(3)" return 0 } proc bn_passwd {handle idx args} { global allow set args [string trim [string trim $args "{"] "}"] set args [split $args " "] Guillaume Tournand <guillaume@tournand.com> September 2003 132/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project set arg(1) "" set arg(2) "" set arg(3) "" set n 0 foreach argu $args { incr n set arg($n) $argu } if {$arg(2)==""} { putidx $idx "Not enough arguments: .bnpasswd bot user ?newpass?" return 0 } bn_transmit $arg(1) $idx [bn_enc "bnrq passwd $arg(2) $arg(3)"] putcmdlog "#$handle# bnpasswd $arg(2) ..." set arg(1) [string tolower $arg(1)] if {$arg(1)!="all"} { return 0 } if {!($allow(cp))} { putidx $idx "No password changes allowed." return 0 } if {![validuser $arg(2)]} { putidx $idx "No such user." return 0 } setuser $arg(2) PASS $arg(3) putidx $idx "Password changed for user $arg(2)" return 0 } proc bn_say {handle idx args} { global allow set args [string trim [string trim $args "{"] "}"] set args [split $args " "] set arg(1) "" set arg(2) "" set arg(3) "" set n 0 foreach argu $args { incr n set arg($n) $argu } set saytxt "[lrange $args 2 end]" if {($arg(2)=="")||($saytxt=="")} { putidx $idx "Not enough arguments: .bnsay bot channel text" return 0 } bn_transmit $arg(1) $idx [bn_enc "bnrq say $arg(2) $saytxt"] putcmdlog "#$handle# bnsay ($arg(2)) ..." set arg(1) [string tolower $arg(1)] if {$arg(1)!="all"} { return 0 } if {!($allow(say))} { putidx $idx "No channel messages allowed." } else { if {![botonchan $arg(2)]} { putidx $idx "Not on channel $arg(2)" } else { puthelp "PRIVMSG $arg(2) :$saytxt" putidx $idx "Said $saytxt on $arg(2)" } } return 0 } proc bn_msg {handle idx args} { global allow set args [string trim [string trim $args "{"] "}"] set args [split $args " "] set arg(1) "" Guillaume Tournand <guillaume@tournand.com> September 2003 133/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project set arg(2) "" set arg(3) "" set n 0 foreach argu $args { incr n set arg($n) $argu } set saytxt "[lrange $args 2 end]" if {($arg(2)=="")||($saytxt=="")} { putidx $idx "Not enough arguments: .bnmsg bot nick text" return 0 } bn_transmit $arg(1) $idx [bn_enc "bnrq msg $arg(2) $saytxt"] putcmdlog "#$handle# bnmsg ($arg(2)) $saytxt" set arg(1) [string tolower $arg(1)] if {$arg(1)!="all"} { return 0 } if {!($allow(msg))} { putidx $idx "No messages allowed." } else { puthelp "PRIVMSG $arg(2) :$saytxt" putidx $idx "Said $saytxt to $arg(2)" } return 0 } proc bn_rehash {handle idx args} { global allow bn_transmit $args $idx [bn_enc "bnrq rehash $handle"] putcmdlog "#$handle# bnrehash" set args [string tolower $args] if {$args!="all"} { return 0 } if {!($allow(rhh))} { putidx $idx "No rehash allowed." } else { rehash } return 0 } proc bn_join {handle idx args} { global allow set args [string trim [string trim $args "{"] "}"] set args [split $args " "] set arg(1) "" set arg(2) "" set arg(3) "" set arg(4) "" set arg(5) "" set n 0 foreach argu $args { incr n set arg($n) $argu } if {($arg(2)=="")} { putidx $idx "Not enough arguments: .bnjoin bot #channel" return 0 } bn_transmit $arg(1) $idx [bn_enc "bnrq join $arg(2)"] putcmdlog "#$handle# bnjoin($arg(1)) $arg(2) ..." set arg(1) [string tolower $arg(1)] if {$arg(1)!="all"} { return 0 } if {!($allow(ac))} { putidx $idx "Channel joining not allowed" return 0 } foreach chan [channels] { if {[string tolower $arg(2)]==[string tolower $chan]} { putidx $idx "I'm on $arg(2) already!" Guillaume Tournand <guillaume@tournand.com> September 2003 134/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project return 0 } } channel add $arg(2) putidx $idx "Joined channel $arg(2)" return 0 } proc bn_part {handle idx args} { global allow set args [string trim [string trim $args "{"] "}"] set args [split $args " "] set arg(1) "" set arg(2) "" set arg(3) "" set arg(4) "" set arg(5) "" set n 0 foreach argu $args { incr n set arg($n) $argu } if {($arg(2)=="")} { putidx $idx "Not enough arguments: .bnpart bot #channel" return 0 } bn_transmit $arg(1) $idx [bn_enc "bnrq part $arg(2)"] putcmdlog "#$handle# bnpart($arg(1)) $arg(2) ..." set arg(1) [string tolower $arg(1)] if {$arg(1)!="all"} { return 0 } if {!($allow(ac))} { putidx $idx "Channel parting not allowed" return 0 } set ioc 0 foreach chan [channels] { if {[string tolower $arg(2)]==[string tolower $chan]} { set ioc 1 } } if {!($ioc)} { putidx $idx "I'm not on channel $arg(2)!" return 0 } channel remove $arg(2) putidx $idx "Left channel $arg(2)" return 0 } proc bn_die {handle idx args} { global allow owner set args [string trim [string trim $args "{"] "}"] set args [split $args " "] if {[lsearch $owner $handle]<0} { putidx $idx "What? You need '.help'" return 0 } bn_transmit [lindex $args 0] $idx [bn_enc "bnrq die $handle"] putcmdlog "#$handle# bndie" set args [string tolower $args] if {[lindex $args 0]!="all"} { return 0 } if {!($allow(die))} { putidx $idx "No killing allowed." } else { die [lrange $args 1 end] } return 0 } Guillaume Tournand <guillaume@tournand.com> September 2003 135/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project proc bn_chanset {handle idx args} { global allow set args [string trim $args "{}"] set args [split $args " "] set arg(1) "" set arg(2) "" set arg(3) "" set arg(4) "" set arg(5) "" set arg(6) "" set arg(7) "" set n 0 foreach argu $args { incr n set arg($n) $argu } if {($arg(1)=="")||($arg(2)=="")||($arg(3)=="")} { putidx $idx "Usage: .bnchanset bot channel setlist" return 0 } bn_transmit $arg(1) $idx [bn_enc "bnrq chanset $arg(2) [lrange $args 2 end]"] putcmdlog "#$handle# bnchanset" set arg(1) [string tolower $arg(1)] if {$arg(1)!="all"} { return 0 } if {!($allow(cset))} { putidx $idx "No channel mode set allowed" return 0 } if {[string tolower $arg(3)]=="chanmode"} { channel set $arg(2) $arg(3) [lrange $args 3 end] } else { channel set $arg(2) $arg(3) $arg(4) $arg(5) $arg(6) $arg(7) } putidx $idx "Set modes for $arg(2)" return 0 } proc bn_chancmd {handle idx args} { global allow set args [string trim $args "{}"] set args [split $args " "] set arg(1) "" set arg(2) "" set arg(3) "" set arg(4) "" set arg(5) "" set arg(6) "" set arg(7) "" set n 0 foreach argu $args { incr n set arg($n) $argu } if {[string tolower $arg(1)]=="all"} { putidx $idx "You may not use parameter all with this command." return 0 } if {($arg(2)!="")&&([lsearch "op deop voice devoice kick invite" $arg(2)]==-1)} { putidx $idx "Bad option $arg(2): must be op, deop, voice, devoice, kick or invite" return 0 } if {($arg(1)=="")||($arg(2)=="")||($arg(3)=="")} { putidx $idx "Usage: bnchan chancmd nick channel ?extra?" return 0 } bn_transmit $arg(1) $idx [bn_enc "bnrq chancmd $arg(2) $arg(3) $arg(4) [lrange $args 4 end]"] return 1 Guillaume Tournand <guillaume@tournand.com> September 2003 136/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project } proc bn_restart {handle idx args} { global allow owner set args [string trim [string trim $args "{"] "}"] set args [split $args " "] if {[lsearch $owner $handle]<0} { putidx $idx "What? You need '.help'" return 0 } bn_transmit [lindex $args 0] $idx [bn_enc "bnrq restart $handle"] putcmdlog "#$handle# bnrestart" set args [string tolower $args] if {[lindex $args 0]!="all"} { return 0 } if {!($allow(rst))} { putidx $idx "No killing allowed." } else { restart } return 0 } proc bn_help {handle idx args} { putidx $idx "Botnet script commands" putidx $idx "?param? means optional parameter" putidx $idx "bot means receiving bot or all" putidx $idx " " putidx $idx "+bnbot bot handle address ?hostmask?" putidx $idx "+bnuser bot handle hostmask" putidx $idx "-bnuser bot handle hostmask" putidx $idx "+bnhost bot handle hostmask" putidx $idx "-bnhost bot handle hostmask" putidx $idx "bnchattr bot handle modestring ?channel?" putidx $idx "bnbotattr bot handle modestring" putidx $idx "bnpasswd bot handle ?password? - omit password and it will be removed" putidx $idx "bnjoin bot channel" putidx $idx "bnpart bot channel" putidx $idx "bnchanset bot channel mode ?mode? ?mode? ... - max 7 modes(has a bug, no flood-sets)" putidx $idx "bnsay bot channel text - says something to channel" putidx $idx "bnmsg bot nick text - send privmsg to user from bot or all" putidx $idx "bnchan bot chancmd nick channel ?extra? - execute channel operations" putidx $idx "bnrehash bot" putidx $idx "bnrestart bot - if you are permowner you can use this" putidx $idx "bndie bot ?reason? - if you are permowner you can use this" putidx $idx " " putidx $idx "Comments, suggestions, ideas and bugs should be sent to cmouse@fiiu.org" putidx $idx "ATTENTION! Bug reports should be sent with as much as info you can get" putidx $idx "and YOU MUST send at least the error message or description of the error" putidx $idx "Otherwise it will be useless..." putidx $idx " " } putlog "Botnet userlist functions, master side v4.0(now with bnhelp!) by cmouse" Guillaume Tournand <guillaume@tournand.com> September 2003 137/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project bnusers_slave.tcl # This is the counterpart for the bnusers_master.tcl # Please pay attention to the configure. # Comments, suggestions and bugreports to cmouse@fiiu.org # read bnusers_master.tcl for additional information # VERSION HISTORY # v4.0 # Added new command .bnchan # # v3.1 # Fixed bugs in .bnchanset # Added .bnrestart # Removed error messages from wrong password etc. # v3.0 # Added .bndie, .bnjoin, .bnpart and .bnchanset # Fixed minor mistakes # v2.0 # Fixed the bug in .bnsay and .bnmsg # Added .bnrehash, .bnbotattr # v1.0 # From here it all starts... =) # SLAVE SIDE # IMPORTANT! THIS MUST NOT BE changeme! # This is the one of the most important # fake msg preventers since we can't see # the hostmask. If not changed the script # WILL NOT start set cipher "cypherkey" # Set the following lists to bot names you wish to be able to do the command # Please note that the letter are all in small. do _not_ use any capital letters # example: # set allow(ab) {codem sleazyjack horax} # If you do not want anyone to be able to use the command # just leave it empty # # example: # set allow(die) {} # Here are the settings # Allow bot adding set allow(ab) {ad4m} # Allow user adding set allow(au) {ad4m} # Allow deleting of users set allow(du) {ad4m} # Allow hostlist editing set allow(hl) {ad4m} # Allow mode changes set allow(ca) {ad4m} # Allow password changing set allow(cp) {ad4m} # Allow channel say set allow(say) {ad4m} # Allow msg'ing Guillaume Tournand <guillaume@tournand.com> September 2003 138/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project set allow(msg) {ad4m} # Allow channel joining/parting set allow(ac) {ad4m} # Allow channel mode setting(chanmode, +bitch, -autoop, etc.)[1/0] set allow(cset) {ad4m} set allow(chancmd) {ad4m} # Allow rehash] default is {} set allow(rhh) {ad4m} # Allow restart default/recommended is {} # This command drops your bot(s) from IRC # Permanent owner only set allow(rst) {ad4m} # Allow die default/recommended is {} # BE CAREFUL WHO YOU GIVE PERMANENT OWNER RIGHTS!!! # This command can kill your ENTIRE botnet set allow(die) {ad4m} # Do not touch below bind bot - "bnrq" bn_receive if {$cipher=="changeme"} { putlog "BOTNET user handle" putlog "$owner\(that's you) is a idiot who can't read english!" putlog "CHANGE THE BOTNET CIPHER!" return 0 } proc bn_dec {strn} { global cipher set rep [decrypt $cipher $strn] return $rep } proc bn_enc {strn} { global cipher set rep [encrypt $cipher $strn] return $rep } proc bn_reply {from cmd args} { set args [bn_dec $args] putlog "$from: $args" return 0 } proc bn_transmit {to transmit} { set transmit [bn_enc $transmit] putbot $to "bnr $transmit" return 0 } proc bn_receive {to cmd args} { set to [string tolower $to] global allow owner set args [bn_dec $args] set args [split $args " "] set n -1 set arg(0) "" set arg(1) "" set arg(2) "" set arg(3) "" Guillaume Tournand <guillaume@tournand.com> September 2003 139/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project set arg(4) "" set arg(5) "" set arg(6) "" set arg(7) "" set from [string tolower $to] foreach argu $args { incr n set arg($n) $argu } if {$arg(0)!="bnrq"} { return 0 } if {![validuser $to]} { putbot $to "bnrp There was a error" return 0 } switch -glob -- $arg(1) { "addbot" { if {[lsearch $allow(ab) $to]<0} { bn_transmit $to "Bot adding failed. Not allowed" return 0 } set rsp [addbot $arg(2) $arg(4)] if {!($rsp)} { bn_transmit $to "Bot adding failed. Entry already exists" return 0 } setuser $arg(2) HOSTS "$arg(3)" bn_transmit $to "Bot $arg(2) added with hostmask $arg(3) and address $arg(4)" putcmdlog "Botnet: $from added $arg(2) to user database as bot" return 0 } "adduser" { if {[lsearch $allow(au) $to]<0} { bn_transmit $to "User adding failed. Not allowed" return 0 } set rsp [adduser $arg(2) $arg(3)] if {!($rsp)} { bn_transmit $to "User adding failed. Entry already exists" return 0 } setuser $arg(2) HOSTS "$arg(3)" bn_transmit $to "User $arg(2) added with hostmask $arg(3)" putcmdlog "Botnet: $from added $arg(2) to user database as user" return 0 } "deluser" { if {[lsearch $allow(du) $to]<0} { bn_transmit $to "User adding failed. Not allowed" return 0 } if {[matchattr $arg(2) "+n"]} { bn_transmit $to "You cannot remove owner!" return 0 } set rsp [deluser $arg(2)] if {!($rsp)} { bn_transmit $to "User deleting failed. No such user" return 0 } bn_transmit $to "User $arg(2) deleted" putcmdlog "Botnet: $from deleted $arg(2) from user database" return 0 } "addhost" { if {[lsearch $allow(hl) $to]<0} { bn_transmit $to "No hostlist editing for you." return 0 } Guillaume Tournand <guillaume@tournand.com> September 2003 140/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if {![validuser $arg(2)]} { bn_transmit $to "No such user" return 0 } set hostlist [getuser $arg(2) HOSTS] if {[lsearch -exact $hostlist $arg(3)]>-1} { bn_transmit $to "$arg(2) has that host already." return 0 } setuser $arg(2) HOSTS $arg(3) bn_transmit $to "Host $arg(3) added to $arg(2)" putcmdlog "Botnet: $to added a host to $arg(2)" return 0 } "delhost" { if {[lsearch $allow(hl) $to]<0} { bn_transmit $to "No hostlist editing for you." return 0 } if {![validuser $arg(2)]} { bn_transmit $to "No such user" return 0 } set hostlist [getuser $arg(2) HOSTS] if {[lsearch -exact $hostlist $arg(3)]==-1} { bn_transmit $to "$arg(2) doesn't have that host." return 0 } delhost $arg(2) $arg(3) bn_transmit $to "Host $arg(3) deleted from $arg(2)" putcmdlog "Botnet: $to deleted a host from $arg(2)" return 0 } "giveattr" { if {[lsearch $allow(ca) $to]<0} { bn_transmit $to "No mode viewing/changing allowed." return 0 } if {[string match "*#*" $arg(3)]==0} { set rsp [chattr $arg(2)] } else { set rsp [chattr $arg(2) $arg(3)] } if {$rsp=="*"} { bn_transmit $to "No such user" return 0 } bn_transmit $to "User $arg(2) modes: $rsp" putcmdlog "Botnet: $from requested $arg(2)'s modes" return 0 } "botattr" { if {[lsearch $allow(ca) $to]<0} { bn_transmit $to "No mode viewing/changing allowed." return 0 } if {[string match "*#*" $arg(4)]==0} { set rsp [chattr $arg(2) $arg(3)] } else { set rsp [chattr $arg(2) $arg(3) $arg(4)] } if {$rsp=="*"} { bn_transmit $to "No such bot" return 0 } bn_transmit $to "User $arg(2) modes: $rsp" putcmdlog "Botnet: $from changed $arg(2)'s modes" return 0 Guillaume Tournand <guillaume@tournand.com> September 2003 141/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project } "chattr" { if {[lsearch $allow(ca) $to]<0} { bn_transmit $to "No mode viewing/changing allowed." return 0 } if {[string match "*#*" $arg(4)]==0} { set rsp [chattr $arg(2) $arg(3)] } else { set rsp [chattr $arg(2) $arg(3) $arg(4)] } if {$rsp=="*"} { bn_transmit $to "No such user" return 0 } bn_transmit $to "User $arg(2) modes: $rsp" putcmdlog "Botnet: $from changed $arg(2)'s modes" return 0 } "passwd" { if {[lsearch $allow(cp) $to]<0} { bn_transmit $to "No password changes allowed." return 0 } if {![validuser $arg(2)]} { bn_transmit $to "No such user." return 0 } setuser $arg(2) PASS $arg(3) bn_transmit $to "Password changed for user $arg(2)" putcmdlog "Botnet: $from changed $arg(2)'s password" return 0 } "say" { if {[lsearch $allow(say) $to]<0} { bn_transmit $to "No channel messages allowed." return 0 } if {![botonchan $arg(2)]} { bn_transmit $to "Not on channel $arg(2)" return 0 } puthelp "PRIVMSG $arg(2) :[lrange $args 3 end]" bn_transmit $to "Said that to channel $arg(2)" putcmdlog "Botnet: $to made me speak to channel $arg(2)" return 0 } "msg" { if {[lsearch $allow(msg) $to]<0} { bn_transmit $to "No private messages allowed." return 0 } puthelp "PRIVMSG $arg(2) :[lrange $args 3 end]" bn_transmit $to "Said that to $arg(2)" putcmdlog "Botnet: $to made me speak to $arg(2)" return 0 } "rehash" { if {[lsearch $allow(rhh) $to]<0} { bn_transmit $to "You may not rehash this bot." return 0 } bn_transmit $to "Rehashing..." putcmdlog "Botnet: $arg(2)@$to ordered a rehash" rehash return 0 } "join" { Guillaume Tournand <guillaume@tournand.com> September 2003 142/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if {[lsearch $allow(ac) $to]<0} { bn_transmit $to "Channel joining not allowed." return 0 } foreach chan [channels] { if {[string tolower $arg(2)]==[string tolower $chan]} { bn_transmit $to "I'm on $arg(2) already!" return 0 } } channel add $arg(2) bn_transmit $to "Joined channel $arg(2)" putcmdlog "$to made me join $arg(2)" return 0 } "part" { if {[lsearch $allow(ac) $to]<0} { bn_transmit $to "Channel joining not allowed." return 0 } set ioc 0 foreach chan [channels] { if {[string tolower $arg(2)]==[string tolower $chan]} { set ioc 1 } } if {!($ioc)} { bn_transmit $to "I'm not on channel $arg(2)!" return 0 } channel remove $arg(2) bn_transmit $to "Left channel $arg(2)" putcmdlog "$to made me left $arg(2)" return 0 } "die" { if {[lsearch $allow(die) $to]<0} { putcmdlog "BOTNET: Killing not allowed" return 0 } if {[lsearch $owner $arg(2)]<0} { putcmdlog "BOTNET: $arg(2) is not a permowner" return 0 } putcmdlog "$arg(2)@$to killed me" die [lrange $args 3 end] } "chanset" { if {[lsearch $allow(cset) $to]<0} { bn_transmit $to "Channel mode setting not allowed" return 0 } set ioc 0 foreach chan [channels] { set chan [string tolower $chan] if {$arg(2)==$chan} { set ioc 1 } } if {$ioc==0} { bn_transmit $to "I'm not on channel $arg(2)!" return 0 } if {[string tolower $arg(3)]=="chanmode"} { channel set $arg(2) $arg(3) [lrange $args 4 end] putlog "$arg(2) $arg(3) [lrange $args 4 end]" } else { channel set $arg(2) $arg(3) $arg(4) $arg(5) $arg(6) $arg(7) } bn_transmit $to "Mode set for $arg(2)" Guillaume Tournand <guillaume@tournand.com> September 2003 143/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project return 0 } "chancmd" { set arg(2) [string tolower $arg(2)] if {[lsearch $allow(chancmd) $to]<0} { bn_transmit $to "BOTNET: Channel cmd's not allowed" return 0 } if {(![onchan $arg(3) $arg(4)])&&($arg(2)!="invite")} { bn_transmit $to "BOTNET: No such user on $arg(4)" return 0 } switch -exact $arg(2) { "op" { putserv "MODE $arg(4) +o $arg(3)" } "deop" { putserv "MODE $arg(4) -o $arg(3)" } "voice" { putserv "MODE $arg(4) +v $arg(3)" } "devoice" { putserv "MODE $arg(4) -v $arg(3)" } "kick" { putserv "KICK $arg(4) $arg(3) :[lrange $args 4 end]" } "invite" { putserv "INVITE $arg(3) $arg(4)" } } return 0 } "restart" { if {[lsearch $allow(rst) $to]<0} { putcmdlog "BOTNET: Killing not allowed" return 0 } if {[lsearch $owner $arg(2)]<0} { putcmdlog "BOTNET: $arg(2) is not a permowner" return 0 } putcmdlog "$arg(2)@$to restarted me" restart return 0 } } putbot $to "bnrp Unknown command - this should not occur, check version" return 0 } putlog "Botnet userlist handler slave v3.2" Guillaume Tournand <guillaume@tournand.com> September 2003 144/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project greetd.tcl # Script: Greetd.tcl # Version: 0.05b # Author: Jeff Fisher <fishy@dlcwest.com> # # Updates: # 12Feb98 - can now select delay time (idea by Angelos7) # # Notes: # # - can do multi-channel multi-lined greet msgs # - can either msg all users or just non-users # - will only show the greet to one identd or non-identd within 2min # or whatever you change the time level too ... # # Who to show? # 0 = all users # 1 = non-users set greetd(show) 0 # Delay time before reshowing the greet? (In minutes) set greetd(delay) 2 # Show via PRIVMSG or NOTICE? set greetd(method) "NOTICE" # Greet Messages and Their Channels ... # - Channel names within the ( and ) must be lowercase, otherwise it wont work # - Example: # set greetd_msg(#eggdrop) { # "Welcome to #Eggdrop" # "For Eggdrop Files, try ftp.sodre.net/pub/eggdrop" # } # # Got it? Its not that hard :) set greetd_msg(#loufiz) { "Welcome / Bienvenue. #loufiz => http://www.loufiz.com/" "Answer(s) to your question(s) about our eggdrops is on our website." "Les réponses à vos questions sont sur le site web." } ################################################################################### if {$greetd(delay) < 0} {set greetd(delay) 3} bind join - *!*@* autogreet proc autogreet {nick uhost hand chan} { global greetd_msg botnick greetd_queue greetd set chan [string tolower $chan] if {$nick == $botnick} {return 0} if {$greetd(show) == 1 && $hand != "*"} {return 0} if {![info exists greetd_msg($chan)]} {return 0} if {[info exists greetd_queue($chan![ident $uhost])]} {return 0} foreach i $greetd_msg($chan) {puthelp "$greetd(method) $nick :$i"} set greetd_queue($chan![ident $uhost]) 1 set a [timer $greetd(delay) "unset greetd_queue($chan![ident $uhost])"] } proc ident {data} { if {[string index $data 0] == "~"} {return #@[lindex [split $data @] 1]} return [string range [maskhost $data] 2 end] } Guillaume Tournand <guillaume@tournand.com> September 2003 145/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project putlog "Greetd.tcl v0.05b by guppy" Guillaume Tournand <guillaume@tournand.com> September 2003 146/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project weeder2000.tcl ####################################################################### # WEEDER 2000 (c) 2000 - nighty (nighty@undernet.org) - v4 BETA ####################################################################### # WeeDer2000.tcl : Last updated : 23/May/2001. ####################################################################### # Originally build for eggdrop 1.3.28 and TCL 8.x+ on system. # ++ may work on other versions... # beta(tests) { # eggdrop 1.5.x - 4.00BETA (ok) #} # ++ yours may be available in the next version. nighty@undernet.org. # ++ any further version should not be less compatible than previous. ####################################################################### ## READ CAREFULLY AND FOLLOW THE NOTES AND YOU WILL GET IT FASTER ;) ## ####################################################################### #################### # Variables #################### # the port used for bot<>bot communications AND users telnet set userport "8086" ########################################################################################## ##### # you *MUST* set the first (and at least) trignick to your bot's nick. # # if you add trignicks you can just .rehash but if you remove some, # # you will need a .die then a bot restart. DO NOT USE '*' OR THAT WILL FUCK UP EVERYTHING ;). # # # # Note: That's not because you use '.' to trigger its commands that you can avoid to put # # the <SPACE> ' ' between the trigger thing and the command. # # Just like you would type : '<you bot's nick> op <your nick>' # # so you should use : '. op <your nick>' and *NOT* '.op <your nick>' # # as every char/word you enter below will be treated as the bot's nick. # ########################################################################################## ##### set trignick "FrosT FrosT_ FrosT_0 ." # you HOME channel (also CONSOLE channel) set homechan "#loufiz" # the only *ONE* Level 1000 in the bot (handle) set bigcheese "Nolderise" # handles that are protected as owners. set protectowner "Nolderie" # set to 1 to activate, 0 do disable console/debug/automsg options set logonotice 0 set debug 0 set automsg_active 1 # set to 0 to deactivate (allow/disallow the userhost command, default to ALLOW.) set userhost_ok 1 # channels that have 'maxusers' activated separated by spaces or *. set maxusers_chans "*" # max number of channels the bot can join (depends on server). set maxchans 10 # some default messages (\002 = bold) set denymsg "\002ACCESS DENIED\002" set defkick_reason "\002Emmergency Exit\002" Guillaume Tournand <guillaume@tournand.com> September 2003 147/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # handles that wont display AUTH info in WHOIS. set noauth_handles "cservice" # CMaster authentication (leave one or more blank ("") to disable this feature) set CM_username "" set CM_password "" set CM_nickname "X" set CM_servername "channels.undernet.org" # some program needed for online BACKUPS (if equals to "", backup will NOT be available) # if you dont have this file, download it at http://nighty.roots.org/download/online_backup.sh, # then put it in the root directory of your eggdrop (where the .conf file is). # The file must have exec permissions for the user the bot is running under. set backup_prog "online_backup.sh" ################################################################################## ################################################################################## ######### DO NOT EDIT ANYTHING BELOW THIS LINE OR THAT WON'T WORK ################ ################################################################################## ################################################################################## Guillaume Tournand <guillaume@tournand.com> September 2003 148/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project set req_ver "1.3.28" putlog "Loading WeeDer 2000 by nighty (nighty@undernet.org)...." putlog "Checking eggdrop version..." if {[lindex $version 0]!=$req_ver} { if {![string match 1.6.* [lindex $version 0]] && ![string match 1.5.* [lindex $version 0]] && ![string match 1.4.* [lindex $version 0]]} { putlog "ERROR: Your version of eggdrop ([lindex $version 0]) is not 100% compatible." putlog "Script will not load any further. You need version $req_ver - Sorry!" unset noauth_handles unset defkick_reason unset denymsg unset maxchans unset maxusers_chans unset automsg_active unset debug unset logonotice unset protectowner unset bigcheese unset homechan unset trignick unset userport return 0 } } putlog "...EGGDROP VERSION $version : \002OK\002." set verno 5.05-REL set last_m_date "23/05/2001" set level 0 set level2 0 set boot_nick $nick set boot_altnick $altnick set authflag "L" set suspflag "X" set defmodes "+n" set defumodes "+f" set chanopmodes "+fov" set chanmastermodes "+fmov" set chanownermodes "+fmnov" set chanbotmodes "+fmnova" set opmodes "+ofv" set mastermodes "+omfv" set ownermodes "+omnfv" Guillaume Tournand <guillaume@tournand.com> September 2003 149/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project set remallmodes "-ofmnvapjftvxLb" set automsg_handle "auto_msg" catch {unbind msg -|- login do_login} catch {unbind msg L|- logout do_logout} catch {unbind sign L|- * do_quit_logout} catch {unbind msg -|- rehash do_rehash} catch {unbind msg -|- raw do_raw} catch {unbind msg -|- inv do_inv} catch {unbind msg -|- key do_key} catch {unbind msg -|- say do_say} catch {unbind msg -|- act do_act} catch {unbind msg -|- cstat do_cstat} catch {unbind msg -|- newpass do_newpass} catch {unbind msg -|- automsg do_configautomsg} catch {unbind msg -|- clearmode do_clearmode} catch {unbind msg -|- help do_fakehelp} for {set i 0} {$i<[llength $trignick]} {incr i} { catch { unbind pub -|- [lindex $trignick $i] chan_cmd} } catch {unbind join -|- * do_auto_msg} catch {unbind ctcp -|- "FINGER" ctcp_finger} catch {unbind ctcp -|- "TIME" ctcp_time} catch {unbind ctcp -|- "VERSION" ctcp_version} catch {unbind ctcp -|- "CLIENTINFO" ctcp_cinfo} catch {unbind ctcp -|- "USERINFO" ctcp_userinfo} catch {unbind ctcp -|- "ECHO" ctcp_echo} catch {unbind ctcp -|- "SOUND" ctcp_sound} catch {unbind ctcp -|- "PAGE" ctcp_page} catch {unbind ctcp -|- "GENDER" ctcp_gender} bind msg -|- login do_login bind msg L|- logout do_logout bind sign L|- * do_quit_logout bind msg -|- rehash do_rehash bind msg -|- raw do_raw bind msg -|- inv do_inv bind msg -|- key do_key bind msg -|- say do_say bind msg -|- act do_act bind msg -|- cstat do_cstat bind msg -|- newpass do_newpass bind msg -|- automsg do_configautomsg bind msg -|- clearmode do_clearmode bind msg -|- help do_fakehelp for {set i 0} {$i<[llength $trignick]} {incr i} { bind pub -|- [lindex $trignick $i] chan_cmd } bind join -|- * do_auto_msg bind ctcp -|- "FINGER" ctcp_finger bind ctcp -|- "TIME" ctcp_time bind ctcp -|- "VERSION" ctcp_version bind ctcp -|- "CLIENTINFO" ctcp_cinfo bind ctcp -|- "USERINFO" ctcp_userinfo bind ctcp -|- "ECHO" ctcp_echo bind ctcp -|- "SOUND" ctcp_sound bind ctcp -|- "PAGE" ctcp_page bind ctcp -|- "GENDER" ctcp_gender set b_code [lindex $version 1] set ctcp-version "\002WeeDer 2000\002 $verno (build #$b_code) by nighty ($last_m_date)- [unames]" Guillaume Tournand <guillaume@tournand.com> September 2003 150/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project set ctcp-finger "$botnick is $botname" set ctcp-userinfo "$botnick is an IRC Assistant" set ctcpgender "I'm a strong \00290% robot\002, \00210% human\002. Wanna fight ?!" if {$maxusers_chans=="*"} { set nb_chans [llength [channels]] for {set chan_i 0} {$chan_i<$nb_chans} {incr chan_i} { catch { set tmpfd [open "maxusers_[string tolower [lindex [channels] $chan_i]].dat" r] set lachaine [gets $tmpfd] close $tmpfd set maxusers([string tolower [lindex [channels] $chan_i]]) [lindex $lachaine 0] putlog "--MAXUSERS read from file on LOAD: [string tolower [lindex [channels] $chan_i]] ($maxusers([string tolower [lindex [channels] $chan_i]]))" } } } else { set nb_chans [llength $maxusers_chans] for {set chan_i 0} {$chan_i<$nb_chans} {incr chan_i} { catch { set tmpfd [open "maxusers_[string tolower [lindex $maxusers_chans $chan_i]].dat" r] set lachaine [gets $tmpfd] close $tmpfd set maxusers([string tolower [lindex $maxusers_chans $chan_i]]) [lindex $lachaine 0] putlog "--MAXUSERS read from file on LOAD: [string tolower [lindex $maxusers_chans $chan_i]] ($maxusers([string tolower [lindex $maxusers_chans $chan_i]]))" } } } if {[string match 1.6.* [lindex $version 0]]} { putlog "\002v1.6.x\002>>> Attempting to fix the 'strlwr : unknown command' error by a substitution function (EXPERIMENTAL)." proc strlwr {text} { return [string tolower $text] } } proc do_auto_msg {nick uhost hand channel} { global automsg_active automsg_handle botnick logonotice debug level level2 maxusers maxusers_chans verno homechan if {$nick!=$botnick} { if {$maxusers_chans!="*"} { set ok_max 0 for {set xxx 0} {$xxx<[llength $maxusers_chans]} {incr xxx} { if {[string tolower $channel]==[string tolower [lindex $maxusers_chans $xxx]]} {set ok_max 1} } } else { set ok_max 1 } if {$ok_max==1} { set nb_users [llength [chanlist $channel]] set nb_chans [llength [channels]] if {[info exists maxusers([string tolower $channel])]} { if {$nb_users>$maxusers([string tolower $channel])} { set maxusers([string tolower $channel]) $nb_users putserv "notice $channel :Max users record on $channel : \002$maxusers([string tolower $channel])\002" set fdd [open "maxusers_[string tolower $channel].dat" w] puts $fdd "$maxusers([string tolower $channel]) [unixtime]" close $fdd } } else { set maxusers([string tolower $channel]) $nb_users putserv "notice $channel :Max users record on $channel : \002$maxusers([string tolower $channel])\002" set fdd [open "maxusers_[string tolower $channel].dat" w] puts $fdd "$maxusers([string tolower $channel]) [unixtime]" Guillaume Tournand <guillaume@tournand.com> September 2003 151/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project close $fdd } } } else { catch { set tmpfd [open "maxusers_[string tolower $channel].dat" r] set lachaine [gets $tmpfd] close $tmpfd set maxusers([string tolower $channel]) [lindex $lachaine 0] putlog "--MAXUSERS read from file on JOIN: [string tolower $channel] ($maxusers([string tolower $channel]))" } if {[string match *-BETA $verno]} { putserv "privmsg $channel :Version \002$verno\002. Hello ;)" } if {[string match *-DEV $verno]} { putserv "privmsg $channel :I'm being developped... be indulgent please ;)" } if {[string match *-MILLENIUM $verno]} { putserv "privmsg $channel :\002HAPPY NEW YEAR\002 2001." } } if {$automsg_active!=1} { if {$debug==1} {putserv "notice @homechan :\002DEBUG\002: AUTOJOIN MSG triggered by $nick!$uhost (automsg_active==0)"} return 0 } if {![validuser $automsg_handle]} { putlog "HANDLE: $automsg_handle is not known :((" if {$debug==1} {putserv "notice @$homechan :\002DEBUG\002: AUTOJOIN MSG triggered by $nick!$uhost (automsg_handle not valid : $automsg_handle) \[creating...\]"} adduser $automsg_handle *!*Please@Do.not.remove chattr $automsg_handle -afmonv$authflag+c setuser $automsg_handle PASS xozishjzuyqk save return 0 } if {[strlwr $botnick]==[strlwr $nick]} { return 0 } set the_msg [getchaninfo $automsg_handle $channel] if {$the_msg==""} { if {$debug==1} {putserv "notice @$homechan :\002DEBUG\002: AUTOJOIN MSG triggered by $nick!$uhost (no text to display in infoline of $automsg_handle on $channel)"} return 0 } putserv "notice $nick :$the_msg" if {$debug==1} {putserv "notice @$homechan :\002DEBUG\002: Sent AUTOMSG on join to $nick!$uhost"} return 0 } proc do_configautomsg {nick uhost hand args} { global automsg_active level level2 botnick logonotice debug homechan set ret [do_check_level $nick $homechan $uhost] if {$level<501} { putserv "notice $nick :$denymsg" return 0 } set newstat [lindex $args 0] if {[strlwr $newstat]=="on"} { if {$automsg_active==1} { putserv "notice $nick :I already have AUTO_MSG active." return 0 } else { set automsg_active 1 save putserv "notice $nick :AUTO_MSG is now \002ON\002." if {$logonotice==1} {putserv "notice @$homechan :\002(\002GLOBAL AUTO_MSG\002)\002 activated by $nick!$uhost."} return 0 Guillaume Tournand <guillaume@tournand.com> September 2003 152/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project } } if {[strlwr $newstat]=="off"} { if {$automsg_active!=1} { putserv "notice $nick :I already have AUTO_MSG inactive." return 0 } else { set automsg_active 0 save putserv "notice $nick :AUTO_MSG is now \002OFF\002." if {$logonotice==1} {putserv "notice @$homechan :\002(\002GLOBAL AUTO_MSG\002)\002 desactivated by $nick!$uhost."} return 0 } } putserv "notice $nick :Syntax: /msg $botnick automsg \[on|off\]" if {$automsg_active==1} {putserv "notice $nick :Current state : \002ON\002"} if {$automsg_active!=1} {putserv "notice $nick :Current state : \002OFF\002"} return 0 } proc do_rehash {nick uhost hand args} { global denymsg logonotice homechan level authflag set ret [do_check_level $nick $homechan $uhost] if {$level==1000 && [matchattr $hand $authflag]} { putquick "notice $nick :Rehashing...." if {$logonotice} {putserv "notice @$homechan :\002(\002REHASH\002)\002: from $nick!$uhost."} save rehash putserv "notice $nick :... Rehashed!" } else { putserv "notice $nick :$denymsg" } return 0 } proc do_fakehelp {nick uhost hand args} { global denymsg logonotice homechan level authflag botnick set ret [do_check_level $nick $homechan $uhost] if {$level>=1 && [matchattr $hand $authflag]} { putserv "notice $nick :Please type \002$botnick help\002 in the channel." } else { putserv "notice $nick :$denymsg" } return 0 } proc do_raw {nick uhost hand args} { global denymsg logonotice homechan level authflag botnick set ret [do_check_level $nick $homechan $uhost] if {$level==1000 && [matchattr $hand $authflag]} { if {[lindex $args 0]==""} { putserv "notice $nick :Syntax: /msg $botnick raw <string>" return 0 } putserv "[lindex $args 0]" putlog "### \002(\002RAW\002)\002: \002\[\002[lindex $args 0]\002\]\002 from $nick!$uhost." } else { putserv "notice $nick :$denymsg" } return 0 } proc do_inv {nick uhost hand args} { global denymsg logonotice homechan level authflag botnick set args_ck $args set chan_ck [lindex [lindex $args_ck 0] 0] if {![string match "#*" $chan_ck]} { Guillaume Tournand <guillaume@tournand.com> September 2003 153/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project putserv "notice $nick :Syntax: /msg $botnick inv <#channel>" return 0 } if {![validchan $chan_ck]} { putserv "notice $nick :\002I'm not monitoring $chan_ck.\002" return 0 } if {![onchan $botnick $chan_ck]} { putserv "notice $nick :\002I'm not on $chan_ck.\002" return 0 } if {$chan_ck==""} {set chan_ck $homechan} set ret [do_check_level $nick $chan_ck $uhost] if {$level>=50 && [matchattr $hand $authflag]} { if {![isop $botnick $chan_ck]} { putserv "notice $nick :\002I'm not OPPED on $chan_ck\002." return 0 } if {[onchan $nick $chan_ck]} { putserv "notice $nick :You are \002already\002 on $chan_ck." return 0 } putserv "INVITE $nick $chan_ck" if {$logonotice==1} {putserv "notice @$homechan :\002(\002INV\002)\002: $chan_ck from $nick!$uhost."} return 0 } else { putserv "notice $nick :$denymsg" return 0 } } proc do_cstat {nick uhost hand args} { global denymsg logonotice homechan level level2 authflag botnick suspflag set arg [lindex $args 0] if {$hand=="*"} { putserv "notice $nick :$denymsg" return 0 } if {[do_check_level $hand $arg "*"]<1} { putserv "notice $nick :$denymsg" return 0 } if {$arg!=""} { if {[validchan $arg]} { set s_chan $arg } else { putserv "notice $nick :Invalid channel \002$arg\002." return 0 } } else { putserv "notice $nick :Syntax: /msg $botnick cstat <#channel>" return 0 } if {$level>500} {set askuser_is_admin 1} else {set askuser_is_admin 0} if {$logonotice==1} {putserv "notice @$homechan :\002(\002*CSTAT\002)\002: from $nick!$uhost"} set authd_nicks " " set snb_ops 0 set snb_nops 0 set snb_voice 0 set authlist [userlist $authflag|f $s_chan] set fulllist [chanlist $s_chan] for {set iii 0} {$iii<[llength $fulllist]} {incr iii} { if {[isop [lindex $fulllist $iii] $s_chan]} { incr snb_ops } else { if {[isvoice [lindex $fulllist $iii] $s_chan]} { incr snb_voice Guillaume Tournand <guillaume@tournand.com> September 2003 154/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project } else { incr snb_nops } } } set adisp 0 set s_nonotice 1 for {set aaa 0} {$aaa<[llength $authlist]} {incr aaa} { set s_hand [lindex $authlist $aaa] set s_nick [hand2nick $s_hand] if {$s_nick==""} {set s_nick "+$s_hand"} set ret [do_check_level $s_hand $s_chan "*"] if {$ret>500} { if {$askuser_is_admin==1} { set s_nonotice 0 incr adisp if {[matchattr $s_hand $suspflag]} { set is_susp "-" } else { set is_susp "" } set authd_nicks "$authd_nicks$s_nick\(*\002$is_susp$level2\002)" if {$aaa==[expr [llength $authlist]-1]} {set authd_nicks "$authd_nicks."} else {set authd_nicks "$authd_nicks, "} } else { set clevel2 0 if {[matchattr $s_hand |f $s_chan]} {set clevel2 1} if {[matchattr $s_hand |v $s_chan]} {set clevel2 50} if {[matchattr $s_hand |o $s_chan]} {set clevel2 200} if {[matchattr $s_hand |m $s_chan]} {set clevel2 400} if {[matchattr $s_hand |a $s_chan]} {set clevel2 450} if {[matchattr $s_hand |n $s_chan]} {set clevel2 500} if {$clevel2>0} { set s_nonotice 0 incr adisp if {[matchattr $s_hand $suspflag]} { set is_susp "-" } else { set is_susp "" } set authd_nicks "$authd_nicks$s_nick\(*\002$is_susp$clevel2\002)" if {$aaa==[expr [llength $authlist]-1]} {set authd_nicks "$authd_nicks."} else {set authd_nicks "$authd_nicks, "} } } } if {$ret<=500 && $ret!=0} { set s_nonotice 0 incr adisp if {[matchattr $s_hand $suspflag]} { set is_susp "-" } else { set is_susp "" } set authd_nicks "$authd_nicks$s_nick\(\002$is_susp$level2\002)" if {$aaa==[expr [llength $authlist]-1]} {set authd_nicks "$authd_nicks."} else {set authd_nicks "$authd_nicks, "} } if {$adisp % 10 == 1 && $adisp>10} { if {[string match *,* $authd_nicks]} {puthelp "notice $nick :($s_chan) \002Auth\002:$authd_nicks"} set authd_nicks " " set s_nonotice 1 } } set snb_total [expr $snb_ops+$snb_voice+$snb_nops] if {$s_nonotice==0} {if {[string match *,* $authd_nicks]} {puthelp "notice $nick :($s_chan) \002Auth\002:$authd_nicks"}} if {$s_nonotice==1 && $adisp==0} {puthelp "notice $nick :($s_chan) \002Auth\002: \037none\037."} puthelp "notice $nick :($s_chan) \002$snb_ops\002 ops, \002$snb_voice\002 voice, \002$snb_nops\002 stduser. (\002$snb_total\002 Total)." return 0 } proc do_key {nick uhost hand args} { global denymsg logonotice homechan level authflag botnick debug set args_ck $args set chan_ck [lindex [lindex $args_ck 0] 0] Guillaume Tournand <guillaume@tournand.com> September 2003 155/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if {![string match "#*" $chan_ck]} { putserv "notice $nick :Syntax: /msg $botnick key <#channel>" return 0 } if {![validchan $chan_ck]} { putserv "notice $nick :\002I'm not monitoring $chan_ck.\002" return 0 } if {![onchan $botnick $chan_ck]} { putserv "notice $nick :\002I'm not on $chan_ck.\002" return 0 } if {$chan_ck==""} {set chan_ck $homechan} set ret [do_check_level $nick $chan_ck $uhost] if {$debug==1} {putlog "\002do_key\002 - $hand - level=$level on $chan_ck"} if {$level>=50} { set cmodes [lindex [getchanmode $chan_ck] 0] if {[string match "*k*" $cmodes]} { set kmode [lindex [getchanmode $chan_ck] 1] if {[string match "*l*" $cmodes] && [lindex [getchanmode $chan_ck] 2]==""} {set kmode ""} if {$kmode==""} { putserv "notice $nick :Sorry, For some reason I can't see the key in $chan_ck, I'm maybe opless." return 0 } putserv "notice $nick :$chan_ck's key is \002$kmode\002." if {$logonotice==1} {putserv "notice @$homechan :\002(\002KEY\002)\002: $chan_ck from $nick!$uhost."} return 0 } else { putserv "notice $nick :Channel $chan_ck is NOT set +k." return 0 } } else { putserv "notice $nick :$denymsg" return 0 } } proc do_clearmode {nick uhost hand args} { global denymsg logonotice homechan level authflag botnick set args_ck $args set chan_ck [lindex [lindex $args_ck 0] 0] if {![string match "#*" $chan_ck]} { putserv "notice $nick :Syntax: /msg $botnick clearmode <#channel>" return 0 } if {![validchan $chan_ck]} { putserv "notice $nick :\002I'm not monitoring $chan_ck.\002" return 0 } if {![onchan $botnick $chan_ck]} { putserv "notice $nick :\002I'm not on $chan_ck.\002" return 0 } if {$chan_ck==""} {set chan_ck $homechan} set ret [do_check_level $nick $chan_ck $uhost] if {$level>=500 && [matchattr $hand $authflag]} { set cmodes [lindex [getchanmode $chan_ck] 0] set kmode [lindex [getchanmode $chan_ck] 1] if {[string match "*l*" $cmodes] && [lindex [getchanmode $chan_ck] 2]==""} { set lmode $kmode set kmode "" } putserv "notice $nick :Clearing MODEs on $chan_ck..." putserv "mode $chan_ck -spmilk $kmode" Guillaume Tournand <guillaume@tournand.com> September 2003 156/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project putserv "notice $nick :Modes cleared." if {$logonotice==1} {putserv "notice @$homechan :\002(\002CLEARMODE\002)\002: $chan_ck from $nick!$uhost."} return 0 } else { putserv "notice $nick :$denymsg" return 0 } } proc fix {the_string} { return [join [split $the_string]]; } proc do_say {nick uhost hand args} { global denymsg logonotice homechan level authflag botnick set args_ck $args set chan_ck [lindex [lindex [join [split $args_ck]] 0] 0] if {![string match "#*" $chan_ck]} { putserv "notice $nick :Syntax: /msg $botnick say <#channel> <string>" return 0 } if {![validchan $chan_ck]} { putserv "notice $nick :\002I'm not monitoring $chan_ck.\002" return 0 } if {![onchan $botnick $chan_ck]} { putserv "notice $nick :\002I'm not on $chan_ck.\002" return 0 } if {$chan_ck==""} {set chan_ck $homechan} set ret [do_check_level $nick $chan_ck $uhost] if {$level>=800 && [matchattr $hand $authflag]} { set sargs [lindex [join [split $args]] 0] set nb_arg [llength [lindex [join [split $args]] 0]] if {$nb_arg<=1} { putserv "notice $nick :Syntax: /msg $botnick say <#channel> <string>" return 0 } set chan_to_say [lindex [lindex [join [split $args]] 0] 0] set what_to_say [lrange [join [split $sargs]] 1 $nb_arg] putserv "privmsg $chan_to_say :[string range [string range $args [string first " " $args] [expr [string length $args]-1]] [string first " " [string range $args [string first " " $args] [expr [string length $args]-1]]] [expr [string length [string range $args [string first " " $args] [expr [string length $args]-1]]]-2]]" putlog "### \002(\002SAY\002)\002: \002\[\002$chan_to_say/[string range [string range $args [string first " " $args] [expr [string length $args]-1]] [string first " " [string range $args [string first " " $args] [expr [string length $args]-1]]] [expr [string length [string range $args [string first " " $args] [expr [string length $args]1]]]-2]]\002\]\002 from $nick!$uhost." } else { putserv "notice $nick :$denymsg" } return 0 } proc do_newpass {nick uhost hand args} { global denymsg logonotice homechan level authflag botnick debug set argu $args set c_pass [lindex [lindex $argu 0] 0] set n_pass [lindex [lindex $argu 0] 1] if {$hand=="*"} { putserv "notice $nick :$denymsg" return 0 } if {$n_pass==""} { putserv "notice $nick :- Syntax: /msg $botnick newpass <current_password> <new_password>" return 0 } if {![matchattr $hand $authflag]} { putserv "notice $nick :You must be authenticated first." return 0 Guillaume Tournand <guillaume@tournand.com> September 2003 157/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project } if {![passwdok $hand $c_pass]} { putserv "notice $nick :Sorry, wrong password." chattr $hand -$authflag save return 0 } if {[passwdok $hand ""]} { putserv "notice $nick :You don't have a password set, please use: /msg $botnick pass \002new_password\002, to set it." return 0 } setuser $hand PASS $n_pass save if {$logonotice==1} {putserv "notice @$homechan :\002(\002NEWPASS\002)\002: for user $hand ($nick!$uhost)."} putserv "notice $nick :New password set." return 0 } proc do_act {nick uhost hand args} { global denymsg logonotice homechan level authflag botnick set args_ck $args set chan_ck [lindex [lindex [join [split $args_ck]] 0] 0] if {![string match "#*" $chan_ck]} { putserv "notice $nick :Syntax: /msg $botnick act <#channel> <string>" return 0 } if {![validchan $chan_ck]} { putserv "notice $nick :\002I'm not monitoring $chan_ck.\002" return 0 } if {![onchan $botnick $chan_ck]} { putserv "notice $nick :\002I'm not on $chan_ck.\002" return 0 } if {$chan_ck==""} {set chan_ck $homechan} set ret [do_check_level $nick $chan_ck $uhost] if {$level>=800 && [matchattr $hand $authflag]} { set sargs [lindex [join [split $args]] 0] set nb_arg [llength [lindex [join [split $args]] 0]] if {$nb_arg<=1} { putserv "notice $nick :Syntax: /msg $botnick act <#channel> <string>" return 0 } set chan_to_act [lindex [lindex [join [split $args]] 0] 0] set what_to_act [lrange [join [split $sargs]] 1 $nb_arg] putserv "privmsg $chan_to_act :\001ACTION [string range [string range $args [string first " " $args] [expr [string length $args]-1]] [string first " " [string range $args [string first " " $args] [expr [string length $args]-1]]] [expr [string length [string range $args [string first " " $args] [expr [string length $args]-1]]]-2]]\001" putlog "### \002(\002ACT\002)\002: \002\[\002$chan_to_act/[string range [string range $args [string first " " $args] [expr [string length $args]-1]] [string first " " [string range $args [string first " " $args] [expr [string length $args]-1]]] [expr [string length [string range $args [string first " " $args] [expr [string length $args]1]]]-2]]\002\]\002 from $nick!$uhost." } else { putserv "notice $nick :$denymsg" } return 0 } proc ctcp_cinfo {nick uhost handle dest keyword args} { global denymsg logonotice homechan if {[matchattr $handle f]} { if {$logonotice==1} {putserv "notice @$homechan :\002(\002CTCP\002)\002: CLIENTINFO (\002OK\002) from $nick!$uhost."} } else { putlog "CTCP CLIENTINFO (denied): from $nick \($uhost)\ (nonop) " putserv "NOTICE $nick :$denymsg" Guillaume Tournand <guillaume@tournand.com> September 2003 158/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project putserv "\001" if {$logonotice==1} {putserv "notice @$homechan :\002(\002CTCP\002)\002: CLIENTINFO (\002DENIED\002) from $nick!$uhost."} return 1 } } proc ctcp_time {nick uhost handle dest keyword args} { global denymsg logonotice homechan if {[matchattr $handle f]} { if {$logonotice==1} {putserv "notice @$homechan :\002(\002CTCP\002)\002: TIME (\002OK\002) from $nick!$uhost."} } else { putlog "CTCP TIME (denied): from $nick \($uhost\)" putserv "NOTICE $nick :$denymsg" putserv "\001" if {$logonotice==1} {putserv "notice @$homechan :\002(\002CTCP\002)\002: TIME (\002DENIED\002) from $nick!$uhost."} return 1 } } proc ctcp_finger {nick uhost handle dest keyword args} { global denymsg logonotice homechan if {[matchattr $handle f]} { if {$logonotice==1} {putserv "notice @$homechan :\002(\002CTCP\002)\002: FINGER (\002OK\002) from $nick!$uhost."} } else { putlog "CTCP FINGER (denied): from $nick \($uhost)\ (nonop)" putserv "NOTICE $nick :$denymsg" putserv "\001" if {$logonotice==1} {putserv "notice @$homechan :\002(\002CTCP\002)\002: FINGER (\002DENIED\002) from $nick!$uhost."} return 1 } } proc ctcp_userinfo {nick uhost handle dest keyword args} { global denymsg logonotice homechan if {[matchattr $handle f]} { if {$logonotice==1} {putserv "notice @$homechan :\002(\002CTCP\002)\002: USERINFO (\002OK\002) from $nick!$uhost."} } else { putlog "CTCP USERINFO (denied): from $nick \($uhost\) (nonop)" putserv "NOTICE $nick :$denymsg" putserv "\001" if {$logonotice==1} {putserv "notice @$homechan :\002(\002CTCP\002)\002: USERINFO (\002DENIED\002) from $nick!$uhost."} return 1 } } proc ctcp_gender {nick uhost handle dest keyword args} { global ctcpgender logonotice homechan putserv "NOTICE $nick :$ctcpgender" putserv "\001" putlog "CTCP GENDER: from $nick \($uhost\)" if {$logonotice==1} {putserv "notice @$homechan :\002(\002CTCP\002)\002: GENDER (\002OK\002) from $nick!$uhost."} return 1 } proc ctcp_version {nick uhost handle dest keyword args} { global ctcp-version logonotice homechan verno if {[matchattr $handle f]} { } else { } Guillaume Tournand <guillaume@tournand.com> September 2003 159/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if {$logonotice==1} {putserv "notice @$homechan :\002(\002CTCP\002)\002: VERSION (\002OK\002) from $nick!$uhost."} if {[string match *-MILLENIUM $verno]} {putserv "notice $nick :\002Happy New Year\002!@#"} } proc ctcp_echo {nick uhost handle dest keyword args} { global denymsg logonotice homechan if {[matchattr $handle f]} { if {$logonotice==1} {putserv "notice @$homechan :\002(\002CTCP\002)\002: ECHO (\002OK\002) from $nick!$uhost."} } else { putlog "CTCP ECHO (denied) : from $nick at \($uhost\) (nonop)" putserv "NOTICE $nick :$denymsg" putserv "\001" if {$logonotice==1} {putserv "notice @$homechan :\002(\002CTCP\002)\002: ECHO (\002DENIED\002) from $nick!$uhost."} return 1 } } proc ctcp_sound {nick uhost handle dest keyword args} { global denymsg logonotice homechan if {[matchattr $handle f]} { if {$logonotice==1} {putserv "notice @$homechan :\002(\002CTCP\002)\002: SOUND (\002OK\002) from $nick!$uhost."} } else { putlog "CTCP SOUND (denied) : from \($uhost\) $nick (nonop)" putserv "NOTICE $nick :$denymsg" putserv "\001" if {$logonotice==1} {putserv "notice @$homechan :\002(\002CTCP\002)\002: SOUND (\002DENIED\002) from $nick!$uhost."} return 1 } } proc ctcp_page { nick uhost handle dest keyword args} { global denymsg logonotice homechan if {[matchattr $handle f]} { putserv "NOTICE $nick : I have received your page request $nick" putlog "Paged by $uhost ($nick) (op)" if {$logonotice==1} {putserv "notice @$homechan :\002(\002CTCP\002)\002: PAGE (\002OK\002) from $nick!$uhost."} } else { putlog "CTCP PAGE (denied) : from \($uhost\) $nick (nonop)" putserv "NOTICE $nick :$denymsg" putserv "\001" if {$logonotice==1} {putserv "notice @$homechan :\002(\002CTCP\002)\002: PAGE (\002DENIED\002) from $nick!$uhost."} return 1 } } proc do_login {nick userhost handle args} { global botnick verno authflag level homechan logonotice suspflag denymsg level2 if {$args==""} { putserv "notice $nick :Syntax: /msg $botnick login <#channel> <password>" return 0 } set chan_given [lindex [lindex $args 0] 0] set pass_given [lindex [lindex $args 0] 1] if {$pass_given==""} { putserv "notice $nick :Syntax: /msg $botnick login <#channel> <password>" return 0 } if {$chan_given=="*"} { set chan_given $homechan set is_admin 1 } else { set is_admin 0 } Guillaume Tournand <guillaume@tournand.com> September 2003 160/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if {![string match #* $chan_given]} { putserv "notice $nick :Syntax: /msg $botnick login <#channel> <password>" return 0 } if {$is_admin==0} { if {![validchan $chan_given]} { putserv "notice $nick :That channel is not registered." return 0 } } if {[passwdok $handle $pass_given]} { if {[passwdok $handle ""]} { set ret [do_check_level $nick $chan_given $userhost] if {$level2==0} { putserv "notice $nick :$denymsg" return 0 } putserv "notice $nick :\002WARNING\002- You don't have a password set." putserv "notice $nick :You must use \002/msg $botnick pass $pass_given\002 (to set your password to: $pass_given)." putlog "«•»\|\002LOGIN\002\|«•» ($handle)($nick!$userhost) failed login (no password)." if {$logonotice==1} {putserv "notice @$homechan :\002(\002FAILED LOGIN\002)\002: No password set for \002$handle\002 ($nick!$userhost)."} return 0 } else { set ret [do_check_level $nick $chan_given $userhost] if {$level2==0} { putserv "notice $nick :$denymsg" return 0 } if {$level2>500} {set chan_given "*"} if {$is_admin==1 && $level2<=500} { putserv "notice $nick :Syntax: /msg $botnick login <#channel> <password>" return 0 } if {![matchattr $handle $suspflag]} { putserv "notice $nick :AUTH SUCCESSFULL for \002$handle\002 ($nick!$userhost) on $chan_given. (level \002$level2\002)" putlog "«•»\|\002LOGIN (Level:$level2)\002\|«•» \[$chan_given\] ($handle)($nick!$userhost) logged in." if {$logonotice==1} {putserv "notice @$homechan :\002(\002LOGIN\002)\002: SUCCESSFULL for \002$handle\002 ($nick!$userhost) on $chan_given.(level \002$level2\002)"} chattr $handle +$authflag if {$chan_given!="*"} {setlaston $handle $chan_given [time]} } else { putserv "notice $nick :AUTH SUCCESSFULL for \002$handle\002 ($nick!$userhost) on $chan_given. (level \002$level2\002)" putserv "notice $nick :\002SORRY YOU ARE SUSPENDED\002...." putlog "«•»\|\002LOGIN \[SUSPENDED\] (Level:$level2)\002\|«•» \[$chan_given\] ($handle)($nick!$userhost) \002NOT\002 logged in." if {$logonotice==1} {putserv "notice @$homechan :\002(\002FAILED LOGIN\002)\002: SUSPENDED for \002$handle\002 ($nick!$userhost) for $chan_given.(level \002$level2\002)"} chattr $handle -$authflag+$suspflag } save } } if {![passwdok $handle $pass_given]} { if {$handle!="*"} { putserv "notice $nick :ACCESS DENIED - Wrong password!" putlog "«•»\|\002LOGIN\002\|«•» ($handle)($nick!$userhost) failed login (bad password)." if {$logonotice==1} {putserv "notice @$homechan :\002(\002FAILED LOGIN\002)\002: Bad password issued for \002$handle\002 by ($nick!$userhost)."} chattr $handle -$authflag } else { putserv "notice $nick :$denymsg" putlog "«•»\|\002LOGIN\002\|«•» ($nick!$userhost) failed login (no access)." if {$logonotice==1} {putserv "notice @$homechan :\002(\002FAILED LOGIN\002)\002: No Access, from $nick!$userhost."} Guillaume Tournand <guillaume@tournand.com> September 2003 161/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project } save } return 0 } proc do_quit_logout {nick userhost handle channel partmsg} { global botnick verno authflag level homechan logonotice suspflag if {![onchan $handle $channel]} { if {[string tolower $nick] == [string tolower $botnick]} { return 0 } else { if {$handle == ""} { return 0 } else { chattr $handle -$authflag setlaston $handle $channel [time] save if {$logonotice==1} {putserv "notice @$homechan :\002(\002LOGOUT\002)\002: Automatic LOGOUT (Quit IRC) for \002$handle\002 ($nick!$userhost)." } putlog "«•»\|\002LOGOUT\002\|«•» $nick automatically logged out (Quit IRC)" } } } return 0 } proc do_logout {nick userhost handle args} { global botnick verno authflag level homechan logonotice suspflag putserv "NOTICE $nick :You ($nick!$userhost) have been successfully deauthenticated." if {[string tolower $nick] == [string tolower $botnick]} { } else { if {$handle == ""} { } else { chattr $handle -$authflag for {set h 0} {$h<[llength [channels]]} {incr h} { if {[onchan [hand2nick $handle] [lindex [channels] $h]]} { setlaston $handle [lindex [channels] $h] [time] } } save if {$logonotice==1} {putserv "notice @$homechan :\002(\002LOGOUT\002)\002: for \002$handle\002 by ($nick!$userhost)."} putlog "«•»\|\002LOGOUT\002\|«•» ($handle)($nick!$userhost) logged out" } } } proc do_check_level {nick chan uhost} { global bigcheese level homechan debug authflag suspflag debug level2 set channel "*" if {$chan!=""} { set channel $chan } unset level set level 0 set t_hand [finduser $nick!$uhost] if {$uhost=="*"} { if {[validuser $nick]} {set t_hand $nick} else {set t_hand ""} } if {$t_hand==""} { set level 0 } else { if {[matchattr $t_hand |f $chan]} { set level 1 } if {[matchattr $t_hand |v $chan]} { set level 50 } if {[matchattr $t_hand |o $chan]} { set level 200 } if {[matchattr $t_hand |m $chan]} { set level 400 } if {[matchattr $t_hand |a $chan]} { set level 450 } if {[matchattr $t_hand |n $chan]} { set level 500 } if {[matchattr $t_hand o]} { set level 501 } if {[matchattr $t_hand m]} { set level 800 } if {[matchattr $t_hand n]} { set level 999 } if {$t_hand==$bigcheese} { set level 1000 } } set level2 $level Guillaume Tournand <guillaume@tournand.com> September 2003 162/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if {![matchattr $t_hand $authflag]} { set level 0 } if {$t_hand==""} { set t_hand "!nouser!" } if {$debug==1} {putserv "notice @$homechan :\002<*\002DEBUG\002*>\002: Level for \002$t_hand\002 is \002$level\002 on $channel."} if {$debug==1} {putlog "\002\[\002DEBUG:do_check_level\002\]\002: nick=$nick, chan=$chan, uhost=$uhost, handle=$t_hand, level=$level."} if {[matchattr $t_hand $suspflag]} { putserv "notice $nick :\002YOU ARE SUSPENDED !!!!\002" set level -1 } return $level } proc resetlogin {nick uhost hand} { global botnick homechan protectowner logonotice debug authflag verno bigcheese level suspflag set authed_users [userlist $authflag] set nb_max [llength $authed_users] set nb_max [expr $nb_max+1] for {set loop 0} {$loop < $nb_max} {incr loop} { set to_deauth [lindex $authed_users $loop] chattr $to_deauth -$authflag } save putserv "NOTICE $nick :I have cleared all login authentications (\002[expr $nb_max-1]\002)." putserv "NOTICE $nick :All users may \002re-login\002 now." if {$logonotice==1} {putserv "NOTICE @$homechan :\002(\002RESETLOGIN\002)\002: from \002$hand\002 ($nick!$uhost). \002[expr $nb_max-1]\002 total login info cleared."} return 0 } proc clearsuspend {nick uhost hand} { global botnick homechan protectowner logonotice debug authflag verno bigcheese level suspflag set susp_users [userlist $suspflag] set nb_max [llength $susp_users] set nb_max [expr $nb_max+1] for {set loop 0} {$loop < $nb_max} {incr loop} { set to_unsusp [lindex $susp_users $loop] chattr $to_unsusp -$suspflag } save putserv "NOTICE $nick :I have cancelled all users suspensions (\002[expr $nb_max-1]\002)." putserv "NOTICE $nick :All suspended users can \002re-login\002 now." if {$logonotice==1} {putserv "NOTICE @$homechan :\002(\002CLEARSUSPEND\002)\002: from \002$hand\002 ($nick!$uhost). \002[expr $nb_max-1]\002 total suspension(s) cancelled."} return 0 } set temporised_nickchange 0 proc do_restorenick {issuenick} { global nick altnick boot_nick boot_altnick botnick homechan logonotice temporised_nickchange set temporised_nickchange 0 if {[strlwr $botnick]==[strlwr $boot_nick]} { if {$issuenick!="*"} { putserv "NOTICE $issuenick :I already have my default nickname." } } else { set nick $boot_nick set altnick $boot_altnick save putquick "NICK $boot_nick" save if {$issuenick!="*"} { putserv "NOTICE $issuenick :Nickname restored to default." } else { putserv "PRIVMSG $homechan :Restored default nickname." } if {$logonotice==1} {putserv "NOTICE @$homechan :\002(\002BOOTNICK\002)\002: from \002$issuenick\002."} } Guillaume Tournand <guillaume@tournand.com> September 2003 163/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project } proc do_changenick {newnick issuenick time} { global nick altnick boot_nick boot_altnick botnick logonotice if {[strlwr $newnick]==[strlwr $botnick]} { putserv "NOTICE $issuenick :Why would I do that, heh ?!" } else { set nick $newnick set altnick $boot_nick save putquick "NICK $newnick" save putserv "NOTICE $issuenick :Nickname changed." if {$time>0} { putserv "NOTICE $issuenick :Switching back to default ($boot_nick) nickname in $time seconds..." utimer $time {do_restorenick *} if {$logonotice==1} {putserv "NOTICE @$homechan :\002(\002SETNICK\002)\002: from \002$issuenick\002 for \002$time\002 seconds."} } else { if {$logonotice==1} {putserv "NOTICE @$homechan :\002(\002SETNICK\002)\002: from \002$issuenick\002."} } } } proc chan_cmd {nick uhost handle chan args} { global remallmodes botnick homechan protectowner logonotice debug defmodes defumodes last_m_date chanopmodes chanmastermodes chanownermodes chanbotmodes opmodes mastermodes ownermodes logonotice debug authflag verno bigcheese level denymsg defkick_reason suspflag userport maxchans level2 uptime version server botname noauth_handles server-online automsg_handle automsg_active admin trignick verno userhost_ok backup_prog motd userfile config notefile chanfile CM_username CM_password CM_nickname CM_servername boot_nick boot_altnick temporised_nickchange set hand $handle set arg2 "" set allok 0 set slenf [string length $args] if {$debug==1} {putlog "--START debug check(1). (chan_cmd)" } for {set cstr 0} {$cstr<$slenf} {incr cstr} { if {[string index $args $cstr]=="\\"} { if {$debug==1} {putlog "ARGS contains a \\ - Converting ARG2"} set cxx [string first " " "$args"] set slen [expr $slenf-$cxx] set cxx [expr $cxx+1] while {[string index $args $cxx]!=" "} { if {[string index $args $cxx]=="\\"} { set arg2 "$arg2\\" } else { set arg2 "$arg2[string index $args $cxx]" } incr cxx if {$cxx==[expr [expr $slen-1]+[expr $slenf-$slen]]} {break} if {[string index $args $cxx]==" "} {break} } if {$debug==1} {putlog "ARG2 is now : \002$arg2\002"} set allok 1 break } if {$allok==1} {break} } # experimental code # set allok 0 # set slenf [string length $args] # set narg2 "" # if {$debug==1} {putlog "--START debug check(2). (chan_cmd)" } # for {set cstr 0} {$cstr<$slenf} {incr cstr} { # if {[string index $args $cstr]=="\{" || [string index $args $cstr]=="\}"} { Guillaume Tournand <guillaume@tournand.com> September 2003 164/489 MSc Dissertation # # # # # # # # # # # # # # # # # # # # # # # # # # eoec IRC distributed bot lending platform: The Loufiz project if {$debug==1} {putlog "ARGS contains a \{ or a \} - Converting ARG2"} set cxx [string first " " "$args"] set slen [expr $slenf-$cxx] set cxx [expr $cxx+1] while {[string index $args $cxx]!=" "} { if {[string index $args $cxx]=="\{"} { set narg2 "$narg2\\\{" } else { if {[string index $args $cxx]=="\}"} { set narg2 "$narg2\\\}" } else { set narg2 "$narg2[string index $args $cxx]" } } incr cxx if {$cxx==[expr [expr $slen-1]+[expr $slenf-$slen]]} {break} if {[string index $args $cxx]==" "} {break} } set arg2 $narg2 if {$debug==1} {putlog "ARG2 is now : \002$arg2\002"} set allok 1 break } if {$allok==1} {break} } if {$debug==1} {putlog "--END debug check. (chan_cmd)" } set arg_tmp [lindex [join [split $args]] 0] set arg1 [lindex [join [split $arg_tmp]] 0] if {$arg2==""} {set arg2 [lindex [join [split $arg_tmp]] 1]} set arg3 [lindex [join [split $arg_tmp]] 2] set arg4 [lindex [join [split $arg_tmp]] 3] set arg5 [lrange [join [split $arg_tmp]] 4 end] set ret [do_check_level $nick $chan $uhost] if {![matchattr $handle $authflag]} { set level 0 if {$debug==1} { putserv "notice @$homechan :\002<*\002DEBUG\002*>\002: CHAN_CMD (NOT AUTH'D) from $nick!$uhost on $chan."} } if {[strlwr $arg1]=="setnick"} { if {$level<1000} { putserv "NOTICE $nick :$denymsg" return 0 } if {$arg2==""} { putserv "NOTICE $nick :Syntax: \002$botnick setnick <new nickname> \[optional duration (seconds)\]\002" return 0 } if {$temporised_nickchange==1} { putserv "NOTICE $nick :A temporised nick change is already active. Use \002BOOTNICK\002 before or wait." return 0 } if {$arg3<10} { putserv "NOTICE $nick :Invalid duration (minimum 10 seconds)." return 0 } if {$arg3!=""} { set temporised_nickchange 1 do_changenick $arg2 $nick $arg3 } else { set temporised_nickchange 0 do_changenick $arg2 $nick 0 } return 0 } Guillaume Tournand <guillaume@tournand.com> September 2003 165/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if {[strlwr $arg1]=="aware"} { if {$level>=50} { putserv "PRIVMSG $chan :\002AWAAAAAAAAAAARE!@#\002" return 0 } } if {[strlwr $arg1]=="bootnick"} { if {$level<1000} { putserv "NOTICE $nick :$denymsg" return 0 } set temporised_nickchange 0 do_restorenick $nick return 0 } if {[strlwr $arg1]=="admin"} { putserv "notice $nick : - ADMIN INFOS - " putserv "notice $nick :\002Contact\002: $admin" if {$logonotice==1} {putserv "NOTICE @$homechan :\002(\002ADMIN\002)\002: from \002$hand\002 ($nick!$uhost). on $chan."} return 0 } if {[strlwr $arg1]=="version"} { if {$level>=1} { putserv "notice $nick : - VERSION INFOS : WeeDer 2000 - " putserv "notice $nick :\002Release\002: $last_m_date" putserv "notice $nick :\002Version\002: $verno" set t_usr [countusers] if {$t_usr<=1} {set add_t_usr ""} else {set add_t_usr "s"} putserv "notice $nick :\002User DB\002: \002$t_usr\002 total user$add_t_usr" if {[string match *-BETA $verno] || [string match *-DEV $verno]} { putserv "notice $nick :REPORT BUGS TO: \002nighty@undernet.org\002" } if {$logonotice==1} {putserv "NOTICE @$homechan :\002(\002VERSION\002)\002: from \002$hand\002 ($nick!$uhost). on $chan."} return 0 } else { putserv "notice $nick :$denymsg" return 0 } } if {[strlwr $arg1]=="date"} { if {$level>=1} { set curr_date [date] putserv "notice $nick :my current date is set to: \002$curr_date\002" if {$logonotice==1} {putserv "NOTICE @$homechan :\002(\002DATE\002)\002: from \002$hand\002 ($nick!$uhost). on $chan."} return 0 } else { putserv "notice $nick :$denymsg" return 0 } } if {[strlwr $arg1]=="time"} { if {$level>=1} { set curr_time [time] putserv "notice $nick :my current time is set to: \002$curr_time\002" if {$logonotice==1} {putserv "NOTICE @$homechan :\002(\002TIME\002)\002: from \002$hand\002 ($nick!$uhost). on $chan."} return 0 } else { putserv "notice $nick :$denymsg" return 0 } } if {[strlwr $arg1]=="credits"} { putserv "notice $nick : - CREDITS AND COPYRIGHT - " putserv "notice $nick :TCL Script by \002nighty@undernet.org\002 - (c) 2000" putserv "notice $nick :Last modif.: \002$last_m_date\002 (Version $verno)" Guillaume Tournand <guillaume@tournand.com> September 2003 166/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if {[string match *-BETA $verno] || [string match *-DEV $verno]} { putserv "notice $nick :REPORT BUGS TO: \002nighty@undernet.org\002" } if {$logonotice==1} {putserv "NOTICE @$homechan :\002(\002CREDITS\002)\002: from \002$hand\002 ($nick!$uhost). on $chan."} return 0 } if {[strlwr $arg1]=="verify"} { if {$arg2==""} { putserv "notice $nick :Syntax: \002$botnick verify <nickname>\002" return 0 } if {![onchan $arg2 $chan]} { putserv "notice $nick :\002$arg2\002 is NOT on $chan." return 0 } if {$logonotice==1} {putserv "NOTICE @$homechan :\002(\002VERIFY:$arg2\002)\002: from \002$hand\002 ($nick!$uhost). on $chan."} if {[strlwr $arg2]==[strlwr $botnick]} { putserv "notice $nick :Hey! hmmm .. it's me! \002YOU DUMB! \002. I'm the keeper of $chan's realms." return 0 } set ret_chk [do_check_level $arg2 $chan [getchanhost $arg2 $chan]] if {$ret_chk==0} { putserv "notice $nick :\002$arg2\002 is NOT an authenticated person on $chan." } else { set add_txt "" if {$ret_chk>=1} { set add_txt "(\002Channel FRIEND\002)" } if {$ret_chk>=50} { set add_txt "(\002Channel VOICE\002)" } if {$ret_chk>=200} { set add_txt "(\002Channel OP\002)" } if {$ret_chk>=400} { set add_txt "(\002Channel MASTER\002)" } if {$ret_chk>=500} { set add_txt "(\002Channel OWNER\002)" } if {$ret_chk>=501} { set add_txt "(\002Basic ADMIN\002)" } if {$ret_chk>=800} { set add_txt "(\002Trusted ADMIN\002)" } if {$ret_chk>=999} { set add_txt "(\002Senior ADMIN\002)" } if {$ret_chk==1000} { set add_txt "(\002ph3ar! the BigCheese!\002)" } set the_hand [nick2hand $arg2 $chan] set is_auth 0 if {$the_hand=="*"} { set is_auth 0 } else { if {[matchattr $the_hand $authflag]} { set is_auth 1 } else { set is_auth 0 } } if {$ret_chk>500} {set chan_l "*"} else {set chan_l $chan} if {$is_auth==1} {putserv "notice $nick :\002$arg2\002 is authenticated at level \002$ret_chk\002 on $chan_l $add_txt."} if {$is_auth==0} {putserv "notice $nick :\002$arg2\002 is NOT an authenticated person on $chan."} } return 0 } if {[strlwr $arg1]=="netsex"} { set netsexnick $nick if {$level>=200} { if {$arg2!=""} { set netsexnick $arg2 } if {![onchan $netsexnick $chan]} { putserv "notice $nick :\002$netsexnick\002 is not on $chan." return 0 } if {[string tolower $netsexnick]==[string tolower $botnick]} { putserv "kick $chan $nick :\002Masturbate yourself! LAMER\002" return 0 } } Guillaume Tournand <guillaume@tournand.com> September 2003 167/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project putserv "privmsg $chan :\001ACTION would love to have *\002netSEX\002* with $netsexnick...\001" putserv "privmsg $chan :Take me $netsexnick, sweet heart..." putserv "kick $chan $netsexnick :\002uNF\002" return 0 } if {[strlwr $arg1]=="sodomize"} { if {$arg2!=""} { putserv "privmsg $chan :\001ACTION takes $arg2 behind... \002uNF\002 - uNF \002uNF\002 - uNF - \002uNF\002\001" return 0 } } if {[strlwr $arg1]=="resetlogin"} { if {$level>=999} { set ret [resetlogin $nick $uhost $handle] return 0 } else { putserv "notice $nick :$denymsg" return 0 } } if {[strlwr $arg1]=="clearsuspend"} { if {$level>=999} { set ret [clearsuspend $nick $uhost $handle] return 0 } else { putserv "notice $nick :$denymsg" return 0 } } if {[strlwr $arg1]=="console"} { if {$level>=800} { if {$logonotice==0} { set con_state "OFF" } else { set con_state "ON" } if {$arg2==""} { putserv "notice $nick :Syntax: \002$botnick console <on|off>\002 (currently:\002$con_state\002)." return 0 } else { if {[strlwr $arg2]=="on"} { if {$con_state=="ON"} { putserv "notice $nick :Console is already \002ON\002." return 0 } else { set logonotice 1 save putserv "notice $nick :Console is now \002ON\002." putserv "notice @$homechan :\002(\002CONSOLE\002)\002: Turned \002ON\002 by $nick!$uhost." return 0 } } if {[strlwr $arg2]=="off"} { if {$con_state=="OFF"} { putserv "notice $nick :Console is already \002OFF\002." return 0 } else { set logonotice 0 save putserv "notice $nick :Console is now \002OFF\002." putserv "notice @$homechan :\002(\002CONSOLE\002)\002: Turned \002OFF\002 by $nick!$uhost." return 0 } } putserv "notice $nick :Syntax: \002$botnick console <on|off>\002 (currently:\002$con_state\002)." Guillaume Tournand <guillaume@tournand.com> September 2003 168/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project } return 0 } else { putserv "notice $nick :$denymsg" return 0 } } if {[strlwr $arg1]=="uhostcmd"} { if {$level>=800} { if {$userhost_ok==0} { set con_state "DISABLED" } else { set con_state "ENABLED" } if {$arg2==""} { putserv "notice $nick :Syntax: \002$botnick uhostcmd <on|off>\002 (currently:\002$con_state\002)." return 0 } else { if {[strlwr $arg2]=="on"} { if {$con_state=="ENABLED"} { putserv "notice $nick :USERHOST command is already \002ENABLED\002." return 0 } else { set userhost_ok 1 save putserv "notice $nick :USERHOST command is now \002ENABLED\002." if {$logonotice==1} {putserv "notice @$homechan :\002(\002UHOSTCMD\002)\002: \002ENABLED\002 USERHOST command by $nick!$uhost."} return 0 } } if {[strlwr $arg2]=="off"} { if {$con_state=="DISABLED"} { putserv "notice $nick :USERHOST command is already \002DISABLED\002." return 0 } else { set userhost_ok 0 save putserv "notice $nick :USERHOST command is now \002DISABLED\002." if {$logonotice==1} {putserv "notice @$homechan :\002(\002UHOSTCMD\002)\002: \002DISABLED\002 USERHOST command by $nick!$uhost."} return 0 } } putserv "notice $nick :Syntax: \002$botnick uhostcmd <on|off>\002 (currently:\002$con_state\002)." } return 0 } else { putserv "notice $nick :$denymsg" return 0 } } if {[strlwr $arg1]=="die"} { if {$level==1000} { putserv "QUIT :Killed ($nick (\002DIE\002:$arg2 $arg3 $arg4 $arg5))" utimer 2 [save] utimer 7 [die] return 0 } else { putserv "notice $nick :$denymsg" return 0 } } if {[strlwr $arg1]=="rehash"} { if {$level==1000} { Guillaume Tournand <guillaume@tournand.com> September 2003 169/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project putserv "notice $nick :Please use: \002/msg $botnick rehash\002" return 0 } else { putserv "notice $nick :$denymsg" return 0 } } if {[strlwr $arg1]=="newpass"} { if {$level>0} { putserv "notice $nick :Please use: \002/msg $botnick newpass <current_password> <new_password>\002" return 0 } else { putserv "notice $nick :$denymsg" return 0 } } if {[strlwr $arg1]=="save"} { if {$level>=400} { putserv "notice $nick :\002Saved\002 userfile / chanfile...." save if {$logonotice==1} {putserv "notice @$homechan :\002(\002SAVE\002)\002: from $nick!$uhost."} return 0 } else { putserv "notice $nick :$denymsg" return 0 } } if {[strlwr $arg1]=="say"} { if {$level>=800} { putserv "notice $nick :Please use: \002/msg $botnick say <#channel> <string>\002" return 0 } else { putserv "notice $nick :$denymsg" return 0 } } if {[strlwr $arg1]=="act"} { if {$level>=800} { putserv "notice $nick :Please use: \002/msg $botnick act <#channel> <string>\002" return 0 } else { putserv "notice $nick :$denymsg" return 0 } } if {[strlwr $arg1]=="raw"} { if {$level==1000} { putserv "notice $nick :Please use: \002/msg $botnick raw <string>\002" return 0 } else { putserv "notice $nick :$denymsg" return 0 } } if {[strlwr $arg1]=="inv"} { if {$level>=50} { putserv "notice $nick :Please use: \002/msg $botnick inv <#channel>\002" return 0 } else { putserv "notice $nick :$denymsg" return 0 } } if {[strlwr $arg1]=="key"} { if {$level>=50} { putserv "notice $nick :Please use: \002/msg $botnick key <#channel>\002" Guillaume Tournand <guillaume@tournand.com> September 2003 170/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project return 0 } else { putserv "notice $nick :$denymsg" return 0 } } if {[strlwr $arg1]=="login"} { putserv "notice $nick :Please use: \002/msg $botnick login <#channel> <password>\002" return 0 } if {[strlwr $arg1]=="logout"} { if {$level>=1} { putserv "notice $nick :Please use: \002/msg $botnick logout\002" return 0 } else { putserv "notice $nick :$denymsg" return 0 } } if {[strlwr $arg1]=="clearmode"} { if {$level>=500} { putserv "notice $nick :Please use: \002/msg $botnick clearmode <#channel>\002" return 0 } else { putserv "notice $nick :$denymsg" return 0 } } if {[strlwr $arg1]=="fuck"} { if {$level<200} { putserv "notice $nick :$denymsg" return 0 } set nick_to_kick $arg2 if {[strlwr $nick_to_kick]==[strlwr $botnick]} { putserv "notice $nick :Fuck you too...." putserv "mode $chan -ov $nick $nick" putserv "kick $chan $nick :Fuck you too...." return 0 } if {$nick_to_kick==""} { putserv "notice $nick :Syntax: $botnick fuck <nickname> \[reason\]" return 0 } set userhost [getchanhost $nick_to_kick $chan] if {$userhost==""} { putserv "notice $nick :$nick_to_kick is NOT on $chan." return 0 } set hostmask1 [getchanhost $nick_to_kick $chan] set hostmask2 "$nick_to_kick!$hostmask1" set hostmask [maskhost $hostmask2] if {[string index $hostmask 2]!="*"} {set mask_to_ban "*!*[string range $hostmask 2 end]"} else { set mask_to_ban "*![string range $hostmask 2 end]"} set mylevel $level set ret [do_check_level $nick_to_kick $chan [getchanhost $nick_to_kick $chan]] if {$level>$mylevel} { putserv "notice $nick :You cannot KICK/BAN a user with a higher level than yours." if {$logonotice==1} {putserv "notice @$homechan :\002(\002FUCK FAILED\002)\002: from $nick!$uhost on $chan ($nick_to_kick has higher level)."} return 0 } if {![isop $botnick $chan]} { putserv "notice $nick :\002I'm not OPPED in $chan :(\002." return 0 } if {[strlwr $nick]==[strlwr $nick_to_kick]} { Guillaume Tournand <guillaume@tournand.com> September 2003 171/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project putserv "notice $nick :I wouldn't do that if I were you." putserv "notice $nick :.. anyway I won't let you do it ;P" return 0 } set raizon "\002FUX'D\002:Requested" if {$arg3!=""} {set raizon "$arg3 $arg4 $arg5"} pushmode $chan -o $nick_to_kick pushmode $chan -v $nick_to_kick pushmode $chan +b $mask_to_ban flushmode $chan putserv "kick $chan $nick_to_kick :$raizon" if {$logonotice==1} {putserv "notice @$homechan :\002(\002FUCK\002)\002: $nick_to_kick ($mask_to_ban) from $nick!$uhost on $chan ($raizon)."} return 0 } if {[strlwr $arg1]=="massdeop"} { if {$level<400} { putserv "notice $nick :$denymsg" return 0 } if {![isop $botnick $chan]} { putserv "notice $nick :\002I'm not OPPED in $chan :(\002." return 0 } if {[onchan X $chan] || [onchan W $chan]} { putserv "notice $nick :Sorry, X/W Channel service is present." putserv "notice $nick :Massdeopping will get me kicked." return 0 } set user_list [chanlist $chan] set l_user_list [llength $user_list] set op_list "" for {set i 0} {$i<$l_user_list} {incr i} { if {[isop [lindex $user_list $i] $chan] && [strlwr [lindex $user_list $i]]!=[strlwr $botnick]} { set op_list "$op_list [lindex $user_list $i]" } } set l_op_list [llength $op_list] for {set i 0} {$i<$l_op_list} {incr i} { pushmode $chan -o [lindex $op_list $i] } unset op_list unset l_op_list unset user_list unset l_user_list putquick "notice $nick :Massdeoping everyone..... \002w00pAAa\002..." flushmode $chan return 0 } if {[strlwr $arg1]=="suspend"} { if {$level<200} { putserv "notice $nick :$denymsg" return 0 } set susp_nick $arg2 if {$susp_nick==""} { putserv "notice $nick :Syntax: $botnick suspend <nickname>" return 0 } set susp_hand [nick2hand $susp_nick $chan] if {$susp_hand=="*"} { putserv "notice $nick :\002$susp_nick\002 is an \002unknown user\002. Sorry." return 0 } if {[strlwr $susp_nick]==[strlwr $botnick]} { putserv "kick $chan $nick :You cannot suspend me you dumb asshole !!!!!" return 0 Guillaume Tournand <guillaume@tournand.com> September 2003 172/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project } if {![onchan $susp_nick $chan]} { if {![validuser $susp_nick]} { putserv "notice $nick :\002$susp_nick\002 is NOT on $chan." return 0 } else { set susp_hand $susp_nick } } set mylevel $level set ret [do_check_level $susp_nick $chan [getchanhost $susp_nick $chan]] if {$level>=$mylevel} { putserv "notice $nick :You cannot suspend a level equal or higher than yours." return 0 } chattr $susp_hand -$authflag chattr $susp_hand +$suspflag save putserv "mode $chan -ov $susp_nick $susp_nick" putserv "notice $nick :\002$susp_nick\002 is now suspended on $botnick." putserv "notice $susp_nick :\002YOU ARE NOW SUSPENDED BY $nick. LOGGED OUT\002." if {$logonotice==1} {putserv "notice @$homechan :\002(\002SUSPEND\002)\002: $susp_nick from $nick!$uhost."} return 0 } # if {[strlwr $arg1]=="seen"} { # if {$level>0} { # if {$arg2!=""} { # putquick "privmsg $chan :!seen $arg2" # return 0 # } else { # return 0 # } # } # } if {[strlwr $arg1]=="topic"} { if {$level<50} { putserv "notice $nick :$denymsg" return 0 } set cmodes [lindex [getchanmode $chan] 0] if {[string match "*t*" $cmodes]} { if {![isop $botnick $chan]} { set t_ok 0 } else { set t_ok 1 } } else { set t_ok 1 } if {$t_ok==1} { putserv "TOPIC $chan :[string range $args [string first " " $args] [expr [string length $args]-2]]" } else { putserv "notice $nick :Sorry I cannot change the topic. Check channel modes.. am I opped ?!uh." } return 0 } if {[strlwr $arg1]=="unsuspend"} { if {$level<200} { putserv "notice $nick :$denymsg" return 0 } set susp_nick $arg2 if {$susp_nick==""} { putserv "notice $nick :Syntax: $botnick unsuspend <nickname>" return 0 Guillaume Tournand <guillaume@tournand.com> September 2003 173/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project } set susp_hand [nick2hand $susp_nick $chan] if {$susp_hand=="*"} { putserv "notice $nick :\002$susp_nick\002 is an \002unknown user\002. Sorry." return 0 } if {![onchan $susp_nick $chan]} { if {![validuser $susp_nick]} { putserv "notice $nick :\002$susp_nick\002 is NOT on $chan." return 0 } else { set susp_hand $susp_nick } } if {![matchattr $susp_hand $suspflag]} { putserv "notice $nick :\002$susp_nick\002 is NOT suspended." return 0 } set mylevel $level set ret [do_check_level $susp_nick $chan [getchanhost $susp_nick $chan]] if {$level>=$mylevel} { putserv "notice $nick :You cannot unsuspend a level equal or higher than yours." return 0 } chattr $susp_hand -$suspflag save putserv "mode $chan +v $susp_nick" putserv "notice $nick :Suspension for \002$susp_nick\002 is now CANCELLED." putserv "notice $susp_nick :\002YOUR SUSPENSION HAS BEEN CANCELLED BY $nick\002. You can login now." if {$logonotice==1} {putserv "notice @$homechan :\002(\002UNSUSPEND\002)\002: $susp_nick from $nick!$uhost."} return 0 } if {[strlwr $arg1]=="maxusers"} { set zechan [string tolower $chan] if {$arg2!=""} { if {$level<501} { putserv "notice $nick :You must be an ADMIN to see maxusers of other chans than $chan." return 0 } set zechan [string tolower $arg2] if {![validchan $zechan]} { putserv "notice $nick :Invalid channel \002$arg2\002." return 0 } if {$logonotice==1} {putserv "notice @$homechan :\002(\002REMOTE MAXUSERS\002)\002: for $arg2 from $nick!$uhost on $chan."} } set maxchan 0 set maxtime 0 catch { set tfdd [open "maxusers_$zechan.dat" r] set maxwhole [gets $tfdd] close $tfdd set maxchan [lindex $maxwhole 0] set maxtime [ctime [lindex $maxwhole 1]] } if {$maxchan!=0} { if {$maxchan>1} { set maxadd "s" } else { set maxadd "" } putserv "notice $nick :I saw \002$maxchan\002 user$maxadd on $zechan, on $maxtime" } else { putserv "notice $nick :No MAXUSERS information available for $zechan." } return 0 } Guillaume Tournand <guillaume@tournand.com> September 2003 174/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if {[strlwr $arg1]=="pban"} { if {$level<400} { putserv "notice $nick :$denymsg" return 0 } if {$arg2==""} { if {$level>500} {putserv "notice $nick :Syntax: \002$botnick pban \[#channel\] <ban mask> \[reason\]"} else { putserv "notice $nick :Syntax: \002$botnick pban <ban mask> \[reason\]"} return 0 } set ziadmin 0 if {[string match #* $arg2] || [string match &* $arg2] || [string match +* $arg2]} { if {$level>500} { if {![validchan $arg2]} { putserv "notice $nick :Invalid channel \002$arg2\002 -Syntax: \002$botnick pban \[#channel\] <ban mask> \[reason\]" return 0 } set dachan $arg2 set daban $arg3 set dareason "$arg4 $arg5" set ziadmin 1 } else { putserv "notice $nick :Syntax: \002$botnick pban <ban mask> \[reason\]" return 0 } } else { set ziadmin 0 set dachan $chan set daban $arg2 set dareason "$arg3 $arg4 $arg5" } set invalid_ban 0 if {![string match *!* $daban]} { set invalid_ban 1 } if {![string match *@* $daban]} { set invalid_ban 1 } if {$daban=="*!*@*"} { set invalid_ban 1 } if {$daban=="*!*@*.*"} { set invalid_ban 1 } if {$invalid_ban==1} { putserv "notice $nick :Bogus ban mask, Try again." return 0 } set noreason 0 if {$arg3=="" && $ziadmin==0} { set noreason 1 } if {$arg4=="" && $ziadmin==1} { set noreason 1 } if {$noreason==1} { set ban_reason $defkick_reason } else { set ban_reason "$dareason" } newchanban $dachan $daban $handle "$ban_reason" 0 if {$logonotice==1} {putserv "notice @$homechan :\002(\002PBAN\002)\002: for $daban on $dachan from $nick!$uhost."} putserv "notice $nick :Added LOCAL ban for $daban on $dachan ($ban_reason)" save return 0 } if {[strlwr $arg1]=="gban"} { if {$level<501} { putserv "notice $nick :$denymsg" return 0 } set invalid_ban 0 Guillaume Tournand <guillaume@tournand.com> September 2003 175/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if {![string match *!* $arg2]} { set invalid_ban 1 } if {![string match *@* $arg2]} { set invalid_ban 1 } if {$arg2=="*!*@*"} { set invalid_ban 1 } if {$arg2=="*!*@*.*"} { set invalid_ban 1 } if {$invalid_ban==1} { putserv "notice $nick :Bogus ban mask, Try again." return 0 } if {$arg3==""} { set ban_reason $defkick_reason } else { set ban_reason "$arg3 $arg4 $arg5" } newban $arg2 $handle "$ban_reason" 0 if {$logonotice==1} {putserv "notice @$homechan :\002(\002GBAN\002)\002: for $arg2 from $nick!$uhost."} putserv "notice $nick :Added GLOBAL ban for $arg2 ($ban_reason)" save return 0 } if {[strlwr $arg1]=="spban"} { if {$level<400} { putserv "notice $nick :$denymsg" return 0 } if {$arg2==""} { if {$level>500} {putserv "notice $nick :Syntax: \002$botnick spban \[#channel\] <ban mask> \[reason\]"} else { putserv "notice $nick :Syntax: \002$botnick spban <ban mask> \[reason\]"} return 0 } set ziadmin 0 if {[string match #* $arg2] || [string match &* $arg2] || [string match +* $arg2]} { if {$level>500} { if {![validchan $arg2]} { putserv "notice $nick :Invalid channel \002$arg2\002 -Syntax: \002$botnick spban \[#channel\] <ban mask> \[reason\]" return 0 } set dachan $arg2 set daban $arg3 set dareason "$arg4 $arg5" set ziadmin 1 } else { putserv "notice $nick :Syntax: \002$botnick spban <ban mask> \[reason\]" return 0 } } else { set ziadmin 0 set dachan $chan set daban $arg2 set dareason "$arg3 $arg4 $arg5" } set invalid_ban 0 if {![string match *!* $daban]} { set invalid_ban 1 } if {![string match *@* $daban]} { set invalid_ban 1 } if {$daban=="*!*@*"} { set invalid_ban 1 } if {$daban=="*!*@*.*"} { set invalid_ban 1 } if {$invalid_ban==1} { Guillaume Tournand <guillaume@tournand.com> September 2003 176/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project putserv "notice $nick :Bogus ban mask, Try again." return 0 } set noreason 0 if {$arg3=="" && $ziadmin==0} { set noreason 1 } if {$arg4=="" && $ziadmin==1} { set noreason 1 } if {$noreason==1} { set ban_reason $defkick_reason } else { set ban_reason "$dareason" } newchanban $dachan $daban $handle "$ban_reason" 0 sticky if {$logonotice==1} {putserv "notice @$homechan :\002(\002SPBAN\002)\002: for $daban on $dachan (\002sticky\002) from $nick!$uhost."} putserv "notice $nick :Added STICKY LOCAL ban for $daban on $dachan ($ban_reason)" save return 0 } if {[strlwr $arg1]=="sgban"} { if {$level<501} { putserv "notice $nick :$denymsg" return 0 } set invalid_ban 0 if {![string match *!* $arg2]} { set invalid_ban 1 } if {![string match *@* $arg2]} { set invalid_ban 1 } if {$arg2=="*!*@*"} { set invalid_ban 1 } if {$arg2=="*!*@*.*"} { set invalid_ban 1 } if {$invalid_ban==1} { putserv "notice $nick :Bogus ban mask, Try again." return 0 } if {$arg3==""} { set ban_reason $defkick_reason } else { set ban_reason "$arg3 $arg4 $arg5" } newban $arg2 $handle "$ban_reason" 0 sticky if {$logonotice==1} {putserv "notice @$homechan :\002(\002SGBAN\002)\002: for $arg2 (\002sticky\002) from $nick!$uhost."} putserv "notice $nick :Added STICKY GLOBAL ban for $arg2 ($ban_reason)" save return 0 } if {[strlwr $arg1]=="rempban"} { if {$level<400} { putserv "notice $nick :$denymsg" return 0 } if {$arg2==""} { if {$level>500} { putserv "notice $nick :Syntax: \002$botnick rempban \[#channel\] <ban mask|number>\002" return 0 } else { putserv "notice $nick :Syntax: \002$botnick rempban <ban mask|number>\002" return 0 } } if {[string match #* $arg2] || [string match &* $arg2] || [string match +* $arg2]} { if {$level>500} { if {![validchan $arg2]} { Guillaume Tournand <guillaume@tournand.com> September 2003 177/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project putserv "notice $nick :Invalid channel \002$arg2\002 -Syntax: \002$botnick rempban \[#channel\] <ban mask|number>\002" return 0 } set dachan $arg2 set daarg $arg3 } else { putserv "notice $nick :Syntax: \002$botnick rempban <ban mask|number>\002" return 0 } } else { set dachan $chan set daarg $arg2 } set is_string 1 catch { set is_string [expr $daarg*0] } if {$is_string==1} { set unban_ok [killchanban $dachan $daarg] if {$unban_ok==1} { if {$logonotice==1} {putserv "notice @$homechan :\002(\002REMPBAN\002)\002: $daarg for $dachan from $nick!$uhost."} putserv "notice $nick :Removed $dachan ban: $daarg" } else { putserv "notice $nick :No such ban for $dachan. ($daarg)" } } else { set zeban [lindex [lindex [banlist $dachan] [expr $daarg-1]] 0] set unban_ok [killchanban $dachan [lindex [lindex [banlist $dachan] [expr $daarg-1]] 0]] if {$unban_ok==1} { if {$logonotice==1} {putserv "notice @$homechan :\002(\002REMPBAN\002)\002: $zeban for $dachan from $nick!$uhost."} putserv "notice $nick :Removed $dachan ban: $zeban" } else { putserv "notice $nick :No such ban for $dachan. ($daarg)" } } return 0 } if {[strlwr $arg1]=="remgban"} { if {$level<501} { putserv "notice $nick :$denymsg" return 0 } set is_string 1 catch { set is_string [expr $arg2*0] } if {$is_string==1} { set unban_ok [killban $arg2] if {$unban_ok==1} { if {$logonotice==1} {putserv "notice @$homechan :\002(\002REMGBAN\002)\002: $arg2 from $nick!$uhost."} putserv "notice $nick :Removed global ban: $arg2" } else { putserv "notice $nick :No such global ban. ($arg2)" } } else { set zeban [lindex [lindex [banlist] [expr $arg2-1]] 0] set unban_ok [killban [lindex [lindex [banlist] [expr $arg2-1]] 0]] if {$unban_ok==1} { if {$logonotice==1} {putserv "notice @$homechan :\002(\002REMGBAN\002)\002: $zeban from $nick!$uhost."} putserv "notice $nick :Removed global ban: $zeban" } else { putserv "notice $nick :No such global ban. ($arg2)" } } Guillaume Tournand <guillaume@tournand.com> September 2003 178/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project return 0 } if {[strlwr $arg1]=="listbans"} { if {$level<200} { putserv "notice $nick :$denymsg" return 0 } if {[strlwr $arg2]=="full"} { set full_list 1 } else { set full_list 0 } set g_banlist "" set l_banlist "" set zechan $chan if {[string match #* $arg2] || [string match &* $arg2] || [string match +* $arg2]} { if {$level>500} { set zechan $arg2 if {[strlwr $arg2]=="full"} { set full_list 1 } else { set full_list 0 } if {![validchan $zechan]} { putserv "notice $nick :Invalid channel \002$zechan\002 : Syntax : listbans \[#channel|full\] \[|full\]" return 0 } } else { putserv "notice $nick :Syntax: $botnick listbans \[full\]" return 0 } } if {$level>=501} { set g_banlist [banlist] set mzechan "*/$zechan" } if {$level<500 && $full_list==1} { set full_list 0 putserv "notice $nick :Only level 500 may have the \002full\002 option active." } if {$logonotice==1} {putserv "notice @$homechan :\002(\002LISTBANS\002)\002: for $mzechan from $nick!$uhost."} set l_banlist [banlist $zechan] if {$full_list==0} { putserv "notice $nick :Bans with a * close to their number are \002STICKY\002." } if {$g_banlist!=""} { putserv "notice $nick :\002Global Bans\002:" if {$full_list==0} { set banz "" for {set xx1 0} {$xx1<[llength $g_banlist]} {incr xx1} { if {[isbansticky [lindex [lindex $g_banlist $xx1] 0]]} { set banz "$banz (*\002[expr $xx1+1]\002)[lindex [lindex $g_banlist $xx1] 0]" } else { set banz "$banz (\002[expr $xx1+1]\002)[lindex [lindex $g_banlist $xx1] 0]" } if {$xx1 % 10 == 1 && $xx1 > 10} { putserv "notice $nick :$banz" set banz "" } } if {$banz!=""} { putserv "notice $nick :$banz" } } if {$full_list==1} { for {set xx1 0} {$xx1<[llength $g_banlist]} {incr xx1} { Guillaume Tournand <guillaume@tournand.com> September 2003 179/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if {[isbansticky [lindex [lindex $g_banlist $xx1] 0]]} { putserv "notice $nick :(\002[expr $xx1+1]\002)[lindex [lindex $g_banlist $xx1] 0] set on \002[ctime [lindex [lindex $g_banlist $xx1] 3]]\002 by \002[lindex [lindex $g_banlist $xx1] 5]\002 for reason: [lindex [lindex $g_banlist $xx1] 1] (\002STICKY\002)" } else { putserv "notice $nick :(\002[expr $xx1+1]\002)[lindex [lindex $g_banlist $xx1] 0] set on \002[ctime [lindex [lindex $g_banlist $xx1] 3]]\002 by \002[lindex [lindex $g_banlist $xx1] 5]\002 for reason: [lindex [lindex $g_banlist $xx1] 1]" } } } } else { if {$level>=501} { putserv "notice $nick :\002No Global Bans\002." } } if {$l_banlist!=""} { putserv "notice $nick :\002Local Bans\002 for $zechan:" if {$full_list==0} { set banz "" for {set xx1 0} {$xx1<[llength $l_banlist]} {incr xx1} { if {[isbansticky [lindex [lindex $l_banlist $xx1] 0] $zechan]} { set banz "$banz (*\002[expr $xx1+1]\002)[lindex [lindex $l_banlist $xx1] 0]" } else { set banz "$banz (\002[expr $xx1+1]\002)[lindex [lindex $l_banlist $xx1] 0]" } if {$xx1 % 10 == 1 && $xx1 > 10} { putserv "notice $nick :$banz" set banz "" } } if {$banz!=""} { putserv "notice $nick :$banz" } } if {$full_list==1} { for {set xx1 0} {$xx1<[llength $l_banlist]} {incr xx1} { if {[isbansticky [lindex [lindex $l_banlist $xx1] 0] $zechan]} { putserv "notice $nick :(\002[expr $xx1+1]\002)[lindex [lindex $l_banlist $xx1] 0] set on \002[ctime [lindex [lindex $l_banlist $xx1] 3]]\002 by \002[lindex [lindex $l_banlist $xx1] 5]\002 for reason: [lindex [lindex $l_banlist $xx1] 1] (\002STICKY\002)" } else { putserv "notice $nick :(\002[expr $xx1+1]\002)[lindex [lindex $l_banlist $xx1] 0] set on \002[ctime [lindex [lindex $l_banlist $xx1] 3]]\002 by \002[lindex [lindex $l_banlist $xx1] 5]\002 for reason: [lindex [lindex $l_banlist $xx1] 1]" } } } } else { putserv "notice $nick :\002No Local Bans\002 for $zechan." } putserv "notice $nick :*** End of listbans." return 0 } if {[strlwr $arg1]=="add"} { if {$level<400} { putserv "notice $nick :$denymsg" return 0 } set a_nick $arg2 set a_levl $arg3 set a_hndl $arg4 if {$a_levl==""} {set a_levl 200} if {$level>=400} {set available_levels "1,50,\002200\002"} if {$level>=500} {set available_levels "1,50,\002200\002,400"} if {$level>=501} {set available_levels "1,50,\002200\002,400,500"} if {$level>=800} {set available_levels "1,50,\002200\002,400,500,501"} if {$level>=999} {set available_levels "1,50,\002200\002,400,500,501,800"} Guillaume Tournand <guillaume@tournand.com> September 2003 180/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if {$level==1000} {set available_levels "1,50,\002200\002,400,500,501,800,999"} if {$a_nick=="" || $a_levl==0 || $level<=$a_levl} { putserv "notice $nick :Syntax: $botnick add <nickname> \[\[level\] \[handle\]\]" putserv "notice $nick :Levels available: $available_levels" putserv "notice $nick :Default level (channel op): \002200\002." return 0 } if {![onchan $a_nick $chan]} { putserv "notice $nick :\002$a_nick\002 is NOT on $chan." return 0 } set g_flagz 0 if {$a_levl==1} { set g_flagz $defumodes set c_flagz "+f" } if {$a_levl==50} { set g_flagz $defumodes set c_flagz "+fv" } if {$a_levl==200} { set g_flagz $defumodes set c_flagz $chanopmodes } if {$a_levl==400} { set g_flagz $defumodes set c_flagz $chanmastermodes } if {$a_levl==500} { set g_flagz $defumodes set c_flagz $chanownermodes } if {$a_levl==501} { set g_flagz $opmodes set c_flagz "" } if {$a_levl==800} { set g_flagz $mastermodes set c_flagz "" } if {$a_levl==999} { set g_flagz $ownermodes set c_flagz "" } if {$g_flagz==0} { putserv "notice $nick :\002$a_levl\002 is an INVALID level. Choose one from : $available_levels." return 0 } set chk_hand [nick2hand $a_nick $chan] if {$chk_hand!="*" && $a_hndl!=""} { putserv "notice $nick :\002ERROR\002 The nickname \002$a_nick\002 seems to be a known handle ($chk_hand) different that the one you specified ($a_hndl)." return 0 } if {$a_hndl!=""} {set chk_hand $a_hndl} if {$chk_hand=="*"} { set hostmask1 [getchanhost $a_nick $chan] set hostmask2 "$nick!$hostmask1" set hostmask [maskhost $hostmask2] if {[string index $hostmask 2]!="*"} {set hostmask "*!*[string range $hostmask 2 end]"} else { set hostmask "*![string range $hostmask 2 end]"} adduser $a_nick $hostmask chattr $a_nick $g_flagz if {$c_flagz!=""} {chattr $a_nick |$c_flagz $chan} save if {$a_levl>500} {set chan_l "*"} else {set chan_l $chan} Guillaume Tournand <guillaume@tournand.com> September 2003 181/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project putserv "notice $a_nick :\002WELCOME!\002. You have been added to $botnick." if {$a_levl>500} { putserv "notice $a_nick :\002YOU ARE A BOT ADMINISTRATOR\002." } putserv "notice $a_nick :You are now level: \002$a_levl\002 on $chan_l." putserv "notice $a_nick :Please 1) choose a 'password' and use : \002/msg $botnick pass 'password'\002." putserv "notice $a_nick : 2) login. \002/msg $botnick login $chan_l 'password'\002." putserv "notice $nick :\002ADDED\002: $a_nick ($hostmask) on \002$chan_l\002 at level \002$a_levl\002." if {$a_levl>1} {putserv "mode $chan +v $a_nick"} if {$logonotice==1} {putserv "\002(\002ADD\002)\002: $a_nick ($hostmask) on $chan_l with level \002$a_levl\002."} } else { set rrr [do_check_level $a_nick $chan [getchanhost $a_nick $chan]] if {$a_levl<=$level} { putserv "notice $nick :You must use \002$botnick modlevel <nick|handle> <newlevel> if you wish to lower an access." putserv "notice $nick :User $chk_hand (online as $a_nick) as already level \002$level\002." return 0 } set hostmask1 [getchanhost $a_nick $chan] set hostmask2 "$a_nick!$hostmask1" set hostmask [maskhost $hostmask2] if {[string index $hostmask 2]!="*"} {set hostmask "*!*[string range $hostmask 2 end]"} else { set hostmask "*![string range $hostmask 2 end]"} adduser $chk_hand $hostmask chattr $chk_hand $g_flagz if {$c_flagz!=""} {chattr $chk_hand |$c_flagz $chan} save chattr $chk_hand -$authflag save if {$a_levl>500} {set chan_l "*"} else {set chan_l $chan} putserv "notice $a_nick :\002$chk_hand\002. You have been added to $botnick." if {$a_levl>500} { putserv "notice $a_nick :\002YOU ARE A BOT ADMINISTRATOR\002." } putserv "notice $a_nick :You are now level: \002$a_levl\002 on $chan_l." putserv "notice $a_nick :Please re-login. \002/msg $botnick login $chan_l 'password'\002." putserv "notice $nick :\002ADDED/MODIFIED:$chk_hand\002: $a_nick ($hostmask) on \002$chan_l\002 at level \002$a_levl\002." if {$a_levl>1} {putserv "mode $chan +v $a_nick"} if {$logonotice==1} {putserv "\002(\002ADD/MODIFY:$chk_hand\002)\002: $a_nick ($hostmask) on $chan_l with level \002$a_levl\002."} } return 0 } if {[strlwr $arg1]=="join"} { if {$level<999} { putserv "notice $nick :$denymsg" return 0 } if {$arg2==""} { putserv "notice $nick :You must specify a channel name (#,& or +)" return 0 } if {![string match #* $arg2] && ![string match &* $arg2] && ![string match +* $arg2]} { putserv "notice $nick :\002$arg2\002: Invalid channel name." return 0 } set l_chans [llength [channels]] if {$maxchans>1 && $l_chans==$maxchans} { putserv "notice $nick :I'm already auto-joining too many channels ($l_chans), sorry." return 0 } if {[validchan [strlwr $arg2]]} { Guillaume Tournand <guillaume@tournand.com> September 2003 182/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project putserv "notice $nick :hrmm.. you st00pid admin.. I'm already auto-joining $arg2." return 0 } if {$arg3==""} { putserv "notice $nick :Joining $arg2..." } else { putserv "notice $nick :Joining $arg2 (with key : \002$arg3\002)..." } if {![validuser tchanusr]} { putlog "--- TCHANUSR User didn't existed. : Creating...(with no password)" adduser tchanusr *!*Please@Dont.Remove.this.user chattr tchanusr -fp+c setuser tchanusr PASS zeqwxidpoizs save } channel add $arg2 {-bitch -stopnethack -statuslog -autoop -greet -revenge} if {$arg3==""} { channel set $arg2 chanmode +tn } else { channel set $arg2 chanmode +tnk $arg3 } channel set $arg2 flood-chan 0:0 chattr tchanusr |+f $arg2 save if {$logonotice==1} {putserv "notice @$homechan :\002(\002JOIN\002)\002: $arg2 from $nick!$uhost."} putserv "notice $nick :I joined $arg2." return 0 } if {[strlwr $arg1]=="part"} { if {$level<999} { putserv "notice $nick :$denymsg" return 0 } if {$arg2==""} { set arg2 $chan } if {![string match #* $arg2] && ![string match &* $arg2] && ![string match +* $arg2]} { putserv "notice $nick :\002$arg2\002: Invalid channel name." return 0 } set l_chans [llength [channels]] set chan_ok 0 if {[validchan [strlwr $arg2]]} { set chan_ok 1 } if {$chan_ok==0} { putserv "notice $nick :hey ... dumb ass! how could I part a channel that I'm not monitoring ??!" return 0 } if {$arg2==$homechan} { putserv "kick $chan $nick :Tsss..." return 0 } if {[validuser tchanusr]} { if {[matchattr tchanusr |+f $arg2]} { putserv "notice $nick :Leaving $arg2..." putserv "privmsg $arg2 :cya.." chattr tchanusr |-f $arg2 delchanrec tchanusr $arg2 channel remove $arg2 save } else { putserv "notice $nick :This is a regged channel, sorry. you must use the PURGE command." return 0 } } else { putserv "notice $nick :This is a regged channel, sorry. you must use the PURGE command." Guillaume Tournand <guillaume@tournand.com> September 2003 183/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project return 0 } if {$logonotice==1} {putserv "notice @$homechan :\002(\002PART\002)\002: $arg2 from $nick!$uhost."} putserv "notice $nick :I left $arg2." putserv "notice $nick :If users were accidentally or temporarily added for this channel, you will have to clean up yourself ;P" set tmpfn "maxusers_[string tolower $arg2].dat" catch { exec rm -f $tmpfn putserv "notice $nick :Wiped MAXUSERS infos for $arg2." } return 0 } if {[strlwr $arg1]=="clogin"} { if {$level<1} { putserv "notice $nick :$denymsg" return 0 } if {$CM_username=="" || $CM_password=="" || $CM_nickname=="" || $CM_servername==""} { putserv "notice $nick :\002FEATURE DISABLED\002, Sorry." return 0 } set dest "$CM_nickname@$CM_servername" set msgtoCM "login $CM_username $CM_password" puthelp "notice $nick :Authenticating to \002$CM_nickname@$CM_servername\002 as \002$CM_username\002." if {$logonotice==1} {putserv "notice @$homechan :\002(\002CLOGIN\002)\002: to \002$CM_nickname\002 as \002$CM_username\002 from $nick!$uhost."} putserv "privmsg $dest :$msgtoCM" return 0 } if {[strlwr $arg1]=="floodpro"} { if {$level<400} { putserv "notice $nick :$denymsg" return 0 } set newstatus [strlwr $arg2] set currfloodpro [lindex [channel info $chan] 7] if {$currfloodpro=="99:1"} { set curr_status "off" } else { set curr_status "on" } if {$newstatus!="on" && $newstatus!="off"} { putserv "notice $nick :New value for FLOODPRO must be ON or OFF. (currently [strupr $curr_status])" return 0 } if {$curr_status==$newstatus} { putserv "notice $nick :PUBLIC FLOODPRO is already [strupr $newstatus], No changes made." return 0 } if {$curr_status=="off"} { channel set $chan flood-chan 0:0 } else { channel set $chan flood-chan 0:0 } save putserv "notice $nick :PUBLIC FLOODPRO is now [strupr $newstatus]" if {$logonotice==1} {putserv "\002(\002FLOODPRO\002)\002: Turned [strupr $newstatus] by $nick!$uhost on $chan."} return 0 } if {[strlwr $arg1]=="modlevel"} { if {$level<400} { putserv "notice $nick :$denymsg" return 0 } set new_lvl $arg3 Guillaume Tournand <guillaume@tournand.com> September 2003 184/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project set nlvl_isok 1 if {$new_lvl!=0 && $new_lvl!=1 && $new_lvl!=50 && $new_lvl!=200 && $new_lvl!=400 && $new_lvl!=500 && $new_lvl!=501 && $new_lvl!=800 && $new_lvl!=999} { set nlvl_isok 0 } if {$new_lvl==""} { set nlvl_isok 0 } if {$nlvl_isok==0} { putserv "notice $nick :Syntax: $botnick modlevel <nick|handle> <new level>" if {$level==400} { set new_lvls_ok "0,1,50" } if {$level==500} { set new_lvls_ok "0,1,50,200,400" } if {$level==501} { set new_lvls_ok "0,1,50,200,400,500" } if {$level==800} { set new_lvls_ok "0,1,50,200,400,500,501" } if {$level==999} { set new_lvls_ok "0,1,50,200,400,500,501,800" } if {$level==1000} { set new_lvls_ok "0,1,50,200,400,500,501,800,999" } putserv "notice $nick :Acceptable new levels : $new_lvls_ok" putserv "notice $nick :You cannot modify an higher or equal access to yours." return 0 } set m_hand [nick2hand $arg2] if {$m_hand==""} { if {[validuser $arg2]} {set m_hand $arg2} } if {$m_hand=="*"} { set int_hand [finduser $arg2![getchanhost $arg2]] if {$int_hand=="" || $int_hand=="*"} { putserv "notice $nick :\002$arg2\002: Unknown user." return 0 } set m_hand $int_hand } if {[nick2hand $nick]==$m_hand} { putserv "notice $nick :Hey! you can't modify yourself your level.. lil' hax0r!" return 0 } putserv "notice $nick :Found $arg2 (aka $m_hand)" set your_lvl $level set xxx [do_check_level $arg2 $chan [getchanhost $arg2]] if {$level2>=$your_lvl} { putserv "notice $nick :You cannot modify the level of \002$arg2\002 ($m_hand), Level \002$level\002, access higher or equal to your." return 0 } set uuu [do_check_level $m_hand $chan "*"] if {$level2==$new_lvl} { putserv "notice $nick :User $arg2 ($m_hand) had already level \002$new_lvl\002." return 0 } if {$new_lvl>=501} { chattr $m_hand $remallmodes chattr $m_hand -jtvx+fp if {$new_lvl==501} {chattr $m_hand $opmodes} if {$new_lvl==800} {chattr $m_hand $mastermodes} if {$new_lvl==999} {chattr $m_hand $ownermodes} } else { chattr $m_hand |-ofmnav $chan chattr $m_hand $remallmodes chattr $m_hand -jtvx+fp if {$new_lvl==1} {chattr $m_hand |+f $chan} if {$new_lvl==50} {chattr $m_hand |+fv $chan} if {$new_lvl==200} {chattr $m_hand |$chanopmodes $chan} if {$new_lvl==400} {chattr $m_hand |$chanmastermodes $chan} if {$new_lvl==500} {chattr $m_hand |$chanownermodes $chan} } save if {$new_lvl>=501} {set new_lvl_chan "*"} else {set new_lvl_chan $chan} putserv "notice $nick :New level for $arg2 ($m_hand) is \002$new_lvl\002 on $new_lvl_chan" if {$logonotice==1} {putserv "notice @$homechan :\002(\002MODLEVEL\002)\002: for $arg2 ($m_hand) is now \002$new_lvl\002 on $new_lvl_chan - from $nick!$uhost."} return 0 } Guillaume Tournand <guillaume@tournand.com> September 2003 185/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if {[strlwr $arg1]=="chattr"} { if {$level<1000} { putserv "notice $nick :$denymsg" return 0 } if {$arg3==""} { putserv "notice $nick :Syntax: $botnick chattr <handle> <attr. change> \[channel\]" return 0 } if {![validuser $arg2]} { putserv "notice $nick :Handle \002$arg2\002 does not exists." return 0 } if {$arg4==""} { chattr $arg2 $arg3 set n_attr [matchattr $arg2] } else { chattr $arg2 |$arg3 $arg4 set n_attr [matchchanattr $arg2 $arg4] } save putserv "notice $nick :Changes mades for $arg2 $arg4" return 0 } if {[strlwr $arg1]=="status"} { if {$level<1} { putserv "notice $nick :$denymsg" return 0 } set nb_chans [llength [channels]] set nb_users [llength [userlist]] set up_since_utime $uptime set up_since_date [ctime $up_since_utime] set up_since_time [duration [expr [unixtime] - $up_since_utime]] if {$logonotice==1} {putserv "notice @$homechan :\002(\002STATUS\002)\002: from $nick!$uhost"} puthelp "notice $nick :$botname is monitoring \002$nb_chans\002 channels. (\002$nb_users\002 total users in my userbase)." puthelp "notice $nick :\002Since:\002 $up_since_date ($up_since_time)" puthelp "notice $nick :\002Connected to:\002 $server" puthelp "notice $nick :\002Running under:\002 [unames]" return 0 } if {[strlwr $arg1]=="cstat"} { if {$level<1} { putserv "notice $nick :$denymsg" return 0 } if {$arg2!=""} { if {$level>500} { if {[validchan $arg2]} { set s_chan $arg2 } else { putserv "notice $nick :Invalid channel \002$arg2\002." return 0 } } else { putserv "notice $nick :Use it without argument for current channel please." putserv "notice $nick :..or use \002/msg $botnick cstat #channel\002." return 0 } } else { set s_chan $chan } if {$level>500} {set askuser_is_admin 1} else {set askuser_is_admin 0} Guillaume Tournand <guillaume@tournand.com> September 2003 186/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if {$logonotice==1} {putserv "notice @$homechan :\002(\002CSTAT\002)\002: from $nick!$uhost"} set authd_nicks " " set snb_ops 0 set snb_nops 0 set snb_voice 0 set authlist [userlist $authflag|f $s_chan] set fulllist [chanlist $s_chan] for {set iii 0} {$iii<[llength $fulllist]} {incr iii} { if {[isop [lindex $fulllist $iii] $s_chan]} { incr snb_ops } else { if {[isvoice [lindex $fulllist $iii] $s_chan]} { incr snb_voice } else { incr snb_nops } } } set adisp 0 set s_nonotice 1 for {set aaa 0} {$aaa<[llength $authlist]} {incr aaa} { set s_hand [lindex $authlist $aaa] set s_nick [hand2nick $s_hand] if {$s_nick==""} {set s_nick "+$s_hand"} set ret [do_check_level $s_hand $s_chan "*"] if {$ret>500} { if {$askuser_is_admin==1} { set s_nonotice 0 incr adisp if {[matchattr $s_hand $suspflag]} { set is_susp "-" } else { set is_susp "" } set authd_nicks "$authd_nicks$s_nick\(*\002$is_susp$level2\002)" if {$aaa==[expr [llength $authlist]-1]} {set authd_nicks "$authd_nicks."} else {set authd_nicks "$authd_nicks, "} } else { set clevel2 0 if {[matchattr $s_hand |f $s_chan]} {set clevel2 1} if {[matchattr $s_hand |v $s_chan]} {set clevel2 50} if {[matchattr $s_hand |o $s_chan]} {set clevel2 200} if {[matchattr $s_hand |m $s_chan]} {set clevel2 400} if {[matchattr $s_hand |a $s_chan]} {set clevel2 450} if {[matchattr $s_hand |n $s_chan]} {set clevel2 500} if {$clevel2>0} { set s_nonotice 0 incr adisp if {[matchattr $s_hand $suspflag]} { set is_susp "-" } else { set is_susp "" } set authd_nicks "$authd_nicks$s_nick\(*\002$is_susp$clevel2\002)" if {$aaa==[expr [llength $authlist]-1]} {set authd_nicks "$authd_nicks."} else {set authd_nicks "$authd_nicks, "} } } } if {$ret<=500 && $ret!=0} { set s_nonotice 0 incr adisp if {[matchattr $s_hand $suspflag]} { set is_susp "-" } else { set is_susp "" } set authd_nicks "$authd_nicks$s_nick\(\002$is_susp$level2\002)" if {$aaa==[expr [llength $authlist]-1]} {set authd_nicks "$authd_nicks."} else {set authd_nicks "$authd_nicks, "} } if {$adisp % 10 == 1 && $adisp>10} { puthelp "notice $nick :($s_chan) \002Auth\002:$authd_nicks" set authd_nicks " " set s_nonotice 1 } Guillaume Tournand <guillaume@tournand.com> September 2003 187/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project } set snb_total [expr $snb_ops+$snb_voice+$snb_nops] if {$s_nonotice==0} {puthelp "notice $nick :($s_chan) \002Auth\002:$authd_nicks"} if {$s_nonotice==1 && $adisp==0} {puthelp "notice $nick :($s_chan) \002Auth\002: \037none\037."} puthelp "notice $nick :($s_chan) \002$snb_ops\002 ops, \002$snb_voice\002 voice, \002$snb_nops\002 stduser. (\002$snb_total\002 Total)." return 0 } if {[strlwr $arg1]=="uptime"} { putserv "PRIVMSG $chan :\001ACTION is up since [duration [expr [unixtime] - $uptime]].\001" return 0 } if {[strlwr $arg1]=="automsg"} { if {$level>=501} { putserv "notice $nick :Please use /msg $botnick automsg \[on|off\]" return 0 } } if {[strlwr $arg1]=="setauto"} { if {$level<400} { putserv "notice $nick :$denymsg" return 0 } if {![validuser $automsg_handle]} { putserv "notice $nick :\002Internal Error\002: Handle \002$automsg_handle\002 is unknown :(" return 0 } if {[strlwr $arg2]=="*remove"} { set the_msg [getchaninfo $automsg_handle $chan] if {$the_msg==""} { putserv "notice $nick :You cannot remove an already non existant message." return 0 } set ret_end [setchaninfo $automsg_handle $chan none] delchanrec $automsg_handle $chan save if {$logonotice==1} {putserv "notice @$homechan :\002(\002SETAUTO\002)\002: from $nick!$uhost on $chan (DISABLED)."} putserv "notice $nick :Removed '$the_msg'. AUTO_MSG disabled for $chan." return 0 } if {$arg2==""} { putserv "notice $nick :Syntax: $botnick setauto <message to display to users on join>" return 0 } if {$arg3==""} {set full_msg "[join [split $arg2]]"} else { if {$arg4==""} {set full_msg "[join [split $arg2]] [join [split $arg3]]"} else { if {$arg5==""} {set full_msg "[join [split $arg2]] [join [split $arg3]] [join [split $arg4]]"} else { set full_msg "[join [split $arg2]] [join [split $arg3]] [join [split $arg4]] [join [split $arg5]]" } } } set full_msg [join [split $full_msg]] set ret_end [setchaninfo $automsg_handle $chan "$full_msg"] save if {$logonotice==1} {putserv "notice @$homechan :\002(\002SETAUTO\002)\002: from $nick!$uhost on $chan (ENABLED:$full_msg)."} putserv "notice $nick :Ok '$full_msg' is active. AUTO_MSG enabled for $chan." if {$automsg_active!=1} {putserv "notice $nick :\002WARNING\002: GLOBAL AUTO_MSG is disabled. ask a global Admin about it."} return 0 } if {[strlwr $arg1]=="whois"} { if {$level<1} { Guillaume Tournand <guillaume@tournand.com> September 2003 188/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project putserv "notice $nick :$denymsg" return 0 } if {$arg2==""} { putserv "notice $nick :Syntax: $botnick whois <nickname or handle>" return 0 } set w_host [getchanhost $arg2] if {$w_host==""} { if {[validuser $arg2]} { set w_hand $arg2 set w_nick "!unknown!" } else { putserv "notice $nick :USER $arg2 is unknown and/or not on any channels I'm on, and $arg2 does not match any handle I know." return 0 } } else { set w_hand [finduser $arg2!$w_host] if {$w_hand=="*"} { if {[validuser $arg2]} { set w_hand $arg2 set w_nick "!unknown!" } else { putserv "notice $nick :USER $arg2 is unknown (no access)." return 0 } } else { set w_nick $arg2 } } if {$logonotice==1} { if {$w_nick=="!unknown!"} { putserv "notice @$homechan :\002(\002WHOIS\002)\002: for handle $w_hand from $nick!$uhost." } else { putserv "notice @$homechan :\002(\002WHOIS\002)\002: for nick $w_nick ($w_hand) from $nick!$uhost." } } puthelp "notice $nick :\002NICK:\002 $w_nick -- \002HANDLE:\002 $w_hand" set known_hosts [getuser $w_hand HOSTS] set l_known_hosts [llength $known_hosts] set u_hosts "" for {set y 0} {$y<$l_known_hosts} {incr y} { set u_hosts "$u_hosts [lindex $known_hosts $y]" if {$y==[expr $l_known_hosts-1]} { set addy "." } else { set addy "," } set u_hosts "$u_hosts$addy" } puthelp "notice $nick :\002USER@HOSTS:\002 $u_hosts" if {$w_host!=""} { set c_hmask [maskhost $w_host] if {[string index $c_hmask 2]!="*"} {set c_hmask "*!*[string range $c_hmask 2 end]"} else { set c_hmask "*![string range $c_hmask 2 end]"} puthelp "notice $nick :\002CURRENT:\002 $w_nick!$w_host ($c_hmask)" } set my_level $level if {$w_nick!="!unknown!"} {set rrr [do_check_level $w_nick $chan $w_host]} else {set rrr [do_check_level $w_hand $chan "*"]} set lvl $level2 set chn $chan if {$lvl>=501} {set chn "*"} if {$lvl==0} {set lvl_libelle "\002NO ACCESS\002 ?! uh..."} if {$lvl==1} {set lvl_libelle "Friend"} if {$lvl==50} {set lvl_libelle "Voice"} if {$lvl==200} {set lvl_libelle "Channel Op"} if {$lvl==400} {set lvl_libelle "Channel Master"} Guillaume Tournand <guillaume@tournand.com> September 2003 189/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if {$lvl==500} {set lvl_libelle "Channel Owner"} if {$lvl==501} {set lvl_libelle "Admin"} if {$lvl==800} {set lvl_libelle "Trusted Admin"} if {$lvl==999} {set lvl_libelle "Senior Admin"} if {$lvl==1000} {set lvl_libelle "\002phear\002 - BiGch33se!"} if {[matchattr $w_hand $authflag]} { set authstat "\002Yes\002" } else { set authstat "\002No\002" } if {[matchattr $w_hand $suspflag]} { set authstat "\026Suspend\026" } if {[strlwr $w_hand]==[strlwr $botnick]} { set authstat "N/A" } set noauth_nick_len [llength $noauth_handles] for {set yyy 0} {$yyy<$noauth_nick_len} {incr yyy} { if {[strlwr $w_hand]==[strlwr [lindex $noauth_handles $yyy]]} { set authstat "N/A" } } puthelp "notice $nick :\002LEVEL:\002 $lvl on $chn ($lvl_libelle) -- \002AUTH:\002 $authstat" set l_onchn [getuser $w_hand LASTON] if {$l_onchn!=0} {set last_msg "[ctime [lindex $l_onchn 0]] on [lindex $l_onchn 1]"} if {$l_onchn==0} {set last_msg "N/A"} puthelp "notice $nick :\002LAST SEEN:\002 $last_msg" set curr_chans "" if {$w_nick!="!unknown!"} { set cc_list [channels] set cc_len [llength $cc_list] for {set u 0} {$u<$cc_len} {incr u} { if {[onchan $w_nick [lindex $cc_list $u]]} { set curr_chans "$curr_chans[lindex $cc_list $u] " } } if {[strlwr $w_hand]==[strlwr $botnick]} {set curr_chans "N/A"} for {set yyy 0} {$yyy<$noauth_nick_len} {incr yyy} { if {[strlwr $w_hand]==[strlwr [lindex $noauth_handles $yyy]]} { set curr_chans "N/A" } } if {$my_level>=200} { puthelp "notice $nick :\002CURRENTLY ON:\002 $curr_chans" } if {[onchan $w_nick $chan]} { puthelp "notice $nick :\002IDLE:\002 [getchanidle $w_nick $chan] minute(s) on $chan." } } set u_url "" set u_email "" set u_mastercomment "" set u_xtra "" set u_infoline "" catch {set u_url [getuser $w_hand URL]} catch {set u_email [getuser $w_hand EMAIL]} catch {set u_mastercomment [getuser $w_hand COMMENT]} catch {set u_xtra [getuser $w_hand XTRA]} catch {set u_infoline [getuser $w_hand INFO]} if {$u_infoline!=""} {puthelp "notice $nick :\002INFOLINE:\002 $u_infoline"} if {$u_email!=""} {puthelp "notice $nick :\002EMAIL:\002 $u_email"} if {$u_xtra!=""} { set u_l [string length $u_xtra] if {$debug==1} {putlog "UCREATED:u_xtra=$u_xtra ($u_l)"} set u_time_xtra [string range $u_xtra 9 [expr $u_l-2]] if {$debug==1} {putlog "UCREATED:u_time_xtra=$u_time_xtra"} puthelp "notice $nick :\002USER CREATED ON:\002 [ctime $u_time_xtra]" if {$debug==1} {putlog "UCREATED:ctime=[ctime $u_time_xtra]"} } if {$u_url!=""} {puthelp "notice $nick :\002URL:\002 $u_url"} if {$u_mastercomment!=""} { if {$my_level>=400} { puthelp "notice $nick :\002MASTER COMMENT:\002 $u_mastercomment" } } return 0 } if {[strlwr $arg1]=="chanmode"} { if {$level<500} { putserv "notice $nick :$denymsg" Guillaume Tournand <guillaume@tournand.com> September 2003 190/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project return 0 } if {[strlwr $arg2]!="modes" && [strlwr $arg2]!="strictop"} { putserv "notice $nick :Syntax: $botnick chanmode <variable> <newvalue>" putserv "notice $nick :Use: $botnick help variable, to get acceptable <variable> list." return 0 } if {[strlwr $arg2]=="strictop"} { if {[lindex [channel info $chan] 17]=="+bitch"} { set s_op_stat "ON" } else { set s_op_stat "OFF" } if {[strlwr $arg3]!="on" && [strlwr $arg3]!="off"} { putserv "notice $nick :Value of STRICTOP must be ON or OFF. (currently $s_op_stat)" return 0 } if {[strlwr $arg3]==[strlwr $s_op_stat]} { putserv "notice $nick :Value of STRICTOP is already set to $s_op_stat, No changes made." return 0 } if {[strlwr $arg3]=="on"} { channel set $chan +bitch } else { channel set $chan -bitch } save if {$logonotice==1} {putserv "\002(\002CHANMODE\002)\002: STRICTOP now \002[strupr $arg3]\002 from $nick!$uhost for $chan."} putserv "notice $nick :Value of STRICTOP is now [strupr $arg3] on $chan." return 0 } if {[strlwr $arg2]=="modes"} { if {$arg3==""} { putserv "notice $nick :You must specify new MODES to enforce (currently enforcing: [lindex [channel info $chan] 0])" return 0 } if {![string match *+* $arg3] && ![string match *-* $arg3]} { putserv "notice $nick :Invalid MODES, Try again." return 0 } if {[string match *+*+* $arg3] || [string match *-*-* $arg3]} { putserv "notice $nick :Invalid MODES, Try again." return 0 } if {[string length $arg3]<2} { putserv "notice $nick :Invalid MODES, Try again." return 0 } channel set $chan chanmode "$arg3 $arg4 $arg5" save set newmodes [lindex [channel info $chan] 0] if {$logonotice==1} {putserv "\002(\002CHANMODE\002)\002: MODES $newmodes from $nick!$uhost for $chan."} putserv "notice $nick :Now enforcing \002$newmodes\002 on $chan." return 0 } return 0 } if {[strlwr $arg1]=="massop"} { if {$level<200} { putserv "notice $nick :$denymsg" return 0 } if {![botisop $chan]} { putserv "notice $nick :Sorry, I'm not opped in $chan." Guillaume Tournand <guillaume@tournand.com> September 2003 191/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project return 0 } if {$arg2==""} { set massop_type "auth" } else { if {[strlwr $arg2]!="all"} { putserv "notice $nick :Invalid argument, use \002massop all\002 to massop every access 200+" putserv "notice $nick :and use \002massop\002 without argument to only op those who are authenticated." return 0 } else { set massop_type "all" } } set massop_nicks1 "" set massop_nicks2 "" if {$massop_type=="auth"} { set massop_nicks1 [chanlist $chan $authflag&o] set massop_nicks2 [chanlist $chan o$authflag&] } if {$massop_type=="all"} { set massop_nicks1 [chanlist $chan &o] set massop_nicks2 [chanlist $chan o&] } if {$massop_nicks1=="" && $massop_nicks2==""} { putserv "notice $nick :Internal Error. No nicks to op (uh?!)" return 0 } set nb_opped 0 for {set ii 0} {$ii<[llength $massop_nicks1]} {incr ii} { if {![isop [lindex $massop_nicks1 $ii] $chan]} { pushmode $chan +o [lindex $massop_nicks1 $ii] incr nb_opped } } for {set ii 0} {$ii<[llength $massop_nicks2]} {incr ii} { if {![isop [lindex $massop_nicks2 $ii] $chan]} { pushmode $chan +o [lindex $massop_nicks2 $ii] incr nb_opped } } if {$nb_opped!=0} { if {$massop_type=="auth"} { putserv "notice $nick :Mass-Oping *only* AUTHENTICATED persons. To op every 200+ access, use \002massop all\002" putquick "notice $chan :MASSOP for level 200+ authenticated nicks." if {$logonotice==1} {putserv "\002(\002MASSOP\002)\002: AUTHED 200+ from $nick!$uhost for $chan."} } else { putquick "notice $chan :MASSOP for all known level 200+ nicks." if {$logonotice==1} {putserv "\002(\002MASSOP\002)\002: ALL 200+ from $nick!$uhost for $chan."} } flushmode $chan } else { putserv "notice $nick :Everyone that I would have opped is already opped. heh ;)" } return 0 } if {[strlwr $arg1]=="chanlist"} { if {$level<501} { putserv "notice $nick :$denymsg" return 0 } set c_list [channels] set c_disp "" set c_notop "" Guillaume Tournand <guillaume@tournand.com> September 2003 192/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project set c_len [llength $c_list] if {$logonotice==1} {putserv "\002(\002CHANLIST\002)\002: from $nick!$uhost."} for {set z 0} {$z<$c_len} {incr z} { set nb_users [llength [chanlist [lindex $c_list $z]]] set nb_ops 0 for {set x 0} {$x<$nb_users} {incr x} { if {[isop [lindex [chanlist [lindex $c_list $z]] $x] [lindex $c_list $z]]} { incr nb_ops } } set nb_bans [llength [chanbans [lindex $c_list $z]]] if {![isop $botnick [lindex $c_list $z]]} { set c_notop "$c_notop[lindex $c_list $z] " } set modes [getchanmode [lindex $c_list $z]] set zechan [lindex $c_list $z] set maxchan -1 catch { set tfdd [open "maxusers_$zechan.dat" r] set maxwhole [gets $tfdd] close $tfdd set maxchan [lindex $maxwhole 0] } if { $maxchan == -1 } { set maxchan "?" } set c_disp "$c_disp - [lindex $c_list $z] (\002$maxchan\002/u:$nb_users/o:$nb_ops/b:$nb_bans/$modes)" if {$z % 10 == 1 && $z > 10} { putserv "notice $nick :$c_disp" set c_disp "" } } if {$c_disp!=""} {putserv "notice $nick :$c_disp"} if {$maxchans<1} { set max_c "unlimited" } else { set max_c $maxchans } putserv "notice $nick :\002$c_len\002 total channels (max.:$max_c)" if {$c_notop!=""} { putserv "notice $nick :\002Not Opped in:\002 $c_notop" } return 0 } if {[strlwr $arg1]=="hop"} { if {$level<800} { putserv "notice $nick :$denymsg" return 0 } set irc_server $arg2 if {$irc_server==""} { putserv "notice $nick :Syntax: $botnick hop <ServerName.undernet.org> \[port\]. Default port = 6667." return 0 } set irc_port $arg3 if {$irc_port==""} {set irc_port 6667} if {$irc_port<6660 || $irc_port>7000} { putserv "notice $nick :\002$irc_port\002 is NOT a valid IRC port. (out of range 6660>7000)" return 0 } if {![string match *.undernet.org [strlwr $irc_server]]} { putserv "notice $nick :Sorry, I can only connect to the \002Undernet\002. (Invalid server name: $irc_server)." return 0 } putserv "notice $nick :Jumping to $irc_server:$irc_port ..." if {$logonotice==1} {putserv "\002(\002HOP\002)\002: from $nick!$uhost to $irc_server:$irc_port."} save jump $irc_server $irc_port return 0 } if {[strlwr $arg1]=="reg"} { if {$level<999} { Guillaume Tournand <guillaume@tournand.com> September 2003 193/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project putserv "notice $nick :$denymsg" return 0 } if {$arg2==""} { putserv "notice $nick :Syntax: \002$botnick reg <#channel> <nick> \[hostmask\] \[password\]\002" return 0 } if {![string match #* $arg2] && ![string match &* $arg2] && ![string match +* $arg2]} { putserv "notice $nick :\002$arg2\002: Invalid channel name." return 0 } set l_chans [llength [channels]] if {$maxchans>1 && $l_chans==$maxchans} { putserv "notice $nick :I'm already auto-joining too many channels ($l_chans), sorry." return 0 } set nb_argz 1 if {$arg3!=""} {incr nb_argz} if {$arg4!=""} {incr nb_argz} if {$arg5!=""} {incr nb_argz} if {$nb_argz==1} { putserv "notice $nick :Syntax: \002$botnick reg <#channel> <nick> \[hostmask\] \[password\]\002" return 0 } set reg2chan $arg2 if {$nb_argz==2} { set reg2nick $arg3 if {![onchan $reg2nick $chan]} { putserv "notice $nick :\002$reg2nick\002 is NOT on $chan." return 0 } set t_host [maskhost [getchanhost $reg2nick]] if {[string index $t_host 2]!="*"} { set reg2host "*!*[string range $t_host 2 end]" } else { set reg2host "*![string range $t_host 2 end]" } set reg2pass "" } if {$nb_argz==3} { if {[string match *!*@*.* $arg4]} { set reg2nick $arg3 set reg2host $arg4 set reg2pass "" } else { set reg2nick $arg3 if {![onchan $reg2nick $chan]} { putserv "notice $nick :\002$reg2nick\002 is NOT on $chan." return 0 } set t_host [maskhost [getchanhost $reg2nick]] if {[string index $t_host 2]!="*"} { set reg2host "*!*[string range $t_host 2 end]" } else { set reg2host "*![string range $t_host 2 end]" } set reg2pass $arg5 } } if {$nb_argz==4} { set reg2nick $arg3 set reg2host $arg4 Guillaume Tournand <guillaume@tournand.com> September 2003 194/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project set reg2pass $arg5 } if {[validchan [strlwr $reg2chan]]} { putserv "notice $nick :hrmm.. you st00pid admin.. I'm already auto-joining $reg2chan." return 0 } putserv "notice $nick :Registering $reg2chan..." channel add $reg2chan {-bitch -stopnethack -statuslog -autoop -greet -revenge} channel set $reg2chan chanmode +n channel set $reg2chan flood-chan 0:0 save putserv "notice $nick :-- Checking user..." if {[nick2hand $reg2nick]!="*"} { if {[nick2hand $reg2nick]==""} { if {[validuser $reg2nick]} { putserv "notice $nick :-- $reg2nick is known as [nick2hand $reg2nick $chan]" chattr [nick2hand $reg2nick] |$chanownermodes $reg2chan putserv "notice $nick :-- Password not modified for known user." set passnomodif 1 } else { adduser $reg2nick $reg2host putserv "notice $nick :-- Added user $reg2nick ($reg2host)" chattr $reg2nick |$chanownermodes $reg2chan if {$reg2pass!=""} {setuser $reg2nick PASS $reg2pass} set passnomodif 0 } } else { putserv "notice $nick :-- $reg2nick is known as [nick2hand $reg2nick]" chattr [nick2hand $reg2nick] |$chanownermodes $reg2chan putserv "notice $nick :-- Password not modified for known user." set passnomodif 1 } } else { if {[validuser $reg2nick]} { putserv "notice $nick :\002WARNING\002 A USER ALREADY EXISTS BY THAT NAME. YOU MUST ADD MANUALLY THE 500." set passnomodif 1 } else { adduser $reg2nick $reg2host putserv "notice $nick :-- Added user $reg2nick ($reg2host)" chattr $reg2nick |$chanownermodes $reg2chan if {$reg2pass!=""} {setuser $reg2nick PASS $reg2pass} set passnomodif 0 } } save if {[nick2hand $reg2nick $chan]==$reg2nick} { puthelp "notice $reg2nick :Channel \002$reg2chan\002 has been registered to you ($reg2host)." puthelp "notice $reg2nick :You are now level \002500\002 on $reg2chan." if {$reg2pass==""} { if {$passnomodif==0} { puthelp "notice $reg2nick :You dont have a password set, please :" puthelp "notice $reg2nick :1): /msg $botnick pass \002your_new_password\002, to set a password then," puthelp "notice $reg2nick :2): /msg $botnick login $reg2chan \002your_newly_set_password\002, to login." } } else { puthelp "notice $reg2nick :Password has been pre-defined." puthelp "notice $reg2nick :use : /msg $botnick login $reg2chan $reg2pass, to login." puthelp "notice $reg2nick :change your password with : /msg $botnick newpass $reg2pass \002your_new_password\002." } puthelp "notice $reg2nick :Enjoy !@#." Guillaume Tournand <guillaume@tournand.com> September 2003 195/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project putserv "notice $nick :-- Told user $reg2nick the good news... ;P" } save if {$logonotice==1} {putserv "notice @$homechan :\002(\002REG\002)\002: $reg2chan to $reg2nick ($reg2host) from $nick!$uhost."} putserv "notice $nick :-- Registered $reg2chan to $reg2host ($reg2nick)." return 0 } if {[strlwr $arg1]=="purge"} { if {$level<1000} { putserv "notice $nick :$denymsg" return 0 } if {$arg2==""} { putserv "notice $nick :Syntax: \002$botnick purge <#channel> \[reason\]\002" return 0 } if {![validchan $arg2]} { putserv "notice $nick :Invalid channel \002$arg2\002: not monitored." return 0 } set dachan [strlwr $arg2] if {$dachan==[strlwr $homechan]} { putserv "kick $chan $nick :You are so dumb... THIS IS MY HOME CHANNEL YOU BASTARD !@# ;P" return 0 } if {$arg3==""} { set purge_reason "\002NO REASON\002" } else { set purge_reason "$arg3 $arg4 $arg5" } set users_to_clean [userlist |f $dachan] set nb_users [llength $users_to_clean] set cleaned_1 0 set cleaned_50 0 set cleaned_200 0 set cleaned_400 0 set cleaned_500 0 set your_lvl $level set da_chanz [channels] set l_dachanz [llength $da_chanz] putquick "notice $dachan :\002WARNING\002: Channel being purged by $nick!$uhost because : $purge_reason." for {set cp 0} {$cp<$nb_users} {incr cp} { set da_user [lindex $users_to_clean $cp] set ret [do_check_level $da_user $dachan "*"] if {$level2==500} {incr cleaned_500} if {$level2==400} {incr cleaned_400} if {$level2==200} {incr cleaned_200} if {$level2==50} {incr cleaned_50} if {$level2==1 && [strlwr $da_user]!="tchanusr"} {incr cleaned_1} delchanrec $da_user $dachan set remove_handle 1 for {set ccp 0} {$ccp<$l_dachanz} {incr ccp} { set ret [do_check_level $da_user [lindex $da_chanz $ccp] "*"] if {$level2>0} { set remove_handle 0 } } if {[strlwr $da_user]=="tchanusr"} { set remove_handle 0 } if {$remove_handle==1} { deluser $da_user if {$debug==1} {putlog "PURGE:-- Cleaned $da_user/$dachan (REMOVED HANDLE)"} } else { chattr $da_user -$authflag if {$debug==1} {putlog "PURGE:-- Cleaned $da_user/$dachan (HANDLE HAS OTHER ACCESSES)"} } } save Guillaume Tournand <guillaume@tournand.com> September 2003 196/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project set level $your_lvl set total_cusers [expr $cleaned_500+$cleaned_400+$cleaned_200+$cleaned_50+$cleaned_1] if {$total_cusers>1} { set addycusers "s" } else { set addycusers "" } puthelp "notice $nick :Cleaned \002$total_cusers\002 user$addycusers (\002$cleaned_500\002:500, \002$cleaned_400\002:400, \002$cleaned_200\002:200, \002$cleaned_50\002:50, \002$cleaned_1\002:1) from $dachan." putserv "privmsg $dachan :snif.." channel remove $dachan save set tmpfn "maxusers_[string tolower $dachan].dat" catch { exec rm -f $tmpfn putserv "notice $nick :Wiped MAXUSERS infos for $dachan." } if {$logonotice==1} {putserv "notice @$homechan :\002(\002PURGE\002)\002: $dachan from $nick!$uhost \[$purge_reason\]"} puthelp "notice $nick :Channel \002$dachan\002 has been purged." return 0 } if {[strlwr $arg1]=="chaninfo"} { if {$arg2==""} { set dachan $chan } else { set dachan $arg2 } if {![validchan $dachan]} { putserv "notice $nick :This channel is not registered with me." return 0 } set regd2nick [lindex [userlist |+n $dachan] 0] if {$regd2nick==""} { putserv "notice $nick :$dachan has no registration information. Maybe an ADMIN or a TEMPORARY channel." return 0 } set regd2host [lindex [getuser $regd2nick HOSTS] 0] set opt_nick [hand2nick $regd2nick] set opt_rnick "" if {$opt_nick!=""} {set opt_rnick " ($opt_nick)"} putserv "notice $nick :$dachan is registered to \002$regd2nick\002$opt_rnick ($regd2host)." return 0 } if {[strlwr $arg1]=="listusers"} { if {$level<400} { putserv "notice $nick :$denymsg" return 0 } set limitlist 1 set dalimit 10 set limitlevel 1 if {$arg2!=""} { if {$arg2=="1" || $arg2=="50" || $arg2=="200" || $arg2=="400" || $arg2=="500" || $arg2=="501" || $arg2=="800" || $arg2=="999" || $arg2=="1000" || $arg2=="full"} { set dachan $chan if {$arg2!="full"} { set limitlevel $arg2 } else { set arg3 "" set limitlist 0 } if {$arg3=="full"} { set limitlist 0 } } else { if {$level>500} { if {![validchan $arg2]} { Guillaume Tournand <guillaume@tournand.com> September 2003 197/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project putserv "notice $nick :Channel \002$arg2\002 is not registered." return 0 } } else { putserv "notice $nick :You can only \002listusers\002 on current channel, without argument." return 0 } set dachan $arg2 } } else { set dachan $chan } if {$arg3=="1" || $arg3=="50" || $arg3=="200" || $arg3=="400" || $arg3=="500" || $arg3=="501" || $arg3=="800" || $arg3=="999" || $arg3=="1000" || $arg3=="full"} { if {$arg3!="full"} { set limitlevel $arg3 } else { set $arg4 "" set limitlist 0 } if {$arg4=="full"} { set limitlist 0 } } else { if {$arg3!=""} { putserv "notice $nick :Invalid argument \002$arg3\002." return 0 } } set all_users [userlist |f $dachan] set nb_users [llength $all_users] if {$limitlist==1} { set limit "(truncated to $dalimit results, use \002full\002 to force.)" } else { set limit "(display all)" } if {$limitlevel>1} { set levell "(levels >= $limitlevel) " } else { set levell "(all users) " } set nb_displayed 0 puthelp "notice $nick :Listing users for \002$dachan\002 $levell$limit" for {set usr 0} {$usr<$nb_users} {incr usr} { set dauser [lindex $all_users $usr] set ret [do_check_level $dauser $dachan "*"] set dalevel $level2 if {$ret==$dalevel} {set daauth "+"} else {set daauth ""} set dahost "\037Unknown host\037" catch { set dahost [lindex [getuser $dauser HOSTS] 0] } set danick [hand2nick $dauser] if {$danick==""} { set online "\[NOT ONLINE\]" } else { set online "\[ONLINE AS: \002$danick\002\]" } if {$dalevel>=$limitlevel} { puthelp "notice $nick :$daauth\002$dauser\002, $dalevel, $dahost - $online" incr nb_displayed } if {$limitlist==1} { if {$nb_displayed>=$dalimit} { break } } } puthelp "notice $nick :*** End of listusers (\002$nb_displayed\002 total match)." return 0 } if {[strlwr $arg1]=="rem"} { Guillaume Tournand <guillaume@tournand.com> September 2003 198/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if {$level<400} { putserv "notice $nick :$denymsg" return 0 } if {$arg2==""} { if {$level>500} { putserv "notice $nick :Syntax: $botnick rem <nick|handle> \[all\]" } else { putserv "notice $nick :Syntax: $botnick rem <nick|handle>" } return 0 } set deletall 0 if {[onchan $arg2 $chan]} { set t_hand [nick2hand $arg2 $chan] } else { set t_hand $arg2 } if {$t_hand=="*" || ![validuser $t_hand]} { putserv "notice $nick :User \002$arg2\002 is unknown, sorry." return 0 } set your_level $level set uuu [do_check_level $t_hand $chan "*"] set torem_level $level2 if {$torem_level==0 && [strlwr $arg3]!="all"} { putserv "notice $nick :This user doesn't have any access to $chan." if {$your_level>500} { putserv "notice $nick :Use \002$botnick rem $arg2 all\002 to force." } return 0 } if {[nick2hand $nick $chan]==$t_hand} { putserv "notice $nick :I wouldn't do that if I were you....(trying to delete yourself, uh?!)" return 0 } if {$torem_level>=$your_level} { putserv "notice $nick :You cannot REMOVE a user with an access EQUAL or HIGHER than yours, sorry." return 0 } if {[strlwr $arg3]!=""} { if {$your_level>500} { if {[strlwr $arg3]=="all"} { set deletall 1 } else { putserv "notice $nick :Syntax: $botnick rem <nick|handle> \[all\]" return 0 } } else { putserv "notice $nick :You cannot remove this user's access on ALL channels." return 0 } } else { set deletall 0 } if {$torem_level>500} { catch { boot $t_hand REMOVED USER FROM PARTY LINE } deluser $t_hand save if {[nick2hand $arg2]!=""} { putquick "MODE $chan -vo $arg2 $arg2" } if {[nick2hand $arg2]=="*" || [nick2hand $arg2]==""} { set daremnick "+none+" } else { set daremnick $arg2 Guillaume Tournand <guillaume@tournand.com> September 2003 199/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project } putserv "notice $nick :I removed user \002$t_hand\002 (\037Nick\037:$daremnick,\037Level\037:$torem_level). Done" if {$logonotice} {putserv "notice @$homechan :\002(\002REM\002)\002: $t_hand ($daremnick) from $nick!$uhost on $chan (-ADMIN)."} return 0 } else { chattr $t_hand -L chattr $t_hand |-afmnov $chan delchanrec $t_hand $chan set zechanz [channels] set zechanz_l [llength $zechanz] set chan_still_access "" for {set xx 0} {$xx<$zechanz_l} {incr xx} { set zzz [do_check_level $t_hand [lindex $zechanz $xx] "*"] if {$level2>0} { set chan_still_access "$chan_still_access [lindex $zechanz $xx]" } } if {$chan_still_access==""} { catch { boot $t_hand REMOVED USER FROM PARTY LINE } deluser $t_hand save if {[nick2hand $arg2]!=""} { putquick "MODE $chan -vo $arg2 $arg2" } if {[nick2hand $arg2]=="*" || [nick2hand $arg2]==""} { set daremnick "+none+" } else { set daremnick $arg2 } putserv "notice $nick :I removed user \002$t_hand\002 (\037Nick\037:$daremnick) access \002$torem_level\002 on $chan." putserv "notice $nick :The user didn't had any access on other channels, so user has been deleted." if {$logonotice} {putserv "notice @$homechan :\002(\002REM\002)\002: $t_hand ($daremnick) from $nick!$uhost on $chan (-USER)."} return 0 } else { if {$deletall==0} { save if {[nick2hand $arg2]!=""} { putquick "MODE $chan -vo $arg2 $arg2" } if {[nick2hand $arg2]=="*" || [nick2hand $arg2]==""} { set daremnick "+none+" } else { set daremnick $arg2 } putserv "notice $nick :I removed user \002$t_hand\002 (\037Nick\037:$daremnick) access \002$torem_level\002 on $chan." putserv "notice $nick :The user still has access to those channels: $chan_still_access." if {$logonotice} {putserv "notice @$homechan :\002(\002REM\002)\002: $t_hand ($daremnick) from $nick!$uhost on $chan (-ACCESS)."} return 0 } else { catch { boot $t_hand REMOVED USER FROM PARTY LINE } deluser $t_hand save if {[nick2hand $arg2]!=""} { putquick "MODE $chan -vo $arg2 $arg2" } if {[nick2hand $arg2]=="*" || [nick2hand $arg2]==""} { set daremnick "+none+" } else { set daremnick $arg2 } Guillaume Tournand <guillaume@tournand.com> September 2003 200/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project putserv "notice $nick :I removed user \002$t_hand\002 (\037Nick\037:$daremnick) access \002$torem_level\002 on $chan." putserv "notice $nick :The user still had accesses to other channels, but \002ALL\002 flag was specified. User DELETED." if {$logonotice} {putserv "notice @$homechan :\002(\002REM\002)\002: $t_hand ($daremnick) from $nick!$uhost on $chan (-USER, ALL OVERRIDE)."} return 0 } } } } if {[strlwr $arg1]=="debug"} { if {$level==1000} { if {$debug==0} { set dbg_state "OFF" } else { set dbg_state "ON" } if {$arg2==""} { putserv "notice $nick :Syntax: \002$botnick debug <on|off>\002 (currently:\002$dbg_state\002)." return 0 } else { if {[strlwr $arg2]=="on"} { if {$dbg_state=="ON"} { putserv "notice $nick :Debug is already \002ON\002." return 0 } else { set debug 1 save putserv "notice $nick :Debug is now \002ON\002." if {$logonotice==1} {putserv "notice @$homechan :\002(\002DEBUG\002)\002: Turned \002ON\002 by $nick!$uhost."} return 0 } } if {[strlwr $arg2]=="off"} { if {$dbg_state=="OFF"} { putserv "notice $nick :Debug is already \002OFF\002." return 0 } else { set debug 0 save putserv "notice $nick :Debug is now \002OFF\002." if {$logonotice==1} {putserv "notice @$homechan :\002(\002DEBUG\002)\002: Turned \002OFF\002 by $nick!$uhost."} return 0 } } putserv "notice $nick :Syntax: \002$botnick debug <on|off>\002 (currently:\002$dbg_state\002)." } return 0 } else { putserv "notice $nick :$denymsg" return 0 } } if {[strlwr $arg1]=="smokes"} { if {[strlwr $arg2]=="ganja"} { if {$level>=200} { if {![isop $botnick $chan]} { putserv "notice $nick :\002I'm not opped in $chan :(((((\002" return 0 } if {[isop $nick $chan]} { putserv "privmsg $chan :\001ACTION shakes \002$nick\002 !!\001" putserv "mode $chan -o+o-o+o $nick $nick $nick $nick" putserv "privmsg $chan :\002Yeh\002! dude ;]-==~~~" return 0 } Guillaume Tournand <guillaume@tournand.com> September 2003 201/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if {![isop $nick $chan]} { putserv "notice $chan :Smoking ganja is kewl ;))" putserv "mode $chan +o $nick" putserv "notice @$chan :Welcome \002$nick\002, have a blunt !!" putserv "notice $chan :Liberty for hemp! Hemp for liberty!" return 0 } } else { if {![isop $botnick $chan]} { putserv "notice $nick :\002I'm not opped in $chan :(((((\002" return 0 } if {[isop $nick $chan]} { putserv "privmsg $chan :\001ACTION shakes \002$nick\002 !!\001" putserv "mode $chan -o+o-o+o $nick $nick $nick $nick" putserv "privmsg $chan :\002Yeh\002! dude ;]-==~~~" return 0 } if {![isop $nick $chan]} { putserv "notice $chan :Smoking ganja is kewl ;))" putserv "mode $chan +o-o+o-o $nick $nick $nick $nick" putserv "privmsg $chan :\001ACTION *grins* at $nick\001" return 0 } } } } if {[strlwr $arg1]=="cycle"} { if {$level>=400} { putserv "notice $nick :Cycling $chan..." if {$logonotice==1} {putserv "notice @$homechan :\002(\002CYCLE\002)\002: $chan from $nick!$uhost."} putserv "PART $chan :\002brb\002" return 0 } else { putserv "notice $nick :$denymsg" return 0 } } if {[strlwr $arg1]=="cycleall"} { if {$level>=1000} { putserv "notice $nick :Cycling all channels I'm on..." putserv "notice @$homechan :\002(\002CYCLEALL\002)\002: from $nick!$uhost." putserv "JOIN 0" return 0 } else { putserv "notice $nick :$denymsg" return 0 } } if {[strlwr $arg1]=="op"} { if {$level>=200} { if {$arg2==""} {set to_op $nick} else {set to_op $arg2} if {![isop $botnick $chan]} { putserv "notice $nick :\002I'm not opped in $chan :(((((\002" return 0 } if {[isop $to_op $chan]} { putserv "notice $nick :\002$to_op is already an OP in $chan.\002" return 0 } if {![onchan $to_op $chan]} { putserv "notice $nick :\002$to_op is NOT on $chan :(.\002" return 0 } if {[lindex [channel info $chan] 17]=="+bitch"} { set sop 1 } else { set sop 0 } if {$sop==1} { set yourlevel $level Guillaume Tournand <guillaume@tournand.com> September 2003 202/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if {[nick2hand $to_op $chan]!="" && [nick2hand $to_op $chan]!="*"} { set rett [do_check_level [nick2hand $to_op $chan] $chan "*"] } else { set level2 0 } if {$level2<200} { set no_doop 1 } else { set no_doop 0 } if {$no_doop==1} { if {$yourlevel>500} { putserv "notice $nick :\002WARNING\002 You are an admin, but .. $to_op should not be opped while in strictop mode (nouser)" } else { putserv "notice $nick :\002STRICTOP\002 is set to \002ON\002 - You can only op known levels 200+ ($to_op : nouser)" return 0 } } } putserv "privmsg $chan :\001ACTION pulls up \002$to_op\002\001" if {$logonotice==1} {putserv "notice @$homechan :\002(\002OP\002)\002: $chan +o $to_op from $nick!$uhost."} putserv "mode $chan +o $to_op" return 0 } else { putserv "notice $nick :$denymsg" return 0 } } if {[strlwr $arg1]=="dccme"} { if {$level<200} { putserv "notice $nick :$denymsg" return 0 } if {$logonotice==1} {putserv "notice @$homechan :\002(\002DCCME\002)\002: from $nick!$uhost on $chan."} listen $userport all putserv "PRIVMSG $nick :\001DCC CHAT chat [myip] $userport\001" return 0 } if {[strlwr $arg1]=="backup"} { if {$level<800} { putserv "notice $nick :$denymsg" return 0 } if {$backup_prog==""} { putserv "notice $nick :Backup is impossible: MISSING FILE, please download \037http://nighty.roots.org/download/online_backup.sh\037" return 0 } save putserv "notice $nick :Backing up files...." set chn_list [channels] set l_chn_list [llength $chn_list] set bckp_time [unixtime] set motd_file $motd set user_file $userfile set note_file $notefile set conf_file [string range $config 2 end] set chan_file $chanfile if {[catch { exec $backup_prog $bckp_time $motd_file $user_file $note_file $conf_file $chan_file }]==1} { putserv "notice $nick :Error while saving. Contact the administrator of the machine where the bot is hosted." return 0 } else { putserv "notice $nick :Saved file \002BACKUP-$bckp_time.tar.gz\002." if {$logonotice==1} {putserv "notice @$homechan :\002(\002BACKUP\002)\002: From $nick!$uhost."} } Guillaume Tournand <guillaume@tournand.com> September 2003 203/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project return 0 } if {[strlwr $arg1]=="userhost"} { if {$userhost_ok!=0} { if {$arg2==""} { set hostmask1 [getchanhost $nick $chan] set hostmask2 "$nick!$hostmask1" set hostmask [maskhost $hostmask2] if {[string index $hostmask 2]!="*"} {set hostmask "*!*[string range $hostmask 2 end]"} else { set hostmask "*![string range $hostmask 2 end]"} putserv "notice $nick :your user@host is : $hostmask" return 0 } if {$arg2!=""} { if {$level<50} { putserv "notice $nick :You are only allowed to use 'userhost' to yourself.(Your level is too low)" return 0 } if {![onchan $arg2 $chan]} { putserv "notice $nick :\002$arg2\002 is NOT on $chan right now :(" return 0 } set hostmask1 [getchanhost $arg2 $chan] set hostmask2 "$arg2!$hostmask1" set hostmask [maskhost $hostmask2] if {[string index $hostmask 2]!="*"} {set hostmask "*!*[string range $hostmask 2 end]"} else { set hostmask "*![string range $hostmask 2 end]"} putserv "notice $arg2 :your user@host is : $hostmask" putserv "notice $nick :Sent $hostmask to \002$arg2\002." putserv "notice $arg2 :hostmask sent to you by \002$nick\002" return 0 } } } if {[strlwr $arg1]=="deop"} { if {$arg2==""} {set to_deop $nick} else {set to_deop $arg2} set bad 0 if {[strlwr $to_deop]!=[strlwr $nick]} { if {$level<200} { putserv "notice $nick :$denymsg" return 0 } } if {![isop $botnick $chan]} { putserv "notice $nick :\002I'm not opped in $chan :(((((\002" return 0 } if {![onchan $to_deop $chan]} { putserv "notice $nick :\002$to_deop is NOT on $chan :(.\002" return 0 } if {![isop $to_deop $chan]} { putserv "notice $nick :\002$to_deop is already DEOPPED in $chan.\002" return 0 } if {[strlwr $to_deop]==[strlwr $botnick]} {set bad 1} if {[strlwr $to_deop]==[strlwr $bigcheese]} {set bad 1} if {[strlwr $nick]==[strlwr $to_deop]} {set bad 0} if {$bad==1} { if {$logonotice==1} {putserv "notice @$homechan :\002(\002DEOP FAILED\002)\002: $chan -o $to_deop (VIP) from $nick!$uhost."} putserv "notice $nick :\002ERROR\002: User \002$to_deop\002 is VIP." return 0 } Guillaume Tournand <guillaume@tournand.com> September 2003 204/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if {$logonotice==1} {putserv "notice @$homechan :\002(\002DEOP\002)\002: $chan -o $to_deop from $nick!$uhost."} putserv "mode $chan -o $to_deop" return 0 } if {[strlwr $arg1]=="devoice"} { if {$arg2==""} {set to_devoice $nick} else {set to_devoice $arg2} set bad 0 if {[strlwr $to_devoice]!=[strlwr $nick]} { if {$level<50} { putserv "notice $nick :$denymsg" return 0 } } if {![isop $botnick $chan]} { putserv "notice $nick :\002I'm not opped in $chan :(((((\002" return 0 } if {![onchan $to_devoice $chan]} { putserv "notice $nick :\002$to_devoice is NOT on $chan :(.\002" return 0 } if {![isvoice $to_devoice $chan]} { putserv "notice $nick :\002$to_devoice is already UNVOICED in $chan.\002" return 0 } if {[strlwr $to_devoice]==[strlwr $botnick]} {set bad 1} if {[strlwr $to_devoice]==[strlwr $bigcheese]} {set bad 1} if {[strlwr $nick]==[strlwr $to_devoice]} {set bad 0} if {$bad==1} { if {$logonotice==1} {putserv "notice @$homechan :\002(\002DEVOICE FAILED\002)\002: $chan -v $to_deop (VIP) from $nick!$uhost."} putserv "notice $nick :\002ERROR\002: User \002$to_devoice\002 is VIP." return 0 } if {$logonotice==1} {putserv "notice @$homechan :\002(\002DEVOICE\002)\002: $chan -v $to_devoice from $nick!$uhost."} putserv "mode $chan -v $to_devoice" return 0 } if {[strlwr $arg1]=="voice"} { if {$level>=50} { if {$arg2==""} {set to_voice $nick} else {set to_voice $arg2} if {![isop $botnick $chan]} { putserv "notice $nick :\002I'm not opped in $chan :(((((\002" return 0 } if {[isvoice $to_voice $chan]} { putserv "notice $nick :\002$to_voice is already VOICED in $chan.\002" return 0 } if {![onchan $to_voice $chan]} { putserv "notice $nick :\002$to_voice is NOT on $chan :(.\002" return 0 } putserv "privmsg $chan :\001ACTION slaps \002$to_voice\002 a Hi-5\001" if {$logonotice==1} {putserv "notice @$homechan :\002(\002VOICE\002)\002: $chan +v $to_voice from $nick!$uhost."} putserv "mode $chan +v $to_voice" return 0 } else { putserv "notice $nick :$denymsg" return 0 } } if {[strlwr $arg1]=="kickme"} { if {$level<50} { putserv "notice $nick :$denymsg" Guillaume Tournand <guillaume@tournand.com> September 2003 205/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project return 0 } if {$arg2==""} { set reason "Requested!!!" } else { set reason "$arg2 $arg3 $arg4 $arg5" } if {$logonotice==1} {putserv "notice @$homechan :\002(\002KICKME\002)\002: on $chan from $nick!$uhost."} putserv "kick $chan $nick :$reason" return 0 } if {[strlwr $arg1]=="kick"} { if {$arg2==""} { putserv "notice $nick :Syntax: $botnick kick <nickname> \[reason\]" return 0 } else { set to_kick $arg2 } set bad 0 if {$to_kick!=$nick} { if {$level<200} { putserv "notice $nick :$denymsg" return 0 } } if {![isop $botnick $chan]} { putserv "notice $nick :\002I'm not opped in $chan :(((((\002" return 0 } if {![onchan $to_kick $chan]} { putserv "notice $nick :\002$to_kick is NOT on $chan :(.\002" return 0 } if {[strlwr $to_kick]==[strlwr $botnick]} {set bad 1} if {[strlwr $to_kick]==[strlwr $bigcheese]} {set bad 1} if {[strlwr $nick]==[strlwr $to_kick]} {set bad 0} if {$bad==1} { if {$logonotice==1} {putserv "notice @$homechan :\002(\002KICK FAILED\002)\002: $chan/$to_kick (VIP) from $nick!$uhost."} putserv "notice $nick :\002ERROR\002: User \002$to_kick\002 is a VIP." return 0 } if {$arg3!=""} {set reason "$arg3 $arg4 $arg5"} else {set reason $defkick_reason} if {$logonotice==1} {putserv "notice @$homechan :\002(\002KICK\002)\002: $to_kick/$chan ($reason) from $nick!$uhost."} putserv "kick $chan $to_kick :$reason" return 0 } ########################## # GLOBAL HELP SECTION ########################## if {[strlwr $arg1]=="help"} { if {$arg2==""} { puthelp "notice $nick : \002 HELP \002 - Your current level is \002$level\002 which gives you access to :" if {$level==1000} { puthelp "notice $nick :\002Level 1000\002:- die, cycleall, debug, rehash, *raw, chattr, purge, setnick, bootnick." } if {$level>=999} { puthelp "notice $nick :\002Level 0999\002:- join, part, reg, resetlogin, clearsuspend." } if {$level>=800} { puthelp "notice $nick :\002Level 0800\002:- hop, console, *say, *act, uhostcmd, backup." } Guillaume Tournand <guillaume@tournand.com> September 2003 206/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if {$level>=501} { puthelp "notice $nick :\002Level 0501\002:- chanlist, gban, sgban, remgban, *automsg, (maxusers), (cstat)." } if {$level>=500} { puthelp "notice $nick :\002Level 0500\002:- *clearmode, chanmode, (listbans)." } if {$level>=400} { puthelp "notice $nick :\002Level 0400\002:- pban, spban, rempban, add, rem, listusers, cycle, floodpro, modlevel, massdeop, save, setauto." } if {$level>=200} { puthelp "notice $nick :\002Level 0200\002:- op, massop, deop, kick, listbans, fuck, suspend, unsuspend, dccme." } if {$level>=50} { if {$userhost_ok!=0} { set cmd_uhost2 ", (userhost)" } else { set cmd_uhost2 "" } puthelp "notice $nick :\002Level 0050\002:- *inv, *key, voice, devoice, kickme, topic$cmd_uhost2." } if {$level>=1} { puthelp "notice $nick :\002Level 0001\002:- status, cstat, clogin, whois, version, date, time, *newpass, *logout." } if {$userhost_ok!=0} { set cmd_uhost ", userhost," } else { set cmd_uhost "," } puthelp "notice $nick :\002Level 0000\002:- admin, credits, verify, *login$cmd_uhost uptime, maxusers, chaninfo, *ident." if {$level>=1} { puthelp "notice $nick :-- Commands with a \002*\002 are \002/msg\002 commands. (responding to $trignick)" } else { puthelp "notice $nick :-- Commands with a \002*\002 are \002/msg\002 commands." } return 0 } else { ########################## # DETAILED HELP SECTION ########################## set help_cmd [strupr $arg2] if {$level==1000} { if {$help_cmd=="DIE"} { puthelp "notice $nick : \0021000\002 HELP ON \002DIE\002 - Min. Level: " puthelp "notice $nick :- Syntax: \002$botnick die \[reason\]\002 - makes the bot die." return 0 } if {$help_cmd=="RAW"} { puthelp "notice $nick : \0021000\002 HELP ON \002RAW\002 - Min. Level: " puthelp "notice $nick :- Syntax: \002/msg $botnick raw <string>\002 - sends <string> directly to server." return 0 } if {$help_cmd=="DEBUG"} { Guillaume Tournand <guillaume@tournand.com> September 2003 207/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project puthelp "notice $nick : \0021000\002 HELP ON \002DEBUG\002 - Min. Level: " puthelp "notice $nick :- Syntax: \002$botnick debug \[on|off\]\002 - Turns the $homechan's debug ON or OFF." return 0 } if {$help_cmd=="CYCLEALL"} { puthelp "notice $nick : HELP ON \002CYCLEALL\002 - Min. Level: \0021000\002 " puthelp "notice $nick :- Syntax: \002$botnick cycleall\002 - Makes the bot cycle *ALL* channels he is in." return 0 } if {$help_cmd=="SETNICK"} { puthelp "notice $nick : \0021000\002 HELP ON \002SETNICK\002 - Min. Level: " puthelp "notice $nick :- Syntax: \002$botnick setnick <new nickname> \[time in seconds\]\002 - Makes the bot change his nickname." puthelp "notice $nick :- The optional \[time in seconds\] argument makes the bot revert his nick back to \002$boot_nick\002 after that ammount of time (>10)." return 0 } if {$help_cmd=="BOOTNICK"} { puthelp "notice $nick : HELP ON \002BOOTNICK\002 - Min. Level: \0021000\002 " puthelp "notice $nick :- Syntax: \002$botnick bootnick\002 - Makes the bot change his nickname to the one he had upon loading." return 0 } if {$help_cmd=="REHASH"} { puthelp "notice $nick : HELP ON \002REHASH\002 - Min. Level: \0021000\002 " puthelp "notice $nick :- Syntax: \002/msg $botnick rehash\002 Reloads config file." return 0 } if {$help_cmd=="CHATTR"} { puthelp "notice $nick : HELP ON \002CHATTR\002 - Min. Level: \0021000\002 " puthelp "notice $nick :- Syntax: \002$botnick chattr <handle> <attr. change> \[channel\]\002 - Changes flags for GLOBAL options or LOCALLY for \[channel\] if specified." puthelp "notice $nick :- Examples: \002$botnick chattr foo +n\002 or \002$botnick chattr foo2 -m #channel\002." return 0 } if {$help_cmd=="PURGE"} { puthelp "notice $nick : HELP ON \002PURGE\002 - Min. Level: \0021000\002 " puthelp "notice $nick :- Syntax: \002$botnick purge <#channel> \[reason\]\002 - Removes <#channel> from $botnick's auto-join list." puthelp "notice $nick : This also CLEANS the user database by removing the users who only had accesses on that channel." return 0 } } if {$level>=999} { if {$help_cmd=="REG"} { puthelp "notice $nick : \0020999\002 HELP ON \002REG\002 - Min. Level: " puthelp "notice $nick :- Syntax: \002$botnick reg <#channel> <nick> <hostmask> \[password\]\002 - Adds <#channel> to $botnick's auto-join list (*NOT* removable with 'PART')." return 0 } if {$help_cmd=="JOIN"} { puthelp "notice $nick : HELP ON \002JOIN\002 - Min. Level: \0020999\002 " Guillaume Tournand <guillaume@tournand.com> September 2003 208/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project puthelp "notice $nick :- Syntax: \002$botnick join <#channel>\002 Adds <#channel> to $botnick's auto-join list (removable with 'PART')." return 0 } if {$help_cmd=="PART"} { puthelp "notice $nick : HELP ON \002PART\002 - Min. Level: \0020999\002 " puthelp "notice $nick :- Syntax: \002$botnick part \[#channel\]\002 Removes \[#channel\] from $botnick's auto-join list (can only remove channels added with 'JOIN')." puthelp "notice $nick :- If no channel is specified, current channel is used." return 0 } if {$help_cmd=="RESETLOGIN"} { puthelp "notice $nick : HELP ON \002RESETLOGIN\002- Min. Level: \0020999\002 " puthelp "notice $nick :- Syntax: \002$botnick resetlogin\002 - Clears *ALL* users authentications! (needs a /msg $botnick login <#channel> <pass> again)." return 0 } if {$help_cmd=="CLEARSUSPEND"} { puthelp "notice $nick : HELP ON \002CLEARSUSPEND\002- Min. Level: \0020999\002 " puthelp "notice $nick :- Syntax: \002$botnick clearsuspend\002 Cancels *ALL* current active users suspensions." return 0 } } if {$level>=800} { if {$help_cmd=="CONSOLE"} { puthelp "notice $nick : \0020800\002 HELP ON \002CONSOLE\002 - Min. Level: " puthelp "notice $nick :- Syntax: \002$botnick console \[on|off\]\002 Turns the $homechan's console ON or OFF." return 0 } if {$help_cmd=="UHOSTCMD"} { puthelp "notice $nick : HELP ON \002UHOSTCMD\002 - Min. Level: \0020800\002 " puthelp "notice $nick :- Syntax: \002$botnick uhostcmd \[on|off\]\002 - ENABLES (on) or DISABLES (off) the USERHOST command from the bot." return 0 } if {$help_cmd=="BACKUP"} { puthelp "notice $nick : HELP ON \002BACKUP\002 - Min. Level: \0020800\002 " puthelp "notice $nick :- Syntax: \002$botnick backup\002 - Backups users/channels/maxusers/notes/motd/conf ... just in case." return 0 } if {$help_cmd=="SAY"} { puthelp "notice $nick : HELP ON \002SAY\002 - Min. Level: \0020800\002 " puthelp "notice $nick :- Syntax: \002/msg $botnick say <#channel> <string>\002 - makes the bot say <string> on <#channel>." return 0 } if {$help_cmd=="HOP"} { puthelp "notice $nick : HELP ON \002HOP\002 - Min. Level: \0020800\002 " puthelp "notice $nick :- Syntax: \002$botnick hop <server> \[port\]\002 - makes the bot on server <server> with optionnal \[port\] (or 6667)." return 0 } if {$help_cmd=="ACT"} { Guillaume Tournand <guillaume@tournand.com> September 2003 209/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project puthelp "notice $nick : \0020800\002 HELP ON \002ACT\002 - Min. Level: " puthelp "notice $nick :- Syntax: \002/msg $botnick act <#channel> <string>\002 - makes the bot do /me <string> on <#channel>." return 0 } } if {$level>=501} { if {$help_cmd=="CHANLIST"} { puthelp "notice $nick : \0020501\002 HELP ON \002CHANLIST\002 - Min. Level: " puthelp "notice $nick :- Syntax: \002$botnick chanlist\002 - Gives infos about what channels the bot is monitoring." return 0 } if {$help_cmd=="SGBAN"} { puthelp "notice $nick : HELP ON \002SGBAN\002 - Min. Level: \0020501\002 " puthelp "notice $nick :- Syntax: \002$botnick sgban <ban mask> \[reason\]\002 - Maintains a permanent \002sticky\002 ban of <ban mask> on *ALL* channels for reason \[reason\]." return 0 } if {$help_cmd=="GBAN"} { puthelp "notice $nick : HELP ON \002GBAN\002 - Min. Level: \0020501\002 " puthelp "notice $nick :- Syntax: \002$botnick gban <ban mask> \[reason\]\002 - Maintains a permanent ban of <ban mask> on *ALL* channels for reason \[reason\]." return 0 } if {$help_cmd=="REMGBAN"} { puthelp "notice $nick : HELP ON \002REMGBAN\002 - Min. Level: \0020501\002 " puthelp "notice $nick :- Syntax: \002$botnick remgban <ban mask|number>\002 - Removes permanent/sticky global ban of <ban mask> or <number> from bot's memory." puthelp "notice $nick :- Use \002$botnick listbans\002 to view internal list." return 0 } if {$help_cmd=="AUTOMSG"} { puthelp "notice $nick : HELP ON \002AUTOMSG\002 - Min. Level: \0020501\002 " puthelp "notice $nick :- Syntax: \002/msg $botnick automsg \[on|off\]\002 - Toggles AUTO_MSG for *all* channels where defined." return 0 } } if {$level>=500} { if {$help_cmd=="CLEARMODE"} { puthelp "notice $nick : HELP ON \002CLEARMODE\002- Min. Level: \0020500\002 " puthelp "notice $nick :- Syntax: \002/msg $botnick clearmode <#channel>\002 - Clears modes on <#channel> but don't remove +tn." return 0 } if {$help_cmd=="CHANMODE"} { puthelp "notice $nick : HELP ON \002CHANMODE\002 - Min. Level: \0020500\002 " puthelp "notice $nick :- Syntax: \002$botnick chanmode <variable> <value>\002 - Sets <variable> to <value> for <#channel>." puthelp "notice $nick :$botnick help variable - To get acceptable <variable> list." return 0 } Guillaume Tournand <guillaume@tournand.com> September 2003 210/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if {$help_cmd=="VARIABLE"} { puthelp "notice $nick : Level: \0020500\002 HELP ON \002CHANMODE\002 - Min. " puthelp "notice $nick :- Acceptable <variable>:" puthelp "notice $nick :modes <value example>: +tn-k" puthelp "notice $nick :strictop <value example>: on/off" return 0 } } if {$level>=400} { if {$help_cmd=="SPBAN"} { puthelp "notice $nick : \0020400\002 HELP ON \002SPBAN\002 - Min. Level: " puthelp "notice $nick :- Syntax: \002$botnick spban <ban mask> \[reason\]\002 - Maintains a permanent \002sticky\002 ban of <ban mask> on current channel for reason \[reason\]." if {$level>500} { puthelp "notice $nick :- Level 500+ Feature: \002$botnick spban \[#channel\] <ban mask> \[reason\]\002 - Optional remote channel name." } return 0 } if {$help_cmd=="PBAN"} { puthelp "notice $nick : HELP ON \002PBAN\002 - Min. Level: \0020400\002 " puthelp "notice $nick :- Syntax: \002$botnick pban <ban mask> \[reason\]\002 - Maintains a permanent ban of <ban mask> on current channel for reason \[reason\]." if {$level>500} { puthelp "notice $nick :- Level 500+ Feature: \002$botnick pban \[#channel\] <ban mask> \[reason\]\002 - Optional remote channel name." } return 0 } if {$help_cmd=="REMPBAN"} { puthelp "notice $nick : HELP ON \002REMPBAN\002 - Min. Level: \0020400\002 " puthelp "notice $nick :- Syntax: \002$botnick rempban <ban mask|number>\002 - Removes permanent/sticky local channel ban of <ban mask> or <number> from bot's memory." if {$level>500} { puthelp "notice $nick :- Level 500+ Feature: \002$botnick rempban \[#channel\] <ban mask|number>\002 - Optional remote channel name." } puthelp "notice $nick :- Use \002$botnick listbans\002 to view internal list." return 0 } if {$help_cmd=="ADD"} { puthelp "notice $nick : HELP ON \002ADD\002 - Min. Level: \0020400\002 " puthelp "notice $nick :- Syntax: \002$botnick add <nickname> \[\[level\] \[handle\]\]\002 - Adds/updates <nickname>'s access for current channel, specified level, current hostmask." puthelp "notice $nick : You cannot add a user with a level greater or equal to yours. Acceptable levels are : 1,50,200,400,500,501,800,999. If no level is specified, default is : 200." return 0 } if {$help_cmd=="REM"} { puthelp "notice $nick : HELP ON \002REM\002 - Min. Level: \0020400\002 " puthelp "notice $nick :- Syntax: \002$botnick rem <nickname|handle>\002 - Removes <nickname|handle>'s access for current channel." puthelp "notice $nick : You cannot remove a user with a level greater or equal to yours." return 0 } if {$help_cmd=="CYCLE"} { puthelp "notice $nick : HELP ON \002CYCLE\002 - Min. Level: \0020400\002 " puthelp "notice $nick :- Syntax: \002$botnick cycle\002 - Makes the bot part/join current channel." return 0 Guillaume Tournand <guillaume@tournand.com> September 2003 211/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project } if {$help_cmd=="LISTUSERS"} { puthelp "notice $nick : HELP ON \002LISTUSERS\002- Min. Level: \0020400\002 " if {$level<=500} { puthelp "notice $nick :- Syntax: \002$botnick listusers \[level#|full\] \[|full\]\002 - Makes the bot list users for current channel" puthelp "notice $nick :- if specified level#, only users with level higher or equal to level# will be displayed. full specified to show not 10 but all results." puthelp "notice $nick :- Ex.: $botnick listusers full, $botnick listusers 400, $botnick listusers, $botnick listusers 200 full" } else { puthelp "notice $nick :- Syntax: \002$botnick listusers \[#channel\] \[\[|level#|full\] \[|full\]\]\002 - Makes the bot list users for current or specified channel." puthelp "notice $nick :- if specified level#, only users with level higher or equal to level# will be displayed. full specified to show not 10 but all results." puthelp "notice $nick :- Ex.: $botnick listusers #channel full, $botnick listusers #channel 400, $botnick listusers" } return 0 } if {$help_cmd=="FLOODPRO"} { puthelp "notice $nick : HELP ON \002FLOODPRO\002 - Min. Level: \0020400\002 " puthelp "notice $nick :- Syntax: \002$botnick floodpro <on|off>\002 Enables/disables public flood channel protection." return 0 } if {$help_cmd=="MASSDEOP"} { puthelp "notice $nick : HELP ON \002MASSDEOP\002 - Min. Level: \0020400\002 " puthelp "notice $nick :- Syntax: \002$botnick massdeop\002 - Deops everyone in current channel (only if X/W are \002NOT\002 present)." return 0 } if {$help_cmd=="SETAUTO"} { puthelp "notice $nick : HELP ON \002SETAUTO\002 - Min. Level: \0020400\002 " puthelp "notice $nick :- Syntax: \002$botnick setauto <message>\002 - Makes the bot notice every nick that joins the <message> string." puthelp "notice $nick :- You may use \002$botnick setauto *remove\002 to disable the auto message for your channel." return 0 } if {$help_cmd=="SAVE"} { puthelp "notice $nick : HELP ON \002SAVE\002 - Min. Level: \0020400\002 " puthelp "notice $nick :- Syntax: \002$botnick save\002 - Makes the bot save his userfile/chanfile." return 0 } if {$help_cmd=="MODLEVEL"} { puthelp "notice $nick : HELP ON \002MODLEVEL\002 - Min. Level: \0020400\002 " puthelp "notice $nick :- Syntax: \002$botnick modlevel <nickname|handle> <new level>\002 - Changes <nickname|handle>'s access level on current channel." puthelp "notice $nick : You cannot set a user level to something greater or equal to yours. Acceptable levels are : 1,50,200,400,500,501,800,999." return 0 } } if {$level>=200} { if {$help_cmd=="OP"} { puthelp "notice $nick : HELP ON \002OP\002 - Min. Level: \0020200\002 " puthelp "notice $nick :- Syntax: \002$botnick op \[nickname\]\002 ops \[nickname\] if specified, or you." return 0 Guillaume Tournand <guillaume@tournand.com> September 2003 212/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project } if {$help_cmd=="DEOP"} { puthelp "notice $nick : \0020200\002 HELP ON \002DEOP\002 - Min. Level: " puthelp "notice $nick :- Syntax: \002$botnick deop \[nickname\]\002 - deops \[nickname\] if specified, or you." return 0 } if {$help_cmd=="MASSOP"} { puthelp "notice $nick : \0020200\002 HELP ON \002MASSOP\002 - Min. Level: " puthelp "notice $nick :- Syntax: \002$botnick massop \[all\]\002 Massops every level 200+ that is authenticated (specify \002all\002 to also op non-authenticated levels 200+)." return 0 } if {$help_cmd=="LISTBANS"} { puthelp "notice $nick : HELP ON \002LISTBANS\002 - Min. Level: \0020200\002 " puthelp "notice $nick :- Syntax: \002$botnick listbans\002 - View internal banlist." if {$level==500} { puthelp "notice $nick :- Level 500 Feature: \002$botnick listbans full\002 - View all details on bans." } if {$level>500} { puthelp "notice $nick :- Level 500+ Feature: \002$botnick listbans #channel \[full\]\002 - Full details and remote channels." } return 0 } if {$help_cmd=="KICK"} { puthelp "notice $nick : HELP ON \002KICK\002 - Min. Level: \0020200\002 " puthelp "notice $nick :- Syntax: \002$botnick kick <nickname> \[reason\]\002 - kicks <nickname> with reason \[reason\]." return 0 } if {$help_cmd=="FUCK"} { puthelp "notice $nick : HELP ON \002FUCK\002 - Min. Level: \0020200\002 " puthelp "notice $nick :- Syntax: \002$botnick fuck <nickname> \[reason\]\002 - kickbans <nickname> with reason \[reason\]." return 0 } if {$help_cmd=="SUSPEND"} { puthelp "notice $nick : HELP ON \002SUSPEND\002 - Min. Level: \0020200\002 " puthelp "notice $nick :- Syntax: \002$botnick suspend <nickname>\002 - suspends <nickname>'s access to the bot." return 0 } if {$help_cmd=="DCCME"} { puthelp "notice $nick : HELP ON \002DCCME\002 - Min. Level: \0020200\002 " puthelp "notice $nick :- Syntax: \002$botnick dccme\002 - Makes the bot sends you a DCC CHAT (telnet like connexion)." return 0 } if {$help_cmd=="UNSUSPEND"} { puthelp "notice $nick : HELP ON \002UNSUSPEND\002- Min. Level: \0020200\002 " puthelp "notice $nick :- Syntax: \002$botnick unsuspend <nickname>\002 - unsuspends <nickname>'s access to the bot." return 0 } } if {$level>=50} { if {$help_cmd=="INV"} { Guillaume Tournand <guillaume@tournand.com> September 2003 213/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project puthelp "notice $nick : \0020050\002 HELP ON \002INV\002 - Min. Level: " puthelp "notice $nick :- Syntax: \002/msg $botnick inv <#channel>\002 - Invites you to <#channel>." return 0 } if {$help_cmd=="KEY"} { puthelp "notice $nick : HELP ON \002KEY\002 - Min. Level: \0020050\002 " puthelp "notice $nick :- Syntax: \002/msg $botnick key <#channel>\002 - Gives you current <#channel> key (+k)." return 0 } if {$help_cmd=="VOICE"} { puthelp "notice $nick : HELP ON \002VOICE\002 - Min. Level: \0020050\002 " puthelp "notice $nick :- Syntax: \002$botnick voice \[nickname\]\002 - makes the bot voice (+v) specified nickname, or you." return 0 } if {$help_cmd=="TOPIC"} { puthelp "notice $nick : HELP ON \002TOPIC\002 - Min. Level: \0020050\002 " puthelp "notice $nick :- Syntax: \002$botnick topic \[text\]\002 makes the bot change the topic on current channel." return 0 } if {$help_cmd=="DEVOICE"} { puthelp "notice $nick : HELP ON \002DEVOICE\002 - Min. Level: \0020050\002 " puthelp "notice $nick :- Syntax: \002$botnick devoice \[nickname\]\002 - makes the bot unvoice (-v) specified nickname, or you." return 0 } if {$help_cmd=="KICKME"} { puthelp "notice $nick : HELP ON \002KICKME\002 - Min. Level: \0020050\002 " puthelp "notice $nick :- Syntax: \002$botnick kickme \[reason\]\002 makes the bot kick you with optionnal \[reason\]." return 0 } } if {$level>=1} { if {$help_cmd=="WHOIS"} { puthelp "notice $nick : \0020001\002 HELP ON \002WHOIS\002 - Min. Level: " puthelp "notice $nick :- Syntax: \002$botnick whois <nickname|handle>\002 - Displays bot infos about <nickname> or <handle>." return 0 } if {$help_cmd=="VERSION"} { puthelp "notice $nick : HELP ON \002VERSION\002 - Min. Level: \0020001\002 " puthelp "notice $nick :- Syntax: \002$botnick version\002 - Displays bot version informations." return 0 } if {$help_cmd=="NEWPASS"} { puthelp "notice $nick : HELP ON \002NEWPASS\002 - Min. Level: \0020001\002 " puthelp "notice $nick :- Syntax: \002/msg $botnick newpass <current_password> <new_password>\002 - Sets your password to <new_password> if <current_password> is verified correct." return 0 } if {$help_cmd=="DATE"} { Guillaume Tournand <guillaume@tournand.com> September 2003 214/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project puthelp "notice $nick : \0020001\002 HELP ON \002DATE\002 - Min. Level: " puthelp "notice $nick :- Syntax: \002$botnick date\002 - Displays bot's local date." return 0 } if {$help_cmd=="STATUS"} { puthelp "notice $nick : \0020001\002 HELP ON \002STATUS\002 - Min. Level: " puthelp "notice $nick :- Syntax: \002$botnick status\002 - Displays bot's status." return 0 } if {$help_cmd=="CLOGIN"} { puthelp "notice $nick : \0020001\002 HELP ON \002CLOGIN\002 - Min. Level: " if {$CM_username=="" || $CM_password=="" || $CM_nickname=="" || $CM_servername==""} { puthelp "notice $nick :- \002THIS FEATURE IS CURRENTLY NOT AVAILABLE\002." } else { puthelp "notice $nick :- Syntax: \002$botnick clogin\002 logs the $botnick into $CM_nickname as $CM_username." } return 0 } if {$help_cmd=="CSTAT"} { puthelp "notice $nick : HELP ON \002CSTAT\002 - Min. Level: \0020001\002 " if {$level<=500} { puthelp "notice $nick :- Syntax: \002$botnick cstat\002 Displays current #channel's status." puthelp "notice $nick :- shows admins (*) but only the ones having accesses <= 500 on current #channel." } if {$level>500} { puthelp "notice $nick :- Syntax: \002$botnick cstat \[#channel\]\002 - Displays current/choosen #channel's status." puthelp "notice $nick :- shows admins (*) and all levels (Because your are an ADMIN)" } return 0 } if {$help_cmd=="TIME"} { puthelp "notice $nick : \0020001\002 HELP ON \002TIME\002 - Min. Level: " puthelp "notice $nick :- Syntax: \002$botnick time\002 - Displays bot's local time." return 0 } if {$help_cmd=="LOGOUT"} { puthelp "notice $nick : \0020001\002 HELP ON \002LOGOUT\002 - Min. Level: " puthelp "notice $nick :- Syntax: \002/msg $botnick logout\002 - Deauthenticates you." return 0 } } if {$help_cmd=="ADMIN"} { puthelp "notice $nick : \0020000\002 HELP ON \002ADMIN\002 - Min. Level: " puthelp "notice $nick :- Shows administrative informations." return 0 } if {$help_cmd=="LOGIN"} { Guillaume Tournand <guillaume@tournand.com> September 2003 215/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project puthelp "notice $nick : \0020000\002 HELP ON \002LOGIN\002 - Min. Level: " puthelp "notice $nick :- Syntax: \002/msg $botnick login <#channel> <password>\002 - Authenticates you primarily on <#chanel>." if {$level>500} { puthelp "notice $nick :To authenticate as an admin use: /msg $botnick login * <password>." } return 0 } if {$help_cmd=="CREDITS"} { puthelp "notice $nick : HELP ON \002CREDITS\002 - Min. Level: \0020000\002 " puthelp "notice $nick :- Shows copyright/technical informations." return 0 } if {$help_cmd=="UPTIME"} { puthelp "notice $nick : HELP ON \002UPTIME\002 - Min. Level: \0020000\002 " puthelp "notice $nick :- Shows since when the bot is running." return 0 } if {$help_cmd=="USERHOST"} { if {$userhost_ok!=0} { puthelp "notice $nick : HELP ON \002USERHOST\002 - Min. Level: \0020000\002 " puthelp "notice $nick :- Syntax: \002$botnick userhost\002 - Shows you your current hostmask." if {$level>=50} { puthelp "notice $nick :-\002LEVEL 50 FEATURE:\002" puthelp "notice $nick :- Syntax: \002$botnick userhost \[nickname\]\002 - Shows \[nickname\] her/his current hostmask." } return 0 } } if {$help_cmd=="MAXUSERS"} { puthelp "notice $nick : HELP ON \002MAXUSERS\002 - Min. Level: \0020000\002 " puthelp "notice $nick :- Syntax: \002$botnick maxusers\002 - Shows you max number of total users for current channel." if {$level>=501} { puthelp "notice $nick :-\002LEVEL 501 FEATURE:\002" puthelp "notice $nick :- Syntax: \002$botnick maxusers \[#channel\]\002 - Shows you max number of total users for \[#channel\]." } return 0 } if {$help_cmd=="CHANINFO"} { puthelp "notice $nick : HELP ON \002CHANINFO\002 - Min. Level: \0020000\002 " puthelp "notice $nick :- Syntax: \002$botnick chaninfo \[#channel\]\002 Shows you registrant for that channel." return 0 } if {$help_cmd=="IDENT"} { puthelp "notice $nick : HELP ON \002IDENT\002 - Min. Level: \0020000\002 " puthelp "notice $nick :- Syntax: \002/msg $botnick ident <password> \[handle\]\002 -Adds your current user@host to the bot." puthelp "notice $nick : If your current nickname on IRC is not the same 'nickname' (aka 'handle') as in the" puthelp "notice $nick : bot's partyline you must specify this 'handle' after your password." return 0 } if {$help_cmd=="VERIFY"} { Guillaume Tournand <guillaume@tournand.com> September 2003 216/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project puthelp "notice $nick : \0020000\002 HELP ON \002VERIFY\002 - Min. Level: " puthelp "notice $nick :- Syntax \002$botnick verify <nickname>\002 - Checks wether or not <nickname> is known." return 0 } puthelp "notice $nick :Help for command \002$help_cmd\002 is NOT available. Type \002$botnick help\002 to view available commands." return 0 } } if {$level>0} { if {[string length $arg1]>=1} { puthelp "notice $nick :Unknown command \002[strupr $arg1]\002 - Try typing \002$botnick help\002 in \002$chan\002." } return 0 } else { } } set autologout_running 0 set autologout_last 0 set autologout_repeat 15 proc auto_logout {} { global botnick logonotice debug autologout_running autologout_last autologout_repeat authflag set cc_time [unixtime] if {[expr $cc_time-$autologout_last]<[expr [expr $autologout_repeat*60]-60]} { if {$debug==1} {putlog "-- auto_logout(): waiting next exec."} return 0 } if {$autologout_running==1} { if {$debug==1} {putlog "-- auto_logout(): run twice detected. Aborting."} return 0 } set autologout_running 1 if {$debug==1} {putlog "-- auto_logout(): Running..."} set all_users [userlist] set nb_users [llength [userlist]] if {$debug==1} {putlog "--autologout nbuser=$nb_users"} set nb_unlogged 0 set nb_authed 0 for {set idx 0} {$idx<$nb_users} {incr idx} { set da_user [lindex $all_users $idx] if {[matchattr $da_user $authflag]} { set nick_test [hand2nick $da_user] incr nb_authed if {$nick_test=="" || $nick_test=="*"} { chattr $da_user -$authflag incr nb_unlogged if {$debug==1} {putlog "-- auto_logout(): UNLOGGING : $da_user ($nb_unlogged)"} } } } save putlog "-- auto_logout(): Done, $nb_users total users ($nb_authed auth'd), $nb_unlogged users were unlogged successfully !" set autologout_last $cc_time set autologout_running 0 timer $autologout_repeat auto_logout } putlog "Enabling AUTO-LOGOUT every \002$autologout_repeat\002 minutes." utimer 30 auto_logout Guillaume Tournand <guillaume@tournand.com> September 2003 217/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if {$debug==1} {set debug_s "\002ON\002"} else {set debug_s "\002OFF\002"} if {$logonotice==1} {set console_s "\002ON\002"} else {set console_s "\002OFF\002"} if {$automsg_active==1} {set automsg_s "\002ON\002"} else {set automsg_s "\002OFF\002"} if {$userhost_ok!=0} {set uhost_s "\002ENABLED\002"} else {set uhost_s "\002DISABLED\002"} putlog "Settings: Debug=$debug_s,Console=$console_s,Homechan=\002$homechan\002,AutoMSG=$automsg_s,UserHost_CMD =$uhost_s." putlog "Responding to trignicks: \002'\002$trignick\002'\002" # changelog?! if {[string match *-DEV $verno] || [string match *-BETA $verno]} { putlog "++ Fixed actions for nicks containing backslashes.(05/11/2000)" putlog "++ Fixed topic/say/act for backslashes. (05/11/2000)" putlog "++ Fixed level check bug in 'chand_cmd:modlevel'. (24/11/2000)" putlog "++ Fixed some BETA behaviours. (02/12/2000)" putlog "++ All commands are now functionnal, some more added (newpass, chaninfo). (16/12/2000)" putlog "++ Fixed global var overwrite (admin) in *PBAN command (23/12/2000)" putlog "++ Added ability to enable/disable the USERHOST command (23/12/2000) - Idea from TheCops" putlog "++ Added CSTAT command to list Auth'd people on a channel (23/12/2000)" putlog "++ Added AUTO_LOGOUT procedure (09/01/2001)" putlog "++ Fixed bogus 'suspend' behaviour (23/05/2001)" putlog "++ Added 'setnick' command for level 1000 (23/05/2001)" } if {[string match *-MILLENIUM $verno]} { putlog "+++" putlog "\002H A P P Y NEW YEAR 2 0 0 1\002" putlog "+++" } # end of loading. putlog "Loaded (version \002$verno\002 - $last_m_date)... Continuing..." Guillaume Tournand <guillaume@tournand.com> September 2003 218/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Appendix B The database Guillaume Tournand <guillaume@tournand.com> September 2003 219/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Database dump # MySQL dump 8.13 # # Host: localhost Database: loufiz #-------------------------------------------------------# Server version 3.23.36 # # Table structure for table 'admin' # DROP TABLE IF EXISTS admin; CREATE TABLE admin ( id_admin bigint(20) NOT NULL auto_increment, id_user bigint(20) NOT NULL default '0', id_lvl bigint(20) NOT NULL default '0', unixtime_admin bigint(20) NOT NULL default '0', mail_request tinyint(4) NOT NULL default '1', mail_purge tinyint(4) NOT NULL default '1', mail_log tinyint(4) NOT NULL default '1', PRIMARY KEY (id_admin) ) TYPE=MyISAM; # # Dumping data for table 'admin' # # # Table structure for table 'admin_levels' # DROP TABLE IF EXISTS admin_levels; CREATE TABLE admin_levels ( id_level bigint(20) NOT NULL auto_increment, admin_lvl tinyint(4) NOT NULL default '0', admin_descr tinytext NOT NULL, admin_descr_en tinytext NOT NULL, PRIMARY KEY (id_level) ) TYPE=MyISAM; # # Dumping data for table 'admin_levels' # INSERT INTO admin_levels (id_level, admin_lvl, admin_descr, admin_descr_en) VALUES (9,8,'Superviseur','Supervisor'); INSERT INTO admin_levels (id_level, admin_lvl, admin_descr, admin_descr_en) VALUES (2,2,'Assistant','Assistant'); INSERT INTO admin_levels (id_level, admin_lvl, admin_descr, admin_descr_en) VALUES (3,8,'Gérant','Manager'); INSERT INTO admin_levels (id_level, admin_lvl, admin_descr, admin_descr_en) VALUES (4,10,'Administrateur/développeur','Administrator/developer'); INSERT INTO admin_levels (id_level, admin_lvl, admin_descr, admin_descr_en) VALUES (5,9,'Administrateur','Administrator'); INSERT INTO admin_levels (id_level, admin_lvl, admin_descr, admin_descr_en) VALUES (6,7,'Secrétaire','Secretary'); INSERT INTO admin_levels (id_level, admin_lvl, admin_descr, admin_descr_en) VALUES (7,2,'Traducteur','Translator'); INSERT INTO admin_levels (id_level, admin_lvl, admin_descr, admin_descr_en) VALUES (8,1,'Représentant','Representative'); # # Table structure for table 'askin_chan' # DROP TABLE IF EXISTS askin_chan; Guillaume Tournand <guillaume@tournand.com> September 2003 220/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project CREATE TABLE askin_chan ( id_chan bigint(20) unsigned NOT NULL auto_increment, nom_chan tinytext NOT NULL, id_owner bigint(20) NOT NULL default '0', unixtime_demande bigint(20) NOT NULL default '0', commentaire tinytext NOT NULL, rapport tinytext NOT NULL, PRIMARY KEY (id_chan) ) TYPE=MyISAM; # # Dumping data for table 'askin_chan' # # # Table structure for table 'blacklist' # DROP TABLE IF EXISTS blacklist; CREATE TABLE blacklist ( id_black bigint(20) NOT NULL auto_increment, nom_chan tinytext NOT NULL, unixtime_black bigint(20) NOT NULL default '0', nick_admin tinytext NOT NULL, raison text NOT NULL, source bigint(20) NOT NULL default '1', active tinyint(3) unsigned NOT NULL default '1', PRIMARY KEY (id_black) ) TYPE=MyISAM; # # Dumping data for table 'blacklist' # # # Table structure for table 'blacklist_sources' # DROP TABLE IF EXISTS blacklist_sources; CREATE TABLE blacklist_sources ( id_source bigint(20) NOT NULL auto_increment, nom_projet tinytext NOT NULL, PRIMARY KEY (id_source) ) TYPE=MyISAM; # # Dumping data for table 'blacklist_sources' # INSERT INTO blacklist_sources (id_source, nom_projet) VALUES (1,'loufiz'); INSERT INTO blacklist_sources (id_source, nom_projet) VALUES (2,'acetone'); # # Table structure for table 'chan_monitoring' # DROP TABLE IF EXISTS chan_monitoring; CREATE TABLE chan_monitoring ( id_chan bigint(20) NOT NULL auto_increment, nom_chan tinytext NOT NULL, nb_egg_report tinyint(4) NOT NULL default '0', nb_egg_op tinyint(4) NOT NULL default '0', op_depuis bigint(20) NOT NULL default '0', nb_user_1 tinytext NOT NULL, depuis_user_1 bigint(20) NOT NULL default '0', nb_user_2 tinytext NOT NULL, Guillaume Tournand <guillaume@tournand.com> September 2003 221/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project depuis_user_2 bigint(20) NOT NULL default '0', nb_user_3 tinytext NOT NULL, depuis_user_3 bigint(20) NOT NULL default '0', x_present tinyint(4) NOT NULL default '0', x_depuis bigint(20) NOT NULL default '0', axs_x tinytext NOT NULL, axs_depuis bigint(20) NOT NULL default '0', x_automode tinytext NOT NULL, automode_depuis bigint(20) NOT NULL default '0', maj bigint(20) NOT NULL default '0', PRIMARY KEY (id_chan), KEY id_chan (id_chan) ) TYPE=MyISAM; # # Dumping data for table 'chan_monitoring' # # # Table structure for table 'channels' # DROP TABLE IF EXISTS channels; CREATE TABLE channels ( id_chan bigint(20) unsigned NOT NULL auto_increment, nom_chan tinytext NOT NULL, id_owner bigint(20) NOT NULL default '0', egg_group tinyint(4) NOT NULL default '0', unixtime_support bigint(20) NOT NULL default '0', unixtime_demande bigint(20) NOT NULL default '0', warning tinyint(4) NOT NULL default '0', PRIMARY KEY (id_chan) ) TYPE=MyISAM; # # Dumping data for table 'channels' # INSERT INTO channels (id_chan, nom_chan, id_owner, egg_group, unixtime_support, unixtime_demande, warning) VALUES (1,'loufiz',1,0,943916400,943916400,0); # # Table structure for table 'commentaires' # DROP TABLE IF EXISTS commentaires; CREATE TABLE commentaires ( id_comment bigint(20) unsigned NOT NULL auto_increment, id_user bigint(20) NOT NULL default '0', nom_chan tinytext NOT NULL, unixtime_comment bigint(20) NOT NULL default '0', commentaire tinytext NOT NULL, PRIMARY KEY (id_comment) ) TYPE=MyISAM; # # Dumping data for table 'commentaires' # # # Table structure for table 'eggdrops' # DROP TABLE IF EXISTS eggdrops; CREATE TABLE eggdrops ( id_egg bigint(20) unsigned NOT NULL auto_increment, Guillaume Tournand <guillaume@tournand.com> September 2003 222/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project nom tinytext NOT NULL, username tinytext NOT NULL, host1 tinytext NOT NULL, host2 tinytext NOT NULL, host3 tinytext NOT NULL, ip tinytext NOT NULL, port int(11) NOT NULL default '0', svr_bloc int(10) unsigned NOT NULL default '0', egg_bloc int(10) unsigned NOT NULL default '0', xpass tinytext NOT NULL, pere bigint(20) NOT NULL default '0', unixtime_creat bigint(20) NOT NULL default '0', m_server tinytext NOT NULL, m_unixtime bigint(20) NOT NULL default '0', actif tinyint(4) NOT NULL default '1', PRIMARY KEY (id_egg) ) TYPE=MyISAM; # # Dumping data for table 'eggdrops' # # # Table structure for table 'faq' # DROP TABLE IF EXISTS faq; CREATE TABLE faq ( id_faq bigint(20) NOT NULL auto_increment, question tinytext NOT NULL, question_en tinytext NOT NULL, reponse text NOT NULL, reponse_en text NOT NULL, ordre tinyint(4) NOT NULL default '0', groupe tinyint(4) NOT NULL default '0', PRIMARY KEY (id_faq) ) TYPE=MyISAM; # # Dumping data for table 'faq' # INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (1,'Est-ce que vos services sont gratuits ?\r\n','Are your services free ?\r\n','Oui, la totalité des services proposés sur le site web sont gratuits.','Yes, all the services proposed on our website are free of charges.',1,1); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (2,'Puis-je avoir un eggdrop immédiatement sans faire de demande sur le site web ?\n','Can I have an eggdrop without making a request on the web site ?\n','Non, il vous faudra passer 2 minutes de votre vie à faire cette demande. Pas de demande, pas de prêt.\n','No, you\'ll have to spend 2 minutes of your lifetime to make a request. No request, no bots.\n',2,1); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (3,'Où dois-je aller pour avoir un eggdrop ?\r\n','Where should I go to get eggdrops ?\r\n','Sur ce site web (http://www.loufiz.com) dans la section eggdrops &#62; demander.\r\n','On this web site (http://www.loufiz.com) in the section eggdrops &#62; request.\r\n',3,1); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (4,'Comment connaitre les commandes ?\r\n','How can I know the eggdrops commands ?\r\n','eggdrops &#62; administrer &#62; liste des commandes vous conviendra.\r\n','eggdrops &#62; user login &#62; command list should feed your needs.\r\n',4,1); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (5,'Why is the website in French ?','Pourquoi le site est-il en Anglais ?','The english version is available by cliking on the English flag on the top-left corner.','La version française du site est accessible en cliquant sur le drapeau français en haut à gauche.',5,1); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (6,'Où sont les régles de prêt ?\r\n','Where are your conditions of service ?\r\n','La page eggdrops &#62; demander, vous affichera nos conditions de service.\r\n','The page eggdrops &#62; request, will display our conditions of service.\r\n',6,1); Guillaume Tournand <guillaume@tournand.com> September 2003 223/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (7,'Comment savoir si ma demande a été acceptée ou traitée, ou pourquoi les eggdrops ne sont plus sur mon channel ?\r\n','How could I know if my request has been accepted or refused, or why aren\'t the eggdrops on my channel any more ?\r\n','Vous pouvez à tout moment suivre l\'évolution de votre demande ici : eggdrops &#62; administrer &#62; suivi de vos demandes.\r\n','You can see the status of your request at any time here : eggdrops &#62; user login &#62; request follow-up.\r\n',7,1); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (8,'Qu\'est-ce qu\'un identifiant ou LZ ?\r\n','What is an identifier or an LZ ?\r\n','C\'est simplement un login utilisé pour que le site web identifie un utilisateur. Il est composé de plusieurs chiffres et associé à un mot de passe.<BR>Si vous n\'en avez pas, vous pouvez aller en créer un. C\'est gratuit.\r\n','This is just a login used by the web site to identify a user. It\'s made of several numbers, and bind to a password.<BR>If you don\'t have one, you can create one, it\'s free.\r\n',8,1); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (9,'Peut-on avoir plus ou moins de 3 eggdrops ?\n','Can I get more or less than 3 eggdrops ?\n','Non, les eggdrops du projet Loufiz sont prétés par groupe de trois pour une sécurité optimale.\n','No, the Loufiz project eggdrops are lend by group of 3 for an optimal security.\n',9,1); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (10,'Combien de temps dois-je attendre après avoir effectué une demande d\'eggdrops ?\n','How long should I wait after my eggdrops request is done ?\n','Il faut attendre la présence d\'un administrateur. S\'ils sont en ligne au moment de la demande, la décision prend très peu de temps (de l\'ordre de 5 minutes), sinon votre demande sera traitée au maximum 12 heures plus tard.\n','You have to wait for an administrator to review your request. If they are online when your request is done, the decision will be quick (5 minutes roughly), otherwise your request will be reviewed in less than 12 hours.\n',10,1); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (11,'Qu\'est ce qu\'un ident@host ?\r\n','What is a ident@host ?\r\n','La page dans la section services &#62; irc &#62; le ident@host ? répondra parfaitement à cette légitime question.\r\n','The page on the section services &#62; irc &#62; ident@host ? will answer this question.\r\n',11,1); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (12,'Comment savoir mon ident@host actuel ?\r\n','How can I know my current ident@host ?\r\n','Il faut taper .ident@host sur le chan, Adam vous indiquera votre ident@host en notice (le \'.\' précédent ident@host est à inclure dans la commande).\r\n','You have to type .ident@host on the channel, Ad4m will tell your ident@host in notice (the \'.\' in front of ident@host has to be included in the command).\r\n',12,1); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (13,'Pourquoi .ident@host ne marche pas ?\r\n','.ident@host doens\'t work, why ?\r\n','C\'est très probablement dû au fait que vous avez décidé d\'ignorer Ad4m.<BR>Tapez /ignore -r Ad4m!Ad4m@* , puis de nouveau .ident@host.\r\n','You certainly have ignored Ad4m.<BR>Just type /ignore -r Ad4m!Ad4m@* , and type .ident@host again.\r\n',13,1); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (14,'Je ne peux pas faire de demande d\'eggdrops pour mon channel : mon channel a été blacklisté.\n','I can\'t make an eggdrop request for my channel : my channel has been blacklisted.\n','Vous devez être notre grand gagnant de la semaine : ce genre de décoration n\'est pas donnée à n\'importe qui. Il vous faudra aller en parler à un administrateur qui retirera peut-être ce ban.\n','You are our weekly winner : such a distinction isn\'t offered to anyone. You\'ll have to speak to an administrator that will maybe remove this ban.\n',14,1); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (15,'Où est-ce que je peux aller demander des eggdrops hormis ici ?\r\n','Where can I ask eggdrops somewhere else ?\r\n','Nous essayons de garder une liste la plus complète possible et à jour de projets de prêt d\'eggdrops.<BR>Vous trouverez cette liste dans la section eggdrops &#62; liens\r\n','We try to keep a complete and up to date list of such botlending projects.<BR>You\'ll find this list on the section eggdrops &#62; links\r\n',15,1); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (16,'Combien d\'utilisateurs faut-il pour avoir les eggdrops ?\n','How many users should I have to get the eggdrops ?\n','Comme spécifié dans nos conditions de service : 10 (dix).\n','As written on our conditions of service, 10 (ten) users is a minimum.\n',16,2); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (17,'Les utilisateurs doivent ils être toujours sur le channel ?\n','Have the users to be on the channel all the time ?\n','Non, bien évidemment. Eux aussi on le droit de dormir, pas vrai ?\n','No, of course not. They can sleep as well, can\'t they ?\n',17,2); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (18,'Les clones comptent-ils dans le nombre d\'utilisateurs minimum ?\n','Can the clones count for the number of users ?\n','Non, de nouveau. Ce point est inscrit dans nos conditions de service.\n','No, as well. This is written in our conditions of service.\n',18,2); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (19,'J\'ai déjà des robots sur mon channel, puis-je avoir vos eggdrops en plus ?','I already have bots on my channel, can I have your eggdrops as well ?\r\n','Oui, si votre channel (malgré ces eggdrops déjà présent) en a besoin, il n\'y a aucun problème. Nos eggdrops cohabitent avec les autres robots. Toutefois si un de ces robots a placé le channel en mode strictop (ce qui signifie que seuls les utilisateurs reconnu par le robot pourront être opérateurs de ce channel), vous devrez rajouter dans la liste des opérateurs de ce robot les eggdrops prétés par le projet Loufiz afin de respecter nos conditions de service.\r\n','Yes, if your channel (despite of the present bots) need them, there is no problem. Our eggdrops can cohabit with other bots. Thus, if one of this bot sets the channel in strictop Guillaume Tournand <guillaume@tournand.com> September 2003 224/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project mode (which means that just the users recognized by this eggdrop can be op on the channel), you will have to add on this bot the lended eggdrops in the list of the operators for the channel, to respect our conditions of service.\r\n',19,2); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (20,'Pourquoi les eggdrops ne sont plus sur mon channel ?\r\n','Why are your eggdrops not on my channel any more ?\r\n','Le prêt d\'eggdrops pour votre channel a été arrêté. Ce genre de décision n\'étant pas prise pour un oui ou pour un non, vous devriez (en tant que propriétaire du channel) être la personne la mieux placée pour savoir sur quel(s) point(s) votre channel n\'a pas respecté nos conditions de service.<BR>Le suivi des demandes vous renseignera : eggdrops > administrer > suivi de vos demandes.','The eggdrop lending for your channel has been stopped. This kind of decision is never taken without reason(s). As a channel owner, you should be the best informed about what has been done on your channel that has violated our conditions of service.<BR>The request follow up will inform you : eggdrops > user login > request follow-up.\r\n',20,2); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (21,'Comment devenir helper pour votre projet ?\r\n','How can I become a helper for your project ?\r\n','Les connaissances techniques sur les eggdrops ne sont pas nécéssaires, mais il vous faut avoir du temps libre, savoir parler un Français correct (la connaissance de l\'Anglais est un plus), avoir un esprit logique, et ne pas avoir peur d\'apporter vos idées. Si vous êtes intéressé, contactez un administrateur du projet qui sera a même de vous renseigner plus amplement à ce sujet.\r\n','Technical knowledges are not necessary, but you need to have some free time, be able to speak a proper English (French knowledge too will be better), a logic mind, and not be scared to bring your ideas. If you are interrested, contact an administrator of the project. He\'ll be able to give further details.\r\n',21,2); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (22,'Prétez-vous des eggdrops si X est présent ou absent ?\n','Do you lend eggdrops if X is present or absent ?\n','Oui, la présence (ou l\'absence) de X ne nous dérange absolument pas.\n','Yes, the presence (or absence) of X doens\'t bother us.\n',22,3); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (23,'Pourquoi je dois créer un accès 100 sur X ?\r\n','Why do I have to create an access 100 on X ?\r\n','Pour que les robots du projet Loufiz ainsi que X cohabitent sans problème au sein de votre channel, il est important de les faire se reconnaître. Nos eggdrops connaissent X, à vous de faire connaître nos eggdrops à X.\r\n','So that the lended eggdrops and X can both cahabite on your channel without any trouble. Our eggdrops know X, make X know our eggdrops.\r\n',23,3); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (24,'Comment connaitre l\'username de vos eggdrops ?\n','How can I know the username of our eggdrops ?\n','/msg X verify &#60;nick_de_l\'eggdrop&#62;\n','/msg X verify &#60;eggdrop_nick&#62;\n',24,3); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (25,'Comment créer un accès 100 pour vos eggdrops sur X ?\r\n','How can I create an access 100 for your eggdrops on X ?\r\n','Une fois loggué dans X, voici la commande à tapper :<BR>/msg X adduser &#60;#channel&#62; &#60;username&#62; 100\r\n','Once logged on X, here is the command to type :<BR>/msg X adduser &#60;#channel&#62; &#60;username&#62; 100\r\n',25,3); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (26,'Comment activer l\'automode OP ?\n','How can I set the automode OP ?\n','Une fois loggué dans X, voici la commande à tapper :<BR>/msg X modinfo &#60;#channel&#62; automode &#60;username&#62; OP\n','Once logged on X, here is the command to type :<BR>/msg X modinfo &#60;#channel&#62; automode &#60;username&#62; OP\n',26,3); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (27,'Comment vérifier que les accès sont corrects ?\n','How can I check that the access are correct ?\n','/msg x access &#60;#channel&#62; access &#60;username&#62;\n','/msg x access &#60;#channel&#62; access &#60;username&#62;\n',27,3); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (28,'Vais-je perdre les eggdrops quand X viendra ?\n','Will I loose the eggdrops when X will arrive ?\n','Non, vous devrez juste créer un accès 100 automode op sur X pour chacun des eggdrops prétés.\n','No, you will just need to create one access 100 automode op on X for every lent eggdrop.\n',28,3); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (29,'Puis-je créer un accès supérieur à 100 sur X pour vos eggdrops ?\r\n','Can I create an access greater than 100 on X for my eggdrops ?\r\n','Oui, vous pouvez le faire sans problème.<BR>100 est le niveau minimal demandé. Un accès supérieur à 100 ne sera toutefois pas utile aux eggdrops.\r\n','Yes, you can do so without problem.<BR>100 is the minimal access requested. An access greater than 100 will not be usefull.\r\n',29,3); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (30,'Les eggdrops peuvent-ils supporter ma demande d\'enregistrement de channel à X ?\n','Can the eggdrops be supporter for my channel registration on X ?\n','Non, comme spécifié dans le règlement, nous sommes indépendants de Cservice.\n','No, as written in our conditions of service, we are independant of Cservice.\n',30,3); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (31,'Pourquoi mon accès n\'a pas été créé lors de l\'arrivée des eggdrops sur mon channel ?\r\n','Why hasn\'t my access been created when the eggdrops joined my channel ?\r\n','Les accès sont automatiquement créés par l\'interface web, l\'owner a donc évidemment automatiquement accès aux eggdrops pour son channel.\r\n','The access are automatically created by the web interface as soon as an eggdrop join the channel. Of course, the owner of the channel gets his access at this time.\r\n',31,4); Guillaume Tournand <guillaume@tournand.com> September 2003 225/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (32,'Peut-on changer le nick des eggdrops ?\r\n','Can we change the nick of the eggdrops ?\r\n','Non, les eggdrops étant prétés à de nombreux channels ayant chacun des opérateurs et des administrateurs différents, imaginez un peu la situation si chacun d\'entre eux pouvait changer leur nick.\r\n','No, the eggdrops are lent to many channels, each having differents operators, and administrators. Just try to immagine the situation if they all could do so.\r\n',32,4); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (33,'Y a t-il des commandes !op, !voice ... ?\r\n','Are there commands like !op, !voice ... ?\r\n','Non, aucune commande ne se fait sur le channel, elles sont toutes à exécuter avec la commande /msg.<BR>Ce genre de commande ne sera pas ajoutée : les eggdrops ne voient pas ce qui se passe sur les channels.\r\n','No, no command is done on the channel, they all have to be done throw /msg.<BR>This kind of command will not be added : the eggdrops doens\'t see what\'s happening on the channel.\r\n',33,4); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (34,'Comment s\'identifier sur les eggdrops ?\n','How can I identify on the eggdrops ?\n','Il n\'y a pas besoin de s\'identifier, les commandes incluent votre mot de passe si nécessaire.\n','There is no need to identify on the eggdrops, the commands include your password if needed.\n',34,4); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (35,'Ou se trouve une liste des commandes disponibles ?\r\n','Where can I find a list of the available commands ?\r\n','La page eggdrops &#62; administrer &#62; liste des commandes vous conviendra.\r\n','The page eggdrops &#62; user login &#62; command list will feed your need.\r\n',35,4); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (36,'Comment se de-opper par les eggdrops ?\r\n','How can I deop throw the eggdrops ?\r\n','Cette question est souvent posée, et nous allons en détail voir pourquoi une telle commande est une très mauvaise idée :<BR>Notre projet de prêt d\'eggdrops vous autorise à avoir sur votre channel (en quantité raisonnable) autant de robots étrangers à notre service que vous le désirez. A condition évidemment que le propriétaire du channel soit d\'accord.<BR>Imaginons maintenant que Toto (un utilisateur du channel) a mis son robot sur le channel.<BR>Toto demande à un de nos eggdrops de le déopper.<BR>Notre eggdrop obéit, mais le robot de Toto croit avoir affaire à un Take Over et déoppe notre eggdrop.<BR>Donc un autre de nos eggdrops prétés réoppera notre eggdrop déoppé, et le robot de Toto déoppera les 2 ...<BR>Bref ceci génèrera un flood inutile dans ce channel sur lequel Toto voulait juste se déopper.<BR>Ce genre de probleme aurait pu être évité si Toto avait créé un accès pour nos eggdrops dans son robot.<BR>Donc afin d\'être sûr de ne pas rencontrer ce genre de situation désagréable, nos eggdrops n\'incluent pas ce genre de commande, et laissent le soin à l\'utilisateur de se déopper lui même.\r\n','This question has been often asked, and we\'re going to see in detail why is such a command is a bad idea :<BR>Our project allows you to have (in a reasonnable quantity) as many foreign bots as you want. If the channel owner accepts them, of course.<BR>Let\'s imagine now that Toto (a channel user) has set his bot on the channel.<BR>Toto ask one of our eggdrop to deop him.<BR>Our eggdrop do so, but Toto\'s bot think it\'s the start of a Take Over, and deop our eggdrop.<BR>So another of the lent eggdrops will re-op our deopped eggdrop, and toto\'s bot deop them both ...<BR>This will generate a useless flood on this channel just because Toto doens\'t want to be op any more.<BR>Such a situation could have been avoided if Toto had created an access for our eggdrops on his robot.<BR>Therefore, to be sure that such a situation will not happend, our eggdrops doesn\'t include such commands, and let the user deop himself.\r\n',36,4); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (37,'Pourquoi l\'eggdrop ne m\'op pas ?\r\n','Why doesn\'t the eggdrops op me ?\r\n','Si la commande que vous utilisez pour vous opper est correcte (voir la liste des commandes), il y a de très grandes chances pour que le ident@host que vous utilisez sur IRC ne soit pas le même que celui enregistré dans les eggdrops.<BR>Pour vérifier celà, connectez-vous et authentifiez-vous sur le site (dans la section eggdrops &#62; administrer) et comparez votre ident@host d\'IRC avec celui qui est enregistré.\r\n','If the command you are using is correct (see the list of the commands), there are great probabilities that the ident@host you are presently using on IRC is different as the one recorded on the eggdrops.<BR>To check this, just connect and login on the website (in the section eggdrops &#62; user login) and compare your ident@host on IRC and the one on the web site.\r\n',37,4); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (38,'Comment puis-je changer mon host enregistré dans les eggdrops ?\r\n','How can I change my host recorded on the eggdrops ?\r\n','Dans la section eggdrops &#62; administrer, authentifiez-vous, ajoutez/modifiez votre host dans les cases prévues à cet effet, et validez. Les modifications seront propagées aux eggdrops dans moins de 5 minutes.\r\n','Log in the section eggdrops &#62; user login, add/modify your host in your profile, and submit the changes. The modifications will be on the eggdrops in less than 5 minutes.\r\n',38,4); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (39,'Comment puis-je changer mon ident sur IRC ?\r\n','How can I change my ident on IRC ?\r\n','Ceci est à effectuer dans le client irc.<BR>Pour mIRC, il faut aller dans File &#62; Options &#62; Connect &#62; Identd, et mettre le user desiré dans \'User ID.\'.<BR>Il faut aussi cocher la case \'Enable Identd server\' et décocher (si elle existe) \'User ID from email adress\'.<BR>Ensuite il faut se déconnecter et se reconnecter au serveur irc.\r\n','This has to be done on the irc client.<BR>For mIRC, you have to go in File &#62; Options &#62; Connect &#62; Identd, and set the wanted username in \'User ID.\'.<BR>You have to tick the case \'Enable Identd server\' and untick (if it exists) \'User ID from email adress\'.<BR>Then you have to disconnect, and reconnect from to IRC server.\r\n',39,4); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (40,'Comment puis-je changer mon ident enregistré sur le site web ?','How can I change my ident on the web site ?','Vous ne pouvez pas changer l\'ident d\'un identifiant, mais vous pouvez arriver au meme résultat par une autre voie.<BR>Pour cela, allez créer un nouvel identifiant, et demandez aux administrateurs des channels où vous Guillaume Tournand <guillaume@tournand.com> September 2003 226/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project avez un accès de remplacer votre ancien identifiant par le nouveau.<BR>Si vous êtes le propriétaire d\'un channel, allez dans la section eggdrops &#62; retrait , et donnez votre channel à votre nouvel identifiant.\r\n','You can\'t change the ident for an identifier, but you can get the same result with another operation.<BR>To do so, create a new identifier, and ask the channels administrators where you have access to replace your old identifier by the new one.<BR>If you own a channel, just go on the section eggdrops &#62; withdrawal, and give the channel to your new identifier.\r\n',40,4); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (41,'Comment donner accès à quelqu\'un dans les eggdrops ?\r\n','How can I give access to someone on my channel ?\r\n','Cette personne doit se créer un identifiant sur le site web.<BR>Une fois authentifié dans la section eggdrops &#62; administrer, ajoutez cet identifiant comme opérateur ou administrateur dans la page du channel désiré.<BR>A la charge de cette personne de modifier les paramètres de son identifiant pour que son accès fonctionne si elle a effectué des modifications.\r\n','This person has to create an identifier on the website.<BR>Once you are logged in the website on the section eggdrops &#62; user login, add this identifier as an operator or an administrator on the page of the channel.<BR>It\'s up to the person to modify his own profile so that his access will work if he/she has made changes.\r\n',41,4); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (42,'Je n\'arrive pas à m\'identifier mon login ou mot de passe n\'est pas accepté et/ou j\'ai oublié mon numéro d\'identifiant. Que faire ?\r\n','I can\'t identify on the website : my login, or my password isn\'t accepted and/or I have forgotten my identifier number or my password. What can I do ?\r\n','Il vous faut aller dans eggdrops &#62; administrer, login ou mot de passe oublié. Ici vous pourrez demander l\'envoi de votre mot de passe et de votre identifiant par mail.<BR>Toutefois si vous n\'êtes pas un administrateur ou un opérateur de channel, et que vous ne vous êtes pas authentifiés sur le site depuis plus de 30 jours, votre compte a été supprimé. Vous pourrez en re-créer un nouveau.\r\n','You have to go on eggdrops &#62; user login &#62; forgot your identifier or password ?. Here you can ask that these informations will be send to you throw mail.<BR>If you are not an administrator or a channel operator of a channel, and that you haven\'t logged in for more than 30 days, your identifier has been deleted. You can create a new one.\r\n',42,4); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (43,'Peut on changer de topic avec les eggdrops ?\r\n','Can we change the topic with the eggdrops ?\r\n','Non, oppez-vous et changez le à la main. On n\'est jamais mieux servi que par soi-même.\r\n','No, gain ops, and change it. Nobody does the job better than yourself.\r\n',43,4); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (44,'Je veux que vos eggdrops quittent mon channel !\r\n','I want your eggdrops to be removed from my channel !\r\n','Pas de problème, allez dans la section eggdrops &#62; retrait, et demander le retrait des eggdrops. Ils quitteront votre channel dans moins de 5 minutes après la validation de ce formulaire.\r\n','No problem, go on the section eggdrops &#62; withdrawal, and ask the eggdrops to part your channel. They\'ll leave your channel less than 5 minutes after you submit this form.\r\n',44,4); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (45,'Je n\'ai pas d\'eggdrop du projet Loufiz, mais j\'ai besoin d\'aide.\r\n','I don\'t have eggdrops from the Loufiz project, but I need help.\r\n','Nous n\'assurons pas ce genre de service pour des eggdrops extérieurs. Certains channels sont là spécialement pour ca, tel que #protect-irc, #eggdrop ou encore #egg-fr.\r\n','We don\'t make this kind of service for foreign bots. Some channels are here for this purpose, like #protect-irc, #eggdrop or #egg-fr.\r\n',45,4); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (46,'J\'ai déjà un channel enregistré, puis-je demander des eggdrops pour d\'autres channels ?','I already have a channel protected by Loufiz, can I ask eggdrops for other channels ?','Oui, vous pouvez demander des eggdrops pour autant de channel que vous le désirez, tant que vous respectez nos conditions de service.','Yes, you can ask eggdrops for as many channels as you want, as long as you respect our conditions of service',19,2); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (47,'Comment puis-je configurer mon robot pour qu\'il s\'oppe avec vos eggdrops ?','How can I setup my bot so that it can gain ops with your eggdrops ?','Tout d\'abord créez un identifiant pour votre robot, et donnez à cet identifiant le status d\'opérateur de votre channel (dans l\'interface web).<BR>Puis configurez votre robot afin qu\'il demande l\'op à un de nos eggdrops avec le mot de passe que vous avez défini pour son identifiant.','First create an identifier for your bot, and set this identifier as a channel operator (on our web interface).<BR>Then setup your bot to request op from one of our eggdrop with the password you have choosen for its identifier.',35,4); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (48,'Pourquoi vos eggdrops ne sont-ils pas sur #loufiz ?','Why aren\'t your eggdrops on #loufiz ?','En plus de nous faire de l\'air par leur absence, #loufiz n\'a pas besoin de ses eggdrops : ce sont les channels demandeurs qui en ont besoin.<BR>Vu que chaque client IRC peut joindre un nombre prédéterminé de channels, nous trouvons ridicule de mobiliser un de ces channels pour les faire se regrouper dans #loufiz dans le seul but de les empiler.','First we like the fact of having place because of their absence, and #loufiz doens\'t need the eggdrops : it\'s the requester channels that needs them.<BR>Since every IRC client can join a certain amount of channel, we find stupid the fact of taking one of this place just to park them on #loufiz.',30,4); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (51,'Comment connaitre la clef d\'un channel ?','How to get the key of a channel ?','Si vous êtes enregistré comme opérateur de ce channel, la commande Key, détaillée dans la page des commandes des eggdrops, vous sera bien utile.','If you are a registered channel operator, the Key command, explained in the eggdrop commands list page, will be really usefull to you.',37,4); Guillaume Tournand <guillaume@tournand.com> September 2003 227/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (52,'Comment récupérer l\'op dans un channel opless ?','How to regain ops on an opless channel ?','Vous pouvez utiliser la commande Go, détaillée dans la page des commandes des eggdrops, pour mener à bien cette opération.','The command Go, explained in the eggdrop commands list page, will be helpfull to you.',37,4); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (53,'Quelle est la configuration de vos eggdrops ?','How are your eggdrops configured ?','Le but des eggdrops est de garder le status d\'opérateur et de vous le donner à chaque fois que vous leur demandez.<BR>\r\nAfin d\'interférer le moins possible sur la gestion du canal par ses opérateurs, la configuration de nos eggdrops se traduit ainsi :<BR>\r\n<LI>Aucun kick pour flood (quel que soit le type), ou clônes\r\n<LI>Aucun retrait de ban\r\n<LI>Kick d\'utilisateur uniquement pour respecter un ban\r\n<LI>Aucun mode de type \"revanche\" actif\r\n<LI>Mode du canal +n forcé (Pas de message externe)','The goal of our eggdrops is to keep operator status and give it back to you each time you request it.<BR>\r\nTherefore in order to leave you managing your channel, our eggdrops are configured like this :<BR>\r\n<LI>No kick for flood (any type it is), or clones\r\n<LI>No unban\r\n<LI>Kick of user only if it matches a ban\r\n<LI>No mode sets like \"revenge\"\r\n<LI>Channel mode +n always set (No external message)',53,4); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (50,'Comment retirer un ban avec les eggdrops ?','How can I remove a ban with the eggdrops ?','Si vous pouvez entrer sur le channel, oppez-vous et retirez le ban vous-meme.<BR>\r\n<BR>\r\nSi vous êtes banni d\'un channel sur lequel vous avez accès aux eggdrops, faites ceci :<BR>\r\n1 - demandez à un eggdrop de vous inviter : /msg &lt;eggdrop_nick&gt; invite &lt;password&gt; &lt;channel&gt;<BR>\r\n2 - entrez sur le channel<BR>\r\n3 demandez à un eggdrop de vous opper : /msg &lt;eggdrop_nick&gt; op &lt;password&gt; &lt;channel&gt;<BR>\r\n4 - retirez le ban<BR>\r\n<BR>\r\nQuoiqu\'il en soit, si vous avez été banni par nos eggdrops, ne vous plaignez pas : c\'est de votre faute.','If you can enter the channel, gain op and remove the ban yourself.<BR>\r\n<BR>\r\nIf you\'re ban from a channel where you haveve access on the eggdrops :<BR>\r\n1 ask any eggdrop to invite you : /msg &lt;eggdrop_nick&gt; invite &lt;password&gt; &lt;channel&gt;<BR>\r\n2 enter the channel<BR>\r\n3 - ask any eggdrop to op you : /msg &lt;eggdrop_nick&gt; op &lt;password&gt; &lt;channel&gt;<BR>\r\n4 - remove the ban<BR>\r\n<BR>\r\nWhatever happends, you\'re responsable if you have been banned by our eggdrops. So don\'t complain.',37,4); INSERT INTO faq (id_faq, question, question_en, reponse, reponse_en, ordre, groupe) VALUES (54,'J\'ai besoin d\'aide pour mon channel où vos eggdrops ne sont pas op. Où puis-je aller ?','I need help for my channel but your eggdrops aren\'t op there. Where should I go ?','Il faut vous adresser aux ircops : vous les trouverez sur #nastrand ou #zt.','You have to ask ircops : go and ask for their help on #nastrand or #zt.',31,3); # # Table structure for table 'genre' # DROP TABLE IF EXISTS genre; CREATE TABLE genre ( id_genre bigint(20) NOT NULL auto_increment, descr tinytext NOT NULL, descr_en tinytext NOT NULL, PRIMARY KEY (id_genre) ) TYPE=MyISAM; # # Dumping data for table 'genre' # INSERT INTO genre (id_genre, descr, descr_en) VALUES (1,'M.','Mr.'); INSERT INTO genre (id_genre, descr, descr_en) VALUES (2,'Mme','Madam'); INSERT INTO genre (id_genre, descr, descr_en) VALUES (3,'Mlle','Miss'); # # Table structure for table 'getout_chan' # DROP TABLE IF EXISTS getout_chan; CREATE TABLE getout_chan ( id_chan bigint(20) unsigned NOT NULL auto_increment, nom_chan tinytext NOT NULL, id_owner bigint(20) NOT NULL default '0', unixtime_demande bigint(20) NOT NULL default '0', unixtime_support bigint(20) NOT NULL default '0', unixtime_refus bigint(20) NOT NULL default '0', unixtime_purge bigint(20) NOT NULL default '0', id_refus bigint(20) NOT NULL default '0', id_purge bigint(20) NOT NULL default '0', Guillaume Tournand <guillaume@tournand.com> September 2003 228/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project warning tinyint(4) NOT NULL default '0', attente_active tinyint(4) NOT NULL default '0', PRIMARY KEY (id_chan) ) TYPE=MyISAM; # # Dumping data for table 'getout_chan' # # # Table structure for table 'instructions' # DROP TABLE IF EXISTS instructions; CREATE TABLE instructions ( id_instr bigint(20) unsigned NOT NULL auto_increment, unixtime bigint(20) NOT NULL default '0', id_user bigint(20) NOT NULL default '0', commande tinytext NOT NULL, ack tinyint(4) NOT NULL default '0', PRIMARY KEY (id_instr) ) TYPE=MyISAM; # # Dumping data for table 'instructions' # # # Table structure for table 'liens' # DROP TABLE IF EXISTS liens; CREATE TABLE liens ( id_lien bigint(20) NOT NULL auto_increment, channel tinytext NOT NULL, url tinytext NOT NULL, ordre tinyint(3) unsigned NOT NULL default '255', PRIMARY KEY (id_lien) ) TYPE=MyISAM; # # Dumping data for table 'liens' # INSERT INTO liens (id_lien, channel, url, ordre) VALUES (1,'bothouse','http://www.botservice.net/',15); INSERT INTO liens (id_lien, channel, url, ordre) VALUES (40,'paradize','http://www.paradize.ht.st/',22); INSERT INTO liens (id_lien, channel, url, ordre) VALUES (3,'angelique','http://www.angelique.ca/',20); INSERT INTO liens (id_lien, channel, url, ordre) VALUES (34,'a&a','http://www.starbots.info/',10); INSERT INTO liens (id_lien, channel, url, ordre) VALUES (5,'key2peace','http://www.key2peace.org/',3); INSERT INTO liens (id_lien, channel, url, ordre) VALUES (6,'bot2lend','http://www.bot2lend.org/',4); INSERT INTO liens (id_lien, channel, url, ordre) VALUES (41,'belgiumbots','http://members.lycos.nl/zickell/',32); INSERT INTO liens (id_lien, channel, url, ordre) VALUES (37,'logiz','',255); INSERT INTO liens (id_lien, channel, url, ordre) VALUES (39,'botmansion','http://www.botservices.org/',24); INSERT INTO liens (id_lien, channel, url, ordre) VALUES (19,'netbots','',255); INSERT INTO liens (id_lien, channel, url, ordre) VALUES (11,'userservice','http://www.userservice.org/',2); INSERT INTO liens (id_lien, channel, url, ordre) VALUES (35,'botzone','http://botzone.north-zone.net/',30); INSERT INTO liens (id_lien, channel, url, ordre) VALUES (16,'acetone','http://www.acetone.org/',1); INSERT INTO liens (id_lien, channel, url, ordre) VALUES (42,'oeuf','http://oeuf-undernet.net',21); INSERT INTO liens (id_lien, channel, url, ordre) VALUES (36,'sos','http://66.130.40.14:81/',31); # # Table structure for table 'liste_commandes' # DROP TABLE IF EXISTS liste_commandes; CREATE TABLE liste_commandes ( Guillaume Tournand <guillaume@tournand.com> September 2003 229/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project id_cmd bigint(20) NOT NULL auto_increment, nom tinytext NOT NULL, syntax tinytext NOT NULL, exemple tinytext NOT NULL, descr tinytext NOT NULL, descr_en tinytext NOT NULL, etat tinyint(4) NOT NULL default '1', PRIMARY KEY (id_cmd) ) TYPE=MyISAM; # # Dumping data for table 'liste_commandes' # INSERT INTO liste_commandes (id_cmd, nom, syntax, exemple, descr, descr_en, etat) VALUES (1,'Invite','/msg &lt;eggdrop_nick&gt; invite &lt;password&gt; &lt;channel&gt;','/msg Lespaul invite gloubilga #chan','L\'eggdrop vous invite sur le channel.','The eggdrop invites you in the channel.',1); INSERT INTO liste_commandes (id_cmd, nom, syntax, exemple, descr, descr_en, etat) VALUES (2,'Op','/msg &lt;eggdrop_nick&gt; op &lt;password&gt; &lt;channel&gt;','/msg Lespaul op gloubilga #chan','L\'eggdrop vous oppe (+o) sur le channel.','The eggdrop ops you (+o) on the channel.',1); INSERT INTO liste_commandes (id_cmd, nom, syntax, exemple, descr, descr_en, etat) VALUES (3,'Voice','/msg &lt;eggdrop_nick&gt; voice &lt;password&gt; &lt;channel&gt;','/msg Lespaul voice gloubilga #chan','L\'eggdrop vous voice (+v) sur le channel.','The eggdrop voices you (+v) on the channel.',1); INSERT INTO liste_commandes (id_cmd, nom, syntax, exemple, descr, descr_en, etat) VALUES (4,'Who','/msg &lt;eggdrop_nick&gt; who &lt;channel&gt;','/msg Lespaul who #chan','L\'eggdrop vous liste les personnes présentes sur le channel.','The eggdrop displays a list of the persons present on the channel.',1); INSERT INTO liste_commandes (id_cmd, nom, syntax, exemple, descr, descr_en, etat) VALUES (5,'Whois','/msg &lt;eggdrop_nick&gt; whois &lt;nickname&gt;','/msg Lespaul whois Robert','L\'eggdrop vous indique quel identifiant correspond au nickname.','The eggdrop displays what identifier matches the given nickname.',1); INSERT INTO liste_commandes (id_cmd, nom, syntax, exemple, descr, descr_en, etat) VALUES (6,'Go','/msg &lt;eggdrop_nick&gt; go &lt;channel&gt;','/msg Lespaul go #chan','L\'eggdrop quitte et join le chan s\'il n\'est pas op.<BR>Utile pour récupérer l\'op en cas de channel opless.','The eggdrop parts and joins the channel if not op.<BR>Useful for regaining ops.',1); INSERT INTO liste_commandes (id_cmd, nom, syntax, exemple, descr, descr_en, etat) VALUES (7,'Key','/msg &lt;eggdrop_nick&gt; key &lt;password&gt; &lt;channel&gt;','/msg Lespaul key gloubilga #chan','L\'eggdrop vous envoie la clef du channel s\'il est présent sur le channel.','The eggdrop sends you the key of the channel if it is present on it.',1); # # Table structure for table 'lz_chan_1' # DROP TABLE IF EXISTS lz_chan_1; CREATE TABLE lz_chan_1 ( chan_pk bigint(20) NOT NULL auto_increment, id_op bigint(20) NOT NULL default '0', lvl bigint(20) NOT NULL default '0', PRIMARY KEY (chan_pk) ) TYPE=MyISAM; # # Dumping data for table 'lz_chan_1' # # # Table structure for table 'op_levels' # DROP TABLE IF EXISTS op_levels; CREATE TABLE op_levels ( id_level bigint(20) NOT NULL auto_increment, op_level int(4) NOT NULL default '0', op_descr tinytext NOT NULL, op_descr_en tinytext NOT NULL, op_text text NOT NULL, op_text_en text NOT NULL, active tinyint(1) unsigned NOT NULL default '1', Guillaume Tournand <guillaume@tournand.com> September 2003 230/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project PRIMARY KEY (id_level) ) TYPE=MyISAM; # # Dumping data for table 'op_levels' # INSERT INTO op_levels (id_level, op_level, op_descr, op_descr_en, op_text, op_text_en, active) VALUES (1,200,'Opérateur de channel','Channel operator','<LI>accès opérateur sur le channel','<LI>operator access on the channel',1); INSERT INTO op_levels (id_level, op_level, op_descr, op_descr_en, op_text, op_text_en, active) VALUES (2,400,'Admin','Admin','<LI>accès opérateur sur le channel\r\n<LI>peut ajouter/supprimer des operateurs via l\'interface web','<LI>operator access on the channel\r\n<LI>can add/remove operators through the web interface',1); INSERT INTO op_levels (id_level, op_level, op_descr, op_descr_en, op_text, op_text_en, active) VALUES (3,450,'Admin sénior','Senior admin','<LI>accès opérateur sur le channel\r\n<LI>peut ajouter/supprimer des admins via l\'interface web','<LI>operator access on the channel\r\n<LI>can add/remove admins through the web interface',1); INSERT INTO op_levels (id_level, op_level, op_descr, op_descr_en, op_text, op_text_en, active) VALUES (4,500,'Propriétaire','Owner','<LI>accès opérateur sur le channel\r\n<LI>peut ajouter/supprimer des admins séniors','<LI>operator access on the channel\r\n<LI>can add/remove senior admins through the web interface',1); # # Table structure for table 'partenaires_big' # DROP TABLE IF EXISTS partenaires_big; CREATE TABLE partenaires_big ( id_partenaire bigint(20) NOT NULL auto_increment, code_html tinytext NOT NULL, PRIMARY KEY (id_partenaire) ) TYPE=MyISAM; # # Dumping data for table 'partenaires_big' # # # Table structure for table 'partenaires_small' # DROP TABLE IF EXISTS partenaires_small; CREATE TABLE partenaires_small ( id_partenaire bigint(20) NOT NULL auto_increment, href tinytext NOT NULL, src tinytext NOT NULL, alt tinytext NOT NULL, PRIMARY KEY (id_partenaire) ) TYPE=MyISAM; # # Dumping data for table 'partenaires_small' # # # Table structure for table 'raisons_purge' # DROP TABLE IF EXISTS raisons_purge; CREATE TABLE raisons_purge ( id_purge bigint(20) NOT NULL auto_increment, descr tinytext NOT NULL, texte text NOT NULL, descr_en tinytext NOT NULL, texte_en text NOT NULL, PRIMARY KEY (id_purge) Guillaume Tournand <guillaume@tournand.com> September 2003 231/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project ) TYPE=MyISAM; # # Dumping data for table 'raisons_purge' # INSERT INTO raisons_purge (id_purge, descr, texte, descr_en, texte_en) VALUES (1,'eggdrops déoppés/bannis','Les eggdrops prétés par le projet Loufiz sont restés déoppés pendant trop longtemps, ou ont été bannis du channel.','eggdrops deopped/banned','The eggdrops lent by the Loufiz project have been deopped for too long, or have been banned from the channel.'); INSERT INTO raisons_purge (id_purge, descr, texte, descr_en, texte_en) VALUES (2,'channel idle','Le channel est resté idle pendant trop longtemps.','idle channel','The channel has remained idle for too long.'); INSERT INTO raisons_purge (id_purge, descr, texte, descr_en, texte_en) VALUES (3,'accès X absent','Les accès sur X pour les eggdrops n\'ont pas été créés conformément à ce que demande le reglement.','missing X access','Access on X for the eggdrops haven\'t been created as requested in our conditions of service.'); INSERT INTO raisons_purge (id_purge, descr, texte, descr_en, texte_en) VALUES (4,'channel illegal','La raison d\'être du channel est illégalle, et ne sera plus supportée par le projet Loufiz.','illegal channel','The reason of existence of this channel is illegal.'); INSERT INTO raisons_purge (id_purge, descr, texte, descr_en, texte_en) VALUES (5,'chan est plein d\'eggs','Le channel contient assez d\'eggdrops pour assurer sa sécurité, les eggdrops du projet Loufiz sont maintenant inutiles.','eggfull channel','The channel has enough eggdrops to ensure it\'s own security, the Loufiz project\'s eggdrops are now useless.'); INSERT INTO raisons_purge (id_purge, descr, texte, descr_en, texte_en) VALUES (6,'mauvais chanmode','Le channel a comme chanmode +i et/ou +k et/ou +l','bad chanmode','The channel has for chanmode +i and/or +k and/or +l'); # # Table structure for table 'raisons_refus' # DROP TABLE IF EXISTS raisons_refus; CREATE TABLE raisons_refus ( id_refus bigint(20) unsigned NOT NULL auto_increment, descr tinytext NOT NULL, texte text NOT NULL, descr_en tinytext NOT NULL, texte_en text NOT NULL, PRIMARY KEY (id_refus) ) TYPE=MyISAM; # # Dumping data for table 'raisons_refus' # INSERT INTO raisons_refus (id_refus, descr, texte, descr_en, texte_en) VALUES (1,'les infos users sont bidons','Veuillez remplir le formulaire de création d\'un identifiant avec des informations un minimum <U>réelles</U>.','user information are false','Please fill up the identifier creation form with information a minimum <U>real</U>.'); INSERT INTO raisons_refus (id_refus, descr, texte, descr_en, texte_en) VALUES (2,'pas de raison','','no reason',''); INSERT INTO raisons_refus (id_refus, descr, texte, descr_en, texte_en) VALUES (3,'nom de channel glauque','Le nom de votre channel nous force à vous refuser le pret des eggdrops.','bad channel name','The name of your channel forces us to refuse the eggdrop request.'); INSERT INTO raisons_refus (id_refus, descr, texte, descr_en, texte_en) VALUES (4,'le chan est vide','Votre channel ne contient pas les 10 utilisateurs minimum.<BR>Nous vous invitons à refaire une demande plus tard, une fois que votre channel sera un minimum visité.','empty channel','Your channel doesn\'t have the requested 10 users.<BR>We invite you to make a request later, when your channel will be a minimum visited.'); INSERT INTO raisons_refus (id_refus, descr, texte, descr_en, texte_en) VALUES (6,'le chan est plein d\'eggs','Le channel demandé contient suffisamment d\'eggdrops pour assurer sa protection.','eggfull channel','The channel holds enough eggdrops to ensure it\'s protection.'); INSERT INTO raisons_refus (id_refus, descr, texte, descr_en, texte_en) VALUES (5,'nom de channel incorrect','Le nom de votre channel est incorrect.<BR>Nous vous invitons à refaire une demande d\'eggdrops avec un nom de channel valide. ','incorrect channel name','The name of your channel is incorrect.<BR>We invite you to make a new request with a valid channel name.'); INSERT INTO raisons_refus (id_refus, descr, texte, descr_en, texte_en) VALUES (7,'non respect du reglement','Des eggdrops vous ont déjà été prétés, et ont été retirés pour non respect de notre reglement.','unrespected conditions','Eggdrops have already been lent to your channel and have been removed for non respect of our conditions.'); Guillaume Tournand <guillaume@tournand.com> September 2003 232/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project INSERT INTO raisons_refus (id_refus, descr, texte, descr_en, texte_en) VALUES (8,'mauvais chanmode','Votre channel a comme chanmode +i et/ou +k.<BR>Nous vous invitons à refaire une demande plus tard, une fois que vous aurez rendu votre channel conforme à notre règlement.','bad chanmode','Your channel has for chanmode +i and/or +k.<BR>We invite you to make a request later, when your channel will correspond to our conditions of service.'); INSERT INTO raisons_refus (id_refus, descr, texte, descr_en, texte_en) VALUES (9,'chan sans op','Votre channel n\'a aucun opérateur.<BR>Nous vous invitons à faire une demande plus tard, lorsque vous serez à même de vous opper.','opless chan','Your channel is opless.<BR>We invite you to make a request later, when you\'ll be able to gain ops on your channel.'); INSERT INTO raisons_refus (id_refus, descr, texte, descr_en, texte_en) VALUES (10,'demandeur absent du chan','Le demandeur d\'eggdrops n\'était pas présent au moment de l\'étape de validation.<BR>Nous vous invitons à refaire une demande.','requester not on channel','The eggdrops requester wasn\'t on the channel when we wanted to validate the request.<BR>We invite you to make a new request.'); INSERT INTO raisons_refus (id_refus, descr, texte, descr_en, texte_en) VALUES (11,'projet complet','Le projet était complet quand votre demande a été traitée.<BR>\r\nNous vous invitons à refaire une demande lorsqu\'une place se libèrera.','project full','The project was full when we reviewed your request.<BR>\r\nWe invite you to make a new request when a room will be available.'); INSERT INTO raisons_refus (id_refus, descr, texte, descr_en, texte_en) VALUES (12,'demandeur pas propriétaire','Le demandeur d\'eggdrops n\'est pas le propriétaire du channel.','requester isn\'t the chanowner','The eggdrops requester isn\'t the channel owner.'); INSERT INTO raisons_refus (id_refus, descr, texte, descr_en, texte_en) VALUES (13,'assistant loufiz kické/banni','Pendant que la demande était traitée, un opérateur du channel a kické/banni l\'assistant de #loufiz.','loufiz assistant kicked/banned','While reviewing the eggdrop request the Loufiz assistant has been kicked/banned from the channel.'); # # Table structure for table 'serveurs' # DROP TABLE IF EXISTS serveurs; CREATE TABLE serveurs ( id_svr bigint(20) unsigned NOT NULL auto_increment, nom tinytext NOT NULL, port int(11) NOT NULL default '0', coeff_dist int(11) NOT NULL default '0', svr_bloc int(11) NOT NULL default '0', etat tinyint(3) NOT NULL default '1', chan_max tinyint(4) NOT NULL default '0', defaillances tinyint(4) NOT NULL default '0', PRIMARY KEY (id_svr) ) TYPE=MyISAM; # # Dumping data for table 'serveurs' # INSERT INTO serveurs (id_svr, nom, port, coeff_dist, svr_bloc, etat, chan_max, defaillances) VALUES (3,'london.uk.eu.undernet.org',6667,2,3,1,10,0); INSERT INTO serveurs (id_svr, nom, port, coeff_dist, svr_bloc, etat, chan_max, defaillances) VALUES (4,'surrey.uk.eu.undernet.org',6667,2,2,1,10,2); INSERT INTO serveurs (id_svr, nom, port, coeff_dist, svr_bloc, etat, chan_max, defaillances) VALUES (7,'geneva.ch.eu.undernet.org',6667,3,1,1,15,0); INSERT INTO serveurs (id_svr, nom, port, coeff_dist, svr_bloc, etat, chan_max, defaillances) VALUES (8,'amsterdam.nl.eu.undernet.org',6667,3,2,1,10,0); INSERT INTO serveurs (id_svr, nom, port, coeff_dist, svr_bloc, etat, chan_max, defaillances) VALUES (9,'diemen.nl.eu.undernet.org',6667,3,2,1,12,0); INSERT INTO serveurs (id_svr, nom, port, coeff_dist, svr_bloc, etat, chan_max, defaillances) VALUES (10,'ede.nl.eu.undernet.org',6667,3,3,1,12,0); INSERT INTO serveurs (id_svr, nom, port, coeff_dist, svr_bloc, etat, chan_max, defaillances) VALUES (11,'graz.at.eu.undernet.org',6667,4,1,1,16,0); INSERT INTO serveurs (id_svr, nom, port, coeff_dist, svr_bloc, etat, chan_max, defaillances) VALUES (12,'graz2.at.eu.undernet.org',6667,4,1,1,16,0); INSERT INTO serveurs (id_svr, nom, port, coeff_dist, svr_bloc, etat, chan_max, defaillances) VALUES (13,'stockholm.se.eu.undernet.org',6667,5,3,1,15,1); INSERT INTO serveurs (id_svr, nom, port, coeff_dist, svr_bloc, etat, chan_max, defaillances) VALUES (14,'oslo.no.eu.undernet.org',6667,6,2,1,15,0); Guillaume Tournand <guillaume@tournand.com> September 2003 233/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project INSERT INTO serveurs (id_svr, nom, port, coeff_dist, svr_bloc, etat, chan_max, defaillances) VALUES (15,'montreal.qu.ca.undernet.org',6667,10,3,1,10,0); INSERT INTO serveurs (id_svr, nom, port, coeff_dist, svr_bloc, etat, chan_max, defaillances) VALUES (35,'princeton.nj.us.undernet.org',6667,10,1,1,0,0); INSERT INTO serveurs (id_svr, nom, port, coeff_dist, svr_bloc, etat, chan_max, defaillances) VALUES (34,'losangeles.ca.us.undernet.org',6667,15,2,1,0,0); INSERT INTO serveurs (id_svr, nom, port, coeff_dist, svr_bloc, etat, chan_max, defaillances) VALUES (18,'mesa.az.us.undernet.org',6667,12,1,1,35,0); INSERT INTO serveurs (id_svr, nom, port, coeff_dist, svr_bloc, etat, chan_max, defaillances) VALUES (19,'washington.dc.us.undernet.org',6667,10,2,1,10,0); INSERT INTO serveurs (id_svr, nom, port, coeff_dist, svr_bloc, etat, chan_max, defaillances) VALUES (20,'elsene.be.eu.undernet.org',6667,2,3,1,20,0); INSERT INTO serveurs (id_svr, nom, port, coeff_dist, svr_bloc, etat, chan_max, defaillances) VALUES (21,'atlanta.ga.us.undernet.org',6667,12,3,1,15,0); INSERT INTO serveurs (id_svr, nom, port, coeff_dist, svr_bloc, etat, chan_max, defaillances) VALUES (22,'fairfax.va.us.undernet.org',6667,12,1,1,35,0); INSERT INTO serveurs (id_svr, nom, port, coeff_dist, svr_bloc, etat, chan_max, defaillances) VALUES (23,'mclean.va.us.undernet.org',6667,12,2,0,10,0); INSERT INTO serveurs (id_svr, nom, port, coeff_dist, svr_bloc, etat, chan_max, defaillances) VALUES (33,'lelystad.nl.eu.undernet.org',6667,3,2,1,0,0); INSERT INTO serveurs (id_svr, nom, port, coeff_dist, svr_bloc, etat, chan_max, defaillances) VALUES (26,'sanjose.ca.us.undernet.org',6667,11,3,1,10,0); INSERT INTO serveurs (id_svr, nom, port, coeff_dist, svr_bloc, etat, chan_max, defaillances) VALUES (32,'bucharest.ro.eu.undernet.org',6667,3,3,1,0,0); INSERT INTO serveurs (id_svr, nom, port, coeff_dist, svr_bloc, etat, chan_max, defaillances) VALUES (28,'diemen2.nl.eu.undernet.org',6667,3,2,0,12,0); INSERT INTO serveurs (id_svr, nom, port, coeff_dist, svr_bloc, etat, chan_max, defaillances) VALUES (29,'helsinki.fi.eu.undernet.org',6667,6,3,1,15,0); INSERT INTO serveurs (id_svr, nom, port, coeff_dist, svr_bloc, etat, chan_max, defaillances) VALUES (30,'lidingo.se.eu.undernet.org',6667,5,1,1,10,0); INSERT INTO serveurs (id_svr, nom, port, coeff_dist, svr_bloc, etat, chan_max, defaillances) VALUES (31,'milan.it.eu.undernet.org',6667,4,1,1,10,1); # # Table structure for table 'users' # DROP TABLE IF EXISTS users; CREATE TABLE users ( id_user bigint(20) unsigned NOT NULL auto_increment, unixtime_creat bigint(20) NOT NULL default '0', ip_creat tinytext NOT NULL, genre tinytext NOT NULL, nom tinytext NOT NULL, prenom tinytext NOT NULL, unixtime_naiss bigint(20) NOT NULL default '0', ville tinytext NOT NULL, pays tinytext NOT NULL, amail tinytext NOT NULL, username tinytext NOT NULL, host1 tinytext NOT NULL, host2 tinytext NOT NULL, host3 tinytext NOT NULL, pass tinytext NOT NULL, nick tinytext NOT NULL, nb_login bigint(20) NOT NULL default '0', nb_requete bigint(20) NOT NULL default '0', unixtime_modif bigint(20) NOT NULL default '0', unixtime_login bigint(20) NOT NULL default '0', ip_login tinytext NOT NULL, unixtime_oubli bigint(20) NOT NULL default '0', lang tinytext NOT NULL, PRIMARY KEY (id_user), KEY id_user (id_user) ) TYPE=MyISAM; # # Dumping data for table 'users' Guillaume Tournand <guillaume@tournand.com> September 2003 234/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # Guillaume Tournand <guillaume@tournand.com> September 2003 235/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Appendix C The web interface Guillaume Tournand <guillaume@tournand.com> September 2003 236/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project The conditions of service Here are the different steps to request your eggdrops from the Loufiz project: • Read and accept the rules below • If you haven't created an identifier yet, proceed now by filling in the "Identifier creation" form • Fill in the "Eggdrops request" form with your Identifier. Then, everything you need to : • follow the evolution of your request • manage your profile • add/remove operators/admins • manage lent eggdrops is available at Eggdrops > User login. I - Loufiz project II - User request III - Conditions on the lent eggdrop bots IV - Reminder V - Rules violation VI - Important basics VII - Additional I - Loufiz project "Splitproof" ? Keep your channel's rights for free, easily, and with no time limit ! Loufiz.com lends 3 (three) bots [eggdrops] for free for your channel on Undernet; whatever the commitement you have with Cservice. II - User request Loufiz.com blames Take-Overs (channel stealing by flooding or any other attack). So, only the channel owner is able to request bots. He's considered as the owner by the channel users. He's the channel funder or someone rightly entitled. III - Conditions on the lent eggdrop bots The Loufiz project services are free, but users have to respect these conditions : • • • • • • • Users aren't allowed to deop, kick or ban any of the Loufiz bots. Other bots are tolerated only if they are "controlled" by their masters, and if the channel owner agrees with their presence. For the rights and liberty respect, the channel should not be used for pornographic, paedophiliac, warez distribution purposes (music, softwares, movies and so on...) or any other rough or illegal reasons. The user requesting the bot as to ensure that the other operators have read the present rules. In case of a dispute, the owner is responsible. DO NOT give out your password or the operator status to anyone claiming to be a Loufiz project administrator. We don't and won't NEED it. If your channel is registered on Cservice, you have to create an access 100 AUTOMODE OP for each of the 3 eggdrops that are lent. If your channel isn't registered on Cservice, these accesses must be created when you decide to register it. Guillaume Tournand <guillaume@tournand.com> September 2003 237/489 MSc Dissertation • • IRC distributed bot lending platform: The Loufiz project Channel mustn't usually put these mode on : +i +k, or +l avoiding our eggdrops to join. The channel must have at least 10 (ten) users; without clones or bots. NOTE: We don't lend bots to channels designed to help users on IRC. They have to be able to help themselves before trying to help other people. IV - Reminder On Undernet, • • Any advertising is FORBIDDEN. For the best readability and user-friendliness possible, please avoid to use over-colored or repetitive away-message scripts. Undernet's AUP can be found at http://www.user-com.undernet.org/documents/. V - Rules violation The administration can, according to the fault severity, pronounced the following sanctions : • • • Warning. Temporary suspension of eggdrop bots. Channel purge. VI - Important basics • • • We consider that the channel operators have read and accepted the present conditions of service. Loufiz project members help you but aren't at your disposal. The Loufiz project is not responsible for anything happening in the protected channels. VII - Additional o Channel: chat room on Undernet. o The owner: the eggdrops requester, and the channel owner. -Web administration - has the ability to grant operator access to the channel users. -Channel operator. o Chanop: access given to an user by the channel owner. Channel operator. Guillaume Tournand <guillaume@tournand.com> September 2003 238/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project The user side eggdrop/channel.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='eggdrops'; // on met en place la session et la langue require 'include/.htsession'; // on vide la session require 'include/.hteggdrop_vide_session.php'; ?> <HTML> <HEAD> <TITLE>Loufiz : Channel</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> <script> function ouvrirfenetre() { exemple=window.open ("","fenetreimage", "scrollbars=yes, toolbar=no, location=no, directories=no, status=no, resizable=yes") } </script> </HEAD> <BODY> <?PHP require 't_frame.php'; //calcul de la capacite restante require 'include/.htmysql'; $connexion_chans=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_chans); $prct=project_use($egg_max_chan); mysql_close($connexion_chans); Guillaume Tournand <guillaume@tournand.com> September 2003 239/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project echo $conditions; // pour moi, afin de pouvoir tester meme si le projet est plein //$prct=1; if ($prct >= 100){ echo $loufiz_plein; } else { echo $formulaire_demande; } ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 240/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project eggdrop/channel_confirm.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='eggdrops'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Channel</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <?PHP $wait_time=24*3600; require 't_frame.php'; require 'include/.htmysql'; $connexion=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion); $nom_chan= strtolower ($nom_chan); // nettoyage des id_user $id_user=clean_id ($id_user); $valeurs= array($id_user, $pass, $nom_chan); for($cpt=0 ; $valeurs[$cpt] ; $cpt++); if ($cpt < 3){ echo $demande_err_1; } else { $longueur=strlen($nom_chan); // test sur le nom de channel Guillaume Tournand <guillaume@tournand.com> September 2003 241/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project for ($i=0, $bad_channel=0; $i<$longueur; $i++) { $char=substr($nom_chan,$i,1); if (!eregi("^[_a-z0-9-]+", $char) && $char != '.' && $char != '_' && $char != '&') { $bad_channel=1; } } if ($bad_channel){ echo $demande_err_2; } else { $query1="SELECT nom_chan FROM channels WHERE nom_chan='$nom_chan'"; $result1=mysql_query($query1) or die ("Requète non valide"); $existechan1=mysql_num_rows($result1); $query2="SELECT nom_chan FROM askin_chan WHERE nom_chan='$nom_chan'"; $result2=mysql_query($query2) or die ("Requète non valide"); $existechan2=mysql_num_rows($result2); if ($existechan1 || $existechan2) { echo $demande_err_3; } else { $query="SELECT id_user,pass,username,nick,nb_requete FROM users WHERE id_user='$id_user'"; $result=mysql_query($query) or die ("Requète non valide"); $max_result=mysql_num_rows($result); if ($max_result){ $passcheck=mysql_result($result,0,'pass'); } if ($pass != $passcheck) { echo $demande_err_4; } else { // On verifie que le channel ne soit pas blackliste $query_blacklist="SELECT id_black FROM blacklist WHERE nom_chan='$nom_chan' AND active=1"; $result_blacklist = mysql_query($query_blacklist) or die ("Requète non valide"); $blacklisted=mysql_num_rows($result_blacklist); if ($blacklisted){ echo $demande_err_5; } else { // on verifie que le channel puisse re-demander $unixtime_now=time(); $query_wait="SELECT unixtime_refus FROM getout_chan g WHERE nom_chan='$nom_chan' AND attente_active=1"; $result_wait = mysql_query($query_wait) or die ("Requète non valide"); $max_wait=mysql_num_rows($result_wait); if ($max_wait) { $refus_unixtime=mysql_result($result_wait,0,'unixtime_refus'); } if ($unixtime_now-$refus_unixtime<$wait_time) { echo $demande_err_5_1; } else { // On verifie la capacite restante du projet $result_chans = mysql_query("SELECT nom_chan from channels WHERE nom_chan!='loufiz'") or die ("Requete non valide"); Guillaume Tournand <guillaume@tournand.com> September 2003 242/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $max_chans=mysql_num_rows($result_chans); $result_capacite=mysql_query("SELECT DISTINCT egg_bloc from eggdrops WHERE egg_bloc!='0'") or die ("Requete non valide"); $nb_bloc=mysql_num_rows($result_capacite); $chans_max=bcmul($nb_bloc,$egg_max_chan,2); $courrant=bcdiv($max_chans, $chans_max, 2); $prct=bcmul($courrant,100,2); // pour moi, afin de pouvoir tester meme si le projet est plein //$prct=1; if ($prct>=100) { echo $demande_err_6; } else { // compte de demo if ($id_user == $demo_id) { echo $demande_err_6_1; } else { // On fin des tests, on lance la puree $id_user=mysql_result($result,0,'id_user'); $nick=mysql_result($result,0,'nick'); $username=mysql_result($result,0,'username'); $nb_requete=mysql_result($result,0,'nb_requete'); $unixtime_maintenant= time(); // On purge le champ texte pour retirer le symbole ' //$commentaire = strip_single_quote ($commentaire); $query="INSERT INTO askin_chan (nom_chan, id_owner, unixtime_demande, commentaire) VALUES ('$nom_chan', '$id_user', '$unixtime_maintenant', '$commentaire');"; $result = mysql_query($query) or die ("Requête non valide"); // On lance l'instruction pour prevenir les voices $commande=".newapp $nom_chan"; $query="INSERT INTO instructions (unixtime, id_user, commande, ack) VALUES ('$unixtime_maintenant', '$id_user', '$commande', '3');"; $result = mysql_query($query) or die ("Requête non valide"); echo $demande_ok; // envoi de mail a l'equipe pour avertir de la presence d'une nouvelle demande. $query="SELECT nick from users u, admin a WHERE a.id_user=u.id_user AND a.mail_request='1'"; $result = mysql_query($query) or die ("Requête non valide"); $nb_m=mysql_num_rows($result); if ($nb_m){ for ($i=0, $bcc=''; $i<$nb_m; $i++){ Guillaume Tournand <guillaume@tournand.com> September 2003 243/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $nick_mail=mysql_result($result,$i,"nick"); $bcc .= "$nick_mail@loufiz.com,"; } $date_maintenant=date("d/m/Y", "$unixtime_maintenant"); $to=""; $subject = "[www.loufiz.com] demande d'eggdrops pour #$nom_chan / eggdrops request for #$nom_chan"; $body = "Le $date_maintenant, $nick (LZ-$id_user), ayant pour username $username, a effectué une demande d'eggdrops pour le channel #$nom_chan.\n\nThe $date_maintenant, $nick (LZ-$id_user), having $username for username, made an eggdrop request for #$nom_chan."; $header = "From: webmaster@loufiz.com\nReply-To: eggdrops@loufiz.com\n"; $header .= "Bcc: $bcc\r\n"; mail ($to, $subject, $body, $header); } echo "<FORM METHOD='POST' ACTION='index.php'>"; if ($commentaire){ $query="INSERT INTO commentaires (id_user, nom_chan, unixtime_comment, commentaire) VALUES ('$id_user', '$nom_chan', '$unixtime_maintenant', '$commentaire');"; $result=mysql_query($query) or die ("Requète non valide"); } // On supprime les entrees de channels ayant deja ete refusés. (pour le suivi des demandes) $query="DELETE FROM getout_chan WHERE nom_chan='$nom_chan'"; $result=mysql_query($query) or die ("Requète non valide"); // On met a jour la derniere auth $result_update = mysql_query("UPDATE users SET unixtime_login='$unixtime_maintenant' WHERE id_user = '$id_user'") or die ("Requete non valide"); // on incremente le nb de requetes $nb_requete++; $result_update = mysql_query("UPDATE users SET nb_requete='$nb_requete' WHERE id_user = '$id_user'") or die ("Requete non valide"); } } } } } } } } mysql_close($connexion); echo $demande_valid; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 244/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project eggdrop/commandes.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='eggdrops'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <LINK REL='stylesheet' HREF='include/style/table_no_bgcolor.css'> </HEAD> <BODY> <BR> <?PHP // connection a la base require 'include/.htmysql'; $connexion_chans=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_chans); // on affiche l'en tete echo "$commandes_header<BR>"; echo "$commandes_desc<BR>"; echo "<BR><BR><TABLE ALIGN='CENTER' WIDTH='100%' BORDER='0'><TR ALIGN='CENTER'><TH>$commandes_head1</TH><TH WIDTH='450'>$commandes_head2 / <font color='#333399'>$commandes_head3</font></TH><TH>$commandes_head4</TH></TR>"; // select $result=mysql_query("SELECT * FROM liste_commandes WHERE etat='1' ORDER BY nom ASC") or die ("Requete non valide"); $max_cmds=mysql_num_rows($result); // detection de la langue if ($lang == 'fr') { $descr_lang="descr"; } if ($lang == 'en') { Guillaume Tournand <guillaume@tournand.com> September 2003 245/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $descr_lang="descr_en"; } /// affiche les commandes for ($cpt=0; $cpt<$max_cmds;$cpt++) { // fetch les resultats $nom = mysql_result($result,$cpt,"nom"); $syntax = mysql_result($result,$cpt,"syntax"); $exemple = mysql_result($result,$cpt,"exemple"); $descr = mysql_result($result,$cpt,"$descr_lang"); echo "<TR VALIGN='CENTER'"; if (($cpt+1)%2) { echo " bgcolor='#EDEDFF'"; } echo ">"; echo "<TD ALIGN='CENTER'>$nom</TD>"; echo "<TD>$syntax<BR><font color='#333399'>$exemple</font></TD>"; echo "<TD>$descr</TD>"; echo "</TR>"; } echo "</TABLE>"; mysql_close($connexion_chans); ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 246/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project eggdrop/faq.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='eggdrops'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : FAQ</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <?PHP require 'include/.htmysql'; $connexion_chans=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_chans); // detection de la langue if ($lang == 'fr') { $question="question"; $reponse="reponse"; } if ($lang == 'en') { $question="question_en"; $reponse="reponse_en"; } $result_faq=mysql_query("SELECT id_faq, $question, $reponse, groupe FROM faq ORDER by groupe ASC, ordre ASC, id_faq ASC") or die ("Requete non valide"); $max_faqs=mysql_num_rows($result_faq); if ($max_faqs) { Guillaume Tournand <guillaume@tournand.com> September 2003 247/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project echo "<A NAME='top' class='menu'></A><BR><BR><CENTER><H3><U>$faq_head</U></H3></CENTER><BR><HR><BR>"; for ($cpt=0; $cpt<$max_faqs; $cpt++) { $id_faq=mysql_result($result_faq, $cpt, "id_faq"); $quest=mysql_result($result_faq, $cpt, "$question"); $groupe=mysql_result($result_faq, $cpt, "groupe"); if ($groupe != $prev_groupe) { switch ($groupe) { case 1: echo "<BR><BR><H3>$faq_sect1</H3>"; break; case 2: echo "<BR><BR><H3>$faq_sect2</H3>"; break; case 3: echo "<BR><BR><H3>$faq_sect3</H3>"; break; case 4: echo "<BR><BR><H3>$faq_sect4</H3>"; break; } } echo "<A HREF='#$id_faq' class='lien'>$quest</A><BR>"; $prev_groupe=$groupe; } echo "<BR><HR><BR><BR>"; for ($cpt=0; $cpt<$max_faqs; $cpt++) { $id_faq=mysql_result($result_faq, $cpt, "id_faq"); $quest=mysql_result($result_faq, $cpt, "$question"); $rep=mysql_result($result_faq, $cpt, "$reponse"); $groupe=mysql_result($result_faq, $cpt, "groupe"); echo "<A NAME='$id_faq' class='menu'><FONT COLOR='green'>$quest</FONT></A><BR><BR>"; echo "$rep<BR><BR><DIV ALIGN='right'>[<A HREF='#top' class='lien'>$faq_sommaire</A>]</DIV><BR><BR>"; } } mysql_close($connexion_chans); ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 248/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project eggdrop/identifiant.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='eggdrops'; // on met en place la session et la langue require 'include/.htsession'; // on vide la session require 'include/.hteggdrop_vide_session.php'; ?> <HTML> <HEAD> <TITLE>Loufiz : Identifiant</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> <script> function ouvrirfenetre() { exemple=window.open ("","fenetreimage", "scrollbars=yes, toolbar=no, location=no, directories=no, status=no, resizable=yes") } </script> </HEAD> <BODY> <?PHP require 't_frame.php'; require 'include/.htmysql'; $connexion=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion); echo $identifiant_1_1; echo "<FORM METHOD='POST' ACTION='identifiant_confirm.php'> <TABLE WIDTH='95%' HEIGHT='340' BORDER='0' ALIGN='CENTER'> <TR ALIGN='LEFT'><TD>"; // selection du genre // detection de la langue pour savoir dans quelle table tapper. Guillaume Tournand <guillaume@tournand.com> September 2003 249/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if ($lang != 'fr') { $table_genre_texte="descr_$lang"; } if ($lang == 'fr') { $table_genre_texte="descr"; } echo "<SELECT NAME='genre'>"; // si aucun genre selectionné précédemment if (!$genre) { $result_genre=mysql_query("SELECT * from genre") or die ("Requete non valide"); $max_genre=mysql_num_rows($result_genre); echo "<OPTION VALUE=''>"; for ($cpt=0; $cpt<$max_genre; $cpt++) { $id_genre=mysql_result($result_genre,$cpt,"id_genre"); $genre_text=mysql_result($result_genre,$cpt,"$table_genre_texte"); echo "<OPTION VALUE='$id_genre'>$genre_text"; } } if ($genre) { $result_genre=mysql_query("SELECT * from genre WHERE id_genre='$genre'") or die ("Requete non valide"); $max_genre=mysql_num_rows($result_genre); if ($max_genre) { $genre_text=mysql_result($result_genre,0,"$table_genre_texte"); echo "<OPTION VALUE='$genre'>$genre_text"; } $result_genre=mysql_query("SELECT * from genre WHERE id_genre!='$genre'") or die ("Requete non valide"); $max_genre=mysql_num_rows($result_genre); for ($cpt=0; $cpt<$max_genre; $cpt++) { $id_genre=mysql_result($result_genre,$cpt,"id_genre"); $genre_text=mysql_result($result_genre,$cpt,"$table_genre_texte"); echo "<OPTION VALUE='$id_genre'>$genre_text"; } } echo "</SELECT>"; echo "</TD><TD ALIGN='RIGHT'>"; // nom echo "$identifiant_1_2_1"; echo "</TD><TD ALIGN='LEFT'> <INPUT TYPE='text' NAME='nom' value='$nom' SIZE=25 MAXLENGTH=25> </TD><TD ALIGN='RIGHT'>"; // prenom echo "$identifiant_1_2_2"; echo "</TD><TD> <INPUT TYPE='text' NAME='prenom' value='$prenom' SIZE=25 MAXLENGTH=25> </TD></TR><TR ALIGN='LEFT' VALIGN='MIDDLE'><TD ALIGN='RIGHT' COLSPAN=2>"; // date de naissance echo "$identifiant_1_2_3"; echo "</TD><TD ALIGN='LEFT'> <SELECT NAME='naiss_jour'>"; Guillaume Tournand <guillaume@tournand.com> September 2003 250/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if ($naiss_jour) { echo "<OPTION VALUE='$naiss_jour'>$naiss_jour"; } if (!$naiss_jour) { echo "<OPTION VALUE=''>"; } for ($cpt=1; $cpt<=31; $cpt++){ echo "<OPTION VALUE='$cpt'>$cpt"; } echo "</SELECT> / <SELECT NAME='naiss_mois'>"; if ($naiss_mois) { echo "<OPTION VALUE='$naiss_mois'>$naiss_mois"; } if (!$naiss_mois) { echo "<OPTION VALUE=''>"; } for ($cpt=1; $cpt<=12; $cpt++){ echo "<OPTION VALUE='$cpt'>$cpt"; } echo "</SELECT> / <SELECT NAME='naiss_annee'>"; if ($naiss_annee) { echo "<OPTION VALUE='$naiss_annee'>$naiss_annee"; } if (!$naiss_annee) { echo "<OPTION VALUE=''>"; } $year=date("Y"); for ($cpt=$year-5; $cpt>=$year-100; $cpt--){ echo "<OPTION VALUE='$cpt'>$cpt"; } echo "</SELECT> </TD><TD ALIGN='RIGHT'>"; // nickname echo "$identifiant_4_1"; echo "</TD><TD>"; echo "<INPUT TYPE='text' NAME='nick' value='$nick' SIZE=10 MAXLENGTH=10>"; echo "</TD></TR><TR ALIGN='LEFT' VALIGN='MIDDLE'><TD ALIGN='RIGHT'>"; // ville echo "$identifiant_4_1_1"; echo "</TD><TD COLSPAN=2>"; echo "<INPUT TYPE='text' NAME='ville' value='$ville' SIZE=20 MAXLENGTH=20>"; echo "</TD><TD ALIGN='RIGHT'>"; // pays echo "$identifiant_4_2"; echo "</TD><TD>"; echo "<INPUT TYPE='text' NAME='pays' value='$pays' SIZE=20 MAXLENGTH=20>"; echo "</TD></TR><TR HEIGHT='40'><TD ALIGN='RIGHT'>"; // addresse mail echo "$identifiant_4_3"; echo "</TD><TD COLSPAN=2>"; echo "<INPUT TYPE='text' NAME='amail' value='$amail' SIZE=35 MAXLENGTH=35>"; Guillaume Tournand <guillaume@tournand.com> September 2003 251/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project echo "</TD><TD COLSPAN=1 ALIGN='RIGHT' VALIGN='CENTER'>"; // pass and confirmation echo "$identifiant_5_2 : <BR>$identifiant_5_3 : </TD><TD ALIGN='LEFT' VALIGN='CENTER'>"; echo "<INPUT TYPE='password' NAME='pass' SIZE=10 MAXLENGTH=10><BR>"; echo "<INPUT TYPE='password' NAME='confirm_pass' SIZE=10 MAXLENGTH=10>"; echo "</TD></TR>"; /* //echo "$identifiant_4_4"; echo "<BR><BR>"; echo "ADD: <A HREF='../irc/uath.php?window=1' class='lien' target='fenetreimage' onclick='ouvrirfenetre()'>$identifiant_5</A><BR> */ // Lets find out the host if (!$host1) { // on met automatiquement l'user@host $ip=getenv ("REMOTE_ADDR"); $host1=gethostbyaddr($ip); // si le resolv n'a pas marché if ($host1 == $ip) { for ($cpt=0, $nb_points=0; $cpt<strlen ($host1) && $nb_points <2; $cpt++) { $char=substr($host1, $cpt, 1); if ($char == '.') { $nb_points ++; } } $host1=substr($host1, 0, $cpt); $host1 ="$host1*"; } else { for ($cpt=strlen ($host1), $nb_points=0; $cpt>0 && $nb_points <2; $cpt--) { $char=substr($host1, $cpt, 1); if ($char == '.') { $nb_points ++; } } if ($cpt) { $cpt++; } $fin = strlen ($host1) - $cpt; $host1=substr($host1, $cpt, strlen ($host1) - $cpt); $host1 ="*$host1"; } } echo "<TR>"; echo "<TD></TD><TD COLSPAN=4>"; // the user@host echo "<A HREF='../irc/iath.php?window=1' class='lien' target='fenetreimage' onclick='ouvrirfenetre()'>$identifiant_5</A> : "; echo "*!*<INPUT TYPE='text' NAME='username' value='$username' SIZE='10' MAXLENGTH='10'>@<INPUT TYPE='text' NAME='host1' SIZE=23 MAXLENGTH=50 value ='$host1'>"; Guillaume Tournand <guillaume@tournand.com> September 2003 252/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project echo "<BR><BR>"; echo "<FONT SIZE='-1'><B>$identifiant_5_1</B></FONT>"; echo "</TD></TR>"; echo "</TABLE><BR>"; echo "$identifiant_6 <A HREF='reglement.php' class='lien' target='fenetreimage' onclick='ouvrirfenetre()'>$identifiant_6_1</A> $identifiant_6_2<BR>"; // submit cancel echo $identifiant_7; /* echo "<BR><BR> </TD></TR><TR VALIGN='CENTER'><TD COLSPAN=3 ALIGN='CENTER' WIDTH='35%'>"; // mot de passe + confirmation echo $identifiant_5; echo "</TD></TR> </TABLE> <BR>"; echo "$identifiant_6 <A HREF='reglement.php' class='lien' target='fenetreimage' onclick='ouvrirfenetre()'>$identifiant_6_1</A> $identifiant_6_2<BR>"; // submit cancel echo $identifiant_7; */ ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 253/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project eggdrop/identifiant_confirm.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='eggdrops'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Identifiant</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <?PHP require 't_frame.php'; require 'include/.htmysql'; $connexion=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion); $nom= strtoupper ($nom); $prenom= ucfirst(strtolower ($prenom)); $ville= ucfirst(strtolower ($ville)); $pays= strtoupper ($pays); $amail= strtolower ($amail); $amail=strip_space ($amail); $username= strtolower ($username); $host= strtolower ($host1); $nick= strtolower ($nick); // on retire le ~ du username, si present $longueur=strlen($username); $char=substr($username,0,1); if ($char=='~'){ $username=substr($username,1,$longueur-1); } Guillaume Tournand <guillaume@tournand.com> September 2003 254/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $valeurs= array($genre, $nom, $prenom, $naiss_jour, $naiss_mois, $naiss_annee, $nick, $ville, $pays, $amail, $username, $host1, $pass, $confirm_pass); for($cpt=0 ; $valeurs[$cpt] ; $cpt++){} if ($cpt < 14){ echo $identifiant_err_1; } else { // on retire le ~ du username, si present $longueur=strlen($username); $char=substr($username,0,1); if ($char=='~'){ $username=substr($username,1,$longueur-1); } // On verifie le username $longueur=strlen($username); // test sur le username for ($i=0, $bad_username=0; $i<$longueur; $i++) { $char=substr($username,$i,1); if (!eregi("^[_a-z0-9-]+", $char) && $char != '.') { $bad_username=1; } } // on verifie le pass $bad_pass= check_no_space ($pass); // on vérifie le host $bad_host=check_bad_host ($host1); // Si probleme dans le username => message d'erreur if ($bad_username) { echo $identifiant_err_2; $valeurs[10]=''; } else { // erreur de host if ($bad_host) { echo $identifiant_err_3; $valeurs[11]=''; } else { // le password est il plus court que 6 chars $long_pass=strlen($pass); if ($long_pass < 6) { echo $identifiant_err_4; } else { // la confirmation est elle correcte ? if ($pass != $confirm_pass ){ echo $identifiant_err_5; } else { // le password contient il un espace ? if ($bad_pass) { echo $identifiant_err_7; } Guillaume Tournand <guillaume@tournand.com> September 2003 255/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project else { // Un autre username identique existe-t-il ? $username_query="SELECT username FROM users WHERE username='$username'"; $username_result = mysql_query($username_query) or die ("Requète non valide"); $max_username=mysql_num_rows($username_result); $username_query2="SELECT username FROM eggdrops WHERE username='$username'"; $username_result2 = mysql_query($username_query2) or die ("Requète non valide"); $max_username2=mysql_num_rows($username_result2); if ( $max_username || $max_username2 ){ echo $identifiant_err_6; $valeurs[10]=''; } else { /* // we clean the strings from ' $nom = strip_single_quote ($nom); $prenom = strip_single_quote ($prenom); $nick = strip_single_quote ($nick); $ville = strip_single_quote ($ville); $pays = strip_single_quote ($pays); $amail = strip_single_quote ($amail); */ // Go baby ! $unixtime_naiss=mktime(0,0,0,$naiss_mois,$naiss_jour,$naiss_annee); $unixtime_now=time(); $ip_creat = getenv ("REMOTE_ADDR"); $ip_login = $ip_creat; $query="INSERT INTO users(unixtime_creat, ip_creat, genre, nom, prenom, unixtime_naiss, ville, pays, amail, username, host1 , pass, nick, unixtime_modif, unixtime_login, ip_login, lang) VALUES ( '$unixtime_now', '$ip_creat', '$genre', '$nom', '$prenom', '$unixtime_naiss', '$ville','$pays', '$amail','$username', '$host', '$pass', '$nick', '$unixtime_now', '$unixtime_now', '$ip_login', '$lang');"; $result = mysql_query($query) or die ("Requète non valide"); $query="SELECT id_user FROM users WHERE username='$username'"; $result = mysql_query($query) or die ("Requète non valide"); $id_user=mysql_result($result,0,"id_user"); // ajout de l'utilisateur $commande=".+user LZ-$id_user"; $query="INSERT INTO instructions(unixtime, id_user, commande) VALUES('$unixtime_now', '$id_user', '$commande')"; $result = mysql_query($query) or die ("Requète non valide"); // definition du mot de passe $commande=".chpass LZ-$id_user $pass"; $query="INSERT INTO instructions(unixtime, id_user, commande) VALUES('$unixtime_now', '$id_user', '$commande')"; $result = mysql_query($query) or die ("Requète non valide"); Guillaume Tournand <guillaume@tournand.com> September 2003 256/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project // ajout de l'host $commande=".+host LZ-$id_user *!$username@$host"; $query="INSERT INTO instructions(unixtime, id_user, commande) VALUES('$unixtime_now', '$id_user', '$commande')"; $result = mysql_query($query) or die ("Requète non valide"); $commande=".+host LZ-$id_user *!~$username@$host"; $query="INSERT INTO instructions(unixtime, id_user, commande) VALUES('$unixtime_now', '$id_user', '$commande')"; $result = mysql_query($query) or die ("Requète non valide"); // detection de la langue pour savoir dans quelle table tapper. if ($lang != 'fr') { $table_genre_texte="descr_$lang"; } if ($lang == 'fr') { $table_genre_texte="descr"; } $result_genre=mysql_query("SELECT $table_genre_texte FROM genre WHERE id_genre='$genre'") or die ("Requete non valide"); $genre_txt=mysql_result($result_genre,0,"$table_genre_texte"); echo $identifiant_ok_1_1; echo "$genre_txt "; echo $identifiant_ok_1_2; echo $id_user; echo $identifiant_ok_2; } } } } } } } mysql_close($connexion); echo "<INPUT TYPE='hidden' name='genre' value='$valeurs[0]'>"; echo "<INPUT TYPE='hidden' name='nom' value='$valeurs[1]'>"; echo "<INPUT TYPE='hidden' name='prenom' value='$valeurs[2]'>"; echo "<INPUT TYPE='hidden' name='naiss_jour' value='$valeurs[3]'>"; echo "<INPUT TYPE='hidden' name='naiss_mois' value='$valeurs[4]'>"; echo "<INPUT TYPE='hidden' name='naiss_annee' value='$valeurs[5]'>"; echo "<INPUT TYPE='hidden' name='nick' value='$valeurs[6]'>"; echo "<INPUT TYPE='hidden' name='ville' value='$valeurs[7]'>"; echo "<INPUT TYPE='hidden' name='pays' value='$valeurs[8]'>"; echo "<INPUT TYPE='hidden' name='amail' value='$valeurs[9]'>"; echo "<INPUT TYPE='hidden' name='username' value='$valeurs[10]'>"; echo "<INPUT TYPE='hidden' name='host1' value='$valeurs[11]'>"; echo $identifiant_valid; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 257/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project eggdrop/index.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='eggdrops'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Eggdrops</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <?PHP echo $index; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 258/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project eggdrop/liens.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='eggdrops'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <LINK REL='stylesheet' HREF='include/style/table_no_bgcolor.css'> </HEAD> <BODY> <BR> <?PHP require 'include/.htmysql'; $connexion_chans=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_chans); $result_liens = mysql_query("SELECT * FROM liens ORDER BY ordre ASC, id_lien ASC") or die ("Rèquete non valide"); $max_liens=mysql_num_rows($result_liens); if ($max_liens) { echo $liens_1; for ($cpt=0; $cpt<$max_liens; $cpt++){ echo "<TR"; if (!($cpt%2)) { echo " bgcolor='#EDEDFF'"; } echo "><TD ALIGN='CENTER'>"; $channel=mysql_result($result_liens,$cpt,"channel"); echo "#$channel"; echo "</TD><TD ALIGN='LEFT'>"; $url=mysql_result($result_liens,$cpt,"url"); if ($url) { Guillaume Tournand <guillaume@tournand.com> September 2003 259/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project echo "<A HREF='$url' target='_new' class='lien'>$url</A>"; } echo "</TD></TR>"; } echo "</TABLE>"; } echo $lien_loufiz; // On affiche les petites banners $result_partenaires = mysql_query("SELECT * FROM partenaires_small ORDER BY id_partenaire ASC") or die ("Rèquete non valide"); $max_partenaires=mysql_num_rows($result_partenaires); if ($max_partenaires) { echo $liens_2; echo "<TABLE BORDER='0' WIDTH='100%' STYLE='border: none'><TR>"; for ($cpt=0; $cpt<$max_partenaires; $cpt++){ if ( !($cpt%8) ) { echo "</TR><TR>"; } $href=mysql_result($result_partenaires,$cpt,"href"); $src=mysql_result($result_partenaires,$cpt,"src"); $alt=mysql_result($result_partenaires,$cpt,"alt"); echo "<TD><A HREF='$href' TARGET='new' CLASS='lien'><IMG SRC='$src' ALT='$alt' BORDER='0' width='88' height='31'></A></TD>"; } echo "</TR></TABLE>"; } // On affiche les grandes banners $result_partenaires = mysql_query("SELECT * FROM partenaires_big ORDER BY id_partenaire ASC") or die ("Rèquete non valide"); $max_partenaires=mysql_num_rows($result_partenaires); if ($max_partenaires) { echo "<BR><TABLE BORDER='0' STYLE='border: none'>"; for ($cpt=0; $cpt<$max_partenaires; $cpt++){ $url=mysql_result($result_partenaires,$cpt,"code_html"); echo "$url"; } echo "</TABLE>"; } echo $liens_3; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 260/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project eggdrop/reglement.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='eggdrops'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Eggdrops</TITLE> <LINK REL='stylesheet' HREF='include/style/reglement.css'> <?PHP if (!$framed) { echo "<SCRIPT> if (screen.width < 1024) { top.window.moveTo(0,0); } else { self.moveTo((20),(20)); self.resizeTo(('850'),('700')); } </SCRIPT>"; } ?> </HEAD> <BODY> <?PHP //require 't_frame.html'; //calcul de la capacite restante require 'include/.htmysql'; $connexion_chans=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_chans); Guillaume Tournand <guillaume@tournand.com> September 2003 261/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $prct=project_use($egg_max_chan); mysql_close($connexion_chans); if ($prct >= 100) { echo $loufiz_plein; } echo $reglement; if ($framed) { echo $reglement_1; } echo "</TABLE>"; ?> </body> </html> Guillaume Tournand <guillaume@tournand.com> September 2003 262/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project eggdrop/t_frame.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <center> <table HEIGHT='40' width='100%'> <tr> <td><center><a href='identifiant.php' target='home'> <?PHP echo $frame_1; ?> </a></center></td> <td><center><a href='channel.php' target='home'> <?PHP echo $frame_2; ?> </a></center></td> </tr> </table> </center> Guillaume Tournand <guillaume@tournand.com> September 2003 263/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project eggdrop/admin/channels.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='eggadmin'; // on met en place la session et la langue require 'include/.htsession'; session_register("id_chan"); ?> <HTML> <HEAD> <TITLE>Loufiz : Channels</TITLE> <LINK REL='stylesheet' HREF='include/style/table_no_bgcolor.css'> <script> function ouvrirfenetre() { exemple=window.open ("","fenetreimage", "scrollbars=yes, toolbar=no, location=no, directories=no, status=no, resizable=yes") } </script> </HEAD> <BODY> <?PHP $admin_side=0; require 'include/.htmysql'; $nom_chan=strtolower($nom_chan); $connexion_channel=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_channel); $result_channel = mysql_query("SELECT * FROM channels WHERE id_chan='$id_chan'") or die ("Requete non valide"); $max_chan=mysql_num_rows($result_channel); if ($max_chan != 1 || $id_chan == '1'){ echo $admin_channels_1; } else { if ($max_chan == 1){ $id_owner=mysql_result($result_channel,0,"id_owner"); // verification du pass s'il est l'owner if ($id_user == $id_owner) { Guillaume Tournand <guillaume@tournand.com> September 2003 264/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $nom_chan=mysql_result($result_channel,0,"nom_chan"); $query="SELECT pass FROM users WHERE id_user='$id_owner'"; $result_pass = mysql_query($query) or die ("Requete non valide"); $max_result=mysql_num_rows($result_pass); if ($max_result) { $vrai_pass=mysql_result($result_pass,0,"pass"); } } // verification du pass s'il est un admin if ($id_user != $id_owner) { $nom_chan=mysql_result($result_channel,0,"nom_chan"); $query="SELECT u.pass, o.lvl FROM users u, lz_chan_$id_chan o WHERE o.id_op=$id_user AND u.id_user=$id_user"; $result_pass = mysql_query("$query") or die ("Requete non valide"); $max_result=mysql_num_rows($result_pass); if ($max_result) { $isop=mysql_result($result_pass,0,"o.lvl"); if ($isop > 200) { $vrai_pass=mysql_result($result_pass,0,"u.pass"); } } } } if ($user_pass != $vrai_pass) { echo $admin_channels_2; } else { require 'include/.htinclude_code_chan.php'; } } mysql_close($connexion_channel); echo $boutton_logout; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 265/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project eggdrop/admin/eggdrops.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='eggadmin'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Bots</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <?PHP $admin_side=0; $nom=strtolower($nom); require 'include/.htmysql'; $connexion_eggdrops=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_eggdrops); $result_eggdrops = mysql_query("SELECT * FROM eggdrops WHERE nom='$nom' AND actif='1'") or die ("Requete non valide"); $max_egg=mysql_num_rows($result_eggdrops); require 'include/.htinclude_code_egg.php'; mysql_close($connexion_eggdrops); ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 266/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project eggdrop/admin/index.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='eggdrops'; // on met en place la session et la langue require 'include/.htsession'; // On purge les données de la session require 'include/.hteggdrop_vide_session.php'; ?> <HTML> <HEAD> <TITLE>Loufiz : Eggdrops</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <?PHP echo $body_administrer_1; require 'include/.hteggdrop_contact.php'; echo $body_administrer_2; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 267/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project eggdrop/admin/liste_acces.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='eggadmin'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Admin</TITLE> <LINK REL='stylesheet' HREF='include/style/table_no_bgcolor.css'> <script> if (screen.width < 1024) { top.window.moveTo(0,0); } else { self.moveTo((20),(20)) self.resizeTo(("870"),("460")); } </script> </HEAD> <BODY> <?PHP require 'include/.htmysql'; $connexion_chans=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_chans); echo "<CENTER><H3><U>$text_list_axs</U></H3></CENTER><BR>"; // detection de la langue pour savoir dans quelle table tapper. if ($lang != 'fr') { $op_texte="op_text_$lang"; $op_descr="op_descr_$lang"; } Guillaume Tournand <guillaume@tournand.com> September 2003 268/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if ($lang == 'fr') { $op_texte="op_text"; $op_descr="op_descr"; } $query="SELECT op_level, $op_descr, $op_texte from op_levels WHERE active=1 ORDER BY op_level DESC"; $result_level=mysql_query("$query") or die ("Requete non valide"); $max_level=mysql_num_rows($result_level); echo "<TABLE BORDER='0' WIDTH='90%' ALIGN='CENTER'><TR><TD ALIGN='CENTER'><I>$text_list_lvl</I></TD><TD ALIGN='CENTER'><I>$text_list_descr</I></TD><TD ALIGN='CENTER'><I>$text_list_text</I></TD></TR>"; echo "<TR><TD COLSPAN=3><HR></TD></TR>"; for ($cpt=0; $cpt<$max_level; $cpt++){ echo "<TR ALIGN='CENTER'"; if (($cpt)%2) { echo " bgcolor='#EDEDFF'"; } echo "><TD>"; echo mysql_result($result_level,$cpt,"op_level"); echo "<BR><BR>"; echo "</TD><TD>"; echo mysql_result($result_level,$cpt,"$op_descr"); echo "<BR><BR>"; echo "</TD><TD ALIGN='LEFT'>"; echo mysql_result($result_level,$cpt,"$op_texte"); echo "<BR><BR>"; echo "</TD></TR>"; } echo "</TABLE>"; echo "<BR><BR><CENTER>$text_list_rest</CENTER>"; mysql_close($connexion_chans); ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 269/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project eggdrop/admin/logout.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='eggdrops'; // on met en place la session et la langue require 'include/.htsession'; // on vide la session require 'include/.hteggdrop_vide_session.php'; //session_unset(); //session_destroy(); ?> <HTML> <HEAD> <TITLE>Loufiz : Eggdrops</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> <?PHP echo "<META HTTP-EQUIV='refresh' CONTENT=\"3;URL=index.php?PHPSESSID=$PHPSESSID\">" ?> </HEAD> <BODY> <?PHP echo $logout_body; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 270/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project eggdrop/admin/modif_channel.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='eggadmin'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Channels</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <?PHP $admin_side=0; require 'include/.htmysql'; $connexion_channels=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_channels); $query="SELECT * FROM channels WHERE id_chan='$id_chan'"; $result_channel = mysql_query($query) or die ("Requete non valide"); $max_chan=mysql_num_rows($result_channel); if ($max_chan != 1 || $id_chan == '1'){ echo $admin_channels_1; } else { // initialisation du mot de passe a rien $vrai_pass=0; if ($max_chan == 1){ $id_owner=mysql_result($result_channel,0,"id_owner"); // verification du pass s'il est l'owner if ($id_user == $id_owner) { $nom_chan=mysql_result($result_channel,0,"nom_chan"); $query="SELECT pass FROM users WHERE id_user='$id_owner'"; $result_pass = mysql_query($query) or die ("Requete non valide"); $max_result=mysql_num_rows($result_pass); if ($max_result) { Guillaume Tournand <guillaume@tournand.com> September 2003 271/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $vrai_pass=mysql_result($result_pass,0,"pass"); } } // verification du pass s'il est un admin if ($id_user != $id_owner) { $id_chan=mysql_result($result_channel,0,"id_chan"); $query="SELECT u.pass, o.lvl FROM users u, lz_chan_$id_chan o WHERE o.id_op=$id_user AND u.id_user=$id_user"; $result_pass = mysql_query("$query") or die ("Requete non valide"); $max_result=mysql_num_rows($result_pass); if ($max_result) { $isop=mysql_result($result_pass,0,"o.lvl"); if ($isop > 200) { $vrai_pass=mysql_result($result_pass,0,"u.pass"); } } } } if ($user_pass != $vrai_pass) { echo $channels_err_1; } else { require 'include/.htinclude_code_chan_modif.php'; } } mysql_close($connexion_channels); echo "<BR><BR><BR>$channels_boutton_retour"; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 272/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project eggdrop/admin/modif_user.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?php $section='eggadmin'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Eggdrops</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <?PHP $admin_side=0; require 'include/.htmysql'; $connexion_users=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_users); $query="SELECT pass FROM users WHERE id_user='$id_user'"; $result_pass = mysql_query($query) or die ("Requete non valide"); $max_user_pass=mysql_num_rows($result_pass); $vrai_pass="bidon"; if ($max_user_pass) { $vrai_pass=mysql_result($result_pass,0,"pass"); } if ($user_pass != $vrai_pass) { echo $admin_modif_user_1; } else { require 'include/.htinclude_code_user_modif.php'; } mysql_close($connexion_users); echo $admin_modif_user_22; ?> </BODY> Guillaume Tournand <guillaume@tournand.com> September 2003 273/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 274/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project eggdrop/admin/suivi_bot.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='eggdrops'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Suivi</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <BR><BR><BR><BR><HR><BR><BR><BR> <?PHP // connexion a la base de donnée require 'include/.htmysql'; $connexion=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion); // traitement des champs $nom_chan=strtolower($nom_chan); $blacklist=0; // select sur les 3 tables susceptible de contenir l'entree $result_askin = mysql_query("SELECT * from askin_chan WHERE nom_chan='$nom_chan'") or die ("Requete non valide"); $max_askin=mysql_num_rows($result_askin); $result_valid = mysql_query("SELECT * from channels WHERE nom_chan='$nom_chan'") or die ("Requete non valide"); $max_valid=mysql_num_rows($result_valid); $result_getout = mysql_query("SELECT * from getout_chan WHERE nom_chan='$nom_chan' ORDER BY id_chan DESC") or die ("Requete non valide"); $max_askout=mysql_num_rows($result_getout); // dans le cas où rien n'est trouvé if ( (!$max_askin && !$max_valid && !$max_askout) || $nom_chan=='loufiz') { echo $suivi_demandes_1; Guillaume Tournand <guillaume@tournand.com> September 2003 275/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project } else { echo "<H3><B>$suivi_demandes_2_1</B></H3><BR><BR><BR>"; // on fetch et affiche les résultats echo "<TABLE BORDER='0' width='90%' align='center'><TR>"; // cas ou la demande n'est pas encore traitée if ($max_askin){ // on fecth les variables $unixtime_demande=mysql_result($result_askin,0,"unixtime_demande"); $date_demande=date("d/m/Y", "$unixtime_demande"); $status="$suivi_demandes_4."; // on affiche les résultats echo "<TD WIDTH='95'>$date_demande</TD>"; echo "<TD COLSPAN='2'>$suivi_demandes_6</TD></TR>"; echo "<TR><TD></TD><TD>$suivi_demandes_9"; echo "<TD>$status</TD>"; } // cas ou la demande a été validée if ($max_valid){ // on fetch les variables $unixtime_demande=mysql_result($result_valid,0,"unixtime_demande"); $date_demande=date("d/m/Y", "$unixtime_demande"); $unixtime_support=mysql_result($result_valid,0,"unixtime_support"); $date_support=date("d/m/Y", "$unixtime_support"); $warning=mysql_result($result_valid,0,"warning"); $status="<FONT COLOR='green'>$suivi_demandes_3.</FONT>"; // on affiche les résultats echo "<TD WIDTH='95'>$date_demande</TD>"; echo "<TD COLSPAN='2'>$suivi_demandes_6</TD></TR>"; echo "<TR><TD WIDTH='95'>$date_support</TD>"; echo "<TD WIDTH='150'>$suivi_demandes_9 $status</TD>"; if ($warning) { echo "<TD>$suivi_demandes_11</TD>"; } } // cas ou le channel a été refusé ou purgé if ($max_askout) { // on fetch les variables $unixtime_demande=mysql_result($result_getout,0,"unixtime_demande"); $date_demande=date("d/m/Y", "$unixtime_demande"); $id_refus=mysql_result($result_getout,0,"id_refus"); $id_purge=mysql_result($result_getout,0,"id_purge"); // on demande si le channel est blacklisté $query="SELECT id_black FROM blacklist WHERE nom_chan='$nom_chan' AND active='1'"; $result=mysql_query("$query") or die ("Requete non valide"); $blacklist=mysql_num_rows($result); // on affiche la date de demande echo "<TD WIDTH='95'>$date_demande</TD>"; Guillaume Tournand <guillaume@tournand.com> September 2003 276/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project echo "<TD COLSPAN='2'>$suivi_demandes_6</TD></TR>"; // dans le cas ou le channel a été refusé if ($id_refus) { $result_raison=mysql_query("SELECT * from raisons_refus WHERE id_refus='$id_refus'") or die ("Requete non valide"); // detection de la langue pour savoir dans quelle table tapper. if ($lang != 'fr') { $table_refus_texte="texte_$lang"; } if ($lang == 'fr') { $table_refus_texte="texte"; } $unixtime_refus=mysql_result($result_getout,0,"unixtime_refus"); $date_refus=date("d/m/Y", "$unixtime_refus"); $status="<FONT COLOR='red'>$suivi_demandes_5.</FONT>"; $raison=mysql_result($result_raison,0,"$table_refus_texte"); // on affiche les résultats echo "<TR><TD WIDTH='95'>$date_refus</TD>"; echo "<TD WIDTH='150'>$suivi_demandes_9 $status</TD>"; if ($raison) { echo "<TD><B>$suivi_demandes_10</B> : $raison</TD>"; } } // dans le cas ou le channel a été supporté et purgé else { if ($id_purge) { $result_raison=mysql_query("SELECT * from raisons_purge WHERE id_purge='$id_purge'") or die ("Requete non valide"); // detection de la langue pour savoir dans quelle table tapper. if ($lang != 'fr') { $table_refus_texte="texte_$lang"; } if ($lang == 'fr') { $table_refus_texte="texte"; } $raison=mysql_result($result_raison,0,"$table_refus_texte"); } $unixtime_support=mysql_result($result_getout,0,"unixtime_support"); $date_support=date("d/m/Y", "$unixtime_support"); $warning=mysql_result($result_getout,0,"warning"); $unixtime_purge=mysql_result($result_getout,0,"unixtime_purge"); $date_purge=date("d/m/Y", "$unixtime_purge"); // on affiche les résultats $status="<FONT COLOR='green'>$suivi_demandes_3.</FONT>"; echo "<TR><TD WIDTH='95'>$date_support</TD>"; echo "<TD WIDTH='150'>$suivi_demandes_9 $status</TD>"; if ($warning) { echo "<TD>$suivi_demandes_11</TD>"; } echo "</TR><TR><TD>$date_purge</TD>"; $status="<FONT COLOR='red'>$suivi_demandes_5_1.</FONT>"; echo "<TD WIDTH='200'>$suivi_demandes_9 $status</TD>"; if ($raison) { Guillaume Tournand <guillaume@tournand.com> September 2003 277/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project echo "<TD><B>$suivi_demandes_10</B> : $raison</TD>"; } if (!$id_purge) { echo "<TD>$suivi_demandes_14</TD>"; } } } echo "</TR></TABLE>"; // on affiche les résultats du blacklist if ($blacklist) { echo "<BR><BR><CENTER>$suivi_demandes_12</CENTER>"; } } mysql_close($connexion); // boutton retour echo "<BR><BR>$suivi_demandes_13"; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 278/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project eggdrop/admin/suivi_demandes.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='eggdrops'; // on met en place la session et la langue require 'include/.htsession'; // On purge les données de la session require 'include/.hteggdrop_vide_session.php'; ?> <HTML> <HEAD> <TITLE>Loufiz : Eggdrops</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <?PHP echo $suivi_login_body; require 'include/.hteggdrop_contact.php'; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 279/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project eggdrop/admin/users.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?php $section='eggadmin'; // on met en place la session et la langue require 'include/.htsession'; // nettoyage des id_user $id_user=clean_id ($id_user); session_register("id_user"); session_register("user_pass"); session_unregister("id_chan"); ?> <HTML> <HEAD> <TITLE>Loufiz : Eggdrops</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <?PHP $admin_side=0; require 'include/.htmysql'; $connexion_users=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_users); $result_user = mysql_query("SELECT * from users WHERE id_user='$id_user'") or die ("Requete non valide"); $max_user=mysql_num_rows($result_user); if ($max_user != 1 || $id_user == 1){ echo $admin_user_1; } else { if ($max_user == 1){ $vrai_pass=mysql_result($result_user,0,"pass"); } if ($user_pass != $vrai_pass) { Guillaume Tournand <guillaume@tournand.com> September 2003 280/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project echo $admin_user_2; } else { require 'include/.htinclude_code_user.php'; } } mysql_close($connexion_users); echo $boutton_logout; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 281/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project eggdrop/admin/pass_perdu/index.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?php $section='eggdrops'; // on met en place la session et la langue require 'include/.htsession'; // On purge les données de la session require 'include/.hteggdrop_vide_session.php'; ?> <HTML> <HEAD> <TITLE>Loufiz : Channel</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <?php echo $index_pass_perdu; require 'include/.hteggdrop_contact.php'; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 282/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project eggdrop/admin/pass_perdu/pass_perdu.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?php $section='eggdrops'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Channel</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <BR><BR><BR><HR><BR> <?PHP // time between 2 forgotten pass (in second) $time_between_forgot=24*60*60; require 'include/.htmysql'; $connexion=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion); // nettoyage de l'adresse mail $amail=strtolower ($amail); $amail=strip_space ($amail); if (!$amail || (!$id_user && !$username)){ echo $pass_perdu_1; } else { $amail=strtolower($amail); $username=strtolower($username); Guillaume Tournand <guillaume@tournand.com> September 2003 283/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if ($amail && $id_user) { $query="SELECT pass, unixtime_oubli FROM users WHERE id_user='$id_user' AND amail='$amail';"; $result = mysql_query($query) or die ("Rèquete non valide"); $max_result=mysql_num_rows($result); } if ($amail && $username) { $query="SELECT id_user, pass, unixtime_oubli FROM users WHERE username='$username' AND amail='$amail';"; $result = mysql_query($query) or die ("Rèquete non valide"); $max_result=mysql_num_rows($result); } if (!$max_result){ echo $pass_perdu_2; } else { $unixtime_maintenant=time(); $unixtime_dernier_oubli=mysql_result($result,0,'unixtime_oubli'); if ($unixtime_maintenant-$unixtime_dernier_oubli < $time_between_forgot) { echo $pass_perdu_3; } else { if (!$id_user){ $id_user=mysql_result($result,0,'id_user'); } echo "$pass_perdu_4_1 LZ-$id_user $pass_perdu_4_2 $amail</H3></U></B><BR><BR></CENTER>"; $passcheck=mysql_result($result,0,'pass'); $date_maintenant=date("d/m/Y", "$unixtime_maintenant"); $to = "$amail"; $subject = $pass_perdu_5; $body = "$pass_perdu_6 $date_maintenant, $pass_perdu_7 LZ-$id_user $pass_perdu_8 $passcheck"; $header = "From: eggdrops@loufiz.com\nReply-To: eggdrops@loufiz.com"; mail ($to, $subject, $body, $header); $update_user_result=mysql_query("UPDATE users SET unixtime_oubli='$unixtime_maintenant' WHERE id_user='$id_user';") or die ("Rèquete non valide"); $update_date_login=mysql_query("UPDATE users SET unixtime_login='$unixtime_maintenant' WHERE id_user='$id_user';") or die ("Rèquete non valide"); } } } mysql_close($connexion); echo "<BR>"; echo $pass_perdu_9; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 284/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project eggdrop/retrait/index.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?php $section='eggdrops'; // on met en place la session et la langue require 'include/.htsession'; // On purge les données de la session require 'include/.hteggdrop_vide_session.php'; ?> <HTML> <HEAD> <TITLE>Loufiz : Retrait</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <?php echo "<BR><BR><HR><BR><BR> <CENTER><H3><U>$index_retrait_body_1</U></H3></CENTER><BR> <FORM METHOD='POST' ACTION='retrait_cessation.php'> <TABLE ALIGN='CENTER' WIDTH='95%' BORDER=0> <TR> <TD ALIGN='right'>$index_retrait_body_3 :<BR></TD> <TD ALIGN='left'>LZ-<INPUT TYPE='text' NAME='id_user' SIZE=5 MAXLENGTH=5></TD> <TD ALIGN='right' ROWSPAN=2>$index_retrait_body_5 :</TD> <TD ALIGN='left' ROWSPAN=2>#<INPUT TYPE='text' NAME='nom_chan' SIZE=20 MAXLENGTH=120></TD> </TR> <TR> <TD ALIGN='right'>$index_retrait_body_4 :</TD> <TD ALIGN='left'><INPUT TYPE='password' NAME='user_pass' SIZE=20 MAXLENGTH=20></TD> </TR> <TR> <TD COLSPAN=6><HR></TD> Guillaume Tournand <guillaume@tournand.com> September 2003 285/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project </TR> <TR> <TD COLSPAN=6><BR>$index_retrait_body_6<BR><BR></TD> </TR> <TR> <TD COLSPAN=2 ALIGN='right'>$index_retrait_body_7 :</TD> <TD ALIGN='left'>LZ-<INPUT TYPE='text' NAME='nouvel_owner' SIZE=5 MAXLENGTH=5></TD> <TD COLSPAN=2 ALIGN='right'>$index_retrait_body_8 :</TD> <TD ALIGN='left'>LZ-<INPUT TYPE='text' NAME='nouvel_owner_confirm' SIZE=5 MAXLENGTH=5></TD> </TR> </TABLE> <BR><BR> <DIV ALIGN='RIGHT'><INPUT TYPE='submit' VALUE='$index_retrait_body_9'> <INPUT TYPE='reset' VALUE='$index_retrait_body_10'></DIV> </FORM> <BR><HR>"; require 'include/.hteggdrop_contact.php'; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 286/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project eggdrop/retrait/retrait_cessation.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?php $section='eggadmin'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Retrait</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <BR><BR><BR><BR><HR><BR><BR><BR> <?PHP $admin_side=0; require 'include/.htmysql'; $nom_chan=strtolower($nom_chan); $connexion=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion); // nettoyage des id_user $nouvel_owner= clean_id ($nouvel_owner); $nouvel_owner_confirm= clean_id ($nouvel_owner_confirm); $id_user= clean_id ($id_user); $result_valid = mysql_query("SELECT * from channels WHERE nom_chan='$nom_chan' AND id_owner='$id_user'") or die ("Requete non valide"); $max_valid=mysql_num_rows($result_valid); if (!$max_valid || $nom_chan=='loufiz') { echo $retrait_cessation_1; } else { // verification du mot de passe $id_chan=mysql_result($result_valid,0,"id_chan"); $id_owner_chans=mysql_result($result_valid,0,"id_owner"); Guillaume Tournand <guillaume@tournand.com> September 2003 287/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $result_owner=mysql_query("SELECT pass from users WHERE id_user='$id_owner_chans'") or die ("Requete non valide"); $pass = mysql_result($result_owner,0,"pass"); if ( $pass != $user_pass ) { echo $retrait_cessation_2; } else { // verification de la confirmation du nouvel owner if ($nouvel_owner != $nouvel_owner_confirm) { echo $retrait_cessation_3; } else { // invalide pour le compte demo if ($id_owner_chans == $demo_id) { echo $retrait_cessation_2_1; } else { // A partir d'ici : fin des checkups elementaires require 'include/.htinclude_code_retrait_cess.php'; } } } } mysql_close($connexion); echo "<BR><BR>"; echo $retrait_cessation_11; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 288/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project The administration side admin/all_chans.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='team'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Admin</TITLE> <LINK REL='stylesheet' HREF='include/style/table_no_bgcolor.css'> </HEAD> <BODY> <BR> <?PHP echo "<CENTER><H3><B>$all_chans_1</B></H3></CENTER>"; require 'include/.htmysql'; $connexion_chans=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_chans); $result_users = mysql_query("SELECT * FROM channels WHERE nom_chan != 'loufiz' ORDER BY id_chan DESC") or die ("Rèquete non valide"); $max_users=mysql_num_rows($result_users); echo "<TABLE WIDTH='90%' BORDER='0' ALIGN='CENTER'><TR><TH>$all_chans_2</TH><TH>$all_chans_3</TH><TH>$all_chans_4</TH><TH>$all_ch ans_5</TH><TH>$all_chans_6</TH><TH>$all_chans_7</TH></TR><TR><TD COLSPAN=6><HR></TD></TR>"; for ($cpt=0; $cpt<$max_users; $cpt++){ echo "<TR ALIGN='CENTER'"; if (($cpt)%2) { echo " bgcolor='#EDEDFF'"; } echo "><TD>"; $nom_chan=mysql_result($result_users,$cpt,"nom_chan"); $id_chan=mysql_result($result_users,$cpt,"id_chan"); Guillaume Tournand <guillaume@tournand.com> September 2003 289/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project echo "<A HREF='management/channels.php?id_chan=$id_chan' target='home' class='lien'>"; echo "#"; // petite boucle pour éviter de se faire polluer avec les noms a rallonge $longueur=strlen($nom_chan); for ($i=0; $i<$longueur; $i++) { $char=substr($nom_chan, $i, 1); if ((! ($i%20) ) && $i != 0) { echo "<BR>"; } echo "$char"; } echo "</A>"; echo "</TD><TD>"; $id_owner=mysql_result($result_users,$cpt,"id_owner"); echo "<A HREF='management/users.php?id_user=$id_owner' target='home' class='lien'>LZ$id_owner</A>"; echo "</TD><TD>"; $id_chan=mysql_result($result_users,$cpt,"id_chan"); // nb d'op $query="SELECT count(id_op) FROM lz_chan_$id_chan WHERE lvl=200"; $result=mysql_query("$query") or die ("Rèquete non valide"); $max_result=mysql_result($result,0,"count(id_op)"); if ($max_result){ echo "$max_result"; } echo "</TD><TD>"; // nb d'admins $query="SELECT count(id_op) FROM lz_chan_$id_chan WHERE lvl=400"; $result=mysql_query("$query") or die ("Rèquete non valide"); $max_result=mysql_result($result,0,"count(id_op)"); if ($max_result){ echo "$max_result"; } echo "</TD><TD>"; // nb de senior admins $query="SELECT count(id_op) FROM lz_chan_$id_chan WHERE lvl=450"; $result=mysql_query("$query") or die ("Rèquete non valide"); $max_result=mysql_result($result,0,"count(id_op)"); if ($max_result){ echo "$max_result"; } echo "</TD><TD>"; $unixtime_support=mysql_result($result_users,$cpt,"unixtime_support"); echo date("d/m/Y", "$unixtime_support"); echo "</TD></TR>"; } echo "</TABLE>"; mysql_close($connexion_chans); echo "<BR><FORM METHOD='POST' ACTION='index.php'>$boutton_retour</FORM>"; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 290/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project admin/all_users.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='team'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Users</TITLE> <LINK REL='stylesheet' HREF='include/style/table_no_bgcolor.css'> </HEAD> <BODY> <?PHP echo "<BR><CENTER><H3><B>$all_users_1</B></H3></CENTER>"; require 'include/.htmysql'; $connexion_chans=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_chans); $result_users = mysql_query("SELECT * FROM users WHERE id_user!='1' ORDER BY id_user DESC") or die ("Rèquete non valide"); $max_users=mysql_num_rows($result_users); // On affiche les infos sous blocs de $liste_defil lignes $liste_defil=100; if (! $liste_index || $liste_index<0) { $liste_index=0; } $liste_max=$liste_index+$liste_defil; echo "<TABLE WIDTH='100%' BORDER='0'><TR><TH WIDTH='80'>$all_users_1_1</TH><TH>$all_users_2</TH><TH>$all_users_3</TH><TH>$all_users_4</TH><TH WIDTH='110'>$all_users_5</TH><TH>$all_users_6</TH><TH WIDTH='110'>$all_users_7</TH></TR><TR><TD COLSPAN=7><HR></TD></TR>"; for ($cpt=$liste_index; $cpt<$max_users && $cpt<$liste_max; $cpt++){ echo "<TR ALIGN='CENTER'"; Guillaume Tournand <guillaume@tournand.com> September 2003 291/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if (($cpt)%2) { echo " bgcolor='#EDEDFF'"; } echo "><TD>"; $id_user=mysql_result($result_users,$cpt,"id_user"); echo "<A HREF='management/users.php?id_user=$id_user' target='home' class='lien'>LZ$id_user</A>"; echo "</TD><TD>"; echo mysql_result($result_users,$cpt,"nom"); echo "</TD><TD>"; echo mysql_result($result_users,$cpt,"prenom"); echo "</TD><TD>"; echo mysql_result($result_users,$cpt,"pays"); echo "</TD><TD>"; $unixtime_naiss=mysql_result($result_users,$cpt,"unixtime_naiss"); echo date("d/m/Y", "$unixtime_naiss"); //echo mysql_result($result_users,$cpt,"date_naiss"); echo "</TD><TD>"; echo mysql_result($result_users,$cpt,"username"); echo "</TD><TD WIDTH='110'>"; $unixtime_creat=mysql_result($result_users,$cpt,"unixtime_creat"); echo date("d/m/Y", "$unixtime_creat"); echo "</TD></TR>"; } echo "<TR><TD><BR></TD</TR>"; echo "<TR><TD COLSPAN='3' ALIGN='CENTER'>"; if ($liste_index){ $liste_prec=$liste_index-$liste_defil; echo "<A HREF='all_users.php?liste_index=$liste_prec' target='home' class='lien'>$all_users_8</A>"; } echo "</TD><TD COLSPAN='4' ALIGN='CENTER'>"; if ($max_users>$liste_max) { $liste_suiv=$liste_index+$liste_defil; echo "<A HREF='all_users.php?liste_index=$liste_suiv' target='home' class='lien'>$all_users_9</A>"; } echo "</TD></TR></TABLE>"; mysql_close($connexion_chans); echo "<BR><FORM METHOD='GET' ACTION='index.php'>$boutton_retour</FORM>"; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 292/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project admin/chan_monitoring.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='team'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Admin</TITLE> <LINK REL='stylesheet' HREF='include/style/chan_monitoring.css'> </HEAD> <BODY BGCOLOR=#FDFDFF> <BR> <?PHP // variable a initialiser pour autoriser la purge $purge_enable=1; echo "<CENTER><H3><B>$chan_monitoring_1</B></H3></CENTER>"; require 'include/.htmysql'; $connexion_chans=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_chans); $result_chans = mysql_query("SELECT * FROM chan_monitoring WHERE nom_chan != 'loufiz' ORDER BY id_chan DESC") or die ("Rèquete non valide"); $max_chans=mysql_num_rows($result_chans); // Variables globales pour le monitoring $min_users=10; $max_idling=7; // jours $max_opless=7; // heures $max_axs=3; // jours $max_automode=3; // jours (inutilise) $unixtime_now=time(); // on regarde s'il y a des problemes Guillaume Tournand <guillaume@tournand.com> September 2003 293/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project // de report $result = mysql_query("SELECT count(id_chan) FROM chan_monitoring WHERE nb_egg_report<$max_axs") or die ("Rèquete non valide"); $pb_report=mysql_result($result,0,"count(id_chan)"); // d'eggs op $result = mysql_query("SELECT count(id_chan) FROM chan_monitoring WHERE nb_egg_op<nb_egg_report") or die ("Rèquete non valide"); $pb_op=mysql_result($result,0,"count(id_chan)"); // d'access $result = mysql_query("SELECT count(id_chan) FROM chan_monitoring WHERE axs_x<$max_axs AND axs_x!='-'") or die ("Rèquete non valide"); $pb_axs=mysql_result($result,0,"count(id_chan)"); // on affiche l'en tete du tableau echo "<TABLE WIDTH='100%' BORDER='0' ALIGN='CENTER'><TR><TH>$chan_monitoring_2</TH><TH>$chan_monitoring_2_1</TH><TH>"; // si probleme de report if ($pb_report) { echo "<FONT COLOR='red'>"; } echo "$chan_monitoring_3"; if ($pb_report) { echo "</FONT>"; } echo "</TH><TH>"; // si probleme d'op if ($pb_op) { echo "<FONT COLOR='red'>"; } echo "$chan_monitoring_4"; if ($pb_op) { echo "</FONT>"; } echo "</TH><TH>$chan_monitoring_5</TH><TH>$chan_monitoring_6</TH><TH>$chan_monitoring_7</TH><TH>$ch an_monitoring_8</TH><TH>$chan_monitoring_9</TH><TH>$chan_monitoring_10</TH><TH>$chan_monitoring _11</TH><TH>$chan_monitoring_12</TH><TH width='50'>$chan_monitoring_13</TH><TH>"; // si probleme d'axs if ($pb_axs) { echo "<FONT COLOR='red'>"; } echo "$chan_monitoring_14"; if ($pb_axs) { echo "</FONT>"; } echo "</TH><TH>$chan_monitoring_15</TH><TH>$chan_monitoring_17</TH><TH>$chan_monitoring_18</TH></TR ><TR><TD COLSPAN=17><HR></TD></TR>"; for ($cpt=0, $user_purge=0; $cpt<$max_chans; $cpt++){ echo "<TR ALIGN='CENTER' VALIGN='CENTER'"; if ($cpt%2) { echo " bgcolor='#EDEDFF'"; } echo "><TD>"; // on choppe les rapports pour la couleur du channel Guillaume Tournand <guillaume@tournand.com> September 2003 294/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $nb_egg_rapport=mysql_result($result_chans,$cpt,"nb_egg_report"); $nb_egg_op=mysql_result($result_chans,$cpt,"nb_egg_op"); $nb_user_1=mysql_result($result_chans,$cpt,"nb_user_1"); $nb_user_2=mysql_result($result_chans,$cpt,"nb_user_2"); $nb_user_3=mysql_result($result_chans,$cpt,"nb_user_3"); $x_present=mysql_result($result_chans,$cpt,"x_present"); $axs_x=mysql_result($result_chans,$cpt,"axs_x"); // initialise les variables des pb a 0 $pb_egg_rapport=0; $pb_egg_op=0; $pb_nb_user_1=0; $pb_nb_user_2=0; $pb_nb_user_3=0; $pb_axs_x=0; // test sur ces rapports if ($nb_egg_rapport < 3) {$pb_egg_rapport=1;} if ($nb_egg_rapport && $nb_egg_op<$nb_egg_rapport) {$pb_egg_op=1;} if ($nb_egg_rapport && $nb_user_1<$min_users && $nb_user_1 != '-') {$pb_nb_user_1=1;} if ($nb_egg_rapport && $nb_user_2<$min_users && $nb_user_2 != '-') {$pb_nb_user_2=1;} if ($nb_egg_rapport && $nb_user_3<$min_users && $nb_user_3 != '-') {$pb_nb_user_3=1;} if ($axs_x<3 && $x_present==1 && $axs_x != '-') {$pb_axs_x=1;} // Nom du channel $nom_chan=mysql_result($result_chans,$cpt,"nom_chan"); $query=mysql_query("SELECT id_chan FROM channels WHERE nom_chan='$nom_chan'"); $id_chan=mysql_result($query,0,"id_chan"); echo "<A HREF='management/channels.php?id_chan=$id_chan' TARGET='home' CLASS='lien' NAME='$id_chan'>"; // si un probleme est détecté, on affiche le nom en rouge if ($pb_egg_rapport || $pb_egg_op || $pb_axs_x) {echo "<FONT COLOR='RED'>";} echo "#"; // petite boucle pour éviter de se faire polluer avec les noms a rallonge $longueur=strlen($nom_chan); for ($i=0; $i<$longueur; $i++) { $char=substr($nom_chan, $i, 1); if ((! ($i%20) ) && $i != 0) { echo "<BR>"; } echo "$char"; } if ($pb_egg_rapport || $pb_egg_op || $pb_axs_x) {echo "</FONT>";} echo "</A>"; echo "</TD><TD>"; // langue de l'owner $result_owner_lang = mysql_query("SELECT u.lang FROM users u, channels c WHERE u.id_user = c.id_owner AND c.nom_chan='$nom_chan'") or die ("Rèquete non valide"); $owner_lang=mysql_result($result_owner_lang,0,"lang"); echo "<A HREF='irc://irc.undernet.org/$nom_chan' class='lien'>$owner_lang</A>"; echo "</TD><TD>"; // nb rapports if ($pb_egg_rapport) {echo "<FONT COLOR='RED'>";} echo "$nb_egg_rapport"; if ($pb_egg_rapport) {echo "</FONT>";} echo "</TD><TD>"; // nb egg op if ($pb_egg_op) {echo "<FONT COLOR='RED'>";} echo "$nb_egg_op"; if ($pb_egg_op) {echo "</FONT>";} Guillaume Tournand <guillaume@tournand.com> September 2003 295/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project echo "</TD><TD>"; // deop depuis $op_depuis=mysql_result($result_chans,$cpt,"op_depuis"); if (!$op_depuis) {$nb_heures=0;} else { $nb_heures=abs((int)(($unixtime_now-$op_depuis)/3600)); } if ($nb_egg_rapport && $nb_heures>$max_opless && $nb_egg_op<$nb_egg_rapport) {echo "<FONT COLOR='RED'>"; $purge=1;} if ($nb_egg_rapport && $nb_egg_op==$nb_egg_rapport) {$nb_heures="-";} echo "$nb_heures $chan_monitoring_19_1"; if ($nb_egg_rapport && $nb_heures>$max_opless && $nb_egg_op<$nb_egg_rapport) {echo "</FONT>";} echo "</TD><TD>"; // nb user 1 if ($pb_nb_user_1) {echo "<FONT COLOR='RED'>";} echo "$nb_user_1"; if ($pb_nb_user_1) {echo "</FONT>";} echo "</TD><TD>"; // depuis user 1 $depuis_user_1=mysql_result($result_chans,$cpt,"depuis_user_1"); if (!$depuis_user_1) {$nb_jours=0;} else { $nb_jours=abs((int)(($unixtime_now-$depuis_user_1)/86400)); } if ($nb_egg_rapport && $nb_jours>$max_idling && $nb_user_1<$min_users && $nb_user_1 != '-') {echo "<FONT COLOR='RED'>"; $user_purge++;} if ($nb_egg_rapport && $nb_user_1>=$min_users && $nb_user_1 != '-') {$nb_jours="-";} if ($nb_user_1 == '-') {$nb_jours='-';} echo "$nb_jours $chan_monitoring_19"; if ($nb_egg_rapport && $nb_jours>$max_idling && $nb_user_1<$min_users && $nb_user_1 != '-') {echo "</FONT>";} echo "</TD><TD>"; // nb user 2 if ($pb_nb_user_2) {echo "<FONT COLOR='RED'>";} echo "$nb_user_2"; if ($pb_nb_user_2) {echo "</FONT>";} echo "</TD><TD>"; // depuis user 2 $depuis_user_2=mysql_result($result_chans,$cpt,"depuis_user_2"); if (!$depuis_user_2) {$nb_jours=0;} else { $nb_jours=abs((int)(($unixtime_now-$depuis_user_2)/86400)); } if ($nb_egg_rapport && $nb_jours>$max_idling && $nb_user_2<$min_users && $nb_user_2 != '-') {echo "<FONT COLOR='RED'>"; $user_purge++;} if ($nb_egg_rapport && $nb_user_2>=$min_users && $nb_user_2 != '-') {$nb_jours="-";} if ($nb_user_2 == '-') {$nb_jours='-';} echo "$nb_jours $chan_monitoring_19"; if ($nb_egg_rapport && $nb_jours>$max_idling && $nb_user_2<$min_users && $nb_user_2 != '-') {echo "</FONT>";} echo "</TD><TD>"; // nb user 3 if ($pb_nb_user_3) {echo "<FONT COLOR='RED'>";} echo "$nb_user_3"; if ($pb_nb_user_3) {echo "</FONT>";} echo "</TD><TD>"; // depuis user 3 $depuis_user_3=mysql_result($result_chans,$cpt,"depuis_user_3"); if (!$depuis_user_3) {$nb_jours=0;} Guillaume Tournand <guillaume@tournand.com> September 2003 296/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project else { $nb_jours=abs((int)(($unixtime_now-$depuis_user_3)/86400)); } if (($nb_egg_rapport) && ($nb_jours > $max_idling) && ($nb_user_3 < $min_users) && ($nb_user_3 != '-') ) {echo "<FONT COLOR='RED'>"; $user_purge++;} if ($nb_egg_rapport && $nb_user_3>=$min_users && $nb_user_3 != '-') {$nb_jours="-";} if ($nb_user_3 == '-') {$nb_jours='-';} echo "$nb_jours $chan_monitoring_19"; if ($nb_egg_rapport && $nb_jours>$max_idling && $nb_user_3<$min_users && $nb_user_3 != '-') {echo "</FONT>";} echo "</TD><TD>"; // x present switch ($x_present) { case 1: echo "<FONT COLOR ='green'>$chan_monitoring_20</FONT>"; break; case 2: echo "$chan_monitoring_21"; break; case 3: echo "-"; break; } echo "</TD><TD>"; // x depuis $x_depuis=mysql_result($result_chans,$cpt,"x_depuis"); if (!$x_depuis) {$nb_jours=0;} else { $nb_jours=abs((int)(($unixtime_now-$x_depuis)/86400)); } if ($x_present == 3 || $x_present==2) { $nb_jours = '-'; } echo "$nb_jours $chan_monitoring_19"; echo "</TD><TD>"; // nb axs X if ($pb_axs_x) {echo "<FONT COLOR='RED'>";} echo "$axs_x"; if ($pb_axs_x) {echo "</FONT>";} echo "</TD><TD>"; // Axs x depuis $axs_depuis=mysql_result($result_chans,$cpt,"axs_depuis"); if (!$axs_depuis) {$nb_jours=0;} else { $nb_jours=abs((int)(($unixtime_now-$axs_depuis)/86400)); } if ($nb_jours>$max_axs && $x_present==1 && $axs_x<3 && $axs_x != '-') {echo "<FONT COLOR='RED'>"; $purge=3;} if ($x_present==1 && $axs_x==3 && $axs_x != '-') {$nb_jours="-";} if ($axs_x == "-") { $nb_jours='-'; } echo "$nb_jours $chan_monitoring_19"; if ($nb_jours>$max_axs && $x_present==1 && $axs_x<3 && $axs_x != '-') {echo "</FONT>";} echo "</TD><TD>"; /* // On commente le bloc correspondant a l'automode, qui n'est pas un citere de purge $x_automode=mysql_result($result_chans,$cpt,"x_automode"); if ($x_automode<3 && $x_present==1 && $x_automode != '-') {echo "<FONT COLOR='RED'>";} echo "$x_automode"; if ($x_automode<3 && $x_present==1 && $x_automode != '-') {echo "</FONT>";} echo "</TD><TD>"; Guillaume Tournand <guillaume@tournand.com> September 2003 297/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project */ $maj=mysql_result($result_chans,$cpt,"maj"); if ($maj) { $date_maj=date("d/m/Y H:i:s", "$maj"); } else { $date_maj="<BR><BR>"; } echo "$date_maj"; echo "</TD>"; echo "<TD ALIGN='CENTER' VALIGN='CENTER'>"; if (! $purge && $user_purge < 2){ echo "-"; } // s'il faut purger if (($user_purge >= 2 || $purge) && $nom_chan != 'admin-loufiz' && $nom_chan != 'loufiz-demo' && $purge_enable) { // si c'est parceque le channel a été idle trop longtemps if ($user_purge >= 2) { $purge=2; } echo "<FORM METHOD='POST' ACTION='management/retrait_cessation.php?nom_chan=$nom_chan&raison_purge=$purge'>$chan_monitoring _26"; } $purge=0; $user_purge=0; /* // On commente le bloc correspondant a l'automode, qui n'est pas un citere de purge $automode_depuis=mysql_result($result_chans,$cpt,"automode_depuis"); if ($automode_depuis>$max_automode && $x_present==1 && $x_automode<3) {echo "<FONT COLOR='RED'>";} echo "$automode_depuis"; if ($automode_depuis>$max_automode && $x_present==1 && $x_automode<3) {echo "</FONT>";} */ echo "</TD></TR></FORM>"; } echo "</TABLE><BR>"; echo "$chan_monitoring_22 = $min_users<BR>"; echo "$chan_monitoring_23_1 = $max_idling $chan_monitoring_23_2<BR>"; echo "$chan_monitoring_24 = $max_opless $chan_monitoring_23_3<BR>"; echo "$chan_monitoring_25 = $max_axs $chan_monitoring_23_2<BR>"; mysql_close($connexion_chans); echo "<BR><FORM METHOD='POST' ACTION='index.php'>$boutton_retour</FORM>"; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 298/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project admin/chan_monitoring_doc.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='team'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Admin</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <?PHP echo $chan_monitoring_doc; echo "<FORM METHOD=POST ACTION='./'>$boutton_retour</FORM>"; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 299/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project admin/commentaires.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='team'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Commentaires</TITLE> <LINK REL='stylesheet' HREF='include/style/table_no_bgcolor.css'> </HEAD> <BODY> <?PHP echo "<BR><CENTER><H3><B>$commentaires_1</B></H3></CENTER>"; require 'include/.htmysql'; $connexion_chans=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_chans); $result_comment = mysql_query("SELECT * FROM commentaires ORDER BY id_comment DESC") or die ("Rèquete non valide"); $max_comment=mysql_num_rows($result_comment); // On affiche les infos sous blocs de $liste_defil lignes $liste_defil=100; if (! $liste_index || $liste_index<0) { $liste_index=0; } $liste_max=$liste_index+$liste_defil; echo "<TABLE WIDTH='100%' BORDER='0'><TR ALIGN='CENTER'><TH WIDTH='70'>$commentaires_2</TH><TH>$commentaires_3</TH><TH WIDTH='120'>$commentaires_4</TH><TH>$commentaires_5</TH></TR><TR><TD COLSPAN=4><HR></TD</TR>"; for ($cpt=$liste_index; $cpt<$max_comment && $cpt<$liste_max; $cpt++){ Guillaume Tournand <guillaume@tournand.com> September 2003 300/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project echo "<TR ALIGN='CENTER' VALIGN='TOP'"; if (($cpt)%2) { echo " bgcolor='#EDEDFF'"; } echo "><TD>"; $id_user=mysql_result($result_comment,$cpt,"id_user"); echo "LZ-$id_user"; echo "</TD><TD>"; $nom_chan=mysql_result($result_comment,$cpt,"nom_chan"); if ($nom_chan){ // petite boucle pour éviter de se faire polluer avec les noms a rallonge echo "#"; $longueur=strlen($nom_chan); for ($i=0; $i<$longueur; $i++) { $char=substr($nom_chan, $i, 1); if ((! ($i%20) ) && $i != 0) { echo "<BR>"; } echo "$char"; } } echo "</TD><TD>"; $unixtime_comment=mysql_result($result_comment,$cpt,"unixtime_comment"); echo date("d/m/Y", "$unixtime_comment"); echo "</TD><TD ALIGN='LEFT'>"; echo mysql_result($result_comment,$cpt,"commentaire"); echo "</TD></TR>"; } echo "<TR><TD><BR></TD></TR>"; echo "<TR><TD COLSPAN='3'ALIGN='CENTER'>"; if ($liste_index){ $liste_prec=$liste_index-$liste_defil; echo "<A HREF='commentaires.php?liste_index=$liste_prec' target='home' class='lien'>$commentaires_6</A>"; } echo "</TD><TD ALIGN='CENTER'>"; if ($max_comment>$liste_max) { $liste_suiv=$liste_index+$liste_defil; echo "<A HREF='commentaires.php?liste_index=$liste_suiv' target='home' class='lien'>$commentaires_7</A>"; } echo "</TD></TR></TABLE>"; mysql_close($connexion_chans); echo "<BR><FORM METHOD='POST' ACTION='index.php'>$boutton_retour</FORM>"; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 301/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project admin/demande_channels.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='team'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Admin</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <?PHP require 'include/.htmysql'; $connexion_chans=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_chans); $result_demandes = mysql_query("SELECT * from askin_chan ORDER BY id_chan DESC") or die ("Requete non valide"); $max_demandes=mysql_num_rows($result_demandes); // detection de la langue pour savoir dans quelle table tapper. if ($lang != 'fr') { $table_refus_descr="descr_$lang"; } if ($lang == 'fr') { $table_refus_descr="descr"; } $result_raisons=mysql_query("SELECT id_refus,$table_refus_descr from raisons_refus ORDER BY id_refus ASC") or die ("Requete non valide"); $max_refus=mysql_num_rows($result_raisons); Guillaume Tournand <guillaume@tournand.com> September 2003 302/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project echo "<BR><BR><FORM METHOD=POST ACTION='demande_channels_confirm.php'>"; for ($cpt=0; $max_demandes > $cpt; $cpt++){ $id_user=mysql_result($result_demandes,$cpt,"id_owner"); $result_user=mysql_query("SELECT * from users WHERE id_user='$id_user'") or die ("Requete non valide"); echo "<TABLE BORDER='0' width='95%' align='center'><TR ALIGN='CENTER'><TD COLSPAN=2>"; echo $demandes_channels_1; $unixtime=mysql_result($result_demandes,$cpt,"unixtime_demande"); echo date("d/m/Y", "$unixtime"); echo " / "; $genre=mysql_result($result_user,0,"genre"); // detection de la langue pour savoir dans quelle table tapper. if ($lang != 'fr') { $table_genre_texte="descr_$lang"; } if ($lang == 'fr') { $table_genre_texte="descr"; } $result_genre=mysql_query("SELECT $table_genre_texte FROM genre WHERE id_genre='$genre'") or die ("Requete non valide"); $genre=mysql_result($result_genre,0,"$table_genre_texte"); echo "$genre "; echo mysql_result($result_user,0,"nom"); echo " "; echo mysql_result($result_user,0,"prenom"); echo " ("; echo mysql_result($result_user,0,"pays"); echo ") "; $nick=mysql_result($result_user,0,"nick"); echo "<A HREF='management/users.php?id_user=$id_user' target='home' class='lien'>LZ$id_user</A> $nick / "; $unixtime_naiss=mysql_result($result_user,0,"unixtime_naiss"); echo date("d/m/Y", "$unixtime_naiss"); echo "</TD></TR><TR ALIGN='CENTER'><TD COLSPAN=2>"; $username=mysql_result($result_user,0,"username"); $host1=mysql_result($result_user,0,"host1"); $host2=mysql_result($result_user,0,"host2"); $host3=mysql_result($result_user,0,"host3"); if ($host1) { echo "*!*$username@$host1 "; } if ($host2) { echo "/ *!*$username@$host2 "; } if ($host3) { echo "/ *!*$username@$host3"; } echo "</TD></TR>"; // on affiche la langue $user_lang=mysql_result($result_user,0,"lang"); echo "<TR ALIGN='CENTER'><TD COLSPAN=2>"; echo "$demandes_channels_10 : <B>$user_lang</B>"; echo "</TD></TR>"; // on affiche le nom du channel echo "<TR ALIGN='CENTER'><TD COLSPAN=2>"; echo "$demandes_channels_2 : "; $nom_chan=mysql_result($result_demandes,$cpt,"nom_chan"); echo "<A HREF='irc://irc.undernet.org/$nom_chan' class='lien'>#$nom_chan</A>"; // on affiche le rapport d'adam $rapport = mysql_result($result_demandes,$cpt,"rapport"); if ($rapport) { Guillaume Tournand <guillaume@tournand.com> September 2003 303/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project echo "</TD></TR><TR VALIGN='TOP'><TD ALIGN='RIGHT'><B>$demandes_channels_8 :</B></TD><TD COLSPAN=1 ALIGN='LEFT'>$rapport"; } // on affiche le commentaire $commentaire = mysql_result($result_demandes,$cpt,"commentaire"); if ($commentaire) { echo "</TD></TR><TR VALIGN='TOP'><TD ALIGN='RIGHT'><U>$demandes_channels_3</U> :</TD><TD COLSPAN=1 ALIGN='LEFT'>$commentaire"; } echo "<BR><BR></TD></TR><TR ALIGN='CENTER'><TD VALIGN='TOP'>"; $id_chan=mysql_result($result_demandes,$cpt,"id_chan"); echo "<select name='refus[$id_chan]'><option value=''>$demandes_channels_4_1"; for ($i=0; $max_refus > $i; $i++){ $id_refus=mysql_result($result_raisons,$i,"id_refus"); $descr=mysql_result($result_raisons,$i,"$table_refus_descr"); echo "<option value='$id_refus'>$descr"; } echo "</select><BR>"; // on affiche la case de blacklist et de refus pour 24H echo "<BR>$demandes_channels_5 <input type='checkbox' name='blacklist[]' value='$id_chan'><BR> $demandes_channels_9 <input type='checkbox' checked name='attente[]' value='$id_chan'> </TD>"; // on affiche le menu deroulant de la validation echo "<TD VALIGN='TOP'><select name='valid[$id_chan]'><option value=''>$demandes_channels_4_2"; $result_eggs=mysql_query("SELECT DISTINCT egg_bloc from eggdrops WHERE egg_bloc != 0 ORDER BY egg_bloc ASC") or die ("Requete non valide"); $max_eggs=mysql_num_rows($result_eggs); for ($i=1; $max_eggs > $i-1; $i++){ $egg_bloc=mysql_result($result_eggs,$i-1,"egg_bloc"); $result_nom_egg=mysql_query("SELECT nom from eggdrops WHERE egg_bloc='$egg_bloc' AND actif != 0") or die ("Requete non valide"); $max_noms=mysql_num_rows($result_nom_egg); $result_occupe=mysql_query("SELECT count(nom_chan) from channels WHERE egg_group='$egg_bloc'") or die ("Requete non valide"); $nb_chans_pris=mysql_result($result_occupe,0,"count(nom_chan)"); $chan_libres=$egg_max_chan-$nb_chans_pris; if ($chan_libres && $max_noms){ echo "<option value='$egg_bloc'>$egg_bloc "; for ($j=0; $max_noms > $j; $j++) { echo mysql_result($result_nom_egg,$j,"nom"); echo " "; } echo "/ $demandes_channels_6 : $chan_libres"; } } echo "</select><BR>"; echo "<BR>$demandes_channels_7 <input type='checkbox' name='warning[]' value='$id_chan'>"; echo "</TD></TR></TABLE><BR><BR>"; } mysql_close($connexion_chans); echo "<BR>$boutton_valider_annuler</FORM><FORM METHOD=POST ACTION='index.php'>$boutton_retour</FORM>"; ?> Guillaume Tournand <guillaume@tournand.com> September 2003 304/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 305/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project admin/demande_channels_confirm.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='team'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Admin</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <BR><BR> <?PHP require 'include/.htmysql'; $connexion_chans=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_chans); $result_demandes = mysql_query("SELECT * from askin_chan ORDER BY id_chan DESC") or die ("Requete non valide"); $max_demandes=mysql_num_rows($result_demandes); if ($max_demandes){ $ppetit_id=mysql_result($result_demandes,$max_demandes-1,"id_chan"); } for ($i=0; $i != $max_demandes; $i++) { if ($warning[$i]) { $chan_id=$warning[$i]; $list_warn[$chan_id]=1; } } for ($i=0; $i != $max_demandes; $i++) { if ($blacklist[$i]) { $chan_id=$blacklist[$i]; $list_black[$chan_id]=1; } } for ($i=0; $i != $max_demandes; $i++) { Guillaume Tournand <guillaume@tournand.com> September 2003 306/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if ($attente[$i]) { $chan_id=$attente[$i]; $chan_attente[$chan_id]=1; } } for ($cpt=0; $cpt != $max_demandes; $cpt++) { $id_chan=$ppetit_id+$cpt; if ($refus[$id_chan] || $valid[$id_chan]) { if (!$mark_refus) { $mark_refus=1; } $id_user=mysql_result($result_demandes,$max_demandes-$cpt-1,"id_owner"); $result_user=mysql_query("SELECT * from users WHERE id_user='$id_user'") or die ("Requete non valide"); echo "<TABLE BORDER=0 width='90%' align='center'><TR ALIGN='CENTER'><TD COLSPAN=5>"; echo "$demandes_channels_1 "; $unixtime_demande=mysql_result($result_demandes,$max_demandes-$cpt1,"unixtime_demande"); $date_demande=date("d/m/Y", "$unixtime_demande"); echo "$date_demande"; echo " / "; $genre=mysql_result($result_user,0,"genre"); // detection de la langue pour savoir dans quelle table tapper. if ($lang != 'fr') { $table_genre_texte="descr_$lang"; } if ($lang == 'fr') { $table_genre_texte="descr"; } $result_genre=mysql_query("SELECT $table_genre_texte FROM genre WHERE id_genre='$genre'") or die ("Requete non valide"); $genre=mysql_result($result_genre,0,"$table_genre_texte"); echo "$genre "; echo mysql_result($result_user,0,"nom"); echo " "; echo mysql_result($result_user,0,"prenom"); echo " ("; echo mysql_result($result_user,0,"pays"); echo ") / "; $unixtime_naiss=mysql_result($result_user,0,"unixtime_naiss"); echo date("d/m/Y", "$unixtime_naiss"); $nick=mysql_result($result_user,0,"nick"); echo " / <A HREF='management/users.php?id_user=$id_user' target='home' class='lien'>$nick</A>"; echo "</TD></TR><TR ALIGN='CENTER'><TD COLSPAN=5>"; $username=mysql_result($result_user,0,"username"); $host1=mysql_result($result_user,0,"host1"); $host2=mysql_result($result_user,0,"host2"); $host3=mysql_result($result_user,0,"host3"); if ($host1) { echo "*!*$username@$host1 "; } if ($host2) { echo "/ *!*$username@$host2 "; } if ($host3) { echo "/ *!*$username@$host3"; } echo "</TD></TR>"; // on affiche la langue $user_lang=mysql_result($result_user,0,"lang"); echo "<TR ALIGN='CENTER'><TD COLSPAN=5>"; echo "$demandes_channels_10 : <B>$user_lang</B>"; Guillaume Tournand <guillaume@tournand.com> September 2003 307/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project echo "</TD></TR>"; // on affiche le channel echo "<TR ALIGN='CENTER'><TD COLSPAN=5>"; echo "$demandes_channels_2 : <B>"; $nom_chan=mysql_result($result_demandes,$max_demandes-$cpt-1,"nom_chan"); echo "<A HREF='irc://irc.undernet.org/$nom_chan' class='lien'>#$nom_chan</A>"; echo "</B><BR><BR></TD></TR>"; echo "<TR VALIGN='TOP'><TD WIDTH='10%' ALIGN='CENTER'>"; $unixtime_maintenant=time(); // la demande est refusee if ($refus[$id_chan] && !$valid[$id_chan]){ echo "<B><font color='red'>$demande_channel_confirm_0</font></B>"; // construction de la query pour ajouter l'entrée dans getout_chan $getout_query="INSERT INTO getout_chan(nom_chan, id_owner, unixtime_demande, unixtime_refus, id_refus) VALUES('$nom_chan', '$id_user', '$unixtime_demande', '$unixtime_maintenant', '$refus[$id_chan]')"; // si le chan ne peut pas faire de demande pour un certain temps if ($chan_attente[$id_chan]) { $getout_query="INSERT INTO getout_chan(nom_chan, id_owner, unixtime_demande, unixtime_refus, id_refus, attente_active) VALUES('$nom_chan', '$id_user', '$unixtime_demande', '$unixtime_maintenant', '$refus[$id_chan]', '1')"; } $result_getout=mysql_query("$getout_query") or die ("Requete non valide"); // detection de la langue pour savoir dans quelle table tapper. if ($lang != 'fr') { $table_refus_texte="texte_$lang"; } if ($lang == 'fr') { $table_refus_texte="texte"; } $result_refus = mysql_query("SELECT $table_refus_texte from raisons_refus WHERE id_refus='$refus[$id_chan]'") or die ("Requete non valide"); $raison=mysql_result($result_refus,0,"$table_refus_texte"); if ($raison){ echo "</TD><TD ALIGN='RIGHT'>"; echo "<U>$demande_channel_confirm_1</U> :</TD><TD>$raison"; } // si le channel doit etre blacklisté if ($list_black[$id_chan]){ $nick_admin=$_SERVER["PHP_AUTH_USER"]; echo "</TD><TD ALIGN='RIGHT'>"; echo "<font color='red'><U>$demande_channel_confirm_2</U> :</TD><TD>$demande_channel_confirm_3</font>"; //$raison=strip_single_quote("$raison"); // on regarde s'il n'est pas déjà présent $result_blacklist = mysql_query("SELECT * from blacklist WHERE nom_chan='$nom_chan'") or die ("Requete non valide"); $max_blacklist=mysql_num_rows($result_blacklist); // s'il l'est if ($max_blacklist) { $deja_active=mysql_result($result_blacklist,0,"active"); if (!$deja_active) { Guillaume Tournand <guillaume@tournand.com> September 2003 308/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $query="UPDATE blacklist SET nick_admin='$nick_admin', source='1', active='1', raison='$raison', unixtime_black='$unixtime_maintenant' WHERE nom_chan='$nom_chan'"; $result = mysql_query($query) or die ("Requète non valide"); } } // s'il ne l'est pas if (!$max_blacklist) { $query="INSERT INTO blacklist(nom_chan, unixtime_black, nick_admin, raison, source, active) VALUES('$nom_chan', '$unixtime_maintenant', '$nick_admin', '$raison', '1', '1')"; $result = mysql_query($query) or die ("Requète non valide"); } } } // la demande est validee if ($valid[$id_chan] && !$refus[$id_chan]){ echo "<B><font color='green'>$demande_channel_confirm_4</font></B>"; $result_getin=mysql_query("INSERT INTO channels(nom_chan, id_owner, egg_group, unixtime_support, unixtime_demande) VALUES('$nom_chan', '$id_user', '$valid[$id_chan]', '$unixtime_maintenant', '$unixtime_demande')") or die ("Requete non valide"); // on recupere l'id de ce channel pour creer table du chan $result_id_chan=mysql_query("SELECT id_chan FROM channels WHERE nom_chan='$nom_chan'") or die ("Requete non valide"); $num_chan=mysql_result($result_id_chan,0,"id_chan"); $query="CREATE TABLE lz_chan_$num_chan (chan_pk BIGINT(20) PRIMARY KEY AUTO_INCREMENT, id_op BIGINT(20) NOT NULL, lvl BIGINT(20) NOT NULL)"; $result_create_table=mysql_query("$query") or die ("Requete non valide"); // on ajoutte l'entree dans le monitoring $result_getin_monitoring=mysql_query("INSERT INTO chan_monitoring(nom_chan, nb_user_1, nb_user_2, nb_user_3, axs_x, x_automode) VALUES('$nom_chan', '0', '0', '0', '-', '-')") or die ("Requete non valide"); $commande=".+chan #$nom_chan"; $query="INSERT INTO instructions(unixtime, id_user, commande) VALUES('$unixtime_maintenant', '$id_user', '$commande')"; $result = mysql_query($query) or die ("Requète non valide"); $result_egg=mysql_query("SELECT nom from eggdrops WHERE egg_bloc='$valid[$id_chan]'") or die ("Requète non valide"); $max_eggs=mysql_num_rows($result_egg); for ($cpt_egg=0; $cpt_egg != $max_eggs; $cpt_egg++) { $nom_egg=mysql_result($result_egg,$cpt_egg,"nom"); $commande=".bnjoin $nom_egg #$nom_chan"; $query="INSERT INTO instructions(unixtime, id_user, commande, ack) VALUES('$unixtime_maintenant', '$id_user', '$commande', '1')"; $result = mysql_query($query) or die ("Requète non valide"); } $commande=".chattr LZ-$id_user +o #$nom_chan"; $query="INSERT INTO instructions(unixtime, id_user, commande) VALUES('$unixtime_maintenant', '$id_user', '$commande')"; $result = mysql_query($query) or die ("Requète non valide"); if ($list_warn[$id_chan]){ echo "</TD><TD ALIGN='RIGHT'>"; echo "<U>$demande_channel_confirm_2</U> :</TD><TD>$demande_channel_confirm_5"; Guillaume Tournand <guillaume@tournand.com> September 2003 309/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $query="UPDATE channels SET warning='1' WHERE channels.nom_chan = '$nom_chan'"; $result = mysql_query($query) or die ("Requète non valide"); } // on choppe l'utilisation du projet $prct= project_use($egg_max_chan); // si le projet est plein on demande a adam de changer le desc sur X if ($prct >= "100.00") { $commande=".msg X set #loufiz desc Project is full, LZ creation available / Projet complet, création de LZ possible"; $query="INSERT INTO instructions(unixtime, id_user, commande, ack) VALUES('$unixtime_maintenant', '1', '$commande', '4')"; $result = mysql_query($query) or die ("Requète non valide"); } } $result_efface=mysql_query("DELETE FROM askin_chan WHERE askin_chan.id_chan = $id_chan") or die ("Requete non valide"); echo "</TD></TR></TABLE><BR><BR>"; } } if (!$mark_refus) { echo "<BR><BR><CENTER><B><U><H3>$demande_channel_confirm_6<H3></U></B></CENTER><BR>"; } echo "<BR><FORM METHOD=POST ACTION='index.php'>$boutton_retour</FORM>"; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 310/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project admin/index.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='team'; // on met en place la session et la langue require 'include/.htsession'; require 'include/.htmysql'; $connexion_chans=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_chans); /* Old database entry cleanup */ // temps maxi pour un channel dans les archive $max_chan_time=60*24*60*60; // temps maxi pour user idle $max_user_time=30*24*60*60; // suppression des entrées dans le suivi des demandes supérieures a un mois $unixtime_now=time(); $query="DELETE FROM getout_chan WHERE (($unixtime_now-unixtime_refus >= $max_chan_time) and unixtime_refus > 0) or (($unixtime_now-unixtime_purge >= $max_chan_time) and unixtime_purge > 0)"; $result=mysql_query("$query") or die ("Requete non valide"); // detection des utilisateurs idle //on choppe la liste des channels $result_channels=mysql_query("SELECT id_chan, id_owner FROM channels") or die ("Requète non valide"); $max_channels=mysql_num_rows($result_channels); // initialisation du tableau $non_idles = Array(); for ($cpt_chans=0; $cpt_chans < $max_channels; $cpt_chans++) { Guillaume Tournand <guillaume@tournand.com> September 2003 311/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $id_owner=mysql_result($result_channels,$cpt_chans,"id_owner"); $id_chan=mysql_result($result_channels,$cpt_chans,"id_chan"); // on ajoutte l'id au tableau $non_idles[]=$id_owner; // on liste les ops de ce channel $query="SELECT id_op FROM lz_chan_$id_chan"; $result=mysql_query("$query") or die ("Requète non valide"); $max_result=mysql_num_rows($result); // pour chaque op on l'ajoutte dans le tableau for ($cpt=0; $cpt < $max_result; $cpt++) { $id_op=mysql_result($result,$cpt,"id_op"); // on ajoutte l'id au tableau $non_idles[]=$id_op; } } // On ajoutte a ce tableau les utilisateurs qui sont admin du projet Loufiz $query_admins="SELECT id_user FROM admin"; $result_admins=mysql_query($query_admins) or die ("Requete non valide"); $max_admins=mysql_num_rows($result_admins); for ($cpt=0; $cpt<$max_admins; $cpt++){ $id_admin=mysql_result($result_admins,$cpt,"id_user"); // On ajout l'id au tableau $non_idles[]=$id_admin; } $non_idles[]=$demo_id; // A partir des resultats du tableau, on ecreme les utilisateurs idle $unixtime_maintenant=time(); $query="SELECT DISTINCT id_user FROM users WHERE ($unixtime_maintenant - unixtime_login) >= $max_user_time AND id_user > '2' ORDER BY id_user DESC"; $result=mysql_query("$query") or die ("Requete non valide"); $max_users=mysql_num_rows($result); for ($cpt=0; $cpt<$max_users; $cpt++){ $id_user=mysql_result($result,$cpt,"id_user"); for ($i=0, $user_actif=0; $non_idles[$i] && (!$user_actif); $i++){ if ($id_user==$non_idles[$i]) { $user_actif='1'; } } if (!$user_actif) { $delete_query="DELETE FROM users WHERE id_user='$id_user'"; $result_delete=mysql_query($delete_query) or die ("Requete non valide"); //echo "Supression de l'utilisateur N°$id_user.<BR>"; $commande = ".-user LZ-$id_user"; $query_instr="INSERT INTO instructions(unixtime, id_user, commande) VALUES ('$unixtime_maintenant', '1', '$commande')"; $result_instr=mysql_query($query_instr) or die ("Requète non valide"); } } /* End of Old User ID cleanup */ ?> <HTML> <HEAD> <TITLE>Loufiz : Admin</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> Guillaume Tournand <guillaume@tournand.com> September 2003 312/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project <!-<META HTTP-EQUIV='REFRESH' CONTENT='60'> --> <script> function ouvrirfenetre() { exemple=window.open ("","fenetreimage", "scrollbars=yes, toolbar=no, location=no, directories=no, status=no, resizable=yes") } </script> </HEAD> <BODY> <?PHP // Page index de l'interface d'admin a partir d'ici echo "<TABLE WIDTH='100%' HEIGHT='575' BORDER='0'><TR valign='top'><TD WIDTH='45%'>"; echo "<BR>"; // demande d'eggdrops $result_demandes = mysql_query("SELECT count(nom_chan) from askin_chan") or die ("Requete non valide"); $max_demandes=mysql_result($result_demandes,0,"count(nom_chan)"); if ($max_demandes==0) echo "<FONT COLOR='GREEN'>$administration_index_7</FONT>"; else { echo "<A HREF='demande_channels.php' CLASS='lien' target='home'>$administration_index_8_1 $max_demandes $administration_index_8_2</A>"; } echo "<BR><BR><BR>"; // channels control room echo "<B><U>$administration_index_16 :</U></B><BR><BR>"; echo "<A HREF='chan_monitoring.php' CLASS='lien' target='home'>$administration_index_17</A><BR>"; echo "<A HREF='chan_monitoring_doc.php' CLASS='lien' target='home'>$administration_index_18</A>"; echo "<BR><BR><BR>"; // administration de la base de donnée echo "<B><U>$administration_index_1</U></B><BR><BR><A HREF='management/' class='lien' target='home'>$administration_index_2</A><BR>"; $result_users = mysql_query("SELECT count(id_user) FROM users WHERE id_user>'1'") or die ("Rèquete non valide"); $max_users = mysql_result($result_users,0,"count(id_user)"); $result_chans = mysql_query("SELECT count(nom_chan) from channels WHERE nom_chan!='loufiz'") or die ("Requete non valide"); $max_chans=mysql_result($result_chans,0,"count(nom_chan)"); if ($max_users){ echo "<A HREF='all_users.php' class='lien' target='home'>$administration_index_3_1 $max_users $administration_index_3_2</A><BR>"; } echo "<BR>"; if ($max_chans) { echo "<A HREF='all_chans.php' CLASS='lien' target='home'>$administration_index_4_1 $max_chans $administration_index_4_2</A><BR>"; } $result_blacklist = mysql_query("SELECT count(id_black) FROM blacklist WHERE active=1") or die ("Rèquete non valide"); $max_blacklist=mysql_result($result_blacklist,0,"count(id_black)"); if ($max_blacklist){ echo "<A HREF='blacklist/' class='lien' target='home'>$administration_index_5_1 $max_blacklist $administration_index_5_2</A>"; } Guillaume Tournand <guillaume@tournand.com> September 2003 313/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project else { echo "<A HREF='blacklist/' class='lien' target='home'>$administration_index_5_3</A>"; } echo "<BR><BR><BR>"; // administration du projet echo "<B><U>$administration_index_10 :</U></B><BR><BR>"; echo "<A HREF='maj_liens.php' CLASS='lien' target='home'>$administration_index_24</A><BR>"; echo "<A HREF='admin_management/' CLASS='lien' target='home'>$administration_index_11</A>"; echo "<BR>"; // Loufiz stats echo "</TD><TD VALIGN='TOP' ALIGN='CENTER'><BR><H3><B><U>$administration_index_12</U></B></H3>"; $result_adam = mysql_query("SELECT count(id_instr) FROM instructions") or die ("Rèquete non valide"); $max_adam=mysql_result($result_adam,0,"count(id_instr)"); if ($max_adam){ echo "<FONT COLOR='RED'>$max_adam $administration_index_9_2</FONT>"; } if (!$max_adam){ echo "<FONT COLOR='GREEN'>$administration_index_9_3</FONT>"; } echo "<BR>"; $prct=project_use($egg_max_chan); // on affiche le pourcentage en rouge si > 100% if ($prct>100) { echo "<FONT COLOR='red'>"; } echo "$administration_index_13 <B>$prct%"; if ($prct>100) { echo "</FONT>"; } echo "</B><BR>"; $result_comment=mysql_query("SELECT count(id_comment) from commentaires") or die ("Requete non valide"); $max_comment=mysql_result($result_comment,0,"count(id_comment)"); if ($max_comment){ echo "<A HREF='commentaires.php' CLASS='lien' target='home'>$administration_index_14_1 $max_comment $administration_index_14_2</A><BR>"; } echo "<BR>"; // Tableau d'eggdrops $result_eggs=mysql_query("SELECT DISTINCT egg_bloc from eggdrops WHERE egg_bloc!='0' AND actif != '0' ORDER BY egg_bloc ASC") or die ("Requete non valide"); $max_eggs=mysql_num_rows($result_eggs); echo "<TABLE BORDER='0' ALIGN='CENTER' VALIGN='CENTER'>"; for ($i=0; $max_eggs > $i; $i++){ $egg_bloc=mysql_result($result_eggs,$i,"egg_bloc"); $result_nom_egg=mysql_query("SELECT nom, m_server from eggdrops WHERE egg_bloc='$egg_bloc'") or die ("Requete non valide"); $max_noms=mysql_num_rows($result_nom_egg); $result_libre=mysql_query("SELECT nom_chan from channels WHERE egg_group='$egg_bloc'") or die ("Requete non valide"); $max_libre=mysql_num_rows($result_libre); $chan_libres=$egg_max_chan-$max_libre; Guillaume Tournand <guillaume@tournand.com> September 2003 314/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project echo "<TR><TD ALIGN='CENTER'>$egg_bloc</TD>"; for ($j=0; $max_noms > $j; $j++) { $nom_egg = mysql_result($result_nom_egg,$j,"nom"); $m_server = mysql_result($result_nom_egg,$j,"m_server"); echo "<TD><A HREF='management/eggdrops.php?nom=$nom_egg' TARGET='home' CLASS='lien'>"; if ($m_server=='-') { echo "<FONT COLOR='red'>"; } echo "$nom_egg"; if ($m_server=='-') { echo "</FONT>"; } echo "</A></TD>"; } echo "<TD>$administration_index_15_1$chan_libres $administration_index_15_2</TD></TR>"; } echo "</TABLE>"; echo "</TD></TR><TR><TD COLSPAN=2><HR>"; echo "<LI><A HREF='liste_refus.php' target='fenetreimage' onclick='ouvrirfenetre()' class='lien'>$administration_index_19</A>"; echo "<LI><A HREF='liste_admins.php' target='home' class='lien'>$administration_index_21</A>"; echo "<LI><A HREF='https://www.loufiz.com/webaliser/' target='new' class='lien'>$administration_index_22</A>"; echo "</TD></TR>"; // on affiche une ligne echo "<TR><TD COLSPAN=2><HR></TD></TR>"; // on affiche le boutton de resynchro echo "<TR HEIGHT='30'><TD ALIGN='center' VALIGN='center'>"; echo "<FORM METHOD='POST' ACTION='perl/check_and_rebuild_world.pl'><INPUT TYPE='submit' VALUE='$administration_index_25' STYLE={color='red';}></FORM>"; echo "</TD>"; // on affiche le boutton pour rafraichir la page echo "<TD ALIGN='center' VALIGN='center'>"; echo "<FORM METHOD='POST' ACTION='./'>$administration_index_23</FORM>"; echo "</TD></TR></TABLE>"; mysql_close($connexion_chans); ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 315/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project admin/liste_admins.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='team'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Admin</TITLE> <LINK REL='stylesheet' HREF='include/style/table_no_bgcolor.css'> </HEAD> <BODY> <BR><BR><BR><HR><BR> <?PHP require 'include/.htmysql'; $connexion_chans=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_chans); // recherche de la langue et def des tables if ($lang == 'fr') { $admin_descr="admin_descr"; } if ($lang == 'en') { $admin_descr="admin_descr_en"; } $result_admin=mysql_query("SELECT a.id_user, u.nick, a.unixtime_admin, l.$admin_descr from admin a, users u, admin_levels l WHERE a.id_user=u.id_user AND l.id_level=a.id_lvl ORDER BY l.admin_lvl ASC, a.unixtime_admin DESC") or die ("Requete non valide"); $max_admin=mysql_num_rows($result_admin); echo "<BR><BR><CENTER><H3><B><U>$liste_helpers_1</U></B></H3></CENTER><BR>"; echo "<TABLE BORDER=0 width='90%' align='center'><TR ALIGN='CENTER'><TH>$liste_helpers_2</TH><TH>$liste_helpers_3</TH><TH>$liste_helpers_4</TH><TH>$lis te_helpers_5</TH></TR><TR><TD COLSPAN=4><HR></TD></TR>"; Guillaume Tournand <guillaume@tournand.com> September 2003 316/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project for ($i=0; $i<$max_admin; $i++) { echo "<TR ALIGN='CENTER'"; if (($i)%2) { echo " bgcolor='#EDEDFF'"; } echo "><TD>"; $id_user = mysql_result($result_admin,$i,'a.id_user'); if ($id_user!=1) { echo "<A HREF='management/users.php?id_user=$id_user' class='lien' target='home'>"; } echo "LZ-$id_user"; if ($id_user!=1) { echo "</A>"; } echo "</TD><TD>"; echo mysql_result($result_admin,$i,'u.nick'); echo "</TD><TD>"; $unixtime=mysql_result($result_admin,$i,'a.unixtime_admin'); echo date("d/m/Y", "$unixtime"); echo "</TD><TD>"; echo mysql_result($result_admin,$i,"l.$admin_descr"); echo "</TD></TR>"; } echo "</TABLE>"; echo "<BR><FORM METHOD=POST ACTION='./'>$boutton_retour</FORM>"; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 317/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project admin/liste_refus.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='team'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Admin</TITLE> <LINK REL='stylesheet' HREF='include/style/table_no_bgcolor.css'> <SCRIPT> if (screen.width < 1024) { top.window.moveTo(0,0); } else { self.moveTo((20),(20)); self.resizeTo(("850"),("745")); } </SCRIPT> </HEAD> <BODY> <?PHP require 'include/.htmysql'; $connexion_chans=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_chans); echo "<CENTER><H3><U>$liste_refus</U></H3></CENTER><BR>"; // detection de la langue pour savoir dans quelle table tapper. if ($lang != 'fr') { $table_refus_texte="texte_$lang"; $table_refus_descr="descr_$lang"; } Guillaume Tournand <guillaume@tournand.com> September 2003 318/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if ($lang == 'fr') { $table_refus_texte="texte"; $table_refus_descr="descr"; } $result_refus=mysql_query("SELECT $table_refus_descr,$table_refus_texte from raisons_refus") or die ("Requete non valide"); $max_refus=mysql_num_rows($result_refus); echo "<TABLE BORDER='0' WIDTH='90%' ALIGN='center'>"; for ($cpt=0; $cpt<$max_refus; $cpt++){ echo "<TR"; if (($cpt)%2) { echo " bgcolor='#EDEDFF'"; } echo "><TD ALIGN='CENTER' VALIGN='CENTER'>"; echo mysql_result($result_refus,$cpt,"$table_refus_descr"); echo "</TD><TD>"; echo mysql_result($result_refus,$cpt,"$table_refus_texte"); echo "</TD></TR>"; } echo "</TABLE>"; mysql_close($connexion_chans); ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 319/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project admin/maj_liens.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='team'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Admin</TITLE> <LINK REL='stylesheet' HREF='include/style/table_no_bgcolor.css'> </HEAD> <BODY> <BR><BR><HR> <?PHP require 'include/.htmysql'; $connexion_chans=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_chans); // on recherche le niveau d'admin de l'utilisateur $nick_admin=$_SERVER["PHP_AUTH_USER"]; $query="SELECT l.admin_lvl from admin a, users u, admin_levels l WHERE a.id_user=u.id_user AND l.id_level=a.id_lvl AND u.nick='$nick_admin'"; $result=mysql_query($query); $nb_lvl=mysql_num_rows($result); if ($nb_lvl == 1) { $admin_lvl=mysql_result($result,0,"l.admin_lvl"); // s'il a un niveau suffisant, il peut entrer if ($admin_lvl >= $min_admin_level_link) { echo "<BR><BR>"; echo "<CENTER><B><U>$update_link_1</U></B></CENTER><BR>"; // si on a un nom de channel et un ordre, on ajoute if ($l_channel && $l_ordre) { // on nettoie les entrées $l_channel= strtolower ($l_channel); Guillaume Tournand <guillaume@tournand.com> September 2003 320/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $l_channel= strip_space ($l_channel); $l_ordre= clean_id ($l_ordre); $l_ordre= strip_space ($l_ordre); // on verifie que le channel n'est pas deja present dans la base $query="SELECT id_lien FROM liens WHERE channel='$l_channel'"; $result=mysql_query($query); $nb_liens=mysql_num_rows($result); // s'il n'est pas deja present if (!$nb_liens) { $query="INSERT INTO liens (channel, ordre) VALUES ('$l_channel', '$l_ordre')"; // si en plus on a une url, on modifie la query if ($l_url) { $l_url= strtolower ($l_url); $l_url= strip_space ($l_url); $query="INSERT INTO liens (channel, ordre, url) VALUES ('$l_channel', '$l_ordre', '$l_url')"; } $result=mysql_query("$query"); echo "<BR><CENTER><B><FONT COLOR='green'>$update_link_11</FONT><B></CENTER><BR>"; } // si deja present else { echo "<BR><CENTER><B><FONT COLOR='red'>$update_link_12</FONT><B></CENTER><BR>"; } } // si on a une demande de supression de lien if ($d_id_lien) { // on verifie que le lien soit present dans la base $query="SELECT id_lien FROM liens WHERE id_lien='$d_id_lien'"; $result=mysql_query($query); $nb_liens=mysql_num_rows($result); // s'il n'est pas deja present if ($nb_liens) { $query="DELETE FROM liens WHERE id_lien='$d_id_lien'"; $result=mysql_query("$query"); echo "<BR><CENTER><B><FONT COLOR='green'>$update_link_13</FONT><B></CENTER><BR>"; } // si aucun présent else { echo "<BR><CENTER><B><FONT COLOR='red'>$update_link_14</FONT><B></CENTER><BR>"; } } // on affiche le tableau de l'ajout/supression d'un lien echo "<BR><TABLE BORDER='0' width='80%' align='center'><TR ALIGN='CENTER'><TD ALIGN='left' VALIGN='top'>"; echo "<CENTER>$update_link_2</CENTER><BR>"; echo "<FORM METHOD=POST ACTION='maj_liens.php'><BR>"; echo "<B>$update_link_3 : </B>#<INPUT TYPE='text' NAME='l_channel' SIZE='40' MAXLENGTH='150'><BR><BR>"; echo "<B>$update_link_4 : </B><INPUT TYPE='text' NAME='l_url' SIZE='40' MAXLENGTH='200'><BR><BR>"; echo "<B>$update_link_5 : </B><INPUT TYPE='text' NAME='l_ordre' SIZE='3' MAXLENGTH='3'><BR><BR>"; Guillaume Tournand <guillaume@tournand.com> September 2003 321/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project echo "$update_link_submit"; echo "</FORM>"; echo "</TD><TD ALIGN='right' VALIGN='top'>"; // affiche le formulaire pour le retrait d'un lien echo "<CENTER>$update_link_6</CENTER><BR>"; echo "<FORM METHOD=POST ACTION='maj_liens.php'><BR>"; echo "<B>$update_link_7 : </B><INPUT TYPE='text' NAME='d_id_lien' SIZE='10' MAXLENGTH='20'><BR><BR>"; echo "$update_link_submit"; echo "</FORM>"; echo "</TD></TR></TABLE><BR>"; // on affiche la liste des liens présents $result_liens = mysql_query("SELECT * FROM liens ORDER BY ordre ASC, id_lien ASC") or die ("Rèquete non valide"); $max_liens=mysql_num_rows($result_liens); if ($max_liens) { echo "<TABLE WIDTH='100%' BORDER='0'><TR><TH>$update_link_7</TH><TH>$update_link_8</TH><TH>$update_link_9</TH><TH>$upda te_link_10</TH></TR>"; for ($cpt=0; $cpt<$max_liens; $cpt++){ echo "<TR"; if (!($cpt%2)) { echo " bgcolor='#EDEDFF'"; } echo "><TD ALIGN='CENTER'>"; $id_lien=mysql_result($result_liens,$cpt,"id_lien"); echo "$id_lien"; echo "</TD><TD ALIGN='CENTER'>"; $channel=mysql_result($result_liens,$cpt,"channel"); echo "#$channel"; echo "</TD ALIGN='LEFT'><TD>"; $url=mysql_result($result_liens,$cpt,"url"); if ($url) { echo "<A HREF='$url' target='_new' class='lien'>$url</A>"; } echo "</TD><TD ALIGN='CENTER'>"; $ordre=mysql_result($result_liens,$cpt,"ordre"); echo "$ordre"; echo "</TR>"; } echo "</TABLE>"; } echo "<BR><HR><BR>"; // on traite le cas de l'ajout d'une banniere if ($l_href && $l_src) { // on nettoie les entrées $l_href= strip_space ($l_href); $l_src= strip_space ($l_src); // on verifie que le channel n'est pas deja present dans la base $query="SELECT id_partenaire FROM partenaires_small WHERE href='$l_href'"; $result=mysql_query($query); $nb_part=mysql_num_rows($result); Guillaume Tournand <guillaume@tournand.com> September 2003 322/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project // s'il n'est pas deja present if (!$nb_part) { $query="INSERT INTO partenaires_small (href, src) VALUES ('$l_href', '$l_src')"; // si en plus on a un alt, on modifie la query if ($l_alt) { //$l_alt=strip_single_quote ($l_alt); $query="INSERT INTO partenaires_small (href, src, alt) VALUES ('$l_href', '$l_src', '$l_alt')"; } $result=mysql_query("$query"); echo "<BR><CENTER><B><FONT COLOR='green'>$update_link_11</FONT><B></CENTER><BR>"; } // si deja present else { echo "<BR><CENTER><B><FONT COLOR='red'>$update_link_12</FONT><B></CENTER><BR>"; } } // si on a une demande de supression de lien if ($d_id_ban) { // on verifie que le lien soit present dans la base $query="SELECT id_partenaire FROM partenaires_small WHERE id_partenaire='$d_id_ban'"; $result=mysql_query($query); $nb_part=mysql_num_rows($result); // s'il n'est pas deja present if ($nb_part) { $query="DELETE FROM partenaires_small WHERE id_partenaire='$d_id_ban'"; $result=mysql_query("$query"); echo "<BR><CENTER><B><FONT COLOR='green'>$update_link_13</FONT><B></CENTER><BR>"; } // si aucun présent else { echo "<BR><CENTER><B><FONT COLOR='red'>$update_link_14</FONT><B></CENTER><BR>"; } } // maintenant on affiche la liste des bannieres des partenaires echo "<BR><CENTER><B><U>$update_link_16</U></B></CENTER><BR>"; // on affiche un tableau pour ajouter/suppprimer des bannieres echo "<BR><TABLE BORDER='0' width='80%' align='center'><TR ALIGN='CENTER'><TD ALIGN='left' VALIGN='top'>"; echo "<CENTER>$update_link_16</CENTER><BR>"; echo "<FORM METHOD=POST ACTION='maj_liens.php'><BR>"; echo "<B>$update_link_18 : </B><INPUT TYPE='text' NAME='l_href' SIZE='20' MAXLENGTH='150'><BR><BR>"; echo "<B>$update_link_19 : </B><INPUT TYPE='text' NAME='l_src' SIZE='20' MAXLENGTH='200'><BR><BR>"; echo "<B>$update_link_20 : </B><INPUT TYPE='text' NAME='l_alt' SIZE='20' MAXLENGTH='40'><BR><BR>"; echo "$update_link_submit"; echo "</FORM>"; echo "</TD><TD ALIGN='right' VALIGN='top'>"; // affiche le formulaire pour le retrait d'un lien Guillaume Tournand <guillaume@tournand.com> September 2003 323/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project echo "<CENTER>$update_link_17</CENTER><BR>"; echo "<FORM METHOD=POST ACTION='maj_liens.php'><BR>"; echo "<B>$update_link_21 : </B><INPUT TYPE='text' NAME='d_id_ban' SIZE='10' MAXLENGTH='20'><BR><BR>"; echo "$update_link_submit"; echo "</FORM>"; echo "</TD></TR></TABLE><BR>"; // On affiche les petites banners $result_partenaires = mysql_query("SELECT * FROM partenaires_small ORDER BY id_partenaire ASC") or die ("Rèquete non valide"); $max_partenaires=mysql_num_rows($result_partenaires); if ($max_partenaires) { echo "<TABLE BORDER='0' WIDTH='100%' STYLE='border: none'><TR>"; // on définit combien de bannieres seront affichées a l'horizontale $nb_ban_horiz=5; for ($cpt=0; $cpt<$nb_ban_horiz; $cpt++) { echo "<TH>$update_link_21</TH><TH>$update_link_22</TH>"; } echo "</TR><TR ALIGN='right'>"; for ($cpt=0; $cpt<$max_partenaires; $cpt++){ if ( !($cpt%$nb_ban_horiz) ) { echo "</TR><TR ALIGN='right'>"; } $id_partenaire=mysql_result($result_partenaires,$cpt,"id_partenaire"); $href=mysql_result($result_partenaires,$cpt,"href"); $src=mysql_result($result_partenaires,$cpt,"src"); $alt=mysql_result($result_partenaires,$cpt,"alt"); echo "<TD>$id_partenaire</TD><TD><A HREF='$href' TARGET='_new' CLASS='lien'><IMG SRC='$src' ALT='$alt' BORDER='0' width='88' height='31'></A></TD>"; } echo "</TR></TABLE>"; } } // pas de niveau suffisant else { echo "<BR><BR><H3><CENTER>$admin_mgmt_index_4</CENTER></H3><BR><BR>"; } } // pas de réponse du niveau d'admin else { echo "<BR><BR><H3><CENTER>$admin_mgmt_index_5</CENTER></H3><BR><BR>"; } echo "<FORM METHOD=POST ACTION='index.php'>$boutton_retour</FORM>"; mysql_close($connexion_chans); ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 324/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project admin/admin_management/ajout_admin.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='team'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Admin</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <BR><BR><BR><HR> <?PHP // liste des usernames de mails reserves $forbidden_nicks = array ("postmaster", "root", "abus", "abuse", "admin", "botmaster", "eggdrop", "eggdrops", "guillaume", "guigui", "groumf", "loufiz", "mailer-daemon", "nold", "nolderise-ifrance", "seboune", "sebounet", "webmaster"); require 'include/.htmysql'; $connexion_chans=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_chans); // nettoyage des id_user $id_user=clean_id ($id_user); // on recherche le niveau d'admin de l'utilisateur $nick_admin=$_SERVER["PHP_AUTH_USER"]; $query="SELECT l.admin_lvl from admin a, users u, admin_levels l WHERE a.id_user=u.id_user AND l.id_level=a.id_lvl AND u.nick='$nick_admin'"; $result=mysql_query($query); $nb_lvl=mysql_num_rows($result); $admin_lvl=mysql_result($result,0,"l.admin_lvl"); // gros admin ? Guillaume Tournand <guillaume@tournand.com> September 2003 325/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if ($admin_lvl >= $min_admin_level_admin_mgmt) { $result_userlist = mysql_query("SELECT id_user, nick, amail, pass from users WHERE id_user='$id_user'") or die ("Requete non valide"); $max_userlist=mysql_num_rows($result_userlist); $result_adminlist = mysql_query("SELECT id_user from admin WHERE id_user='$id_user'") or die ("Requete non valide"); $deja_admin=mysql_num_rows($result_adminlist); // si aucun id utilisateur saisi if (!$id_user) { echo $admin_mgmt_ajout_1; } else { // si aucun id user correspond dans la base if (!$max_userlist){ echo $admin_mgmt_ajout_2; } else { // sur definition de l'id_user afin d'etre sur de ne pas avoir un chiffre prefixe de 0 $id_user=mysql_result($result_userlist,0,"id_user"); // Si pas de tache, pas bien if (!$sticker) { echo $admin_mgmt_ajout_3; } else { // check du niveau cible $query="SELECT admin_lvl from admin_levels WHERE id_level='$sticker'"; $result = mysql_query("$query") or die ("Requete non valide"); $target_level=mysql_result($result,0,"admin_lvl"); // on verifie que le niveau cible est plus petit que le niveau de l'admin if ($target_level<$admin_lvl) { // s'il est deja admin, modification if ($deja_admin){ // verification que l'admin ai un niveau superieur a sa cible $query="SELECT l.admin_lvl from admin_levels l, admin a WHERE a.id_lvl=l.id_level AND a.id_user='$id_user'"; $result = mysql_query("$query") or die ("Requete non valide"); $user_level=mysql_result($result,0,"l.admin_lvl"); // seulement la il pourra if ($admin_lvl>$user_level) { $query="UPDATE admin SET id_lvl='$sticker' WHERE id_user='$id_user'"; $result=mysql_query($query) or die ("Requete non valide"); echo $admin_mgmt_ajout_6; } // sinon tcho else { echo $admin_mgmt_retrait_3; } } // sinon ajout Guillaume Tournand <guillaume@tournand.com> September 2003 326/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project else { // vérification que le nick ne soit pas déja pris ou réservé $nick=mysql_result($result_userlist,0,"nick"); $query="SELECT u.id_user FROM users u, admin a WHERE u.id_user=a.id_user AND u.nick='$nick'"; $result=mysql_query($query) or die ("Requete non valide"); $nick_in_use=mysql_num_rows($result); $query="SELECT id_egg FROM eggdrops WHERE username='$nick'"; $result=mysql_query($query) or die ("Requete non valide"); $egg_use_nick=mysql_num_rows($result); for ($cpt=0, $bad_nick=0; $forbidden_nicks[$cpt]; $cpt++) { if ($nick == $forbidden_nicks[$cpt]) { $bad_nick=1; } } // verification que le nick ne continne que des characteres normaux $lon_nick=strlen($nick); for ($cpt=0, $regexp_nick=1; $cpt < $lon_nick && $regexp_nick; $cpt++) { $char=substr($nick, $cpt, 1); $regexp_nick=eregi("[_a-z0-9-]", $char); } if ($nick_in_use || $egg_use_nick || $bad_nick || !$regexp_nick) { echo $admin_mgmt_ajout_7; } else { // ajout de l'admin echo $admin_mgmt_ajout_4; echo $admin_mgmt_ajout_5; $unixtime_maintenant=time(); $query="INSERT INTO admin(id_user, id_lvl, unixtime_admin, mail_request, mail_purge, mail_log) VALUES('$id_user', '$sticker', '$unixtime_maintenant', '1', '1', '1')"; $result=mysql_query($query) or die ("Requete non valide"); $commande=".chattr LZ-$id_user +fo"; $query="INSERT INTO instructions(unixtime, id_user, commande) VALUES('$unixtime_maintenant', '$id_user', '$commande')"; $result = mysql_query($query) or die ("Requète non valide"); $commande=".chattr LZ-$id_user +g #loufiz"; $query="INSERT INTO instructions(unixtime, id_user, commande) VALUES('$unixtime_maintenant', '$id_user', '$commande')"; $result = mysql_query($query) or die ("Requète non valide"); $nick=mysql_result($result_userlist,0,"nick"); $amail=mysql_result($result_userlist,0,"amail"); $pass=mysql_result($result_userlist,0,"pass"); Guillaume Tournand <guillaume@tournand.com> September 2003 327/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $path_mail="/usr/home/aliasqmail/"; $commande="/bin/echo '$amail' > $path_mail.qmail-loufiz-$nick"; exec("$commande"); // on evite que le nouvel admin soit ajouté a eggdrops@loufiz.com si c'est seboune if ($id_user != 2) { exec("/bin/echo '$nick@loufiz.com' >> $path_mail.qmail-loufiz-eggdrops"); } $commande="cd /home/webmaster/passwd/; /usr/local/bin/htpasswd -b .admin_htpasswd $nick $pass"; exec("$commande"); } } } } } } } // pas les droits else { echo "<BR><BR><H3><CENTER>$admin_mgmt_index_4</CENTER></H3><BR><BR>"; } mysql_close($connexion_chans); echo "<BR><BR><FORM METHOD='POST' ACTION='./'>$boutton_retour</FORM>"; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 328/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project admin/admin_management/index.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='team'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Admin</TITLE> <LINK REL='stylesheet' HREF='include/style/table_no_bgcolor.css'> </HEAD> <BODY> <BR><BR><HR> <?PHP require 'include/.htmysql'; $connexion_chans=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_chans); // on recherche le niveau d'admin de l'utilisateur $nick_admin=$_SERVER["PHP_AUTH_USER"]; $query="SELECT l.admin_lvl from admin a, users u, admin_levels l WHERE a.id_user=u.id_user AND l.id_level=a.id_lvl AND u.nick='$nick_admin'"; $result=mysql_query($query); $nb_lvl=mysql_num_rows($result); if ($nb_lvl == 1) { $admin_lvl=mysql_result($result,0,"l.admin_lvl"); // s'il a un niveau suffisant, il peut entrer if ($admin_lvl >= $min_admin_level_admin_mgmt) { // recherche de la langue et def des tables if ($lang == 'fr') { $admin_descr="admin_descr"; } Guillaume Tournand <guillaume@tournand.com> September 2003 329/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if ($lang == 'en') { $admin_descr="admin_descr_en"; } $result_admin=mysql_query("SELECT a.id_user, u.nick, a.unixtime_admin, l.$admin_descr from admin a, users u, admin_levels l WHERE a.id_user=u.id_user AND l.id_level=a.id_lvl ORDER BY l.admin_lvl ASC, a.unixtime_admin DESC") or die ("Requete non valide"); $max_admin=mysql_num_rows($result_admin); echo "<BR><TABLE BORDER=0 width='80%' align='center'><TR ALIGN='CENTER'><TD>"; echo "<FORM METHOD='POST' ACTION='ajout_admin.php'><BR>$admin_mgmt_index_1 :<BR><BR>"; echo "LZ-<INPUT TYPE='text' NAME='id_user' SIZE=5 MAXLENGTH=5> "; $query="SELECT id_level, $admin_descr FROM admin_levels WHERE admin_lvl<$admin_lvl ORDER BY admin_lvl"; $result_level=mysql_query("$query"); $max_result=mysql_num_rows($result_level); echo "<SELECT NAME='sticker'><OPTION VALUE=''>$admin_mgmt_index_6"; for ($cpt=0; $cpt<$max_result; $cpt++) { $id_level=mysql_result($result_level,$cpt,'id_level'); $role=mysql_result($result_level,$cpt,"$admin_descr"); echo "<OPTION VALUE='$id_level'>$role"; } echo "</SELECT>"; echo "<BR><BR>$boutton_valider_annuler</FORM>"; echo "</TD><TD>"; echo "<FORM METHOD=POST ACTION='retrait_admin.php'><BR>$admin_mgmt_index_2 :<BR><BR>"; echo "LZ-<INPUT TYPE='text' NAME='id_user' SIZE=5 MAXLENGTH=5><BR><BR>"; echo "$boutton_valider_annuler</FORM>"; echo "</TABLE><BR><BR>"; echo "<CENTER><H3><B><U>$liste_helpers_1</U></B></H3></CENTER>"; echo "<TABLE BORDER=0 width='90%' align='center'><TR ALIGN='CENTER'><TH>$liste_helpers_2</TH><TH>$liste_helpers_3</TH><TH>$liste_helpers_4</TH><TH>$lis te_helpers_5</TH></TR><TR><TD COLSPAN=4><HR></TD></TR>"; for ($i=0; $i<$max_admin; $i++) { echo "<TR ALIGN='CENTER'"; if (($i)%2) { echo " bgcolor='#EDEDFF'"; } echo "><TD>"; $id_user = mysql_result($result_admin,$i,'a.id_user'); echo "LZ-$id_user"; echo "</TD><TD>"; echo mysql_result($result_admin,$i,'u.nick'); echo "</TD><TD>"; $unixtime=mysql_result($result_admin,$i,'a.unixtime_admin'); echo date("d/m/Y", "$unixtime"); echo "</TD><TD>"; echo mysql_result($result_admin,$i,"l.$admin_descr"); echo "</TD></TR>"; } echo "</TABLE>"; echo "$admin_mgmt_index_3"; } // pas de niveau suffisant Guillaume Tournand <guillaume@tournand.com> September 2003 330/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project else { echo "<BR><BR><H3><CENTER>$admin_mgmt_index_4</CENTER></H3><BR><BR>"; } } // pas de réponse du niveau d'admin else { echo "<BR><BR><H3><CENTER>$admin_mgmt_index_5</CENTER></H3><BR><BR>"; } echo "<FORM METHOD=POST ACTION='../'>$boutton_retour</FORM>"; mysql_close($connexion_chans); ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 331/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project admin/admin_management/retrait_admin.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='team'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Admin</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <BR><BR><BR><HR> <?PHP require 'include/.htmysql'; $connexion_chans=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_chans); // nettoyage des id_user $id_user=clean_id ($id_user); // on recherche le niveau d'admin de l'utilisateur $nick_admin=$_SERVER["PHP_AUTH_USER"]; $query="SELECT l.admin_lvl from admin a, users u, admin_levels l WHERE a.id_user=u.id_user AND l.id_level=a.id_lvl AND u.nick='$nick_admin'"; $result=mysql_query($query); $nb_lvl=mysql_num_rows($result); $admin_lvl=mysql_result($result,0,"l.admin_lvl"); // peut il entrer ? if ($admin_lvl >= $min_admin_level_admin_mgmt) { // on fetch les informations de la victime $result_adminlist = mysql_query("SELECT a.id_user, l.admin_lvl, u.nick FROM admin a, users u, admin_levels l WHERE a.id_user='$id_user' AND a.id_user=u.id_user AND a.id_lvl=l.id_level") or die ("Requete non valide"); $max_adminlist=mysql_num_rows($result_adminlist); Guillaume Tournand <guillaume@tournand.com> September 2003 332/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project // pas remplit le champ id_user if (!$id_user) { echo $admin_mgmt_retrait_1; } else { if (!$max_adminlist){ echo $admin_mgmt_retrait_2; } else { $v_admin_lvl=mysql_result($result_adminlist,0,"l.admin_lvl"); // Si l'administrateur a des droits inférieur ou égal a la cible, il n'a pas le droit if ($admin_lvl<=$v_admin_lvl){ echo $admin_mgmt_retrait_3; } else { echo $admin_mgmt_retrait_4; $query="DELETE FROM admin WHERE id_user='$id_user';"; $result=mysql_query($query) or die ("Requete non valide"); $unixtime_maintenant=time(); $commande=".chattr LZ-$id_user -fo"; $query="INSERT INTO instructions(unixtime, id_user, commande) VALUES('$unixtime_maintenant', '$id_user', '$commande')"; $result = mysql_query($query) or die ("Requète non valide"); $commande=".chattr LZ-$id_user -g #loufiz"; $query="INSERT INTO instructions(unixtime, id_user, commande) VALUES('$unixtime_maintenant', '$id_user', '$commande')"; $result = mysql_query($query) or die ("Requète non valide"); $nick=mysql_result($result_adminlist,0,"u.nick"); $path_mail="/usr/home/aliasqmail/"; $path_htpass="/home/webmaster/passwd"; exec("/bin/rm $path_mail.qmail-loufiz-$nick"); $new_admin_result=mysql_query("SELECT u.nick, u.pass FROM admin a, users u WHERE a.id_user=u.id_user AND u.id_user!=2") or die ("Requete non valide"); $max_new_admin=mysql_num_rows($new_admin_result); exec("/bin/rm $path_mail.qmail-loufiz-eggdrops"); exec("cd $path_htpass; rm .admin_htpasswd; /usr/bin/touch .admin_htpasswd"); for ($i=0;$i<$max_new_admin;$i++) { $nick=mysql_result($new_admin_result,$i,"u.nick"); exec("/bin/echo '$nick@loufiz.com' >> $path_mail.qmailloufiz-eggdrops"); $pass=mysql_result($new_admin_result,$i,"u.pass"); $commande="cd $path_htpass; /usr/local/bin/htpasswd -b .admin_htpasswd $nick $pass"; exec("$commande"); } } } } } // pas les droits else { echo "<BR><BR><H3><CENTER>$admin_mgmt_index_4</CENTER></H3><BR><BR>"; } mysql_close($connexion_chans); Guillaume Tournand <guillaume@tournand.com> September 2003 333/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project echo "<BR><BR><FORM METHOD='POST' ACTION='./'>$boutton_retour</FORM>"; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 334/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project admin/blacklist/ajout_blacklist.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='team'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Admin</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <BR><BR><BR><HR> <?PHP require 'include/.htmysql'; $connexion_chans=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_chans); // On purge le champ texte $nom_chan= strtolower ($nom_chan); //$nom_chan = strip_single_quote ($nom_chan); //$raison = strip_single_quote ($raison); $result_blacklist = mysql_query("SELECT id_black from blacklist WHERE nom_chan='$nom_chan' AND active='1' ORDER BY unixtime_black DESC") or die ("Requete non valide"); $max_blacklist=mysql_num_rows($result_blacklist); // on bloque s'il manque le nom de channel ou la raison if (!$nom_chan || !$raison) { echo $blacklist_ajout_1; } else { // verification du nom de channel Guillaume Tournand <guillaume@tournand.com> September 2003 335/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $longueur=strlen($nom_chan); for ($i=0; $i<$longueur; $i++) { $char=substr($nom_chan,$i,1); if ($char=='#'){ $bad_channel=1; } } if ($bad_channel){ echo $blacklist_ajout_2; } else { if ($max_blacklist) { $deja_active=mysql_result($result_blacklist,0,"id_black"); echo "<BR>$deja_active<BR>"; } if ($deja_active){ echo $blacklist_ajout_3; } else { echo $blacklist_ajout_4; $unixtime_maintenant=time(); $nick_admin=$_SERVER["PHP_AUTH_USER"]; if (!isset($deja_active)) { $query="INSERT INTO blacklist(nom_chan, unixtime_black, nick_admin, raison, source, active) VALUES('$nom_chan', '$unixtime_maintenant', '$nick_admin', '$raison', '1', '1')"; } if ($deja_active) { $query="UPDATE blacklist SET nick_admin='$nick_admin', source='1', active='1', raison='$raison', unixtime_black='$unixtime_maintenant' WHERE nom_chan='$nom_chan'"; } // echo "<BR>$query<BR>"; $result=mysql_query($query) or die ("Requete non valide"); } } } mysql_close($connexion_chans); echo "<BR><BR><FORM METHOD='POST' ACTION='./'>$boutton_retour</FORM>"; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 336/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project admin/blacklist/index.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='team'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Admin</TITLE> <LINK REL='stylesheet' HREF='include/style/table_no_bgcolor.css'> </HEAD> <BODY> <BR><BR><BR><HR> <?PHP // On affiche les infos sous blocs de $liste_defil lignes $liste_defil=50; if (! $liste_index || $liste_index<0) { $liste_index=0; } $liste_max=$liste_index+$liste_defil; require 'include/.htmysql'; $connexion_chans=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_chans); $query="SELECT * from blacklist b, blacklist_sources s WHERE active=1 AND b.source=s.id_source ORDER BY unixtime_black DESC, nom_chan ASC"; if ($nom_chan) { $nom_chan=strtolower($nom_chan); //$nom_chan=strip_single_quote($nom_chan); $query="SELECT * from blacklist b, blacklist_sources s WHERE active=1 AND b.source=s.id_source AND nom_chan='$nom_chan' ORDER BY unixtime_black DESC, nom_chan ASC"; } if ($nick_admin) { $nick_admin=strtolower($nick_admin); //$nick_admin=strip_single_quote($nick_admin); Guillaume Tournand <guillaume@tournand.com> September 2003 337/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $query="SELECT * from blacklist b, blacklist_sources s WHERE active=1 AND b.source=s.id_source AND nick_admin='$nick_admin' ORDER BY unixtime_black DESC, nom_chan ASC"; } $result_blacklist = mysql_query("$query") or die ("Requete non valide"); $max_blacklist=mysql_num_rows($result_blacklist); echo "<BR><TABLE BORDER=0 width='90%' align='center'><TR ALIGN='CENTER'><TD>"; echo "<FORM METHOD=POST ACTION='ajout_blacklist.php'><BR>$blacklist_index_1 :<BR>"; echo "#<INPUT TYPE='text' NAME='nom_chan' SIZE=20 MAXLENGTH=120><BR><BR>"; echo "$blacklist_index_7 : <INPUT TYPE='text' NAME='raison' SIZE='50' MAXLENGTH='65000'><BR><BR>"; echo "$blacklist_index_8 "; echo "$blacklist_index_9</FORM>"; echo "</TD><TD>"; echo "<FORM METHOD=POST ACTION='retrait_blacklist.php'><BR>$blacklist_index_2 :<BR>"; echo "#<INPUT TYPE='text' NAME='nom_chan' SIZE=20 MAXLENGTH=120><BR><BR>"; echo "$blacklist_index_10 "; echo "$blacklist_index_9</FORM>"; echo "</TABLE><BR><BR>"; echo "<CENTER><H3><B><U>$blacklist_index_3</U></B></H3></CENTER>"; // select echo "<CENTER><FORM METHOD=POST ACTION='index.php'><BR>"; echo "$blacklist_index_3_1 : #<INPUT TYPE='text' NAME='nom_chan' SIZE='20' MAXLENGTH='120'>"; echo " || "; echo "$blacklist_index_3_2 : <INPUT TYPE='text' NAME='nick_admin' SIZE='20' MAXLENGTH='120'>"; echo " $blacklist_index_11"; echo "</FORM></CENTER>"; echo "<TABLE BORDER=0 width='95%' align='center'><TR ALIGN='CENTER'><TH>$blacklist_index_4</TH><TH>$blacklist_index_5</TH><TH>$blacklist_index_6</TH><T H width='40%'>$blacklist_index_7</TH></TR><TR><TD COLSPAN=4><HR></TD></TR>"; for ($i=$liste_index; $i<$max_blacklist && $i<$liste_max; $i++) { echo "<TR ALIGN='CENTER'"; if (($i)%2) { echo " bgcolor='#EDEDFF'"; } echo "><TD>"; $unixtime_black=mysql_result($result_blacklist,$i,'b.unixtime_black'); echo date ("d/m/Y", "$unixtime_black"); echo "</TD><TD>"; $chan_black = mysql_result($result_blacklist,$i,'b.nom_chan'); // petite boucle pour éviter de se faire polluer avec les noms a rallonge echo "#"; $longueur=strlen($chan_black); for ($cpt=0; $cpt<$longueur; $cpt++) { $char=substr($chan_black, $cpt, 1); if ((! ($cpt%20) ) && $cpt != 0) { echo "<BR>"; } echo "$char"; } echo "</TD><TD>"; $nick_admin_bd = mysql_result($result_blacklist,$i,'b.nick_admin'); echo "$nick_admin_bd"; echo "</TD><TD>"; $raison = mysql_result($result_blacklist,$i,'b.raison'); $source=mysql_result($result_blacklist,$i,'s.nom_projet'); echo "<B>$source</B> $raison"; echo "</TD></TR>"; } Guillaume Tournand <guillaume@tournand.com> September 2003 338/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project echo "<TR><TD COLSPAN='2' ALIGN='CENTER'>"; // previous if ($liste_index){ $liste_prec=$liste_index-$liste_defil; echo "<A HREF='?nick_admin=$nick_admin&nom_chan=$nom_chan&liste_index=$liste_prec' target='home' class='lien'>$commentaires_6</A>"; } // next echo "</TD><TD COLSPAN='2' ALIGN='CENTER'>"; if ($max_blacklist>$liste_max) { $liste_suiv=$liste_index+$liste_defil; echo "<A HREF='?nick_admin=$nick_admin&nom_chan=$nom_chan&liste_index=$liste_suiv' target='home' class='lien'>$commentaires_7</A>"; } echo "</TD></TR>"; echo "</TABLE>"; echo "<BR><FORM METHOD=POST ACTION='../'>$boutton_retour</FORM>"; mysql_close($connexion_chans); ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 339/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project admin/blacklist/retrait_blacklist.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='team'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Admin</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <BR><BR><BR><HR> <?PHP require 'include/.htmysql'; $connexion_chans=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_chans); // On purge le champ texte $nom_chan= strtolower ($nom_chan); //$nom_chan = strip_single_quote ($nom_chan); $result_blacklist = mysql_query("SELECT * from blacklist WHERE nom_chan='$nom_chan' ORDER BY unixtime_black DESC") or die ("Requete non valide"); $max_blacklist=mysql_num_rows($result_blacklist); if (!$nom_chan) { echo $blacklist_retrait_1; } else { $longueur=strlen($nom_chan); for ($i=0; $i<$longueur; $i++) { $char=substr($nom_chan,$i,1); if ($char=='#'){ $bad_channel=1; } Guillaume Tournand <guillaume@tournand.com> September 2003 340/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project } if ($bad_channel){ echo $blacklist_retrait_2; } else { // s'il est present dans la table, on verifie le champ active if ($max_blacklist) { $deja_active=mysql_result($result_blacklist,$cpt,"active"); } // pas present dans la table if (!$max_blacklist || !$deja_active){ echo $blacklist_retrait_3; } else { echo $blacklist_retrait_4; // on set le flag active a 0 $query="UPDATE blacklist SET active=0 WHERE nom_chan='$nom_chan'"; $result=mysql_query($query) or die ("Requete non valide"); } } } mysql_close($connexion_chans); echo "<BR><BR><FORM METHOD='POST' ACTION='./'>$boutton_retour</FORM>"; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 341/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project admin/management/channels.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='eggadmin'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Channels</TITLE> <LINK REL='stylesheet' HREF='include/style/table_no_bgcolor.css'> <script> function ouvrirfenetre() { exemple=window.open ("","fenetreimage", "scrollbars=yes, toolbar=no, location=no, directories=no, status=no, resizable=yes") } </script> </HEAD> <BODY> <?PHP $admin_side=1; require 'include/.htmysql'; $nom_chan=strtolower($nom_chan); $connexion_channel=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_channel); if ($id_chan) { $query="SELECT * FROM channels WHERE id_chan='$id_chan'"; } if ($nom_chan) { $query="SELECT * FROM channels WHERE nom_chan='$nom_chan'"; } $result_channel = mysql_query($query) or die ("Requete non valide"); $max_chan=mysql_num_rows($result_channel); if ($max_chan != 1 || $id_chan == '1' || $nom_chan== 'loufiz'){ echo $admin_channels_1; } else { $id_chan=mysql_result($result_channel,0,"id_chan"); Guillaume Tournand <guillaume@tournand.com> September 2003 342/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $nom_chan=mysql_result($result_channel,0,"nom_chan"); $id_owner=mysql_result($result_channel,0,"id_owner"); require 'include/.htinclude_code_chan.php'; } mysql_close($connexion_channel); echo "<FORM METHOD='POST' ACTION='index.php'>$boutton_retour</FORM>"; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 343/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project admin/management/eggdrops.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='eggadmin'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Bots</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <?PHP $admin_side=1; $nom=strtolower($nom); require 'include/.htmysql'; $connexion_eggdrops=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_eggdrops); $result_eggdrops = mysql_query("SELECT * FROM eggdrops WHERE nom='$nom' AND actif='1'") or die ("Requete non valide"); $max_egg=mysql_num_rows($result_eggdrops); require 'include/.htinclude_code_egg.php'; mysql_close($connexion_eggdrops); echo "<BR><FORM METHOD='POST' ACTION='index.php'>$boutton_retour</FORM>"; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 344/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project admin/management/index.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='team'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Eggdrops</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <?PHP echo $index_management_1; require 'include/.htmysql'; $connexion=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion); // detection de la langue pour savoir dans quelle table tapper. if ($lang != 'fr') { $table_purge_texte="descr_$lang"; } if ($lang == 'fr') { $table_purge_texte="descr"; } $result_purge = mysql_query("SELECT * from raisons_purge ORDER BY id_purge ASC") or die ("Requete non valide"); $max_purge=mysql_num_rows($result_purge); echo "<SELECT NAME='raison_purge'>"; echo "<OPTION VALUE=''>$index_management_3"; for ($cpt=0; $cpt<$max_purge; $cpt++) { $id_purge=mysql_result($result_purge,$cpt,'id_purge'); Guillaume Tournand <guillaume@tournand.com> September 2003 345/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $descr=mysql_result($result_purge,$cpt,$table_purge_texte); echo "<OPTION VALUE='$id_purge'>$descr"; } echo "</SELECT>"; echo $index_management_2; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 346/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project admin/management/modif_channel.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?php $section='eggadmin'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Channels</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <?PHP $admin_side=1; require 'include/.htmysql'; $connexion_channels=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_channels); if ($id_chan) { $query="SELECT * FROM channels WHERE id_chan='$id_chan'"; } if ($nom_chan) { $query="SELECT * FROM channels WHERE nom_chan='$nom_chan'"; } $result_channel = mysql_query($query) or die ("Requete non valide"); $max_chan=mysql_num_rows($result_channel); if ($max_chan != 1 || $id_chan == '1' || $nom_chan == 'loufiz'){ echo $admin_channels_1; } else { $id_owner=mysql_result($result_channel,0,"id_owner"); $nom_chan=mysql_result($result_channel,0,"nom_chan"); $id_chan=mysql_result($result_channel,0,"id_chan"); require 'include/.htinclude_code_chan_modif.php'; } mysql_close($connexion_channels); Guillaume Tournand <guillaume@tournand.com> September 2003 347/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project echo "<BR><BR><BR>$channels_boutton_retour"; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 348/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project admin/management/modif_user.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='eggadmin'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Eggdrops</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <?PHP $admin_side=1; require 'include/.htmysql'; $connexion_users=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_users); require 'include/.htinclude_code_user_modif.php'; mysql_close($connexion_users); echo "<BR><BR>$admin_modif_user_22"; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 349/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project admin/management/retrait_cessation.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?php $section='eggadmin'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Retrait</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <BR><BR><BR><BR><HR><BR><BR><BR> <?PHP $admin_side=1; require 'include/.htmysql'; $nom_chan=strtolower($nom_chan); $connexion=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion); // nettoyage des id_user $nouvel_owner= clean_id ($nouvel_owner); $result_valid = mysql_query("SELECT * from channels WHERE nom_chan='$nom_chan'") or die ("Requete non valide"); $max_valid=mysql_num_rows($result_valid); if (!$max_valid || $nom_chan=='loufiz') { echo $retrait_cessation_1; } else { $id_chan=mysql_result($result_valid,0,"id_chan"); if ((!$raison_purge && !$nouvel_owner) || ($raison_purge && $nouvel_owner)){ Guillaume Tournand <guillaume@tournand.com> September 2003 350/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project echo $retrait_cessation_1_1; } else { // A partir d'ici : fin des checkups elementaires $id_owner_chans=mysql_result($result_valid,0,"id_owner"); require 'include/.htinclude_code_retrait_cess.php'; } } mysql_close($connexion); echo "<BR><BR><FORM METHOD=POST ACTION='../chan_monitoring.php'>$boutton_retour</FORM>"; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 351/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project admin/management/users.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $section='eggadmin'; // on met en place la session et la langue require 'include/.htsession'; ?> <HTML> <HEAD> <TITLE>Loufiz : Eggdrops</TITLE> <LINK REL='stylesheet' HREF='include/style/loufiz.css'> </HEAD> <BODY> <?PHP $admin_side=1; $username=strtolower($username); require 'include/.htmysql'; $connexion_users=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_users); if ($username) { $result_user = mysql_query("SELECT * from users WHERE username='$username'") or die ("Requete non valide"); } if ($id_user){ $result_user = mysql_query("SELECT * from users WHERE id_user='$id_user'") or die ("Requete non valide"); } $max_user=mysql_num_rows($result_user); if ($max_user != 1 || $id_user == 1){ echo $admin_user_1; } else { $id_user=mysql_result($result_user,0,"id_user"); require 'include/.htinclude_code_user.php'; mysql_close($connexion_users); } Guillaume Tournand <guillaume@tournand.com> September 2003 352/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project echo "<FORM METHOD='POST' ACTION='index.php'>$boutton_retour</FORM>"; ?> </BODY> </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 353/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project admin/perl/check_and_rebuild_world.pl #!/usr/bin/perl -w # Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights # reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # - Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # - Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # - Neither the name of the Loufiz project nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ###################################################################### ###################################################################### ### ### Include des modules necessaires ### ###################################################################### ###################################################################### use strict; use DBI; use Net::Telnet; use Date::Format; use CGI qw(:cgi); ###################################################################### ###################################################################### ### ### Initialisation pour faire la page Web dynamique ### ###################################################################### ###################################################################### $| = 1; my $file="/tmp/check_and_rebuild_world.pid"; my $session_id=param("PHPSESSID"); print "Content-type: multipart/mixed;boundary=--loufiz$$"; print " <HTML><HEAD><TITLE>Database to eggdrops re-synchronisation</TITLE></HEAD><BODY> <!-- Guillaume Tournand <guillaume@tournand.com> September 2003 354/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Loufiz se demande si l'universalité de la pensee philosophique du XXeme sciecle repose sur la controverse existant entre les individualités d'ecriture et l'institut surréaliste sous-jacent chez la plupart des auteurs tout en respectant la linearite du monde occidental. Loufiz a l'explication: Le Québec représente la dégénéréscence du peuple Français. Colonisé en quelques siecles et pris entre les esquimeaux et les hamburgers, ils ne purent sauvegarder longtemps leur potentiel génétique grandiose. Aujourd'hui, les neurones y sont éspèce protegée... Et l'on peut s'alarmer de l'efficacité de la police americaine lorsqu'on voit des Celine Dion ou autres Robert Charlebois en liberté. --> "; # on teste si le programme ne tourne pas déja if (-e $file) { print "<BR><BR><FONT COLOR='red'><H2><CENTER>Another instance is running, please try again later.</CENTER></H2></FONT>"; } # go baby ! else { # on créer le fichier system ("echo $$ > $file"); ###################################################################### ###################################################################### ### ### Declaration des variables necessaires ### ###################################################################### ###################################################################### # Declaration des variables pour mysql my $host = "localhost"; my $user = "root"; my $password = "DBAPasswd42"; my $database = "loufiz"; # declaration de variables pour telnet sur ADAM my ($hostname, $port, $egg_nickname, $egg_password, $telnet, $timeout_time); $hostname="localhost"; $port="42000"; $egg_nickname="LZ-SYS"; $egg_password="YUbdgTR421"; $timeout_time=30; my $sleep_egg=10; # declaration des variables pour le mass delete my ($max_users, $cpt); # declaration des variables pour le join/part des channels my (@bots, @status_output, @output, $bot_cpt, $chan_present, $grep_res, @channels_egg, @channels_www, $cpt_chan, $match); # declaration des variables pour le fetch des donnees my ($id_user, $username, $host1, $host2, $host3, $pass, $id_chan, $nom_chan, $id_owner, $id_op); my ($sth_user, $ref_user, $num_rows_users, $sth_chan, $ref_chan, $sth_ops, $ref_ops, $sth_admin, $ref_admin, $num_rows_admin); ###################################################################### ###################################################################### ### ### Le programme ### ###################################################################### ###################################################################### Guillaume Tournand <guillaume@tournand.com> September 2003 355/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # On se connecte a la base de donnée my $dbh = DBI->connect("DBI:mysql:database=$database;host=$host", $user, $password, {'RaiseError' => 1}); # Connexion telnet $telnet = new Net::Telnet ( Timeout=>$timeout_time, Errmode=>'die'); $telnet->open(Host => $hostname, Port => $port); # Authentification $telnet->waitfor(String => 'Nickname.'); $telnet->print($egg_nickname); $telnet->waitfor(String => 'Enter your password.'); $telnet->print($egg_password); $telnet->waitfor(String => "*** $egg_nickname joined the party line."); ###################################################################### ###################################################################### ### ### CHECK DES CHANNELS ### ###################################################################### ###################################################################### print "<BR><H2>Eggdrops channels check in progress ...</H2><BR>"; print "<I>0 - Checking Ad4m channels</I><BR>"; # analyse des channels de Adam $telnet->print('.status'); $telnet->print('.info'); @output = $telnet->waitfor(String => 'No info has been set for you.'); # split de output en lignes @status_output=split(/\n\s+/, "@output"); # On analyse le resultat du status for ($bot_cpt=0; $status_output[$bot_cpt]; $bot_cpt++) { # on passe tout en minuscule $status_output[$bot_cpt]=lc($status_output[$bot_cpt]); # est ce que ca match une entree de channel ? if ($status_output[$bot_cpt] =~ /^[#](.*)\s*:\s*\d*.*/) { $chan_present=$1; # On supprime les blancs du nom de channel for ($_=$chan_present; s/ //; $chan_present=$_) {} # on traite ce cas seulement si le channel n'est pas loufiz if ($chan_present ne "loufiz") { # on rajoutte le nom du channel dans la liste des channels de l'eggdrop push @channels_egg, $chan_present; } } } Guillaume Tournand <guillaume@tournand.com> September 2003 356/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # on fetch la liste des channels dans lequel l'eggdrop est supposé etre $sth_chan = $dbh->prepare("SELECT nom_chan FROM channels WHERE nom_chan!='loufiz'"); $sth_chan->execute(); while ($ref_chan = $sth_chan->fetchrow_hashref()) { $nom_chan=$ref_chan->{'nom_chan'}; push @channels_www, $nom_chan; } $sth_chan->finish(); # differences entre les resultats de l'eggdrop et ceux de la base for ($cpt_chan=0; $channels_egg[$cpt_chan]; $cpt_chan++) { for ($bot_cpt=0, $match=0; $channels_www[$bot_cpt] && !$match; $bot_cpt++) { if ($channels_www[$bot_cpt] eq $channels_egg[$cpt_chan]) { $match=1; } } if (!$match) { print "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR='red'>Ad4m parts #$channels_egg[$cpt_chan]</FONT><BR>"; $telnet->print(".-chan #$channels_egg[$cpt_chan]\n"); } } # differences entre les resultats de la base et ceux de l'eggdrop for ($cpt_chan=0; $channels_www[$cpt_chan]; $cpt_chan++) { for ($bot_cpt=0, $match=0; $channels_egg[$bot_cpt] && !$match; $bot_cpt++) { if ($channels_www[$cpt_chan] eq $channels_egg[$bot_cpt]) { $match=1; } } if (! $match) { print "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR='red'>Ad4m joins #$channels_www[$cpt_chan]</FONT><BR>"; $telnet->print(".+chan #$channels_www[$cpt_chan]\n"); } } undef (@output); undef (@status_output); undef (@channels_egg); undef (@channels_www); print "<I>End of Ad4m channels check.</I><BR><BR>"; # on choppe la liste des bots $telnet->print('.bots'); @output = $telnet->waitfor(String => '(total: '); # On choppe la liste des eggdrops connectés. if (@output) { # On trie le resultat pour obtenir le nom des eggdrops connectés chomp @output; @bots=split(/, /, "@output"); # on supprime la merde apres le nom du dernier eggdrop for ($cpt=1; $bots[$cpt]; $cpt++){ if ($bots[$cpt] =~ /^([^ ]*).*/) { $bots[$cpt]=$1; } } # On undef pour etre sur de ne pas faire d'erreur undef (@output); Guillaume Tournand <guillaume@tournand.com> September 2003 357/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # On commence la moulinette de connexion aux eggdrops (sauf sur adam) for ($cpt=1; $bots[$cpt]; $cpt++){ # On passe tout en minuscule $bots[$cpt]=lc($bots[$cpt]); print "<I>$cpt - Checking $bots[$cpt] channels</I><BR>"; # Connexion a l'eggdrop $telnet->print(".relay $bots[$cpt]"); # Authentification @output = $telnet->waitfor(String => 'Nickname.', Timeout => $timeout_time ); # on envoit le login si OK if (grep /Nickname./, @output) { undef (@output); $telnet->print($egg_nickname); @output = $telnet->waitfor(String => 'Enter your password.'); $telnet->print($egg_password); # on envoit le pass si OK if (grep /Enter your password./, @output) { undef (@output); $telnet->waitfor(String => "*** $egg_nickname joined the party line."); $telnet->print('.status'); $telnet->print('.info'); @output = $telnet->waitfor(String => 'No info has been set for you.'); # split de output en lignes @status_output=split(/\n\s+/, "@output"); # On analyse le resultat du status for ($bot_cpt=0; $status_output[$bot_cpt]; $bot_cpt++) { # on passe tout en minuscule $status_output[$bot_cpt]=lc($status_output[$bot_cpt]); # est ce que ca match une entree de channel ? if ($status_output[$bot_cpt] =~ /^[#](.*)\s*:\s*\d*.*/) { $chan_present=$1; # On supprime les blancs du nom de channel for ($_=$chan_present; s/ //; $chan_present=$_) {} # on traite ce cas seulement si le channel n'est pas loufiz if ($chan_present ne "loufiz") { # on rajoutte le nom du channel dans la liste des channels de l'eggdrop push @channels_egg, $chan_present; } } } # on fetch la liste des channels dans lequel l'eggdrop est supposé etre $sth_chan = $dbh->prepare("SELECT nom_chan FROM channels c, eggdrops e WHERE e.egg_bloc=c.egg_group AND e.nom='$bots[$cpt]'"); $sth_chan->execute(); while ($ref_chan = $sth_chan->fetchrow_hashref()) { $nom_chan=$ref_chan->{'nom_chan'}; push @channels_www, $nom_chan; } Guillaume Tournand <guillaume@tournand.com> September 2003 358/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $sth_chan->finish(); # differences entre les resultats de l'eggdrop et ceux de la base for ($cpt_chan=0; $channels_egg[$cpt_chan]; $cpt_chan++) { for ($bot_cpt=0, $match=0; $channels_www[$bot_cpt] && !$match; $bot_cpt++) { if ($channels_www[$bot_cpt] eq $channels_egg[$cpt_chan]) { $match=1; } } if (!$match) { print "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR='red'>$bots[$cpt] parts #$channels_egg[$cpt_chan]</FONT><BR>"; $telnet->print(".-chan #$channels_egg[$cpt_chan]\n"); } } # differences entre les resultats de la base et ceux de l'eggdrop for ($cpt_chan=0; $channels_www[$cpt_chan]; $cpt_chan++) { for ($bot_cpt=0, $match=0; $channels_egg[$bot_cpt] && !$match; $bot_cpt++) { if ($channels_www[$cpt_chan] eq $channels_egg[$bot_cpt]) { $match=1; } } if (! $match) { print "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR='red'>$bots[$cpt] joins #$channels_www[$cpt_chan]</FONT><BR>"; $telnet->print(".+chan #$channels_www[$cpt_chan]\n"); } } # On quitte le .relay $telnet->print('.save'); $telnet->print('.backup'); $telnet->print('.quit'); # On undef pour etre sur de ne pas faire d'erreur undef (@output); undef (@status_output); undef (@channels_egg); undef (@channels_www); # pause entre 2 bots sleep $sleep_egg; print "<I>End of $bots[$cpt] channels check.</I><BR><BR>"; } } } } print "<H2>End of the eggdrops channels check</H2><BR>"; print "<BR><BR><BR>"; Guillaume Tournand <guillaume@tournand.com> September 2003 359/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project ###################################################################### ###################################################################### ### ### Reconstruction de la userlist ### ###################################################################### ###################################################################### print "<H2>Rebuilding the userlist ...</H2><BR>"; # On recherche l'id user le plus grand $sth_user = $dbh->prepare("SELECT max(id_user) FROM users"); $sth_user->execute(); $ref_user = $sth_user->fetchrow_hashref(); $max_users=$ref_user->{'max(id_user)'}; # fin de la requete $sth_user->finish(); print "<I>Deleting the users ...</I><BR>"; # On procede au mass delete des utilisateurs for ($cpt=2; $cpt<=$max_users; $cpt++) { $telnet->print(".-user LZ-$cpt"); @output = $telnet->waitfor(String => "Deleted LZ-$cpt", String => "No such user!"); } print "<I>Done</I><BR><BR>"; # On choppe l'ensemble des utilisateurs $sth_user = $dbh->prepare("SELECT id_user, username, host1, host2, host3, pass FROM users WHERE id_user>1 ORDER BY id_user"); $sth_user->execute(); $num_rows_users = $sth_user->rows(); # Pour chaque utilisateur while ($ref_user = $sth_user->fetchrow_hashref()) { $id_user=$ref_user->{'id_user'}; $username=$ref_user->{'username'}; $host1=$ref_user->{'host1'}; $host2=$ref_user->{'host2'}; $host3=$ref_user->{'host3'}; $pass=$ref_user->{'pass'}; # Ajout de l'utilisateur print "Adding LZ-$id_user<BR>"; $telnet->print(".+user LZ-$id_user\n"); @output = $telnet->waitfor(String => "Added LZ-$id_user"); # definition du mot de passe print "Setting LZ-${id_user}'s password<BR>"; $telnet->print(".chpass LZ-$id_user $pass\n"); @output = $telnet->waitfor(String => "Changed password."); # si host present if ($host1) { print "Adding host *!*$username\@$host1 to LZ-$id_user<BR>"; $telnet->print(".+host LZ-$id_user *!$username\@$host1\n"); @output = $telnet->waitfor(String => "Added '*!$username\@$host1'"); $telnet->print(".+host LZ-$id_user *!~$username\@$host1\n"); @output = $telnet->waitfor(String => "Added '*!~$username\@$host1'"); } Guillaume Tournand <guillaume@tournand.com> September 2003 360/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # si host present if ($host2) { print "Adding host *!*$username\@$host2 to LZ-$id_user<BR>"; $telnet->print(".+host LZ-$id_user *!$username\@$host2\n"); @output = $telnet->waitfor(String => "Added '*!$username\@$host2'"); $telnet->print(".+host LZ-$id_user *!~$username\@$host2\n"); @output = $telnet->waitfor(String => "Added '*!~$username\@$host2'"); } # si host present if ($host3) { print "Adding host *!*$username\@$host3 to LZ-$id_user<BR>"; $telnet->print(".+host LZ-$id_user *!$username\@$host3\n"); @output = $telnet->waitfor(String => "Added '*!$username\@$host3'"); $telnet->print(".+host LZ-$id_user *!~$username\@$host3\n"); @output = $telnet->waitfor(String => "Added '*!~$username\@$host3'"); } # On verifie si l'utilisateur est owner ou operateur d'un channel $sth_chan = $dbh->prepare("SELECT id_chan, nom_chan, id_owner FROM channels WHERE nom_chan!='loufiz'"); $sth_chan->execute(); # Pour chaque channel while ($ref_chan = $sth_chan->fetchrow_hashref()) { $id_chan=$ref_chan->{'id_chan'}; $nom_chan=$ref_chan->{'nom_chan'}; $id_owner=$ref_chan->{'id_owner'}; # Si l'utilisateur est l'owner du channel if ($id_user == $id_owner) { print "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR='green'>Adding LZ-$id_user as #$nom_chan owner</FONT><BR>"; $telnet->print(".chattr LZ-$id_user +o #$nom_chan\n"); @output = $telnet->waitfor(String => "Channel flags for LZ-$id_user on"); } # Sinon on vérifie s'il est op du channel else { $sth_ops = $dbh->prepare("SELECT id_op FROM lz_chan_$id_chan"); $sth_ops->execute(); while ($ref_ops = $sth_ops->fetchrow_hashref()) { $id_op=$ref_ops->{'id_op'}; # si l'utilisateur est op du channel if ($id_user == $id_op) { print "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR='green'>Adding LZ-$id_user as #$nom_chan operator</FONT><BR>"; $telnet->print(".chattr LZ-$id_user +o #$nom_chan\n"); @output = $telnet->waitfor(String => "Channel flags for LZ$id_user on"); } } # fin des requetes $sth_ops->finish(); } } # fin des requetes $sth_chan->finish(); # Enfin on vérifie si l'utilisateur est un admin du projet loufiz $sth_admin = $dbh->prepare("SELECT id_admin FROM admin WHERE id_user='$id_user'"); $sth_admin->execute(); $num_rows_admin = $sth_admin->rows(); # S'il est admin if ($num_rows_admin) { Guillaume Tournand <guillaume@tournand.com> September 2003 361/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project print "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT COLOR='red'>Adding LZ$id_user as #loufiz administrator</FONT><BR>"; $telnet->print(".chattr LZ-$id_user +of\n"); @output = $telnet->waitfor(String => "Global flags for LZ-$id_user"); $telnet->print(".chattr LZ-$id_user +g #Loufiz\n"); @output = $telnet->waitfor(String => "Channel flags for LZ-$id_user on"); } # fin des requetes $sth_admin->finish(); print "<BR>"; } # fin des requetes $sth_user->finish(); # sauvegarde et deconnexion de la partyline $telnet->print('.backup'); $telnet->print('.quit'); # Deconnexion telnet $telnet->close(); # Deconnexion Mysql $dbh->disconnect(); print "<BR><BR>"; print "<H2>Operation complete, you may now close your browser.</H2>"; # on supprime le fichier system ("rm -f $file"); } print "<BR><FORM METHOD='POST' ACTION='../?PHPSESSID=$session_id'>"; print "<DIV ALIGN='right'><INPUT TYPE='submit' VALUE='Back'></DIV></FORM>"; print "</BODY></HTML>"; Guillaume Tournand <guillaume@tournand.com> September 2003 362/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project The include folder include/.hteggdrop_contact.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP echo "<DIV ALIGN='RIGHT'>Contact : <A HREF='mailto:eggdrop@loufiz.com' class ='lien'>eggdrop@loufiz.com</A></DIV>"; ?> Guillaume Tournand <guillaume@tournand.com> September 2003 363/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project include/.hteggdrop_vide_session.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP // On vide les variables de session a chaque fenetre de login session_unregister("id_chan"); session_unregister("id_user"); session_unregister("user_pass"); ?> Guillaume Tournand <guillaume@tournand.com> September 2003 364/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project include/.htinclude_code_chan.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP echo "<TABLE WIDTH='100%' BORDER='0'><TR VALIGN='TOP'><TD ALIGN='CENTER' VALIGN='CENTER'>"; echo "<B><U>$text_channel</U> : <A HREF='irc://irc.undernet.org/$nom_chan' class='lien'>#"; // petite boucle pour éviter de se faire polluer avec les noms a rallonge $longueur=strlen($nom_chan); for ($i=0; $i<$longueur; $i++) { $char=substr($nom_chan, $i, 1); if ((! ($i%20) ) && $i != 0) { echo "<BR>"; } echo "$char"; } echo "</A></B>"; echo "</TD><TD ALIGN='RIGHT'>"; $unixtime_demande=mysql_result($result_channel,0,"unixtime_demande"); $date_demande=date("d/m/Y", "$unixtime_demande"); echo "<B><U>$text_date_demande</U> : $date_demande</B><BR>"; $unixtime_support=mysql_result($result_channel,0,"unixtime_support"); $date_support=date("d/m/Y", "$unixtime_support"); echo "<B><U>$text_date_support</U> : $date_support</B><BR>"; echo "</TD></TR></TABLE>"; echo "<BR><TABLE WIDTH='100%' BORDER='0'><TR VALIGN='CENTER'><TD COLSPAN=2 WIDTH='50%' ALIGN='LEFT'>"; //$id_owner=mysql_result($result_channel,0,"id_owner"); $result_owner = mysql_query("SELECT nick FROM users WHERE id_user='$id_owner'") or die ("Requete non valide"); $nick=mysql_result($result_owner,0,"nick"); // c'est l'owner ou la zone d'admin if ($admin_side || $id_user == $id_owner) { echo "<BR>$text_id_owner : <B>LZ-$id_owner</B> <A HREF='users.php?id_user=$id_owner' target='home' class='lien'>$nick</A>"; $user_level=500; } Guillaume Tournand <guillaume@tournand.com> September 2003 365/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project // c'est un operateur if (!$admin_side && $id_user != $id_owner) { echo "<BR>$text_id_owner : <B>LZ-$id_owner</B> $nick"; // alors on choppe son niveau $result_ops = mysql_query("SELECT lvl FROM lz_chan_$id_chan WHERE id_op=$id_user") or die ("Requete non valide"); $user_level=mysql_result($result_ops,0,"lvl"); } echo "</TD>"; if ($admin_side) { echo "<TD COLSPAN=2 ALIGN='RIGHT'><BR><A HREF='../chan_monitoring.php#$id_chan' CLASS='lien' TARGET='home'>$text_monitoring</A></TD>"; $user_level=500; } // la liste des eggdrops echo "</TR><TR><TD COLSPAN=4><HR></TD></TR><TR VALIGN='CENTER' ALIGN='CENTER'><TD COLSPAN=4>"; $egg_group=mysql_result($result_channel,0,"egg_group"); $result_egg = mysql_query("SELECT nom, m_server FROM eggdrops WHERE egg_bloc='$egg_group' ORDER BY nom ASC") or die ("Requete non valide"); echo "<BR><B>$text_channel_couvert N°$egg_group</B> :<BR>"; $max_bot=mysql_num_rows($result_egg); for ($cpt=0; $cpt<$max_bot; $cpt++) { $egg_nick=mysql_result($result_egg,$cpt,"nom"); $m_server=mysql_result($result_egg,$cpt,"m_server"); echo "<A HREF='eggdrops.php?nom=$egg_nick' target=home class='lien'>"; if ($m_server=="-") { echo "<FONT COLOR='red'>"; } echo "$egg_nick"; if ($m_server=="-") { echo "</FONT>"; } echo "</A> "; } echo "<BR><BR><BR><BR></TD></TR>"; // ajouter un operateur if (!$admin_side) { echo "<TR><TD COLSPAN=2 ALIGN='CENTER'><U>$text_ajout_op</U><FORM ACTION='modif_channel.php' METHOD='POST'>"; } if ($admin_side) { echo "<TR><TD COLSPAN=2 ALIGN='CENTER'><U>$text_ajout_op</U><FORM ACTION='modif_channel.php?id_chan=$id_chan' METHOD='POST'>"; } echo "LZ-<INPUT TYPE='text' NAME='new_op' SIZE='5' MAXLENGTH='5'> <SELECT NAME='level'>"; $query="SELECT id_level, op_level FROM op_levels WHERE op_level < $user_level AND active=1 ORDER BY op_level ASC"; $result_op_lvl = mysql_query("$query") or die ("Requete non valide"); $max_lvl=mysql_num_rows($result_op_lvl); echo "<OPTION VALUE=''>$text_op_level"; for ($cpt_lvl=0; $cpt_lvl < $max_lvl; $cpt_lvl++) { $id_level=mysql_result($result_op_lvl,$cpt_lvl,"id_level"); $level=mysql_result($result_op_lvl,$cpt_lvl,"op_level"); echo "<OPTION VALUE=$id_level>$level"; } echo "</SELECT>"; echo "<BR><BR>$boutton_ajout_op $boutton_retrait_op"; echo "</FORM></TD>"; // modifier un access Guillaume Tournand <guillaume@tournand.com> September 2003 366/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if (!$admin_side) { echo "<TD COLSPAN=2 ALIGN='CENTER'><U>$text_modif_acces</U><FORM ACTION='modif_channel.php' METHOD='POST'>"; } if ($admin_side) { echo "<TD COLSPAN=2 ALIGN='CENTER'><U>$text_modif_acces</U><FORM ACTION='modif_channel.php?id_chan=$id_chan' METHOD='POST'>"; } echo "LZ-<INPUT TYPE='text' NAME='new_op' SIZE='5' MAXLENGTH='5'> <SELECT NAME='level'>"; echo "<OPTION VALUE=''>$text_op_level"; for ($cpt_lvl=0; $cpt_lvl < $max_lvl; $cpt_lvl++) { $id_level=mysql_result($result_op_lvl,$cpt_lvl,"id_level"); $level=mysql_result($result_op_lvl,$cpt_lvl,"op_level"); echo "<OPTION VALUE=$id_level>$level"; } echo "</SELECT>"; echo "<BR><BR>$boutton_modif_access"; echo "</FORM></TD>"; echo "</TR>"; // On affiche un lien vers la liste des access echo "<TR><TD COLSPAN=4 ALIGN='CENTER'><A HREF='liste_acces.php' target='fenetreimage' onclick='ouvrirfenetre()' class='lien'>$text_list_axs</A></TD></TR>"; // la liste des operateurs $query="SELECT * FROM lz_chan_$id_chan ORDER BY lvl DESC"; $result_ops = mysql_query("$query") or die ("Requete non valide"); $max_ops=mysql_num_rows($result_ops); if ($max_ops) { echo "<TR VALIGN='TOP'><TD COLSPAN=4 ALIGN='CENTER'><BR>$text_op_sup</I></TD></TR>"; echo "<TR><TD ALIGN='CENTER'><I>$text_identifiant</I></TD><TD ALIGN='CENTER'><I>$text_nick</I></TD><TD ALIGN='CENTER'><I>$text_username</I></TD><TD ALIGN='CENTER'><A HREF='liste_acces.php' target='fenetreimage' onclick='ouvrirfenetre()' class='lien'><I>$text_op_level</I></A></TD></TR>"; } // on affiche la liste des operateurs for ($cpt=0; $cpt<$max_ops; $cpt++){ $id_op=mysql_result($result_ops,$cpt,"id_op"); $op_lvl=mysql_result($result_ops,$cpt,"lvl"); $result_user = mysql_query("SELECT nick, username FROM users WHERE id_user='$id_op'") or die ("Requete non valide"); $nick=mysql_result($result_user,0,"nick"); echo "<TR"; if (($cpt-1)%2) { echo " bgcolor='#EDEDFF'"; } echo ">"; $username=mysql_result($result_user,0,"username"); if ($admin_side) { echo "<TD ALIGN='CENTER'><A HREF='users.php?id_user=$id_op' target='home' class='lien'>LZ-$id_op</A></TD>"; } if (!$admin_side && $id_user == $id_op) { echo "<TD ALIGN='CENTER'><A HREF='users.php?id_user=$id_op' target='home' class='lien'>LZ-$id_op</A></TD>"; } if (!$admin_side && $id_user != $id_op) { echo "<TD ALIGN='CENTER'>LZ-$id_op</TD>"; } echo "<TD ALIGN='CENTER'>$nick</TD>"; echo "<TD ALIGN='CENTER'>$username</TD>"; echo "<TD ALIGN='CENTER'>$op_lvl</TD>"; echo "</TR>"; } Guillaume Tournand <guillaume@tournand.com> September 2003 367/489 MSc Dissertation // IRC distributed bot lending platform: The Loufiz project echo "<TR><TD COLSPAN=4><BR></TD></TR>"; echo "</TABLE><BR>"; echo "$boutton_valider_annuler"; ?> Guillaume Tournand <guillaume@tournand.com> September 2003 368/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project include/.htinclude_code_chan_modif.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP // nettoyage des id_user $id_owner=clean_id ($id_owner); $new_op=clean_id ($new_op); // recherche du niveau de l'utilisateur // s'il est l'owner ou on est dans la zone d'admin if ($admin_side || $id_user == $id_owner) { $user_level=500; } // c'est un operateur if (!$admin_side && $id_user != $id_owner) { $result_ops = mysql_query("SELECT lvl FROM lz_chan_$id_chan WHERE id_op=$id_user") or die ("Requete non valide"); $user_level=mysql_result($result_ops,0,"lvl"); } if ($level) { $query="SELECT op_level FROM op_levels WHERE id_level=$level"; $result = mysql_query($query) or die ("Requète non valide"); $usr_level=mysql_result($result,0,"op_level"); } $unixtime=time(); if (!$add && !$rem && !$mod) { echo "<BR><BR><CENTER><H3><B><U>$channels_err_2</U></B></H3></CENTER>"; } else { // dans le cas ou on a ajoutté un operateur if ($add) { // verification de la présence de l'identifiant et de l'access if (!$level || !$new_op) { echo "<BR><BR><CENTER><H3><B><U>$channels_err_6</U></B></H3></CENTER>"; Guillaume Tournand <guillaume@tournand.com> September 2003 369/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project } else { // On verifie la presence de l'identifiant dans la base $query="SELECT id_user FROM users WHERE id_user='$new_op'"; $result_exist = mysql_query($query) or die ("Requete non valide"); $nb_result=mysql_num_rows($result_exist); if (!$nb_result) { echo "<BR><BR><CENTER><H3><B><U>$channels_err_4 LZ-$new_op $channels_err_4_1</U></B></H3></CENTER>"; } else { // si son access n'est pas assez grand, meme pas la peine if ($user_level <= $usr_level) { echo "<BR><BR><CENTER><H3><B><U>$channels_err_7</U></B></H3></CENTER>"; } else { // on verifie que l'utilisateur ne soit pas deja present comme operateur $query="SELECT id_op FROM lz_chan_$id_chan WHERE id_op='$new_op'"; $result_exist = mysql_query($query) or die ("Requete non valide"); $nb_result=mysql_num_rows($result_exist); // on verifie aussi que l'id ne soit pas celui de l'owner if ($nb_result || $new_op==$id_owner) { echo "<BR><BR><CENTER><H3><B><U>$channels_err_5 LZ-$new_op $channels_err_5_1</U></B></H3></CENTER>"; } else { // tout est ok, on procède a l'insert et aux instructions $commande = ".chattr LZ-$new_op +o #$nom_chan"; $query_instr="INSERT INTO instructions(unixtime, id_user, commande) VALUES ( '$unixtime','$id_user', '$commande')"; $result_instr=mysql_query($query_instr) or die ("Requète non valide"); echo "$channels_err_3<CENTER>$channels_err_8 LZ$new_op</CENTER>"; $query="INSERT INTO lz_chan_$id_chan (id_op, lvl) VALUES ('$new_op', '$usr_level')"; $result = mysql_query($query) or die ("Requète non valide"); // on met a jour le nb de requetes if (!$admin_side) { $query="SELECT nb_requete FROM users WHERE id_user='$id_user'"; $result_requete = mysql_query($query) or die ("Requete non valide"); $nb_requete=mysql_result($result_requete,0,"nb_requete"); $nb_requete++; $result_update=mysql_query("UPDATE users SET nb_requete='$nb_requete' WHERE id_user = '$id_user'") or die ("Requete non valide"); $query = "UPDATE users SET unixtime_modif='$unixtime' WHERE id_user = '$id_user'"; $result_update=mysql_query($query) or die ("Requete non valide"); Guillaume Tournand <guillaume@tournand.com> September 2003 370/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project } } } } } } // dans le cas ou on a modifie un acces if ($mod) { // verification de la présence de l'identifiant et de l'access if (!$level || !$new_op) { echo "<BR><BR><CENTER><H3><B><U>$channels_err_6</U></B></H3></CENTER>"; } else { // on verifie que l'utilisateur soit bien present comme operateur $query="SELECT lvl FROM lz_chan_$id_chan WHERE id_op='$new_op'"; $result_exist = mysql_query($query) or die ("Requete non valide"); $nb_result=mysql_num_rows($result_exist); if (!$nb_result) { echo "<BR><BR><CENTER><H3><B><U>$channels_err_5 LZ$new_op $channels_err_5_2</U></B></H3></CENTER>"; } else { // si son access n'est pas assez grand, meme pas la peine $previous_lvl=mysql_result($result_exist,0,"lvl"); if ($user_level <= $usr_level || $user_level <= $previous_lvl) { echo "<BR><BR><CENTER><H3><B><U>$channels_err_7</U></B></H3></CENTER>"; } else { // Si l'acces est le meme on y touche pas if ($previous_lvl == $usr_level) { echo "<BR><BR><CENTER><H3><B><U>$channels_err_11</U></B></H3></CENTER>"; } else { // tout est ok, on procède a l'insert et aux instructions echo "$channels_err_3<CENTER>$channels_err_9 LZ$new_op</CENTER>"; $query="UPDATE lz_chan_$id_chan SET lvl=$usr_level WHERE id_op=$new_op"; $result = mysql_query($query) or die ("Requète non valide"); // on met a jour le nb de requetes if (!$admin_side) { $query="SELECT nb_requete FROM users WHERE id_user='$id_user'"; $result_requete = mysql_query($query) or die ("Requete non valide"); $nb_requete=mysql_result($result_requete,0,"nb_requete"); $nb_requete++; $result_update=mysql_query("UPDATE users SET nb_requete='$nb_requete' WHERE id_user = '$id_user'") or die ("Requete non valide"); $result_update=mysql_query("UPDATE users SET unixtime_modif='$unixtime' WHERE id_user = '$id_user'") or die ("Requete non valide"); Guillaume Tournand <guillaume@tournand.com> September 2003 371/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project } } } } } } // dans le cas ou on a supprime un operateur if ($rem) { // verification de la présence de l'identifiant et de l'access if (!$new_op) { echo "<BR><BR><CENTER><H3><B><U>$channels_err_6_1</U></B></H3></CENTER>"; } else { // on verifie que l'utilisateur soit bien present comme operateur $query="SELECT lvl FROM lz_chan_$id_chan WHERE id_op='$new_op'"; $result_exist = mysql_query($query) or die ("Requete non valide"); $nb_result=mysql_num_rows($result_exist); if (!$nb_result) { echo "<BR><BR><CENTER><H3><B><U>$channels_err_5 LZ$new_op $channels_err_5_2</U></B></H3></CENTER>"; } else { // si son access n'est pas assez grand, meme pas la peine $previous_lvl=mysql_result($result_exist,0,"lvl"); if ($user_level <= $previous_lvl) { echo "<BR><BR><CENTER><H3><B><U>$channels_err_7</U></B></H3></CENTER>"; } else { // tout est ok, on procède a l'insert et aux instructions $commande = ".chattr LZ-$new_op -o #$nom_chan"; $query_instr="INSERT INTO instructions(unixtime, id_user, commande) VALUES ('$unixtime','$id_user', '$commande')"; $result_instr=mysql_query($query_instr) or die ("Requète non valide"); echo "$channels_err_3<CENTER>$channels_err_10 LZ$new_op</CENTER>"; $query="DELETE FROM lz_chan_$id_chan WHERE id_op=$new_op"; $result = mysql_query($query) or die ("Requete non valide"); // on met a jour le nb de requetes if (!$admin_side) { $query="SELECT nb_requete FROM users WHERE id_user='$id_user'"; $result_requete = mysql_query($query) or die ("Requete non valide"); $nb_requete=mysql_result($result_requete,0,"nb_requete"); $nb_requete++; $result_update=mysql_query("UPDATE users SET nb_requete='$nb_requete' WHERE id_user = '$id_user'") or die ("Requete non valide"); $result_update=mysql_query("UPDATE users SET unixtime_modif='$unixtime' WHERE id_user = '$id_user'") or die ("Requete non valide"); } } Guillaume Tournand <guillaume@tournand.com> September 2003 372/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project } } } } ?> Guillaume Tournand <guillaume@tournand.com> September 2003 373/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project include/.htinclude_code_egg.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP if ($max_egg != 1){ echo $admin_egg_1; } else { // on affiche les caracts de l'egg echo "<TABLE WIDTH='100%' BORDER='0'><TR VALIGN='TOP'><TD WIDTH='25%' ALIGN='CENTER' VALIGN='CENTER'>"; echo "<B><U>$admin_egg_2</U> : $nom</B>"; echo "</TD><TD WIDTH='30%' ALIGN='RIGHT'>"; echo "<B><U>$admin_egg_3</B></U> :"; echo "</TD><TD WIDTH='15%' ALIGN='LEFT'>"; $unixtime_creat=mysql_result($result_eggdrops,0,"unixtime_creat"); $date_creat=date("d/m/Y", "$unixtime_creat"); echo "<B>$date_creat<BR></B>"; echo "</TD><TD WIDTH='27%' ALIGN='RIGHT'>"; $egg_bloc=mysql_result($result_eggdrops,0,"egg_bloc"); $query="SELECT nom_chan FROM channels WHERE egg_group='$egg_bloc'"; $result=mysql_query($query); $nb_chans=mysql_num_rows($result); $chans_libres=$egg_max_chan-$nb_chans; echo "<B>$admin_egg_4 $nb_chans $admin_egg_4_1<BR></B>"; echo "<B>$chans_libres $admin_egg_5</B>"; echo "</TD></TR></TABLE>"; // on affiche les proprietes echo "<BR><BR><TABLE WIDTH='100%' BORDER='0'><TR VALIGN='CENTER'><TD ALIGN='CENTER'>"; $username=mysql_result($result_eggdrops,0,"username"); $host1=mysql_result($result_eggdrops,0,"host1"); $host2=mysql_result($result_eggdrops,0,"host2"); $host3=mysql_result($result_eggdrops,0,"host3"); $ip=mysql_result($result_eggdrops,0,"ip"); $pere=mysql_result($result_eggdrops,0,"pere"); // affichage en hard de la liste des bots $pere=2; Guillaume Tournand <guillaume@tournand.com> September 2003 374/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if ($host1){ echo "*!*$username@$host1<BR>"; } if ($host2) { echo "*!*$username@$host2<BR>"; } if ($host3) { echo "*!*$username@$host3<BR>"; } if ($ip) { echo "<TD ALIGN='CENTER'>$admin_egg_6 : $ip"; } // si admin side on affiche le port et le pass de l'egg sur X if ($admin_side) { // on l'affiche seulement pour les admin lvl > $min_admin_level_pass_cservice $nick_admin=$_SERVER["PHP_AUTH_USER"]; $query="SELECT l.admin_lvl from admin a, users u, admin_levels l WHERE a.id_user=u.id_user AND l.id_level=a.id_lvl AND u.nick='$nick_admin'"; $result=mysql_query($query); $nb_lvl=mysql_num_rows($result); if ($nb_lvl == 1) { $admin_lvl=mysql_result($result,0,"l.admin_lvl"); if ($admin_lvl >= $min_admin_level_pass_cservice) { $port=mysql_result($result_eggdrops,0,"port"); $xpass=mysql_result($result_eggdrops,0,"xpass"); if ($xpass){ echo ":$port<BR><BR>$admin_egg_12 : $xpass"; } } } } echo "</TD><TD ALIGN='RIGHT' WIDTH='90'>"; // on affiche le bot pere if ($pere){ $query="SELECT nom, m_server FROM eggdrops WHERE id_egg='$pere'"; $result=mysql_query($query) or die ("Requete non valide"); $nom_pere=mysql_result($result,0,"nom"); $m_server=mysql_result($result,0,"m_server"); echo "<U>$admin_egg_7</U> : <A HREF='eggdrops.php?nom=$nom_pere' target='home' class='lien'>"; if ($m_server=="-") { echo "<FONT COLOR='red'>"; } echo "$nom_pere"; if ($m_server=="-") { echo "</FONT>"; } echo "</A>"; } // on affiche l'egg bloc et les eggdrops de l'egg bloc echo "</TD></TR><TR VALIGN='CENTER'><TD COLSPAN=2 ALIGN='CENTER'>"; $egg_bloc=mysql_result($result_eggdrops,0,"egg_bloc"); $svr_bloc=mysql_result($result_eggdrops,0,"svr_bloc"); if ($egg_bloc) { echo "<BR><BR><B>$nom $admin_egg_8 $egg_bloc, $admin_egg_8_1</B><BR>"; $query="SELECT nom, m_server FROM eggdrops WHERE egg_bloc='$egg_bloc' AND nom!='$nom' ORDER BY nom ASC"; $result=mysql_query($query) or die ("Requete non valide"); $max_result=mysql_num_rows($result); for ($cpt=0; $cpt < $max_result; $cpt++) { $nom_egg=mysql_result($result,$cpt,"nom"); $m_server=mysql_result($result,$cpt,"m_server"); Guillaume Tournand <guillaume@tournand.com> September 2003 375/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project echo "<A HREF='eggdrops.php?nom=$nom_egg' target='home' class='lien'>"; if ($m_server=="-") { echo "<FONT COLOR='red'>"; } echo "$nom_egg"; if ($m_server=="-") { echo "</FONT>"; } echo "</A> "; } } // on affiche la liste de channels couverts $query="SELECT id_chan, nom_chan FROM channels WHERE egg_group='$egg_bloc' AND nom_chan != 'loufiz' ORDER BY nom_chan"; $result=mysql_query($query) or die ("Requete non valide"); $max_result=mysql_num_rows($result); if ($max_result){ echo "<BR><BR><B>$admin_egg_9</B><BR>"; } if ($admin_side) { for ($cpt=0; $cpt < $max_result; $cpt++) { $id_couvert=mysql_result($result,$cpt,"id_chan"); $chan_couvert=mysql_result($result,$cpt,"nom_chan"); echo "<A HREF='channels.php?id_chan=$id_couvert' target='home' class='lien'>#$chan_couvert</A> "; } } if (!$admin_side) { for ($cpt=0; $cpt < $max_result; $cpt++) { $id_couvert=mysql_result($result,$cpt,"id_chan"); $chan_couvert=mysql_result($result,$cpt,"nom_chan"); if ($id_couvert == $id_chan) { echo "<A HREF='channels.php' target='home' class='lien'>#$chan_couvert</A> "; } if ($id_couvert != $id_chan) { echo "#$chan_couvert "; } } } // on affiche l'etat de connexion $m_server=mysql_result($result_eggdrops,0,"m_server"); $m_unixtime=mysql_result($result_eggdrops,0,"m_unixtime"); $m_date=date("d/m/Y H:i:s", "$m_unixtime"); echo "<BR><BR><B>$admin_egg_13 $m_date (GMT+1)</B><BR>"; echo "$admin_egg_14 "; if ($m_server == '-') { echo "<FONT COLOR='red'>$admin_egg_16</FONT>"; } if ($m_server != '-') { echo "<FONT COLOR='green'>$admin_egg_15 $m_server</FONT>"; } // on affiche la liste des servers echo "<BR><BR><B>$admin_egg_10$svr_bloc :</B><BR>"; $query="SELECT * FROM serveurs WHERE svr_bloc='$svr_bloc' AND etat='1'"; if (!$svr_bloc){ $query="SELECT * FROM serveurs WHERE etat='1'"; } $result=mysql_query($query) or die ("Requete non valide"); $max_result=mysql_num_rows($result); for ($cpt=0; $cpt < $max_result; $cpt++) { Guillaume Tournand <guillaume@tournand.com> September 2003 376/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $nom_svr=mysql_result($result,$cpt,"nom"); $svr_port=mysql_result($result,$cpt,"port"); echo "$nom_svr:$svr_port<BR>"; } echo "</TD>"; // on affiche la liste des bots fils $query="SELECT nom, m_server FROM eggdrops WHERE pere='$pere' AND actif != '0' ORDER BY nom ASC"; $result=mysql_query($query) or die ("Requete non valide"); $max_result=mysql_num_rows($result); if ($max_result) { echo "<TD ALIGN='RIGHT' VALIGN='TOP'><BR><U>$admin_egg_11</U> :<BR><BR>"; for ($cpt=0; $cpt < $max_result; $cpt++) { $nom_egg=mysql_result($result,$cpt,"nom"); $m_server=mysql_result($result,$cpt,"m_server"); echo "<A HREF='eggdrops.php?nom=$nom_egg' target='home' class='lien'>"; if ($m_server=="-") { echo "<FONT COLOR='red'>"; } echo "$nom_egg"; if ($m_server=="-") { echo "</FONT>"; } echo "</A><BR>"; } echo "</TD>"; } echo "</TR></TABLE><BR>"; } ?> Guillaume Tournand <guillaume@tournand.com> September 2003 377/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project include/.htinclude_code_retrait_cess.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP // fichier d'include des retraits / cessation $unixtime_maintenant=time(); // On met a jour la derniere auth du proprio du channel $result_update = mysql_query("UPDATE users SET unixtime_login='$unixtime_maintenant' WHERE id_user = '$id_owner_chans'") or die ("Requete non valide"); // Pas de nouvel owner, on purge if (!$nouvel_owner){ // on choppe l'utilisation du projet $prct= project_use($egg_max_chan); // si le projet est plein, vu qu'on va purger on demande a adam de changer le desc sur X if ($prct >= "100.00") { $commande=".msg X set #loufiz desc To borrow eggdrops => web site / Pour un pret d\'eggdrops, aller sur le site web"; $query="INSERT INTO instructions(unixtime, id_user, commande, ack) VALUES('$unixtime_maintenant', '1', '$commande', '4')"; $result = mysql_query($query) or die ("Requète non valide"); } // on recherche dans quel block d'egg tapper $egg_bloc=mysql_result($result_valid,0,"egg_group"); $result_egg=mysql_query("SELECT nom from eggdrops WHERE egg_bloc='$egg_bloc'") or die ("Requete non valide"); $max_egg=mysql_num_rows($result_egg); echo $retrait_cessation_4; // on envoie les commandes de part aux eggdrops $commande=".-chan #$nom_chan"; $query="INSERT INTO instructions(unixtime, id_user, commande) VALUES('$unixtime_maintenant', '$id_owner_chans', '$commande')"; $result = mysql_query($query) or die ("Requète non valide"); Guillaume Tournand <guillaume@tournand.com> September 2003 378/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project echo $retrait_cessation_5; for ($cpt=0; $cpt<$max_egg; $cpt++) { $nom_egg=mysql_result($result_egg,$cpt,"nom"); echo "<B>$nom_egg</B> "; $commande=".bnpart $nom_egg #$nom_chan"; $query="INSERT INTO instructions(unixtime, id_user, commande, ack) VALUES('$unixtime_maintenant', '$id_owner_chans', '$commande', '2')"; $result = mysql_query($query) or die ("Requète non valide"); } // on supprime la table des operateurs $id_chan=mysql_result($result_valid,0,"id_chan"); $query="DROP TABLE lz_chan_$id_chan"; $result = mysql_query($query) or die ("Requète non valide"); // on supprime l'entrée dans le monitoring $query="DELETE FROM chan_monitoring WHERE nom_chan='$nom_chan'"; $result = mysql_query($query) or die ("Requète non valide"); // on deplace l'enregistrement du channel dans getout_chan $owner_chan=mysql_result($result_valid,0,"id_owner"); $unixtime_support=mysql_result($result_valid,0,"unixtime_support"); $unixtime_demande=mysql_result($result_valid,0,"unixtime_demande"); $warning=mysql_result($result_valid,0,"warning"); $query="INSERT INTO getout_chan(nom_chan, id_owner, unixtime_demande, unixtime_support, unixtime_purge, warning) VALUES('$nom_chan', '$owner_chan', '$unixtime_demande', '$unixtime_support', '$unixtime_maintenant', '$warning')"; if ($admin_side) { $query="INSERT INTO getout_chan(nom_chan, id_owner, unixtime_demande, unixtime_support, unixtime_purge, warning, id_purge) VALUES('$nom_chan', '$owner_chan', '$unixtime_demande', '$unixtime_support', '$unixtime_maintenant', '$warning', '$raison_purge')"; } $result = mysql_query($query) or die ("Requète non valide"); // on supprime l'enregistrement $query="DELETE FROM channels WHERE nom_chan='$nom_chan'"; $result = mysql_query($query) or die ("Requète non valide"); echo $retrait_cessation_6; if ($admin_side) { // On envoit un mail a la mailling list du projet Loufiz $result_purge = mysql_query("SELECT * from raisons_purge where id_purge='$raison_purge'") or die ("Requete non valide"); $raison_fr = mysql_result($result_purge,0,'texte'); $raison_en = mysql_result($result_purge,0,'texte_en'); $nom_admin=$_SERVER["PHP_AUTH_USER"]; $date_maintenant= date("d/m/Y", "$unixtime_maintenant"); // envoi de mail pour la purge $query="SELECT nick from users u, admin a WHERE a.id_user=u.id_user AND a.mail_purge='1'"; $result = mysql_query($query) or die ("Requête non valide"); $nb_m=mysql_num_rows($result); if ($nb_m){ for ($i=0, $bcc=''; $i<$nb_m; $i++){ $nick_mail=mysql_result($result,$i,"nick"); $bcc .= "$nick_mail@loufiz.com,"; } $to=""; $subject = "[www.loufiz.com] channel #$nom_chan purgé / channel #$nom_chan purged"; $body = "Le $date_maintenant, le channel #$nom_chan a été purgé par $nom_admin\nRaison : $raison_fr\n\nThe $date_maintenant, the channel #$nom_chan has been purged by $nom_admin\nReason : $raison_en"; $header = "From: webmaster@loufiz.com\nReply-To: eggdrops@loufiz.com\n"; $header .= "Bcc: $bcc\r\n"; Guillaume Tournand <guillaume@tournand.com> September 2003 379/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project mail ($to, $subject, $body, $header); } } } // un nouvel owner, on change de proprio if ($nouvel_owner != $id_owner_chans && $nouvel_owner) { // on vérifie que l'id existe $result_new_owner=mysql_query("SELECT id_user from users WHERE id_user='$nouvel_owner'") or die ("Requete non valide"); $max_new_owner=mysql_num_rows($result_new_owner); if (!$max_new_owner || $nouvel_owner==1){ echo $retrait_cessation_7; } else { echo $retrait_cessation_8; // on supprime le nouvel owner de la liste des ops si présent $query="SELECT lvl from lz_chan_$id_chan WHERE id_op=$nouvel_owner"; $result=mysql_query($query) or die ("Requète non valide"); $is_op=mysql_num_rows($result); if ($is_op) { $query="DELETE FROM lz_chan_$id_chan WHERE id_op=$nouvel_owner"; $result=mysql_query($query) or die ("Requète non valide"); echo $retrait_cessation_9; } if (!$is_op) { $commande=".chattr LZ-$nouvel_owner +o #$nom_chan"; $query="INSERT INTO instructions(unixtime, id_user, commande) VALUES('$unixtime_maintenant', '$id_owner_chans', '$commande')"; $result = mysql_query($query) or die ("Requète non valide"); } $query="UPDATE channels SET id_owner='$nouvel_owner' WHERE nom_chan='$nom_chan'"; $result = mysql_query($query) or die ("Requète non valide"); $commande=".chattr LZ-$id_owner_chans -o #$nom_chan"; $query="INSERT INTO instructions(unixtime, id_user, commande) VALUES('$unixtime_maintenant', '$id_owner_chans', '$commande')"; $result = mysql_query($query) or die ("Requète non valide"); } } // dans ce cas, c'est une farce if ($nouvel_owner == $id_owner_chans) { echo $retrait_cessation_10; } ?> Guillaume Tournand <guillaume@tournand.com> September 2003 380/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project include/.htinclude_code_user.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP // nettoyage des id_user $id_user=clean_id ($id_user); $result_admin = mysql_query("SELECT id_lvl from admin WHERE id_user='$id_user'") or die ("Requete non valide"); $max_admin=mysql_num_rows($result_admin); if ($max_admin){ $is_admin=mysql_result($result_admin,0,"id_lvl"); } echo "<FORM ACTION='modif_user.php' METHOD='POST'>"; echo "<TABLE WIDTH='100%' BORDER='0'><TR VALIGN='TOP'><TD WIDTH='17%' ALIGN='LEFT' VALIGN='CENTER'>"; echo "$admin_user_3<BR>"; echo "LZ-$id_user</B>"; echo "</TD><TD WIDTH='27%' ALIGN='RIGHT'>"; echo $admin_user_4; if ($admin_side) { echo "$admin_user_4_0"; } echo "</TD><TD WIDTH='27%' ALIGN='LEFT'>"; $unixtime_naiss=mysql_result($result_user,0,"unixtime_naiss"); $date_naiss=date("d/m/Y", "$unixtime_naiss"); echo "<B>$date_naiss<BR></B>"; $unixtime_creat=mysql_result($result_user,0,"unixtime_creat"); $date_creat=date("d/m/Y H:i:s", "$unixtime_creat"); echo "<B>$date_creat</B>"; $ip_creat=mysql_result($result_user,0,"ip_creat"); echo "<BR><B>$ip_creat</B>"; if ($admin_side) { $user_lang=mysql_result($result_user,0,"lang"); echo "<BR><B>$user_lang</B>"; } echo "</TD><TD WIDTH='50%' ALIGN='RIGHT'>"; if (!$admin_side) { Guillaume Tournand <guillaume@tournand.com> September 2003 381/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if ($lang != $user_lang) { $result_lang_change = mysql_query("UPDATE users SET lang='$lang' WHERE id_user='$id_user'") or die ("Requete non valide"); } } if ($admin_side) { $nb_requete=mysql_result($result_user,0,"nb_requete"); echo "<U>$admin_user_4_1</U> : $nb_requete<BR>"; $unixtime_modif=mysql_result($result_user,0,"unixtime_modif"); $date_modif=date("d/m/Y H:i:s", "$unixtime_modif"); echo "<U>$admin_user_4_2</U> :<BR>$date_modif<BR>"; $nb_login=mysql_result($result_user,0,"nb_login"); echo "<U>$admin_user_4_3</U> : $nb_login<BR>"; } $unixtime_login=mysql_result($result_user,0,"unixtime_login"); $date_login=date("d/m/Y H:i:s", "$unixtime_login"); $ip_login=mysql_result($result_user,0,"ip_login"); echo "$admin_user_5 : $date_login<BR>$ip_login"; echo "</TD></TR></TABLE>"; echo "<BR><TABLE WIDTH='100%' BORDER='0'><TR VALIGN='CENTER'><TD ALIGN='RIGHT'>"; $genre=mysql_result($result_user,0,"genre"); // detection de la langue pour savoir dans quelle table tapper. if ($lang != 'fr') { $table_genre_texte="descr_$lang"; } if ($lang == 'fr') { $table_genre_texte="descr"; } $result_genre=mysql_query("SELECT $table_genre_texte FROM genre WHERE id_genre='$genre'") or die ("Requete non valide"); $genre=mysql_result($result_genre,0,"$table_genre_texte"); $nom=mysql_result($result_user,0,"nom"); $prenom=mysql_result($result_user,0,"prenom"); if ($admin_side) { echo "<BR><H3><B>$genre</B> <input type='text' name='nom' size='35' maxlength='50' value=\"$nom\"> <input type='text' name='prenom' size=35 maxlength=50 value=\"$prenom\"></H3>"; } if (!$admin_side) { echo "<BR><H3><B>$genre $nom $prenom</B></H3>"; } // $pass=mysql_result($result_user,0,"pass"); echo "</TD><TD COLSPAN='2' ALIGN='CENTER'>"; $nick=mysql_result($result_user,0,"nick"); // si l'utilisateur est admin, il ne peut pas changer son nick if (! $is_admin){ echo "$admin_user_6 : <input type='text' name='nick' size=10 maxlength=10 value=\"$nick\">"; } if ($is_admin){ echo "$admin_user_6 : <B>$nick</B><input type='hidden' name='nick' size=10 maxlength=10 value=\"$nick\">"; } echo "</TD><TD ALIGN='RIGHT'>"; if ($admin_side) { echo "<input type='hidden' name='id_user' size=5 maxlength=5 value='$id_user'>"; } echo "</TD></TR><TR><TD COLSPAN=3><HR></TD></TR><TR VALIGN='CENTER'><TD ALIGN='LEFT'>"; Guillaume Tournand <guillaume@tournand.com> September 2003 382/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $ville=mysql_result($result_user,0,"ville"); $pays=mysql_result($result_user,0,"pays"); $amail=mysql_result($result_user,0,"amail"); echo "$admin_user_7:<BR><input type='text' name='amail' size=35 maxlength=35 value=\"$amail\"></TD>"; echo "<TD>$admin_user_8:<BR><input type='text' name='ville' size=20 maxlength=20 value=\"$ville\"></TD>"; echo "<TD>$admin_user_9:<BR><input type='text' name='pays' size=20 maxlength=20 value=\"$pays\">"; echo "</TD></TR><TR VALIGN='CENTER'><TD ALIGN='CENTER'>"; $username=mysql_result($result_user,0,"username"); $host1=mysql_result($result_user,0,"host1"); $host2=mysql_result($result_user,0,"host2"); $host3=mysql_result($result_user,0,"host3"); echo $admin_user_10; echo "*!*$username@<input type='text' name='host1' size=35 maxlength=50 value='$host1'><BR><BR>"; echo "*!*$username@<input type='text' name='host2' size=35 maxlength=50 value='$host2'><BR><BR>"; echo "*!*$username@<input type='text' name='host3' size=35 maxlength=50 value='$host3'><BR><BR>"; echo "</TD><TD COLSPAN=2 ALIGN='RIGHT'>"; echo $admin_user_11; echo "<U>$admin_user_12</U> :<input type='password' name='new_pass1' size=20 maxlength=20><BR><BR>"; echo "<U>$admin_user_13</U> :<input type='password' name='new_pass2' size=20 maxlength=20>"; echo "</TD></TR>"; if ($is_admin){ // detection de la langue pour savoir dans quelle table tapper. if ($lang != 'fr') { $table_admin_descr="admin_descr_$lang"; } if ($lang == 'fr') { $table_admin_descr="admin_descr"; } $result_admin = mysql_query("SELECT $table_admin_descr from admin_levels WHERE id_level='$is_admin'") or die ("Requete non valide"); $admin_rank=mysql_result($result_admin,0,"$table_admin_descr"); echo "<TR><TD COLSPAN='3' ALIGN='CENTER'><FONT COLOR='RED'><B>LZ$id_user</B> $admin_user_14 <B>$admin_rank</B> $admin_user_15</FONT></TD></TR>"; // fetch les preferences $query="SELECT mail_request, mail_purge, mail_log FROM admin WHERE id_user='$id_user'"; $result_mail_select=mysql_query("$query") or die ("Requete non valide"); $mail_request=mysql_result($result_mail_select, 0, "mail_request"); $mail_purge=mysql_result($result_mail_select, 0, "mail_purge"); $mail_log=mysql_result($result_mail_select, 0, "mail_log"); echo "<TR><TD ALIGN='right'><BR>$admin_user_19</TD></TR>"; echo "<TR><TD ALIGN='right'>$admin_user_20</TD><TD ALIGN='left'>"; if ($mail_request) { echo "<input type='radio' name='mail_request' value='1' checked> $admin_user_23 <input type='radio' name='mail_request' value='0'> $admin_user_24"; } if (!$mail_request) { echo "<input type='radio' name='mail_request' value='1'> $admin_user_23 <input type='radio' name='mail_request' value='0' checked> $admin_user_24"; } echo "</TD></TR>"; echo "<TR><TD ALIGN='right'>$admin_user_21</TD><TD ALIGN='left'>"; if ($mail_purge) { Guillaume Tournand <guillaume@tournand.com> September 2003 383/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project echo "<input type='radio' name='mail_purge' value='1' checked> $admin_user_23 <input type='radio' name='mail_purge' value='0'> $admin_user_24"; } if (!$mail_purge) { echo "<input type='radio' name='mail_purge' value='1'> $admin_user_23 <input type='radio' name='mail_purge' value='0' checked> $admin_user_24"; } echo "</TD></TR>"; echo "<TR><TD ALIGN='right'>$admin_user_22</TD><TD ALIGN='left'>"; if ($mail_log) { echo "<input type='radio' name='mail_log' value='1' checked> $admin_user_23 <input type='radio' name='mail_log' value='0'> $admin_user_24"; } if (!$mail_log) { echo "<input type='radio' name='mail_log' value='1'> $admin_user_23 <input type='radio' name='mail_log' value='0' checked> $admin_user_24"; } } // on liste les channels avec l'id comme owner echo "<TR VALIGN='TOP'><TD WIDTH='50%'>"; $result_nbm = mysql_query("SELECT id_chan, nom_chan from channels WHERE id_owner=$id_user") or die ("Requete non valide"); $nb_m=mysql_num_rows($result_nbm); if ($nb_m){ echo "<BR><U>$admin_user_16 LZ-$id_user $admin_user_17</U> :<BR><BR>"; for ($i=0; $i<$nb_m; $i++){ $id_chan=mysql_result($result_nbm,$i,"id_chan"); $nom_chan=mysql_result($result_nbm,$i,"nom_chan"); echo "<A HREF='channels.php?id_chan=$id_chan' class='lien' target='home'>#$nom_chan</A><BR>"; } } // on liste les channels avec l'id comme op/admin Attention ca risque d'etre lourd echo "</TD><TD COLSPAN=2 WIDTH='50%'>"; $result_nbc = mysql_query("SELECT nom_chan, id_chan FROM channels WHERE nom_chan!='loufiz'") or die ("Requete non valide"); $nb_c=mysql_num_rows($result_nbc); // pour chaque channel de la table channels for ($cpt=0, $deja_op=0; $cpt < $nb_c; $cpt++) { $id_chan=mysql_result($result_nbc,$cpt,"id_chan"); $requete="SELECT lvl FROM lz_chan_$id_chan WHERE id_op='$id_user'"; //echo "$requete<BR>"; $result_isop=mysql_query("$requete") or die ("Requète non valide"); $nb_isop=mysql_num_rows($result_isop); // si l'id est op if ($nb_isop) { // on affiche le joli texte if (!$deja_op) { $deja_op=1; echo "<BR><U>$admin_user_16 LZ-$id_user $admin_user_18</U> :<BR><BR>"; } // on recupere le niveau d'op et le nom du channel $isop=mysql_result($result_isop,0,"lvl"); $nom_chan=mysql_result($result_nbc,$cpt,"nom_chan"); if ($admin_side) { echo "<A HREF='channels.php?id_chan=$id_chan' class='lien' target='home'>#$nom_chan</A><BR>"; } Guillaume Tournand <guillaume@tournand.com> September 2003 384/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if (!$admin_side && $isop > 200) { echo "<A HREF='channels.php?id_chan=$id_chan' class='lien' target='home'>#$nom_chan</A><BR>"; } if (!$admin_side && $isop <= 200) { echo "#$nom_chan<BR>"; } } } echo "</TD></TR></TABLE>"; // mise a jour des nb de connexions if (!$admin_side) { $nb_login=mysql_result($result_user,0,"nb_login"); $nb_login++; $unixtime_maintenant=time(); $ip_login = getenv ("REMOTE_ADDR"); $result_update = mysql_query("UPDATE users SET nb_login='$nb_login' WHERE id_user = '$id_user'") or die ("Requete non valide"); $result_update = mysql_query("UPDATE users SET ip_login='$ip_login' WHERE id_user = '$id_user'") or die ("Requete non valide"); $result_update = mysql_query("UPDATE users SET unixtime_login='$unixtime_maintenant' WHERE id_user = '$id_user'") or die ("Requete non valide"); } echo "$boutton_valider_annuler</FORM>"; ?> Guillaume Tournand <guillaume@tournand.com> September 2003 385/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project include/.htinclude_code_user_modif.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP // fonction qui cherche les différences entre les ancinnes preferences et les nouvelles function pref_change ($old, $new, $combien) { for ($cpt=0; $cpt<$combien; $cpt++){ if ($old[$cpt] != $new[$cpt]){ // dans le cas du password, on vérifie que le nouveau soit présent if ($cpt==8 && ($new[$cpt]=='')) { // aucune action } else { $change[]=$cpt; } } } return $change; } // on formatte les données $nick=strtolower($nick); $ville=ucfirst(strtolower($ville)); $pays=strtoupper($pays); $amail=strtolower($amail); $amail=strip_space ($amail); $host1=strtolower($host1); $host2=strtolower($host2); $host3=strtolower($host3); $nom=strtoupper($nom); $prenom=ucfirst(strtolower($prenom)); /* // we clean the strings from ' $nom = strip_single_quote ($nom); $prenom = strip_single_quote ($prenom); $nick = strip_single_quote ($nick); $ville = strip_single_quote ($ville); $pays = strip_single_quote ($pays); Guillaume Tournand <guillaume@tournand.com> September 2003 386/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $amail = strip_single_quote ($amail); $username = strip_single_quote ($username); */ // on verifie le pass $bad_pass= check_no_space ($new_pass1); $long_pass=strlen($new_pass1); // we check the hosts $bad_host1=check_bad_host ($host1); $bad_host2=check_bad_host ($host2); $bad_host3=check_bad_host ($host3); $result_user = mysql_query("SELECT * from users WHERE id_user='$id_user'") or die ("Requete non valide"); // on vérifie si l'utilisateur est admin, si oui, privé de nick ! $result_admin = mysql_query("SELECT id_lvl from admin WHERE id_user='$id_user'") or die ("Requete non valide"); $max_admin=mysql_num_rows($result_admin); if ($max_admin){ $nick=mysql_result($result_user,0,"nick"); $query="SELECT mail_request, mail_purge, mail_log FROM admin WHERE id_user='$id_user'"; $result_mail_select=mysql_query("$query") or die ("Requete non valide"); $old_mail_request=mysql_result($result_mail_select, 0, "mail_request"); $old_mail_purge=mysql_result($result_mail_select, 0, "mail_purge"); $old_mail_log=mysql_result($result_mail_select, 0, "mail_log"); } // partie admin et celle non-admin n'ont pas les memes droits de changements $new_valeurs= array('valeur1', $nick, $ville, $pays, $amail, $host1, $host2, $host3, $new_pass1); $old_valeurs= array('valeur2', mysql_result($result_user,0,"nick"), mysql_result($result_user,0,"ville"), mysql_result($result_user,0,"pays"), mysql_result($result_user,0,"amail"), mysql_result($result_user,0,"host1"), mysql_result($result_user,0,"host2"), mysql_result($result_user,0,"host3"), mysql_result($result_user,0,"pass")); $elements=9; // si l'utilisateur est admin on rajoutte ses choix de mail if ($max_admin) { $old_valeurs[]=$old_mail_request; $old_valeurs[]=$old_mail_purge; $old_valeurs[]=$old_mail_log; $new_valeurs[]=$mail_request; $new_valeurs[]=$mail_log; $new_valeurs[]=$mail_purge; $elements = $elements+3; } if ($admin_side) { $new_valeurs[]= $nom; $new_valeurs[]= $prenom; $old_valeurs[]= mysql_result($result_user,0,"nom"); $old_valeurs[]= mysql_result($result_user,0,"prenom"); $elements = $elements+2; } $change= pref_change($old_valeurs, $new_valeurs, $elements); // si aucun changement n'a été effectué if (!$change[1]){ echo $admin_modif_user_2; } else { Guillaume Tournand <guillaume@tournand.com> September 2003 387/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project // ok on met a jour echo $admin_modif_user_3; $unixtime_now = time(); if (!$admin_side) { $query="SELECT nb_requete FROM users WHERE id_user='$id_user'"; $result_requete = mysql_query($query) or die ("Requete non valide"); $nb_requete=mysql_result($result_requete,0,"nb_requete"); $nb_requete++; $result_update=mysql_query("UPDATE users SET nb_requete='$nb_requete' WHERE id_user = '$id_user'") or die ("Requete non valide"); $result_update=mysql_query("UPDATE users SET unixtime_modif='$unixtime_now' WHERE id_user = '$id_user'") or die ("Requete non valide"); } $username_result=mysql_query("SELECT username from users WHERE id_user='$id_user'") or die ("Requete non valide"); $username=mysql_result($result_user,0,"username"); for ($cpt=1; $change[$cpt]; $cpt++){ if ($change[$cpt]==1 && $nick){ $query="UPDATE users SET nick='$nick' WHERE users.id_user = $id_user"; $result = mysql_query($query) or die ("Requète non valide"); echo "<LI>$admin_modif_user_4 $nick"; } if ($change[$cpt]==2 && $ville){ $query="UPDATE users SET ville='$ville' WHERE users.id_user = $id_user"; $result = mysql_query($query) or die ("Requète non valide"); echo "<LI>$admin_modif_user_5 $ville"; } if ($change[$cpt]==3 && $pays){ $query="UPDATE users SET pays='$pays' WHERE users.id_user = $id_user"; $result = mysql_query($query) or die ("Requète non valide"); echo "<LI>$admin_modif_user_6 $pays"; } if ($change[$cpt]==4 && $amail){ $query="UPDATE users SET amail='$amail' WHERE users.id_user = $id_user"; $result = mysql_query($query) or die ("Requète non valide"); echo "<LI>$admin_modif_user_7 $amail"; $admin_result=mysql_query("SELECT u.nick FROM admin a, users u WHERE a.id_user=u.id_user AND a.id_user='$id_user'") or die ("Requete non valide"); $max_admin=mysql_num_rows($admin_result); if ($max_admin) { $path_mail="/usr/home/aliasqmail/"; exec("/bin/echo '$amail' > $path_mail.qmail-loufiz-$nick"); } } // modifcation du premier user@host if ($change[$cpt]==5){ $query="SELECT host1,host2,host3 FROM users WHERE id_user='$id_user'"; $result = mysql_query($query) or die ("Requète non valide"); $max_result=mysql_num_rows($result); $hosts=array('hosts','host1','host2','host3'); for ($i=1, $doublon=0; $i<4; $i++){ $comparateur=mysql_result($result,0,$hosts[$i]); if ($comparateur == $host1 && $new_valeurs[5]){ $doublon=1; } } if ($bad_host1){ echo "<LI>$admin_modif_user_8"; Guillaume Tournand <guillaume@tournand.com> September 2003 388/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project } if ($doublon) { echo "<LI>$admin_modif_user_9"; } // si oui suppression du u@h if ($old_valeurs[5] && !$bad_host1 &&!$doublon) { echo "<LI>$admin_modif_user_10"; // suppression du premier u@h $commande = ".-host LZ-$id_user *!$username@$old_valeurs[5]"; $query_instr="INSERT INTO instructions(unixtime, id_user, commande) VALUES ('$unixtime_now', '$id_user', '$commande')"; $result_instr=mysql_query($query_instr) or die ("Requète non valide"); $commande = ".-host LZ-$id_user *!~$username@$old_valeurs[5]"; $query_instr="INSERT INTO instructions(unixtime, id_user, commande) VALUES ('$unixtime_now', '$id_user', '$commande')"; $result_instr=mysql_query($query_instr) or die ("Requète non valide"); // mise a jour $query="UPDATE users SET host1='$host1' WHERE users.id_user = $id_user"; $result = mysql_query($query) or die ("Requète non valide"); } // si oui, mise en place du nouveau u@h if ($new_valeurs[5] && !$bad_host1 &&!$doublon) { // mise en place du u@h $commande = ".+host LZ-$id_user *!$username@$new_valeurs[5]"; $query_instr="INSERT INTO instructions(unixtime, id_user, commande) VALUES ('$unixtime_now', '$id_user', '$commande')"; $result_instr=mysql_query($query_instr) or die ("Requète non valide"); $commande = ".+host LZ-$id_user *!~$username@$new_valeurs[5]"; $query_instr="INSERT INTO instructions(unixtime, id_user, commande) VALUES ('$unixtime_now', '$id_user', '$commande')"; $result_instr=mysql_query($query_instr) or die ("Requète non valide"); echo "<LI>$admin_modif_user_11 : *!*$username@$host1"; $query="UPDATE users SET host1='$host1' WHERE users.id_user = $id_user"; $result = mysql_query($query) or die ("Requète non valide"); } } // modification du 2eme u@h if ($change[$cpt]==6){ $query="SELECT host1,host2,host3 FROM users WHERE id_user='$id_user'"; $result = mysql_query($query) or die ("Requète non valide"); $max_result=mysql_num_rows($result); $hosts=array('hosts','host1','host2','host3'); for ($i=1, $doublon=0; $i<4; $i++){ $comparateur=mysql_result($result,0,$hosts[$i]); if ($comparateur == $host2 && $new_valeurs[6]){ $doublon=1; } } if ($bad_host2){ echo "<LI>$admin_modif_user_12"; } Guillaume Tournand <guillaume@tournand.com> September 2003 389/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if ($doublon) { echo "<LI>$admin_modif_user_13"; } if ($old_valeurs[6] && !$bad_host2 &&!$doublon) { echo "<LI>$admin_modif_user_14"; $commande = ".-host LZ-$id_user *!$username@$old_valeurs[6]"; $query_instr="INSERT INTO instructions(unixtime, id_user, commande) VALUES ('$unixtime_now', '$id_user', '$commande')"; $result_instr=mysql_query($query_instr) or die ("Requète non valide"); $commande = ".-host LZ-$id_user *!~$username@$old_valeurs[6]"; $query_instr="INSERT INTO instructions(unixtime, id_user, commande) VALUES ('$unixtime_now', '$id_user', '$commande')"; $result_instr=mysql_query($query_instr) or die ("Requète non valide"); $query="UPDATE users SET host2='$host2' WHERE users.id_user = $id_user"; $result = mysql_query($query) or die ("Requète non valide"); } if ($new_valeurs[6] && !$bad_host2 &&!$doublon) { $commande = ".+host LZ-$id_user *!$username@$new_valeurs[6]"; $query_instr="INSERT INTO instructions(unixtime, id_user, commande) VALUES ('$unixtime_now', '$id_user', '$commande')"; $result_instr=mysql_query($query_instr) or die ("Requète non valide"); $commande = ".+host LZ-$id_user *!~$username@$new_valeurs[6]"; $query_instr="INSERT INTO instructions(unixtime, id_user, commande) VALUES ('$unixtime_now', '$id_user', '$commande')"; $result_instr=mysql_query($query_instr) or die ("Requète non valide"); echo "<LI>$admin_modif_user_15 : *!*$username@$host2"; $query="UPDATE users SET host2='$host2' WHERE users.id_user = $id_user"; $result = mysql_query($query) or die ("Requète non valide"); } } if ($change[$cpt]==7){ $query="SELECT host1,host2,host3 FROM users WHERE id_user='$id_user'"; $result = mysql_query($query) or die ("Requète non valide"); $max_result=mysql_num_rows($result); $hosts=array('hosts','host1','host2','host3'); for ($i=1, $doublon=0; $i<4; $i++){ $comparateur=mysql_result($result,0,$hosts[$i]); if ($comparateur == $host3 && $new_valeurs[7]){ $doublon=1; } } if ($bad_host3){ echo "<LI>$admin_modif_user_16"; } if ($doublon) { echo "<LI>$admin_modif_user_17"; } if ($old_valeurs[7] && !$bad_host3 &&!$doublon) { echo "<LI>$admin_modif_user_18"; $commande = ".-host LZ-$id_user *!$username@$old_valeurs[7]"; $query_instr="INSERT INTO instructions(unixtime, id_user, commande) VALUES ('$unixtime_now', '$id_user', '$commande')"; $result_instr=mysql_query($query_instr) or die ("Requète non valide"); $commande = ".-host LZ-$id_user *!~$username@$old_valeurs[7]"; Guillaume Tournand <guillaume@tournand.com> September 2003 390/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $query_instr="INSERT INTO instructions(unixtime, id_user, commande) VALUES ('$unixtime_now', '$id_user', '$commande')"; $result_instr=mysql_query($query_instr) or die ("Requète non valide"); $query="UPDATE users SET host3='$host3' WHERE users.id_user = $id_user"; $result = mysql_query($query) or die ("Requète non valide"); } if ($new_valeurs[7] && !$bad_host3 &&!$doublon) { $commande = ".+host LZ-$id_user *!$username@$new_valeurs[7]"; $query_instr="INSERT INTO instructions(unixtime, id_user, commande) VALUES ('$unixtime_now', '$id_user', '$commande')"; $result_instr=mysql_query($query_instr) or die ("Requète non valide"); $commande = ".+host LZ-$id_user *!~$username@$new_valeurs[7]"; $query_instr="INSERT INTO instructions(unixtime, id_user, commande) VALUES ('$unixtime_now', '$id_user', '$commande')"; $result_instr=mysql_query($query_instr) or die ("Requète non valide"); echo "<LI>$admin_modif_user_19 : *!*$username@$host3"; $query="UPDATE users SET host3='$host3' WHERE users.id_user = $id_user"; $result = mysql_query($query) or die ("Requète non valide"); } } // changement du mot de passe if ($change[$cpt]==8 && $new_pass1) { // vérification que le mot de passe ne soit pas trop court if ($long_pass < 6) { echo $admin_modif_user_2_0; } else { // verification qu'il ne contienne pas d'espace if ($bad_pass) { echo $admin_modif_user_2_1; } else { // si la confirmation n'est pas identique au premier if ($new_pass1 != $new_pass2) { echo $admin_modif_user_20; } else { // on ne touche pas au compte de démo si on n'est pas dans la zone d'admin if (!$admin_side && $id_user==$demo_id) { echo $admin_modif_user_20_1; } else { // tout semble ok, on procede au changement $user_pass=$new_pass1; // on enregistre dans la session le mot de passe. if (!$admin_side) { session_register("user_pass"); } Guillaume Tournand <guillaume@tournand.com> September 2003 391/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project // mise a jour du mot de passe dans la base de donnée $query="UPDATE users SET pass='$new_pass1' WHERE users.id_user = $id_user"; $result = mysql_query($query) or die ("Requète non valide"); // mise a jour du mot de passe dans les eggdrops $commande = ".chpass LZ-$id_user $new_pass1"; $query_instr="INSERT INTO instructions(unixtime, id_user, commande) VALUES ('$unixtime_now', '$id_user', '$commande')"; $result_instr=mysql_query($query_instr) or die ("Requète non valide"); echo $admin_modif_user_21; // On met a jour pour les admins du projet loufiz $admin_result=mysql_query("SELECT u.nick FROM admin a, users u WHERE a.id_user=u.id_user AND a.id_user='$id_user'") or die ("Requete non valide"); $max_admin=mysql_num_rows($admin_result); // user est admin ? if ($max_admin) { $path_htpass="/home/webmaster/passwd"; $new_admin_result=mysql_query("SELECT u.nick, u.pass FROM admin a, users u WHERE a.id_user=u.id_user") or die ("Requete non valide"); $max_new_admin=mysql_num_rows($new_admin_result); exec("cd $path_htpass; rm .admin_htpasswd; /usr/bin/touch .admin_htpasswd"); for ($i=0;$i<$max_new_admin;$i++) { $nick=mysql_result($new_admin_result,$i,"u.nick"); $pass=mysql_result($new_admin_result,$i,"u.pass"); $commande="cd $path_htpass; /usr/local/bin/htpasswd -b .admin_htpasswd $nick $pass"; exec("$commande"); } } } } } } } if ($change[$cpt]==9){ $query="UPDATE admin SET mail_request='$mail_request' WHERE id_user = $id_user"; $result = mysql_query($query) or die ("Requète non valide"); echo "<LI>$admin_modif_user_23"; } if ($change[$cpt]==10){ $query="UPDATE admin SET mail_purge='$mail_purge' WHERE id_user = $id_user"; $result = mysql_query($query) or die ("Requète non valide"); echo "<LI>$admin_modif_user_24"; } if ($change[$cpt]==11){ Guillaume Tournand <guillaume@tournand.com> September 2003 392/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $query="UPDATE admin SET mail_log='$mail_log' WHERE id_user = $id_user"; $result = mysql_query($query) or die ("Requète non valide"); echo "<LI>$admin_modif_user_25"; } if ($admin_side) { if ($change[$cpt]==12 && $nom){ $query="UPDATE users SET nom='$nom' WHERE users.id_user = $id_user"; $result = mysql_query($query) or die ("Requète non valide"); echo "<LI>$admin_modif_user_26 $nom"; } if ($change[$cpt]==13 && $prenom){ $query="UPDATE users SET prenom='$prenom' WHERE users.id_user = $id_user"; $result = mysql_query($query) or die ("Requète non valide"); echo "<LI>$admin_modif_user_27 $prenom"; } } } } ?> Guillaume Tournand <guillaume@tournand.com> September 2003 393/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project include/.htinclude_functions.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP // We include here the needed functions used on the website // fonction qui remplace ' par \' function strip_single_quote ($to_clean) { $longueur=strlen($to_clean); for ($i=0; $i<$longueur; $i++) { $char=substr($to_clean,$i,1); if ($char=="'"){ $cleaned="$cleaned\\$char"; } if ($char!="'") { $cleaned="$cleaned$char"; } } return $cleaned; } // Fonction qui vérifie un host function check_bad_host ($host) { $bad_host=0; $longueur=strlen($host); // test host; for ($i=0; $i<$longueur && !$bad_host; $i++) { $char=substr($host,$i,1); if (!eregi("^[a-z0-9-]+", $char) && $char != '.' && $char != '*') { $bad_host=1; } } return $bad_host; } // on retire les 0 inutiles devant un num d'identifiant function clean_id ($identifiant) { Guillaume Tournand <guillaume@tournand.com> September 2003 394/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $longueur=strlen($identifiant); for ($i=0, $prem_char=0; !$prem_char && $i<$longueur; $i++) { $prem_char=substr($identifiant,0,1); if (!$prem_char){ $longueur=strlen($identifiant); $identifiant=substr($identifiant,1,$longueur-1); } } return $identifiant; } // Fonction qui verifie que la string ne contienne pas d'espace function check_no_space ($string) { $bad_string='0'; $longueur=strlen($string); for ($i=0; $i<$longueur; $i++) { $char=substr($string,$i,1); if ($char==" ") { $bad_string='1'; } } return $bad_string; } // fonction qui supprime tout espace d'une adresse mail function strip_space ($to_clean) { $longueur=strlen($to_clean); for ($i=0; $i<$longueur; $i++) { $char=substr($to_clean,$i,1); if ($char!=" ") { $cleaned="$cleaned$char"; } } return $cleaned; } // fonction qui renvoit le pourcentage d'utilisation du projet function project_use ($egg_max_chan) { $result_chans = mysql_query("SELECT count(id_chan) from channels WHERE nom_chan!='loufiz'") or die ("Requete non valide"); $protected_chans=mysql_result($result_chans,0,"count(id_chan)"); $result_capacite=mysql_query("SELECT DISTINCT egg_bloc from eggdrops WHERE egg_bloc!='0' AND actif != '0'") or die ("Requete non valide"); $nb_bloc=mysql_num_rows($result_capacite); $chans_max=bcmul($nb_bloc,$egg_max_chan,2); $courrant=bcdiv($protected_chans, $chans_max, 2); $prct=bcmul($courrant,100,2); return $prct; } ?> Guillaume Tournand <guillaume@tournand.com> September 2003 395/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project include/.htinclude_shared_vars.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP // This file holds the list of the global shared variables // nb max de chans par eggdrop $egg_max_chan=10; // compte de demo $demo_id=719; $demo_channel="loufiz-demo"; // niveau min pour page liens $min_admin_level_link=7; // niveau min pour page management admins $min_admin_level_admin_mgmt=8; // niveau min pour voir pass Cservice eggdrop $min_admin_level_pass_cservice=9; ?> Guillaume Tournand <guillaume@tournand.com> September 2003 396/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project include/.htmysql <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP $server="localhost"; $login="root"; $password="DBAPasswd42" ;?> Guillaume Tournand <guillaume@tournand.com> September 2003 397/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project include/.htsession <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP // Set the session if ($PHPSESSID) { session_id("$PHPSESSID"); } session_start(); if (!isset ($lang) ) { // On detecte la langue du navigateur // si francais, pages en fr $langue_navigateur=$_SERVER["HTTP_ACCEPT_LANGUAGE"]; $langue_navigateur=strtolower("$langue_navigateur"); // Attention certains browsers francophonnes ont comme valeur fr-ca (par exemple), avec cette operation on est sur $langue_navigateur=substr($langue_navigateur,0,2); if (($langue_navigateur == 'fr') && !isset($lang)) { $lang='fr'; } // sinon en anglais if (!$lang) { $lang='en'; } session_register("lang"); } if (isset ($lang)) { if (isset ($section)) { require "include/$lang/.ht$section.php"; } } // require the functions list require 'include/.htinclude_functions.php'; // require the definitions Guillaume Tournand <guillaume@tournand.com> September 2003 398/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project require 'include/.htinclude_shared_vars.php'; ?> Guillaume Tournand <guillaume@tournand.com> September 2003 399/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project include/en/.hteggadmin.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP // variables globales $boutton_valider_annuler="<BR><DIV ALIGN='RIGHT'><INPUT TYPE='submit' VALUE='Submit'> <INPUT TYPE='reset' VALUE='Reset'></DIV>"; $boutton_logout="<DIV ALIGN='RIGHT'><FORM METHOD='POST' ACTION='logout.php'><INPUT TYPE='submit' VALUE='Logout'></FORM></DIV>"; $boutton_retour="<DIV ALIGN='RIGHT'><INPUT TYPE='submit' VALUE='Back'></DIV>"; // liste des acces $text_list_axs="Access list"; $text_list_lvl="Level"; $text_list_descr="Description"; $text_list_text="Details"; $text_list_rest="You cannot add, change, or delete a user with equal or higher access than your own."; // admin channels $admin_channels_1="<BR><BR><BR><CENTER><H3><B><U>Invalid channel name</U></B></H3></CENTER><BR><BR>"; $admin_channels_2="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Authentication error.</H3></U></B><BR><BR><BR> Please ensure that caps lock hasn't been enabled by misake, your login or password do not match.<BR><BR></CENTER>"; $text_channel="Channel"; $text_date_demande="Request date"; $text_date_support="Support date"; $text_id_owner="Owner Identifier"; $text_nom_channel="Channel name"; $text_channel_couvert="This channel is protected by the egg group"; $text_op_sup="<U>Additional operators/admins</U> :<BR><BR>"; $text_identifiant="Identifier"; $text_nick="Nick"; $text_username="Ident"; $text_op_level="Access"; $text_monitoring="Monitoring of this channel"; Guillaume Tournand <guillaume@tournand.com> September 2003 400/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $text_ajout_op="Add/remove an operator"; $boutton_ajout_op="<INPUT TYPE='submit' NAME='add' VALUE='Add'>"; $boutton_retrait_op="<INPUT TYPE='submit' NAME='rem' VALUE='Remove'>"; $text_modif_acces="Modify a user's access level"; $boutton_modif_access="<INPUT TYPE='submit' NAME='mod' VALUE='Change'>"; // confirmation admin channels $channels_err_1="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Authentication error.</H3></U></B><BR><BR><BR> Please ensure that caps lock hasn't been enabled by misake, your login or password do not match.<BR><BR></CENTER>"; $channels_err_2="Please click on one of the buttons supplied"; $channels_err_3="<BR><BR><CENTER><H3><B><U>The modifications will be effective in less than 2 minutes.</U></B></H3></CENTER><BR>"; $channels_err_4="The identifier you supplied"; $channels_err_4_1="is incorrect"; $channels_err_5="The identifier you supplied"; $channels_err_5_1="is already a channel operator"; $channels_err_5_2="is not a channel operator"; $channels_err_6="Please complete both of the identifier <B>and</B> access fields"; $channels_err_6_1="Please complete the identifier field"; $channels_err_7="You have insufficiant access to perform this operation"; $channels_err_8="Add the operator"; $channels_err_9="Changing the privileges for"; $channels_err_10="Removing the operator"; $channels_boutton_retour="<DIV ALIGN='CENTER'><FORM METHOD='POST' ACTION='channels.php?id_chan=$id_chan'><INPUT TYPE='submit' VALUE='Back'></FORM></DIV>"; $channels_err_11="The new access level you supplied is identical to the previous access level"; // administrer eggdrops $admin_egg_1="<BR><BR><BR><CENTER><H3><B><U>The bot name you supplied is invalid</U></B></H3></CENTER><BR><BR>"; $admin_egg_2="Eggdrop"; $admin_egg_3="Startup date"; $admin_egg_4="Present on"; $admin_egg_4_1="chan(s)."; $admin_egg_5="free channel(s)."; $admin_egg_6="IP Address"; $admin_egg_7="Hub bot"; $admin_egg_8="is part of the egg block N°"; $admin_egg_8_1="with :"; $admin_egg_9="list of channels protected by the block :"; $admin_egg_10="Server list of the svr-bloc N°"; $admin_egg_11="Leaf bots"; $admin_egg_12="Cservice password"; $admin_egg_13="The"; $admin_egg_14="Status :"; $admin_egg_15="connected to"; $admin_egg_16="disconnected"; // admin user $admin_user_1="<BR><BR><BR><CENTER><H3><B><U>Invalid user Identifier</U></B></H3></CENTER><BR><BR>"; $admin_user_2="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Authentication error.</H3></U></B><BR><BR><BR>Ensure that caps lock hasn't been enabled by misake, your login or password do not match.<BR><BR></CENTER>"; $admin_user_3="<B><U>User</U> : "; $admin_user_4="<B><U>Birth date</U> : <BR></B><B><U>Creation date</U> : </B><BR><BR>"; $admin_user_4_0="<B><U>Language</U> : </B>"; $admin_user_4_1="Number of requests"; $admin_user_4_2="Last modification"; Guillaume Tournand <guillaume@tournand.com> September 2003 401/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $admin_user_4_3="Number of logins"; $admin_user_5="<U>Last access</U>"; $admin_user_6="Nick"; $admin_user_7="E-mail address"; $admin_user_8="City"; $admin_user_9="Country"; $admin_user_10="<BR><BR><U>Recorded hosts</U> :<BR><BR>"; $admin_user_11="<BR><BR><B>Password change</B><BR><B>(6 characters minimum)<BR><BR>"; $admin_user_12="New password"; $admin_user_13="Confirmation"; $admin_user_14="is"; $admin_user_15="of the Loufiz project"; $admin_user_16="Channels where"; $admin_user_17="is <B>owner</B>"; $admin_user_18="is <B>operator/admin</B>"; $admin_user_19="Receive by mail :"; $admin_user_20="Eggdrops requests"; $admin_user_21="Channel purges"; $admin_user_22="Daily log"; $admin_user_23="Yes"; $admin_user_24="No"; // modif user $admin_modif_user_1="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Authentication error.</H3></U></B><BR><BR><BR> Ensure that Caps lock hasn't been enabled by misake, your login or password do not match.<BR><BR></CENTER>"; $admin_modif_user_2="<BR><BR><CENTER><H3><B><U>No change made</U></B></H3></CENTER><BR><BR>"; $admin_modif_user_2_0="<BR><BR>Your new password has to be at least 6 characters long.<BR><U>The password remains unchanged</U>"; $admin_modif_user_2_1="<BR><BR><BR>Your new password cannot contain spaces.<BR><U>The password remains unchanged</U>"; $admin_modif_user_3="<BR><BR><CENTER><H3><B><U>The modifications will be effective in less than 2 minutes.</U></B></H3></CENTER><BR>"; $admin_modif_user_4="The nick is now"; $admin_modif_user_5="The city is now"; $admin_modif_user_6="The country is now"; $admin_modif_user_7="The e-mail address is now"; $admin_modif_user_8="1st ident@host incorrect"; $admin_modif_user_9="The 1st ident@host is already recorded in your profile."; $admin_modif_user_10="Removing the 1st ident@host"; $admin_modif_user_11="The 1st ident@host is now"; $admin_modif_user_12="2nd ident@host incorrect"; $admin_modif_user_13="The 2nd ident@host is already recorded in your profile."; $admin_modif_user_14="Removing the 2nd ident@host"; $admin_modif_user_15="The 2nd ident@host is now"; $admin_modif_user_16="3rd ident@host incorrect"; $admin_modif_user_17="The 3rd ident@host is already recorded in your profile."; $admin_modif_user_18="Removing the 3rd ident@host"; $admin_modif_user_19="The 3rd ident@host is now"; $admin_modif_user_20="<LI>Error in the re-definition of your <I>password</I>. Pay attention to the password confirmation. <U>The password remains unchanged</U>"; $admin_modif_user_20_1="<LI>Error in the re-definition of your <I>password</I>. You cannot change the demo account password !</U>"; $admin_modif_user_21="<LI>The password has been updated"; $admin_modif_user_22="<DIV ALIGN='CENTER'><FORM METHOD='POST' ACTION='users.php?id_user=$id_user'><INPUT TYPE='submit' VALUE='Back'></FORM></DIV>"; $admin_modif_user_23="Switched status of the eggdrop request mail."; $admin_modif_user_24="Switched status of the purge mail."; $admin_modif_user_25="Switched status of the log mail."; $admin_modif_user_26="The last name is now :"; $admin_modif_user_27="The first name is now :"; Guillaume Tournand <guillaume@tournand.com> September 2003 402/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project // Page de retrait cessation <- Whatever the hell that means $retrait_cessation_1="<CENTER><H3><B><U>Invalid channel name</U></B></H3></CENTER>"; $retrait_cessation_1_1="<CENTER><H3><B><U>Please enter a new owner, or a reason to purge this channel.</U></B></H3></CENTER>"; $retrait_cessation_2="<CENTER><H2><B>Authentification error.</B></H2><BR><BR><H3><B><U>Ensure that caps lock hasn't been enabled by misake</U>, your login or password do not match.</B></H3></CENTER>"; $retrait_cessation_2_1="<CENTER><H2><B>Demo account</B></H2><BR><BR><H3><B><U>You cannot remove/give a channel using the demo account</U></B></H3></CENTER>"; $retrait_cessation_3="<CENTER><H3><B><U>The new owner confirmation is incorrect</U></B></H3></CENTER>"; $retrait_cessation_4="<CENTER><H3>You eggdrop withdraw has been recorded</H3><BR></CENTER>"; $retrait_cessation_5="<BR>The eggdrops "; $retrait_cessation_6="will be removed from <B>#$nom_chan</B> in less than 2 minutes."; $retrait_cessation_7="<CENTER><H3>The identifier LZ-$nouvel_owner is incorrect. You can't give him the channel.</H3><BR></CENTER>"; $retrait_cessation_8="<CENTER><H3>Your request to give #$nom_chan to LZ-$nouvel_owner has been recorded, and will be effective in less than 2 minutes.</H3><BR></CENTER>"; $retrait_cessation_9="<CENTER>Removing LZ-$nouvel_owner of the operator list<CENTER>"; $retrait_cessation_10="<CENTER><H3>the identifier LZ-$nouvel_owner is already the owner of this channel.</H3><BR></CENTER>"; $retrait_cessation_11="<DIV ALIGN='RIGHT'><FORM METHOD=POST ACTION='index.php'><INPUT TYPE='submit' VALUE='Back'></FORM></DIV>"; ?> Guillaume Tournand <guillaume@tournand.com> September 2003 403/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project include/en/.hteggdrops.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP //index.php $index="<BR> The Loufiz project's free and ad-less services offer the lent of 3 bots (eggdrop) on <a href='http://www.undernet.org' target='_new' class='lien'>Undernet</a>, to allow channel owner to secure their channel.<BR> These services and their help are available in English and French.<BR> <BR> <A HREF='/eggdrop/reglement.php?framed=1' class='lien' target='home'>Request :</A><BR> <LI>Read the conditions of service. <LI>Create an identifier. <LI>Make an eggdrop request. <BR><BR> <A HREF='/eggdrop/admin/' class='lien' target='home'>User login :</A><BR> <LI>Follow up your eggdrops request. <LI>Read the eggdrop commands list. <LI>Receive your identifier or password when forgotten. <LI>Administer your information, for example add/remove a host. <LI>Manage your channel: add/remove operators/admins. <LI>Find out the configuration of the lent eggdrops. <LI>Remove the eggdrops or give the channel to another user. <BR><BR> <U>Stay tuned</U> :<BR> <LI><A HREF='/big-brother/' class='lien' target='home'>Monitoring :</A> Live monitoring of our servers and their connections statistics. <LI><A HREF='/eggdrop/faq.php' class='lien' target='home'>FAQ :</A> The most frequent questions/answers. <LI><A HREF='/contact/' class='lien' target='home'>Contact :</A> contact the team. <LI><A HREF='/eggdrop/liens.php' class='lien' target='home'>Links :</A> know the other botlending projects. <BR><BR><BR> The Loufiz project's team will never ask your password or the operator status.<BR> The Loufiz project hasn't been designed to help out takeovers.<BR> "; Guillaume Tournand <guillaume@tournand.com> September 2003 404/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project //reglement.php $loufiz_plein="<BR><BR><CENTER><FONT COLOR=RED SIZE=+1>The <B>maximum number of channels</B> the Loufiz project can protect <B>is attained</B>.<BR><U>New eggdrops request cannot be granted.</U></FONT></CENTER>"; $reglement="<BR> <BR> <HR> <BR> <U>Here are the different steps to request your eggdrops from the Loufiz project</U> :<BR> <BR> <BLOCKQUOTE> <LI TYPE=disc>Read and accept the rules below <LI TYPE=disc>If you haven't created an identifier yet, proceed now by filling in the \"Identifier creation\" form <LI TYPE=disc>Fill in the \"Eggdrops request\" form with your Identifier. </BLOCKQUOTE> <BR> <BR> Then, <U>everything</U> you need to : <BLOCKQUOTE> <LI TYPE=disc>follow the evolution of your request <LI TYPE=disc>manage your profile <LI TYPE=disc>add/remove operators/admins <LI TYPE=disc>manage lent eggdrops </BLOCKQUOTE> is available at <A HREF='admin/' target='home' class='lien'>Eggdrops > User login</A>. <BR> <BR> <HR> <BR> <BR> <TABLE WIDTH='100%'><TR><TD COLSPAN='3'> <a href='#but' class='lien'>I - Loufiz project</a><br> <a href='#demandeur' class='lien'>II - User request</a><br> <a href='#regles1' class='lien'>III - Conditions on the lent eggdrop bots</a><br> <a href='#regles2' class='lien'>IV - Reminder</a><br> <a href='#nonrespect' class='lien'>V - Rules violation</a><br> <a href='#notions' class='lien'>VI - Important basics</a><br> <a href='#suppl' class='lien'>VII - Additional</a><br> <br> <br> <br> <br> <a name='but'>I - Loufiz project</a><br> <br> \"Splitproof\" ? <br> <UL>Keep your channel's rights for free, easily, and with no time limit !<br> Loufiz.com lends 3 (three) bots [eggdrops] for free for your channel on <a href='http://www.undernet.org' target='_new' class='lien'>Undernet</a>; whatever the commitement you have with <a href='http://cservice.undernet.org' target='_new' class='lien'>Cservice</a>.</UL> <br> <a name='demandeur'>II - User request</a><br> <UL> Loufiz.com blames Take-Overs (channel stealing by flooding or any other attack).<BR> So, only the channel owner is able to request bots. He's considered as the owner by the channel users. He's the channel funder or someone rightly entitled.<br> </UL> <br> <a name='regles1'>III - Conditions on the lent eggdrop bots</a><br> <br> The Loufiz project services are free, but users have to respect these conditions : <UL><LI TYPE=disc> Users aren't allowed to deop, kick or ban any of the Loufiz bots. <LI TYPE=disc> Other bots are tolerated only if they are \"controlled\" by their masters, and if the channel owner agrees with their presence. <LI TYPE=disc> For the rights and liberty respect, the channel should not be used for pornographic, paedophiliac, warez distribution purposes (music, softwares, movies and so on...) or any other rough or illegal reasons. Guillaume Tournand <guillaume@tournand.com> September 2003 405/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project <LI TYPE=disc> The user requesting the bot as to ensure that the other operators have read the present rules. <LI TYPE=disc> In case of a dispute, the owner is responsible. <LI TYPE=disc> <B>DO NOT give out your password or the operator status to anyone claiming to be a Loufiz project administrator.</B> We don't and won't NEED it.<BR> <LI TYPE=disc> If your channel is registered on <a href='http://cservice.undernet.org' target='_new' class='lien'>Cservice</a>, you have to create an access <B>100 AUTOMODE OP for each of the 3 eggdrops that are lent.</B> If your channel isn't registered on <a href='http://cservice.undernet.org' target='_new' class='lien'>Cservice</a>, these accesses must be created when you decide to register it. <LI TYPE=disc> Channel mustn't usually put these mode on : +i +k, or +l avoiding our eggdrops to join. <LI TYPE=disc> The channel must have <U>at least</U> 10 (ten) users; without clones or bots. </UL> <U>NOTE</U>: We don't lend bots to channels designed to help users on IRC. They have to be able to help themselves before trying to help other people.<br> <br> <br> <a name='regles2'>IV - Reminder</a><br> <br> On <a href='http://www.undernet.org' target='_new' class='lien'>Undernet</a>, <UL> <LI TYPE=disc> Any advertising is FORBIDDEN. <LI TYPE=disc> For the best readability and user-friendliness possible, please avoid to use over-colored or repetitive away-message scripts. </UL> <a href='http://www.undernet.org' target='_new' class='lien'>Undernet</a>'s AUP can be found at <A HREF='http://www.user-com.undernet.org/documents/' target ='_new' class='lien'>http://www.usercom.undernet.org/documents/</A>. <BR><BR> <br> <a name='nonrespect'>V - Rules violation</a><br> <br> The administration can, according to the fault severity, pronounced the following sanctions : <UL> <LI TYPE=disc> Warning. <LI TYPE=disc> Temporary suspension of eggdrop bots. <LI TYPE=disc> Channel purge. </UL> <br> <a name='notions'>VI - Important basics</a><br> <br><UL> <LI TYPE=disc> We consider that the channel operators have read and accepted the present conditions of service. <LI TYPE=disc> Loufiz project members help you but aren't at your disposal. <LI TYPE=disc> The Loufiz project is not responsible for anything happening in the protected channels. </UL> <br> <a name='suppl'>VII - Additional</a><br> <br> <UL> <LI TYPE=circle> <U>Channel</U>: chat room on <a href='http://www.undernet.org' target='_new' class='lien'>Undernet</A>.<BR> <BR> <LI TYPE=circle> <U>The owner</U>: the eggdrops requester, and the channel owner. <BR>-Web administration - has the ability to grant operator access to the channel users. <BR>-Channel operator.<BR> <BR> <LI TYPE=circle> <U>Chanop</U>: access given to an user by the channel owner. <BR>Channel operator.<BR> </UL> <BR><BR> </TD></TR>"; // validation $reglement_1="<TR><TD ALIGN='CENTER'> <FORM METHOD='POST' ACTION='index.php'> <INPUT TYPE='submit' VALUE='I refuse'></FORM> </TD><TD ALIGN='CENTER'> Guillaume Tournand <guillaume@tournand.com> September 2003 406/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project <FORM METHOD='POST' ACTION='identifiant.php'> <INPUT TYPE='submit' VALUE=\"I accept => identifier creation\"></FORM> </TD><TD ALIGN='CENTER'> <FORM METHOD='POST' ACTION='channel.php'> <INPUT TYPE='submit' VALUE=\"I accept => eggdrops request\"></FORM> </TD></TR>"; //demande d'eggdrops $conditions="<BR> <U>Conditions to fill in in order to borrow eggdrops :</U><BR> <BR> <LI>Having read and accepted the Loufiz project <A HREF='reglement.php' class='lien' target='fenetreimage' onclick='ouvrirfenetre()'>conditions of service</a>; the form validation involves user's agreement. <LI>Owning a channel <U>on undernet</U> with <U>at least</U> 10 (ten) users, without bots or clones. <LI>Having an identifier as LZ-X - an identifier is a unique figure allowing you to identify yourself on the web - (<A HREF='identifiant.php' target='home' class='lien'>Identifier creation</A>) <LI>filling in correctly the current channel request form <BR><BR>"; $formulaire_demande="<FORM METHOD='POST' ACTION='channel_confirm.php'> <TABLE WIDTH='100%' HEIGHT='50%' BORDER='0'> <TR ALIGN='LEFT' VALIGN='MIDDLE'><TD ALIGN='RIGHT'> Channel :</TD><TD ALIGN='LEFT' COLSPAN='2'> #<INPUT TYPE='text' NAME='nom_chan' SIZE=20 MAXLENGTH=120> </TR></TD><TR ALIGN='LEFT' VALIGN='MIDDLE'><TD ALIGN='RIGHT'> Identifier :</TD> <TD ALIGN='LEFT'> LZ-<INPUT TYPE='text' NAME='id_user' SIZE=4 MAXLENGTH=4></TD><TD ALIGN='LEFT'><A HREF='faq.php#8' target='home' class='lien'>What is an identifier ?</A> - <A HREF='identifiant.php' target='home' class='lien'>Identifier creation</A></TD></TR> <TR ALIGN='LEFT' VALIGN='MIDDLE'><TD ALIGN='RIGHT'> Identifier's password :</TD><TD ALIGN='LEFT'> <INPUT TYPE='password' NAME='pass' SIZE=10 MAXLENGTH=10></TD><TD ALIGN='LEFT'> <A HREF='admin/pass_perdu/' class='lien' target='home'><B>forgot your identifier or password?</B></A></TD> </TR><TR><TD ALIGN='RIGHT'> Observation :<BR>(Optional)</TD><TD ALIGN='LEFT' COLSPAN='2'> <TEXTAREA NAME='commentaire' ROWS='5' COLS='55'></TEXTAREA> </TD></TR> </TABLE> <BR><DIV ALIGN='RIGHT'> <INPUT TYPE='submit' VALUE='Submit'> <INPUT TYPE='reset' VALUE='Cancel'> </DIV> </FORM>"; //demande eggdrops confirmation $demande_err_1="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Please fill in all required areas</H3></U></B><BR><BR><BR> Your request can go NO further, you have to go back and take your time to fill in <U>every</U> little white rectangle.<BR><BR></CENTER> <FORM METHOD='POST' ACTION='channel.php'>"; $demande_err_2="<BR><BR><BR><BR><BR><B><U><CENTER><H3>The channel #$nom_chan isn't a valid channel name.</H3></U></B><BR><BR><BR> Channel name can only holds characters like : a-z, 0-9, -, ., _, &<BR> <BR>Your request can go NO further, you have to go back and correct it.<BR><BR></CENTER> <FORM METHOD='POST' ACTION='channel.php'>"; $demande_err_3="<BR><BR><BR><BR><BR><B><U><CENTER><H3>A channel request for the channel #$nom_chan already exists.</H3></U></B><BR><BR><BR> Your request can go NO further, you have to go back and choose another channel.<BR><BR></CENTER> <FORM METHOD='POST' ACTION='channel.php'>"; $demande_err_4="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Authentication error.</H3></U></B><BR><BR><BR> Guillaume Tournand <guillaume@tournand.com> September 2003 407/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Make sure Caps Lock isn't in use by mistake, the login/password doesn't match.<BR><BR></CENTER> <FORM METHOD='POST' ACTION='channel.php'>"; $demande_err_5="<BR><BR><BR><BR><BR><B><U><CENTER><H3>The channel #$nom_chan is in the blacklist. You cannot proceed to an eggdrops request.</H3></U></B><BR><BR><BR> Your request can go NO further, you have to go back and choose another channel.<BR><BR></CENTER> <FORM METHOD='POST' ACTION='channel.php'>"; $demande_err_5_1="<BR><BR><BR><BR><BR><B><U><CENTER><H3>An application for #$nom_chan has already been submitted and refused in the last 24 hours. You have to wait 24 hours in order to apply again.</H3></U></B><BR><BR><BR> Your request can go NO further.<BR><BR></CENTER> <FORM METHOD='POST' ACTION='channel.php'>"; $demande_err_6="<BR><BR><CENTER><FONT COLOR=RED SIZE=+1>The <B>maximum number of channels</B> Loufiz project can protect <B>is reached</B>.<BR><U>New eggdrops request cannot be granted.</U></FONT></CENTER><FORM METHOD='POST' ACTION='channel.php'>"; $demande_err_6_1="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Demo Account !</H3></U></B><BR><BR><BR> You cannot request eggdrops with the demo account.<BR><BR></CENTER> <FORM METHOD='POST' ACTION='channel.php'>"; $demande_ok="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Your request is being considered.</H3></U></B><BR><BR><BR> You can follow your request evolution in the <A HREF='admin/suivi_demandes.php' CLASS='lien' TARGET='home'>Manage / request follow-up</A> section<BR><BR><BR>"; $demande_valid="<CENTER><BR><BR><INPUT TYPE='submit' VALUE='Submit'></CENTER>"; // liste des commandes des eggdrops $commandes_header="<CENTER><U><H3>Command list of Loufiz project's eggdrops.</H3></U></CENTER>"; $commandes_desc="For these examples, we suppose that your channel name is #chan, your password is gloubilga, and your eggdrop - Lespaul - is present on the channel."; $commandes_head1="Command"; $commandes_head2="Syntax"; $commandes_head3="Example"; $commandes_head4="Description"; //creation d'identifiant $identifiant_1_1="<CENTER><H3><U>Identifier creation</U></H3> These datas will remain confidential and will be used only at your request.</CENTER>"; $identifiant_1_2_1="Last name :"; $identifiant_1_2_2="First name :"; $identifiant_1_2_3="Birthday :"; $identifiant_4_1="Nickname :"; $identifiant_4_1_1="City :"; $identifiant_4_2="Country :"; $identifiant_4_3="e-mail :"; $identifiant_4_4="If you don't know your ident@host, type <B>.ident@host</B> on #loufiz."; $identifiant_5="ident@host"; $identifiant_5_1="Type .ident@host in #Loufiz to find your ident@host."; $identifiant_5_2="Password"; $identifiant_5_3="Confirmation"; $identifiant_6="I assure on my honor, that the answers above are true; I have read and accepted the"; $identifiant_6_1="conditions of service"; $identifiant_6_2="of the Loufiz project, and I will commit myself to respect them."; $identifiant_7="<DIV ALIGN='RIGHT'> <INPUT TYPE='submit' VALUE=\"I accept\"> <INPUT TYPE='reset' VALUE=\"I refuse\"> </DIV> </FORM>"; //creation identifiant confirm Guillaume Tournand <guillaume@tournand.com> September 2003 408/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $identifiant_err_1="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Please attend to fill in every required area</H3></U></B><BR><BR><BR> Your request can go NO further, you have to go back and take your time to fill in <U>every</U> little white rectangles.<BR><BR></CENTER> <FORM METHOD='POST' ACTION='identifiant.php'>"; $identifiant_err_2="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Identifier error</H3></U></B><BR><BR><BR> The ident <I>$username</I> is incorrect, it can only holds characters like : a-z, 0-9, -, _, .<BR> <BR>Your request can go NO further, you have to go back and correct your ident.<BR><BR></CENTER> <FORM METHOD='POST' ACTION='identifiant.php'>"; $identifiant_err_3="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Host error</H3></U></B><BR><BR><BR> The host <I>$host1</I> is incorrect, it can only holds characters like : a-z, 0-9, -, .<BR> <BR>Your request can go NO further, you have to go back and correct your host.<BR><BR></CENTER> <FORM METHOD='POST' ACTION='identifiant.php'>"; $identifiant_err_4="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Password error</H3></U></B><BR> <BR><BR>Your <I>password</I> is too short.<P><B>It has to hold, at least, 6 (six) characters</B><BR><BR></CENTER> <FORM METHOD='POST' ACTION='identifiant.php'>"; $identifiant_err_5="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Password error</H3></U></B><BR><BR><BR> Your <I>password</I> confirmation is incorrect.<P>You have to re-type the same <I>password</I> in the <I>Confirmation</I> area. <BR><BR></CENTER> <FORM METHOD='POST' ACTION='identifiant.php'>"; $identifiant_err_6="<BR><BR><BR><BR><BR><B><U><CENTER><H3>A user with <I>$username</I> as <I>ident</I> already exists.</H3></U></B><BR><BR><BR> Your request can go NO further, you have to go back and choose another <I>ident</I>.<BR><BR></CENTER> <FORM METHOD='POST' ACTION='identifiant.php'>"; $identifiant_err_7="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Your <I>password</I> holds the *space* character.</H3></U></B><BR><BR><BR> Your request can go NO further, you have to go back and choose another <I>password</I>.<BR><BR></CENTER> <FORM METHOD='POST' ACTION='identifiant.php'>"; $identifiant_ok_1_1="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Your identifier has been created.</H3></U></B><BR><BR><BR><BR><BR><BR>"; $identifiant_ok_1_2="$nom $prenom, $ville ($pays), $amail, your identifier number is : <BR><B>LZ-"; $identifiant_ok_2="<BR><u>Please note this identifier</u>, it will be required to manage your eggdrops</B><BR><BR> You can manage your datas and channels in the <A HREF='admin/index.php' CLASS='lien' TARGET='home'>Manage</A> section.<BR><BR>Click on 'Submit' to request eggdrops for a channel. <FORM METHOD='POST' ACTION='channel.php'></CENTER>"; $identifiant_valid="<CENTER><BR><BR><INPUT TYPE='submit' VALUE='Submit'></CENTER>"; //liens $liens_1="<CENTER><U><H3>Channels and web site associations offering eggdrop lending.</H3></U></CENTER><BR> <TABLE ALIGN='CENTER' WIDTH='800' BORDER='0'><TR ALIGN='CENTER'><TH>Channel<BR><BR></TH><TH>Web address<BR><BR></TH></TR>"; $liens_2="<BR><BR><CENTER><U><H3>Loufiz project partners.</H3></U></CENTER>"; $liens_3="<BR><BR><DIV ALIGN='RIGHT'>The Loufiz project isn't responsible for these websites.</DIV>"; $lien_loufiz="<BR><BR><BR><CENTER><U><H3>Put in a link to the Loufiz project's web site.</H3></U></CENTER> <BR><U>Banner 88x31 of the Loufiz project</U> : <A HREF='http://www.loufiz.com/' TARGET='new' CLASS='lien'><IMG SRC='https://www.loufiz.com/images/loufiz_banner_88_31.gif' BORDER='0' ALT='Loufiz project'></A><BR><BR> Copy these lines into the web site's HTML source where you want to put a link to the Loufiz project's web site :<BR> <pre> &lt;!-- www.loufiz.com --&gt; &lt;A HREF='http://www.loufiz.com/' TARGET='new'&gt; &lt;IMG SRC='http://www.loufiz.com/images/loufiz_banner_88_31.gif' BORDER='0' ALT='Loufiz project'&gt; Guillaume Tournand <guillaume@tournand.com> September 2003 409/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project &lt;/A&gt; &lt;!-- www.loufiz.com --&gt; </pre>"; // frame demande eggdrops/creation identifiant $frame_1="Identifier creation"; $frame_2="Eggdrops request"; // index administrer $body_administrer_1="<TABLE ALIGN='CENTER' WIDTH='100%' HEIGHT='575'><TR><TD COLSPAN=2 ALIGN='CENTER'> The <a href='suivi_demandes.php' target='home' class='lien'>request follow-up</a> allows you to follow your eggdrops request evolution.<BR><BR> To remove eggdrops, <U>or</U> to give the channel to an another user : <A HREF='../retrait/index.php' target='home' class='lien'>Withdrawal of eggdrops</A><HR> </TD></TR> <TR><TD COLSPAN='2'><BR></TD></TR> <TR VALIGN='TOP'><TD ALIGN='CENTER' COLSPAN='2'> <H3><B><U>Your user profile and channel(s)</U></B></H3 <BR>By authenticating yourself here, you will be able to modify your hosts, nick, email address, to define a new password, and to see which channel(s) you are operator of.<BR> Besides, if you are a channel owner, or an admin, you can manage your channel here, and see in details the description of lent eggdrops. <BR><BR><BR> <FORM METHOD='POST' ACTION='users.php'> <BLOCKQUOTE> <TABLE BORDER='0'> <TR><TD ALIGN='RIGHT'>Identifier : </TD> <TD ALIGN='left'> LZ-<INPUT TYPE='text' NAME='id_user' SIZE=5 MAXLENGTH=5> </TD></TR> <TD ALIGN='RIGHT'>Password : </TD> <TD ALIGN='LEFT'> <INPUT TYPE='password' NAME='user_pass' SIZE=20 MAXLENGTH=20> </TD></TR> </TABLE> </BLOCKQUOTE><CENTER><BR> <INPUT TYPE='submit' VALUE='Submit'> <INPUT TYPE='reset' VALUE='Cancel'> </CENTER></FORM> </TD></TR> <TR><TD></TD><TD ALIGN='RIGHT'><A HREF='pass_perdu/' class='lien' target='home'><B>Forgot your identifier or password?</B></A><BR><BR> </TD></TR> <TR><TD COLSPAN='2' VALIGN='CENTER' ALIGN='CENTER'> <HR><H3><A HREF='../commandes.php' class='lien' target='home'>Command list</A> for Loufiz project's eggdrops.</H3>"; $body_administrer_2="</TR></TD> </TABLE>"; // variables globales $boutton_valider_annuler="<BR><DIV ALIGN='RIGHT'><INPUT TYPE='submit' VALUE='Submit'> <INPUT TYPE='reset' VALUE='Reset'></DIV></FORM>"; $boutton_logout="<DIV ALIGN='RIGHT'><FORM METHOD='POST' ACTION='logout.php'><INPUT TYPE='submit' VALUE='Logout'></FORM></DIV>"; //page logout $logout_body="<BR><BR><BR><BR><HR><BR><BR><BR><H3><CENTER>The un-authentication operation was successfull, you will be redirected to the homepage in 3 seconds.</CENTER></H3>"; Guillaume Tournand <guillaume@tournand.com> September 2003 410/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project // Suivi demandes login $suivi_login_body="<BR><BR><BR><HR><BR><BR> <CENTER><H3><B><U>Request follow-up</U></B></H3></CENTER> <BR><BR> This section allows you to follow up your eggdrops requests. <BR><BR><BR> <BR> <FORM METHOD='POST' ACTION='suivi_bot.php'> <CENTER> <B>Channel name</B> : #<INPUT TYPE='text' NAME='nom_chan' SIZE=20 MAXLENGTH=120><BR> <BR> <INPUT TYPE='submit' VALUE='Submit'> <INPUT TYPE='reset' VALUE='Cancel'> </CENTER> </FORM> <BR><BR><BR><HR>"; // page de suivi des demandes $suivi_demandes_1="<CENTER><H3><B><U>The channel #$nom_chan hasn't been found in the database</U></B></H3></CENTER>"; $suivi_demandes_2_1="Eggdrops request follow up for #$nom_chan"; $suivi_demandes_3="validated"; $suivi_demandes_4="Your request hasn't been processed by an administrator"; $suivi_demandes_5="refused"; $suivi_demandes_5_1="channel purged"; $suivi_demandes_6="Eggdrops request"; $suivi_demandes_7="on"; $suivi_demandes_8="by"; $suivi_demandes_9="<U>Status</U>:"; $suivi_demandes_10="Reason"; $suivi_demandes_11="<B><U>Warning</U></B> : The applicant's ident@host may be incorrect!<BR>He has to visit the <A HREF='index.php' target='home' class='lien'>Manage</A> section to correct it."; $suivi_demandes_12="<FONT COLOR=red><B><U>Warning</U></B> : The channel #$nom_chan was added to the blacklist, so noone can request eggdrops for it.</FONT>"; $suivi_demandes_13="<DIV ALIGN='RIGHT'><FORM METHOD=POST ACTION='index.php'><INPUT TYPE='submit' VALUE='Return'></FORM></DIV>"; $suivi_demandes_14="The eggdrops have been removed, according to the channel owner request"; // index retrait cessation $index_retrait_body_1="Withdraw Loufiz project's eggdrops or give a channel to another user."; $index_retrait_body_3="Identifier"; $index_retrait_body_4="Password"; $index_retrait_body_5="Channel"; $index_retrait_body_6="If you want to give this channel to another user enter his identifier here.<BR>Else, leave these areas empty."; $index_retrait_body_7="New owner"; $index_retrait_body_8="Confirmation"; $index_retrait_body_9="Submit"; $index_retrait_body_10="Reset"; // Page de retrait cessation // se trouve dans le fichier .hteggadmin.php // Index pass perdu $index_pass_perdu="<BR><BR><BR><HR><BR> <CENTER><H3><B>Forgotten password</B></H3></CENTER><BR><BR> Your password can be sent via e-mail. Please, enter :<BR> Guillaume Tournand <guillaume@tournand.com> September 2003 411/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project <LI>your ident <B>or</B> your Identifier. <LI>the registered e-mail address on the Loufiz project. <BR><BR> You can ask for your password only once a day.<BR> <BR><BR> <FORM METHOD='POST' ACTION='pass_perdu.php'> <BLOCKQUOTE> <TABLE BORDER='0' WIDTH='60%' ALIGN='CENTER'> <TR> <TD ALIGN='right'>Ident :</TD> <TD ALIGN='left'> <INPUT TYPE='text' NAME='username' SIZE='10' MAXLENGTH='10'> </TD> <TD ALIGN='right'><B>or</B> Identifier :</TD> <TD ALIGN='left'> LZ-<INPUT TYPE='text' NAME='id_user' SIZE='5' MAXLENGTH='5'> </TD></TR> <TD ALIGN='right' colspan='2'>E-mail : </TD> <TD ALIGN='LEFT' colspan='2'> <INPUT TYPE='text' NAME='amail' SIZE='35' MAXLENGTH='35'> </TD></TR> </TABLE> </BLOCKQUOTE> <BR><BR> <DIV ALIGN='RIGHT'> <INPUT TYPE='submit' VALUE='Submit'> <INPUT TYPE='reset' VALUE='Reset'> </DIV> </FORM> <DIV ALIGN='RIGHT'><FORM METHOD='POST' ACTION='../index.php'> <INPUT TYPE='submit' VALUE='Back'></DIV> <BR><BR><HR>"; // Pass perdu $pass_perdu_1="<BR><BR><B><U><CENTER><H3>Fill in every required areas</H3></U></B><BR><BR><BR>Your request can't go no further, you have to go back and take your time to fill in <U>every</U> little white rectangles.<BR><BR></CENTER>"; $pass_perdu_2="<BR><BR><B><U><CENTER><H3>No identifier/ident matches the given email</H3></U></B><BR><BR><BR>Your request can't go on further.<BR><BR></CENTER>"; $pass_perdu_3="<BR><BR><B><U><CENTER><H3>Your password has already been sent to you within the past 24 hours.</H3></U></B><BR><BR><BR>Your request can't go on further.<BR><BR></CENTER>"; $pass_perdu_4_1="<BR><BR><B><U><CENTER><H3>Identifier password"; $pass_perdu_4_2="has been sent to the e-mail"; $pass_perdu_5="[www.loufiz.com] identifier and password"; $pass_perdu_6="The"; $pass_perdu_7="identifier"; $pass_perdu_8="asked for his password to be sent via his e-mail. His password is"; $pass_perdu_9="<DIV ALIGN='RIGHT'><FORM METHOD='POST' ACTION='index.php'><INPUT TYPE='submit' VALUE='Return'></DIV>"; // FAQ $faq_head="List of the frequently asked questions."; $faq_sect1="The web interface"; $faq_sect2="Conditions of service"; $faq_sect3="X / Cservice"; $faq_sect4="Eggdrops use"; $faq_sommaire="Summary"; ?> Guillaume Tournand <guillaume@tournand.com> September 2003 412/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project include/en/.htteam.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP // variables globales $boutton_retour="<DIV ALIGN='RIGHT'><INPUT TYPE='submit' VALUE='Back'></DIV>"; $boutton_valider_annuler="<DIV ALIGN='RIGHT'><INPUT TYPE='submit' VALUE='Submit'> <INPUT TYPE='reset' VALUE='Reset'></DIV>"; // page d'index d'administration $administration_index_1="Data base administration :"; $administration_index_2="Database search."; $administration_index_3_1="There are"; $administration_index_3_2="registered users."; $administration_index_4_1="Loufiz protects"; $administration_index_4_2="channel(s)."; $administration_index_5_1="There are"; $administration_index_5_2="blacklisted channel(s)."; $administration_index_5_3="There are no blacklisted channel."; $administration_index_7="No new eggdrops request."; $administration_index_8_1="There is/are"; $administration_index_8_2="new eggdrops request(s)."; $administration_index_9_2="instruction(s) waiting for the botnet."; $administration_index_9_3="No instruction waiting for the botnet."; $administration_index_10="Project management"; $administration_index_11="Add/remove administrators."; $administration_index_12="Loufiz stats"; $administration_index_13="The Loufiz project runs at"; $administration_index_14_1="There are"; $administration_index_14_2="comments."; $administration_index_15_1="free:"; $administration_index_15_2="chan(s)"; $administration_index_16="Channel control room"; $administration_index_17="Channel monitoring system"; $administration_index_18="Doc. on the channel monitoring system"; $administration_index_19="List of the bot rejection reasons"; $administration_index_21="List of administrators"; $administration_index_22="Statistics of the web server http://www.loufiz.com/ (english)"; Guillaume Tournand <guillaume@tournand.com> September 2003 413/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $administration_index_23="<INPUT TYPE='submit' VALUE='Refresh'>"; $administration_index_24="Update the link page."; $administration_index_25="Synchro database => eggdrops"; // update link page $update_link_1="Channels and websites of organizations who offer bot lending services."; $update_link_2="Add a link"; $update_link_3="Channel"; $update_link_4="Web site"; $update_link_5="Order"; $update_link_6="Remove a link"; $update_link_7="id_link"; $update_link_8="Channel"; $update_link_9="Web address"; $update_link_10="Order"; $update_link_11="Link added"; $update_link_12="Link already present"; $update_link_13="Link removed"; $update_link_14="Link non-existant"; $update_link_15="Loufiz project partners."; $update_link_16="Add a banner"; $update_link_17="Remove a banner"; $update_link_18="Web address"; $update_link_19="Image source"; $update_link_20="Description (optional)"; $update_link_21="id"; $update_link_22="Banner"; $update_link_submit="<INPUT TYPE='submit' VALUE='Submit'>"; // All chans $all_chans_1="List of protected channels"; $all_chans_2="name"; $all_chans_3="Identifier owner"; $all_chans_4="nb op"; $all_chans_5="nb admin"; $all_chans_6="nb s. admin"; $all_chans_7="support date"; // all users $all_users_1="List of registered users"; $all_users_1_1="Identifier"; $all_users_2="last name"; $all_users_3="first name"; $all_users_4="country"; $all_users_5="birth date"; $all_users_6="ident"; $all_users_7="registration date"; $all_users_8="Previous"; $all_users_9="Next"; //Monitoring des channels $chan_monitoring_1="Channel monitoring system"; $chan_monitoring_2="Channel"; $chan_monitoring_2_1="Lang"; $chan_monitoring_3="Nb report"; $chan_monitoring_4="Nb egg op"; $chan_monitoring_5="deop since"; $chan_monitoring_6="User 1"; $chan_monitoring_7="User1 since"; $chan_monitoring_8="User 2"; $chan_monitoring_9="User2 since"; Guillaume Tournand <guillaume@tournand.com> September 2003 414/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $chan_monitoring_10="User 3"; $chan_monitoring_11="User3 since"; $chan_monitoring_12="X"; $chan_monitoring_13="X since"; $chan_monitoring_14="Axs X"; $chan_monitoring_15="Axs since"; $chan_monitoring_16="Nb OP mode"; $chan_monitoring_17="Update"; $chan_monitoring_18="Purge"; $chan_monitoring_19="d."; $chan_monitoring_19_1="H."; $chan_monitoring_20="Present"; $chan_monitoring_21="Absent"; $chan_monitoring_22="minimum users requested"; $chan_monitoring_23_1="maximum time with insufficiant users"; $chan_monitoring_23_2="days"; $chan_monitoring_23_3="hours"; $chan_monitoring_24="maximum time for deopped eggdrops"; $chan_monitoring_25="maximum time for a channel without one access 100 per eggdrop"; $chan_monitoring_26="<INPUT TYPE='submit' VALUE='Purge'>"; // Chan monitoring doc // Nb automode op = <LI>from these access <font color='#333399'><B>Nb op mode</B></font> are in AUTOMODE OP<BR> $chan_monitoring_doc="<BR><BR><HR><BR> <CENTER><H3><B>Documentation of the table : Channel monitoring system</B></H3></CENTER> <BR> This table of the channel monitoring system enables project administrators to see on a single table if the protected channels match our conditions of service.<BR> This table has to be read from left to right, and each 'since' column refers to the column to its left.<BR> <BR><BR> So : the channel <font color='#333399'><B>Channel</B></font>, whose owner choosed language <font color='#333399'><B>Lang</B></font>, where <font color='#333399'><B>Nb report</B></font> eggdrops has come to report, has :<BR><BR> <LI><font color='#333399'><B>Nb egg op</B></font> oped eggdrops on the channel<BR> <LI>deop since : <font color='#333399'><B>deop since</B></font><BR> <LI>the eggdrop N°1 says there are <font color='#333399'><B>User 1</B></font> present users on the channel <LI>this number is under the minimal number of users that the conditions of service requests since : <font color='#333399'><B>User1 since</B></font> days<BR> <LI>the eggdrop N°2 says there are <font color='#333399'><B>User 2</B></font> present users on the channel <LI>this number is under the minimal number of users that the conditions of service requests since : <font color='#333399'><B>User2 since</B></font> days<BR> <LI>the eggdrop N°3 says there are <font color='#333399'><B>User 3</B></font> present users on the channel <LI>this number is under the minimal number of users that the conditions of service requests since : <font color='#333399'><B>User3 since</B></font> days<BR> <LI>on this channel, X is <font color='#333399'><B>X</B></font><BR> <LI>the state of presence of X is the same since : <font color='#333399'><B>X since</B></font> days <LI>there are <font color='#333399'><B>Axs X</B></font> access on X (at least 100) for the eggdrops<BR> <LI>this number of access remains the same since <font color='#333399'><B>Axs since</B></font> days<BR> <LI>the information for this channel have been updated the : <font color='#333399'><B>Update</B></font><BR> <BR><BR> When a value (oped eggdrops number, users number, access or X automode) are <B>under</B> what is requested by the conditions of service, this value is displayed in <font color='red'>red</font>. The channel becomes <I>purgeable</I> when this value stayed <B>under</B> the limit for too long. At this time, a button appears in the <font color='#333399'><B>Purge</B></font> column. Press this button and the channel will be purged.<BR> <BR> The values are updated every 2 hours. They can be perturbed by facts independent to our will, like lag.<BR> <BR> <B>Note :</B> before purging a channel because all the access haven't been properly set on X, please contact the channel owner, before the <B>Purge</B> button appears."; // Commentaires $commentaires_1="List of the comments"; Guillaume Tournand <guillaume@tournand.com> September 2003 415/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $commentaires_2="Identifier"; $commentaires_3="Channel"; $commentaires_4="date"; $commentaires_5="comment"; $commentaires_6="Previous"; $commentaires_7="Next"; // demandes channels $demandes_channels_1="The "; $demandes_channels_2="Channel"; $demandes_channels_3="Comment"; $demandes_channels_4_1="REJECT"; $demandes_channels_4_2="VALIDATION"; $demandes_channels_5="blacklist channel"; $demandes_channels_6="free"; $demandes_channels_7="ident@host warning"; $demandes_channels_8="Report"; $demandes_channels_9="ignore for 24H"; $demandes_channels_10="Language"; // demandes channel confirm $demande_channel_confirm_0="Refused"; $demande_channel_confirm_1="Reason"; $demande_channel_confirm_2="Warning"; $demande_channel_confirm_3="The channel has been blacklisted."; $demande_channel_confirm_4="Valid"; $demande_channel_confirm_5="Your ident@host is probably incorrect !<BR>To correct it, click on the 'User login' section."; $demande_channel_confirm_6="Select at least one request"; // Liste des helpers et des admins $liste_helpers_1="List of Helpers and Administrators"; $liste_helpers_2="User"; $liste_helpers_3="Nickname"; $liste_helpers_4="Entrance date"; $liste_helpers_5="Task"; // Liste des refus $liste_refus="Table of rejection reasons"; // Index management $index_management_1="<TABLE BORDER='0' ALIGN='CENTER' WIDTH='100%'><TR><TD ALIGN='CENTER' VALIGN='TOP' WIDTH='49%'> <BR><H3><B><U>User administration</U></B></H3><BR> <FORM METHOD='POST' ACTION='users.php'> <BLOCKQUOTE> <TABLE BORDER='0' WIDTH='70%'> <TR><TD>User Identifier :</TD> <TD ALIGN='left'> LZ-<INPUT TYPE='text' NAME='id_user' SIZE=5 MAXLENGTH=5> </TD></TR> <TR><TD><B>Or</B> ident:</TD> <TD ALIGN='left'> <INPUT TYPE='text' NAME='username' SIZE=10 MAXLENGTH=10> </TD></TR> </TABLE> </BLOCKQUOTE> <INPUT TYPE='submit' VALUE='Submit'> <INPUT TYPE='reset' VALUE='Reset'> </FORM> Guillaume Tournand <guillaume@tournand.com> September 2003 416/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project </TD><TD ALIGN='CENTER' VALIGN='TOP'> <BR><H3><B><U>Channel administration</U></B></H3> <BR> <FORM METHOD='POST' ACTION='channels.php'> <BLOCKQUOTE> <TABLE BORDER='0' WIDTH='85%'> <TR><TD>Channel name :</TD> <TD ALIGN='right'> #<INPUT TYPE='text' NAME='nom_chan' SIZE=25 MAXLENGTH=120> </TD></TR> </TABLE> </BLOCKQUOTE> <INPUT TYPE='submit' VALUE='Submit'> <INPUT TYPE='reset' VALUE='Reset'> </FORM> </TD></TR><TR><TD COLSPAN=2 ALIGN='CENTER' VALIGN='CENTER'> <H3><B><U>Eggdrop card consultation</U></B></H3><BR> <FORM METHOD='POST' ACTION='eggdrops.php'> <BLOCKQUOTE> <TABLE BORDER='0' WIDTH='40%'> <TR><TD>Eggdrop name :</TD> <TD ALIGN='right'> <INPUT TYPE='text' NAME='nom' SIZE=20 MAXLENGTH=20> </TD></TR> </TABLE> </BLOCKQUOTE> <INPUT TYPE='submit' VALUE='Submit'> <INPUT TYPE='reset' VALUE='Reset'> </FORM> </TD></TR><TR><TD COLSPAN=2><HR></TD></TR><TR><TD ALIGN='CENTER' VALIGN='TOP'> <FONT COLOR=RED size='+1'><B><U>Purge a channel :</U></B></FONT><BR><BR> <DIV ALIGN='LEFT'>If you want to <U>give</U> this channel to another user, enter <U>his</U> identifier number here, otherwise, leave this empty.</DIV></TD> <TD ALIGN='CENTER' VALIGN='CENTER'><BR> <FORM METHOD='POST' ACTION='retrait_cessation.php'> <TABLE BORDER='0' WIDTH='95%> <TR ALIGN='right'><TD><FONT COLOR=RED>Channel name :</FONT></TD> <TD ALIGN='right'> <FONT COLOR=RED>#</FONT><INPUT TYPE='text' NAME='nom_chan' SIZE=25 MAXLENGTH=120> </TD></TR> <TR><TD>Purge reason :</TD> <TD ALIGN='right'>"; $index_management_2="</TD></TR> <TD><B>or </B>new owner :</TD><TD ALIGN='right'>LZ-<INPUT TYPE='text' NAME='nouvel_owner' SIZE=5 MAXLENGTH=5></TD></TR></TABLE> <BR><INPUT TYPE='submit' VALUE='Submit'> <INPUT TYPE='reset' VALUE='Reset'> </FORM> </TD></TR> </TABLE>"; $index_management_3="Purge reason"; // index admin management $admin_mgmt_index_1="<B>Add/modify</B> a member"; $admin_mgmt_index_2="<B>Remove</B> a member"; $admin_mgmt_index_3="<BR><BR><CENTER>The following access on the <B>bots</B> <U>will have to be created as well</U> :</CENTER> <UL> <LI> <B>X</B> /msg x adduser #loufiz &#60;username&#62; 200 <LI> <B>FrosT</B> FrosT add &#60;nick&#62; 200 <BR><BR> To change the ident@host of an user in FrosT, use the command <I>FrosT add</I>.<BR> Type <I>FrosT help add</I> for more details. </UL>"; $admin_mgmt_index_4="You don't have the authorization to enter here."; $admin_mgmt_index_5="No administration level has been found for you."; Guillaume Tournand <guillaume@tournand.com> September 2003 417/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $admin_mgmt_index_6="Choose a task"; // admin management retrait $admin_mgmt_retrait_1="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Please, type a value in the identifier area.</H3></U></B><BR><BR><BR>Your request can't go on further, you have to go back and fill in the little white rectangle.<BR><BR></CENTER>"; $admin_mgmt_retrait_2="<BR><BR><BR><BR><BR><B><U><CENTER><H3>The user LZ-$id_user isn't an administrator.</H3></U></B><BR><BR><BR>Your request can't go on further, you have to go back and choose an administrator's user identifier.<BR><BR></CENTER>"; $admin_mgmt_retrait_3="<BR><BR><BR><BR><BR><B><U><CENTER><H3>You don't have sufficient privileges to modify/remove the user LZ-$id_user from the administrators list.</H3></U></B><BR><BR><BR>Your request can't go on further.<BR><BR></CENTER>"; $admin_mgmt_retrait_4="<BR><BR><BR><BR><BR><B><U><CENTER><H3>The user LZ-$id_user has been deleted from the administrators list.</H3></U></B><BR><BR><BR>"; // admin management ajout $admin_mgmt_ajout_1="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Please, type a value in the identifier area.</H3></U></B><BR><BR><BR>Your request can't go on further, you have to go back and fill in the little white rectangle.<BR><BR></CENTER>"; $admin_mgmt_ajout_2="<BR><BR><BR><BR><BR><B><U><CENTER><H3>user isn't valid.</H3></U></B><BR><BR><BR>Your request can't go on further, you have to go back and choose an identifier from a valid user.<BR><BR></CENTER>"; $admin_mgmt_ajout_3="<BR><BR><BR><BR><BR><B><U><CENTER><H3>You haven't set a task for LZ$id_user.</H3></U></B><BR><BR><BR>Your request can't go on further, you have to go back and grant him a task.<BR><BR></CENTER>"; $admin_mgmt_ajout_4="<BR><BR><BR><BR><BR><B><U><CENTER><H3>The user LZ-$id_user has been added to the administrators list.</H3></U></B><BR><BR><BR>"; $admin_mgmt_ajout_5="The user LZ-$id_user has now :<BR><BR><LI>a global operator access on the eggdrops<LI>access on the Administration section (his login is his nick)<LI>an e-mail @loufiz.com<LI>been added in the mailing-list eggdrops@loufiz.com<LI>been added in the contact section"; $admin_mgmt_ajout_6="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Changes on LZ-$id_user have been made.</H3></U></B><BR><BR><BR>"; $admin_mgmt_ajout_7="<BR><BR><BR><BR><BR><B><U><CENTER><H3>The nick of LZ-$id_user has to be changed in order to be added as an admin.</H3></U></B><BR><BR><BR>Your request can't get on further, you have to go back and change his/her nick for alphanumerical characters only.<BR><BR></CENTER>"; // index blacklist $blacklist_index_1="<B>Add</B> a channel to the blacklist"; $blacklist_index_2="<B>Remove</B> a channel from the blacklist"; $blacklist_index_3="List of blacklisted channels"; $blacklist_index_3_1="Channel"; $blacklist_index_3_2="Admin"; $blacklist_index_4="Date"; $blacklist_index_5="Channel"; $blacklist_index_6="Admin"; $blacklist_index_7="Reason"; $blacklist_index_8="<INPUT TYPE='submit' VALUE='Add'>"; $blacklist_index_9="<INPUT TYPE='reset' VALUE='Reset'>"; $blacklist_index_10="<INPUT TYPE='submit' VALUE='Remove'>"; $blacklist_index_11="<INPUT TYPE='submit' VALUE='Select'>"; // ajout blacklist $blacklist_ajout_1="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Please type a channel name and a reason.</H3></U></B><BR><BR><BR>Your request can't go on further, you have to go back and fill in every little white fields.<BR><BR></CENTER>"; $blacklist_ajout_2="<BR><BR><BR><BR><BR><B><U><CENTER><H3>The channel #$nom_chan isn't a valid channel name.</H3></U></B><BR><BR><BR>Your request can't go on further, you have to go back and choose another channel name.<BR><BR></CENTER>"; $blacklist_ajout_3="<BR><BR><BR><BR><BR><B><U><CENTER><H3>The channel #$nom_chan is already in the blacklist.</H3></U></B><BR><BR><BR>Your request can't go on further, you have to go back and choose a channel that isn't present on the list already.<BR><BR></CENTER>"; Guillaume Tournand <guillaume@tournand.com> September 2003 418/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $blacklist_ajout_4="<BR><BR><BR><BR><BR><B><U><CENTER><H3>The channel #$nom_chan has successfully been added to the blacklist.</H3></U></B><BR><BR><BR>"; // retrait blacklist $blacklist_retrait_1="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Please type a channel name.</H3></U></B><BR><BR><BR>Your request can't go on further, you have to go back and fill up the field.<BR><BR></CENTER>"; $blacklist_retrait_2="<BR><BR><BR><BR><BR><B><U><CENTER><H3>The channel #$nom_chan isn't a valid channel name.</H3></U></B><BR><BR><BR>Your request can't go on further, you have to go back and choose another channel.<BR><BR></CENTER>"; $blacklist_retrait_3="<BR><BR><BR><BR><BR><B><U><CENTER><H3>The channel #$nom_chan isn't in the blacklist.</H3></U></B><BR><BR><BR>Your request can't go on further, you have to go back and choose a channel present on the list.<BR><BR></CENTER>"; $blacklist_retrait_4="<BR><BR><BR><BR><BR><B><U><CENTER><H3>The channel #$nom_chan has been deleted from the blacklist.</H3></U></B><BR><BR><BR>"; ?> Guillaume Tournand <guillaume@tournand.com> September 2003 419/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project include/fr/.hteggadmin.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP // variables globales $boutton_valider_annuler="<BR><DIV ALIGN='RIGHT'><INPUT TYPE='submit' VALUE='Valider'> <INPUT TYPE='reset' VALUE='Annuler'></DIV>"; $boutton_logout="<DIV ALIGN='RIGHT'><FORM METHOD='POST' ACTION='logout.php'><INPUT TYPE='submit' VALUE='Logout'></FORM></DIV>"; $boutton_retour="<DIV ALIGN='RIGHT'><INPUT TYPE='submit' VALUE='Retour'></DIV>"; // liste des acces $text_list_axs="Liste des accès"; $text_list_lvl="Level"; $text_list_descr="Description"; $text_list_text="Détails"; $text_list_rest="Vous ne pouvez pas ajouter, modifier, supprimer un accès supérieur ou égal au votre."; // admin channels $admin_channels_1="<BR><BR><BR><CENTER><H3><B><U>Nom de channel invalide</U></B></H3></CENTER><BR><BR>"; $admin_channels_2="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Erreur d'authentification.</H3></U></B><BR><BR><BR> Assurez vous que Ver. Maj. n'est pas activé par erreur, le mot de passe ne correspond pas au login.<BR><BR></CENTER>"; $text_channel="Channel"; $text_date_demande="Date de demande"; $text_date_support="Date de support"; $text_id_owner="Identifiant propriétaire"; $text_nom_channel="Nom du channel"; $text_channel_couvert="Ce channel est couvert par le groupe d'egg"; $text_op_sup="<U>Opérateurs/admins supplémentaires</U> :<BR><BR>"; $text_identifiant="Identifiant"; $text_nick="Nick"; $text_username="ident"; $text_op_level="Accès"; Guillaume Tournand <guillaume@tournand.com> September 2003 420/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $text_monitoring="Monitoring de ce channel"; $text_ajout_op="Ajouter/supprimer un opérateur"; $boutton_ajout_op="<INPUT TYPE='submit' NAME='add' VALUE='Ajouter'>"; $boutton_retrait_op="<INPUT TYPE='submit' NAME='rem' VALUE='Supprimer'>"; $text_modif_acces="Modifier un accès"; $boutton_modif_access="<INPUT TYPE='submit' NAME='mod' VALUE='Modifier'>"; // confirmation admin channels $channels_err_1="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Erreur d'authentification.</H3></U></B><BR><BR><BR> Assurez vous que Ver. Maj. n'est pas activé par erreur, le mot de passe ne correspond pas au login.<BR><BR></CENTER>"; $channels_err_2="Veuillez cliquer sur un bouton"; $channels_err_3="<BR><BR><CENTER><H3><B><U>Les modifications prendront effet dans moins de 2 minutes.</U></B></H3></CENTER><BR>"; $channels_err_4="L'identifiant"; $channels_err_4_1="est incorrect"; $channels_err_5="L'identifiant"; $channels_err_5_1="est déjà opérateur du channel"; $channels_err_5_2="n'est pas un opérateur de ce channel"; $channels_err_6="Veuillez remplir les champs identifiant <B>et</B> accès"; $channels_err_6_1="Veuillez remplir le champ identifiant"; $channels_err_7="Vous n'avez pas de privilèges suffisants pour cette opération"; $channels_err_8="Ajout de l'opérateur"; $channels_err_9="Modification des droits de l'identifiant"; $channels_err_10="Suppression de l'opérateur"; $channels_boutton_retour="<DIV ALIGN='CENTER'><FORM METHOD='POST' ACTION='channels.php?id_chan=$id_chan'><INPUT TYPE='submit' VALUE='Retour'></FORM></DIV>"; $channels_err_11="Le nouvel accès est le même que l'ancien"; // administrer eggdrops $admin_egg_1="<BR><BR><BR><CENTER><H3><B><U>Nom d'eggdrop invalide</U></B></H3></CENTER><BR><BR>"; $admin_egg_2="Eggdrop"; $admin_egg_3="Date de mise en service"; $admin_egg_4="Présent sur"; $admin_egg_4_1="chan(s)."; $admin_egg_5="channel(s) libre(s)."; $admin_egg_6="Adresse IP"; $admin_egg_7="Bot père"; $admin_egg_8="est dans le bloc d'egg N°"; $admin_egg_8_1="avec :"; $admin_egg_9="liste des channels couverts par le bloc :"; $admin_egg_10="Liste des serveurs du svr-bloc N°"; $admin_egg_11="Bots fils"; $admin_egg_12="Password cservice"; $admin_egg_13="Le"; $admin_egg_14="Etat :"; $admin_egg_15="connecté à"; $admin_egg_16="déconnecté"; // admin user $admin_user_1="<BR><BR><BR><CENTER><H3><B><U>Identifiant invalide</U></B></H3></CENTER><BR><BR>"; $admin_user_2="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Erreur d'authentification.</H3></U></B><BR><BR><BR>Assurez vous que Ver. Maj. n'est pas activé par erreur, le mot de passe ne correspond pas au login.<BR><BR></CENTER>"; $admin_user_3="<B><U>User</U> : "; $admin_user_4="<B><U>Date de naissance</U> : <BR></B><B><U>Date de création</U> : </B><BR><BR>"; $admin_user_4_0="<B><U>Langue</U> : </B>"; $admin_user_4_1="Nb de requêtes"; Guillaume Tournand <guillaume@tournand.com> September 2003 421/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $admin_user_4_2="Dernière modification"; $admin_user_4_3="Nb de logins"; $admin_user_5="<U>Dernier accès</U>"; $admin_user_6="Nick"; $admin_user_7="Adresse e-mail"; $admin_user_8="Ville"; $admin_user_9="Pays"; $admin_user_10="<BR><BR><U>Hosts enregistrés</U> :<BR><BR>"; $admin_user_11="<BR><BR><B>Changement de password</B><BR><B>(6 caractères minimum)<BR><BR>"; $admin_user_12="Nouveau pass"; $admin_user_13="Confirmation"; $admin_user_14="est"; $admin_user_15="du projet Loufiz"; $admin_user_16="Chans où"; $admin_user_17="est <B>owner</B>"; $admin_user_18="est <B>opérateur/admin</B>"; $admin_user_19="Recevoir par mail :"; $admin_user_20="Demandes d'eggdrops"; $admin_user_21="Purges de channels"; $admin_user_22="Log quotidien"; $admin_user_23="Oui"; $admin_user_24="Non"; // modif user $admin_modif_user_1="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Erreur d'authentification.</H3></U></B><BR><BR><BR> Assurez vous que Ver. Maj. n'est pas activé par erreur, le mot de passe ne correspond pas au login.<BR><BR></CENTER>"; $admin_modif_user_2="<BR><BR><CENTER><H3><B><U>Aucun changement effectué</U></B></H3></CENTER><BR><BR>"; $admin_modif_user_2_0="<BR><BR>Votre nouveau mot de passe doit contenir au minimum 6 caractères.<BR><U>Le mot de passe reste inchangé</U>"; $admin_modif_user_2_1="<BR><BR><BR>Votre nouveau mot de passe ne doit pas contenir le caractère *espace*.<BR><U>Le mot de passe reste inchangé</U>"; $admin_modif_user_3="<BR><BR><CENTER><H3><B><U>Les modifications prendront effet dans moins de 2 minutes.</U></B></H3></CENTER><BR>"; $admin_modif_user_4="Le nick est maintenant"; $admin_modif_user_5="La ville est maintenant"; $admin_modif_user_6="Le pays est maintenant"; $admin_modif_user_7="L'adresse mail est maintenant"; $admin_modif_user_8="1er ident@host incorrect"; $admin_modif_user_9="Le 1er ident@host est déjà inscrit dans votre profil."; $admin_modif_user_10="Suppression du 1er ident@host"; $admin_modif_user_11="Le 1er ident@host est maintenant"; $admin_modif_user_12="2ème ident@host incorrect"; $admin_modif_user_13="Le 2ème ident@host est déjà inscrit dans votre profil."; $admin_modif_user_14="Suppression du 2ème ident@host"; $admin_modif_user_15="Le 2ème ident@host est maintenant"; $admin_modif_user_16="3ème ident@host incorrect"; $admin_modif_user_17="Le 3ème ident@host est déjà inscrit dans votre profil."; $admin_modif_user_18="Suppression du 3ème ident@host"; $admin_modif_user_19="Le 3ème ident@host est maintenant"; $admin_modif_user_20="<LI>Erreur dans la redéfinition de votre <I>mot de passe</I>. Veillez à confirmer votre password correctement."; $admin_modif_user_20_1="<LI>Erreur dans la redéfinition de votre <I>mot de passe</I>. Vous ne pouvez pas changer le mot de passe du compte de demo !</U>"; $admin_modif_user_21="<LI>Le mot de passe est mis à jour"; $admin_modif_user_22="<DIV ALIGN='CENTER'><FORM METHOD='POST' ACTION='users.php?id_user=$id_user'><INPUT TYPE='submit' VALUE='Retour'></FORM></DIV>"; $admin_modif_user_23="Changement d'état de l'envoi de mail de demandes d'eggdrops."; $admin_modif_user_24="Changement d'état de l'envoi de mail de purges."; $admin_modif_user_25="Changement d'état de l'envoi de mail du log quotidien. "; $admin_modif_user_26="Le nom est maintenant :"; $admin_modif_user_27="Le prénom est maintenant :"; Guillaume Tournand <guillaume@tournand.com> September 2003 422/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project // Page de retrait cessation $retrait_cessation_1="<CENTER><H3><B><U>Nom de channel invalide</U></B></H3></CENTER>"; $retrait_cessation_1_1="<CENTER><H3><B><U>Veuillez saisir un nouvel owner ou une raison de purger ce channel.</U></B></H3></CENTER>"; $retrait_cessation_2="<CENTER><H2><B>Les informations fournies sont incorrectes</B></H2><BR><BR><H3><B><U>Assurez vous que Ver. Maj. n'est pas activé par erreur</U>, le mot de passe ne correspond pas au login.</B></H3></CENTER>"; $retrait_cessation_2_1="<CENTER><H2><B>Compte demo</B></H2><BR><BR><H3><B><U>Vous ne pouvez pas purger/donner de channel avec le compte de demo</U></B></H3></CENTER>"; $retrait_cessation_3="<CENTER><H3><B><U>Confirmation du nouvel owner incorrect</U></B></H3></CENTER>"; $retrait_cessation_4="<CENTER><H3>Votre demande de retrait d'eggdrops a bien été prise en compte</H3><BR></CENTER>"; $retrait_cessation_5="<BR>Les eggdrops "; $retrait_cessation_6="seront retirés de <B>#$nom_chan</B> dans moins de 2 minutes."; $retrait_cessation_7="<CENTER><H3>l'identifiant LZ-$nouvel_owner est incorrect. Vous ne pouvez donc pas lui donner ce channel.</H3><BR></CENTER>"; $retrait_cessation_8="<CENTER><H3>Votre demande de cessation de #$nom_chan à LZ-$nouvel_owner a bien été prise en compte. Elle prendra effet dans moins de 2 minutes.</H3><BR></CENTER>"; $retrait_cessation_9="<CENTER>Suppression de LZ-$nouvel_owner de la liste des opérateurs<CENTER>"; $retrait_cessation_10="<CENTER><H3>l'identifiant LZ-$nouvel_owner est déjà l'owner de ce channel.</H3><BR></CENTER>"; $retrait_cessation_11="<DIV ALIGN='RIGHT'><FORM METHOD=POST ACTION='index.php'><INPUT TYPE='submit' VALUE='Retour'></FORM></DIV>"; ?> Guillaume Tournand <guillaume@tournand.com> September 2003 423/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project include/fr/.hteggdrops.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP //index.php $index="<BR> Les services gratuits et sans publicité du projet Loufiz proposent un prêt de 3 robots (eggdrop) sur <a href='http://www.undernet.org' target='_new' class='lien'>Undernet</a>, dans le but d'aider le propriétaire du salon de discussion à assurer la sécurité de ce dernier.<BR> Ces services ainsi que leur aide sont disponibles en Anglais et en Français.<BR> <BR> <A HREF='/eggdrop/reglement.php?framed=1' class='lien' target='home'>Demander :</A><BR> <LI>Consulter nos conditions de service. <LI>Créer un identifiant. <LI>Effectuer une demande d'eggdrops. <BR><BR> <A HREF='/eggdrop/admin/' class='lien' target='home'>Administrer :</A><BR> <LI>Suivre l'évolution de votre demande. <LI>Consulter la liste des commandes des eggdrops. <LI>Obtenir votre identifiant ou mot de passe en cas d'oubli. <LI>Administrer vos informations, par exemple ajouter/modifier un host. <LI>Gérer votre channel: ajouter/supprimer des opérateurs/admins. <LI>Connaître la configuration des eggdrops prétés. <LI>Retirer les eggdrops prétés ou donner le channel à un autre utilisateur. <BR><BR> <U>S'informer</U> :<BR> <LI><A HREF='/big-brother/' class='lien' target='home'>Monitoring :</A> accéder au suivi de nos serveurs et aux statistiques de connexions. <LI><A HREF='/eggdrop/faq.php' class='lien' target='home'>FAQ :</A> les questions/réponses les plus fréquentes. <LI><A HREF='/contact/' class='lien' target='home'>Contact :</A> contacter l'équipe. <LI><A HREF='/eggdrop/liens.php' class='lien' target='home'>Liens :</A> connaître les autres projets de prêt d'eggdrops. <BR><BR><BR> L'équipe du projet Loufiz ne vous demandera jamais votre mot de passe ou le status d'opérateur.<BR> Le projet Loufiz n'a en aucun cas été créé pour aider les takeovers.<BR> "; Guillaume Tournand <guillaume@tournand.com> September 2003 424/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project //reglement.php $loufiz_plein="<BR><BR><CENTER><FONT COLOR=RED SIZE=+1>Le <B>nombre maximal de channels</B> que le projet loufiz pouvait protéger <B>est atteint</B>.<BR><U>Les nouvelles demandes d'eggdrops ne pourront donc pas être acceptées.</U></FONT></CENTER>"; $reglement="<BR> <BR> <HR> <BR> <U>Voici les differentes étapes à suivre pour demander un prêt d'eggdrops du projet Loufiz</U> :<BR> <BR> <BLOCKQUOTE> <LI TYPE=disc>Lire et accepter le règlement ci-dessous <LI TYPE=disc>Si vous n'avez pas déjà créé un identifiant, faites-le en remplissant le formulaire \"Création d'un identifiant\" <LI TYPE=disc>Remplir le formulaire \"Demande d'eggdrops\" avec votre identifiant. </BLOCKQUOTE> <BR> <BR> Par la suite, <U>tout</U> ce dont vous aurez besoin pour : <BLOCKQUOTE> <LI TYPE=disc>suivre l'évolution de votre demande <LI TYPE=disc>administrer votre profil <LI TYPE=disc>rajouter/supprimer des opérateurs/admins <LI TYPE=disc>administrer les eggdrops qui vous seront prêtés </BLOCKQUOTE> est disponible à la section <A HREF='admin/' target='home' class='lien'>Eggdrops > Administrer</A>. <BR> <BR> <HR> <BR> <BR> <TABLE WIDTH='100%'><TR><TD COLSPAN='3'> <a href='#but' class='lien'>I - Le projet Loufiz</a><br> <a href='#demandeur' class='lien'>II - Demandeur</a><br> <a href='#regles1' class='lien'>III - Conditions de prêt des robots</a><br> <a href='#regles2' class='lien'>IV - Rappels</a><br> <a href='#nonrespect' class='lien'>V - Non respect des règlements</a><br> <a href='#notions' class='lien'>VI - Notions importantes</a><br> <a href='#suppl' class='lien'>VII - Supplémentaire</a><br> <br> <br> <br> <br> <a name='but'>I - Le projet Loufiz</a><br> <br> \"Splitproof\" ? <br> <UL>Conservez vos droits sur votre channel gratuitement, en toute simplicité, et sans limitation de durée!<br> Loufiz.com prête gratuitement 3 (trois) robots [eggdrops] pour votre channel sur <a href='http://www.undernet.org' target='_new' class='lien'>Undernet</a>, et ce quelque soit votre engagement envers <a href='http://cservice.undernet.org' target='_new' class='lien'>Cservice</a>.</UL> <br> <a name='demandeur'>II - Demandeur</a><br> <UL> Loufiz.com condamne les Take-Over (prises de channel forcées par flood ou autres attaques).<BR> Ainsi, seul l'owner du channel est considéré comme apte à réaliser une demande de robots. Il est considéré par les usagers du channel comme le propriétaire de ce dernier. C'est donc logiquement le créateur du channel ou quelqu'un l'ayant justement acquis.<br> </UL> <br> <a name='regles1'>III - Conditions de prêt des robots</a><br> <br> Les services du projet Loufiz sont gratuits, mais les utilisateurs doivent s'engager à respecter ces conditions : <UL><LI TYPE=disc> Aucun deop, kick ou ban de robots n'est toléré. <LI TYPE=disc> Les autres robots ne sont tolérés qur dans la mesure où ils sont \"maitrisés\" par leurs propriéraires, et que l'owner du channel en question approuve leur présence. Guillaume Tournand <guillaume@tournand.com> September 2003 425/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project <LI TYPE=disc> Par respect des droits et des libertés de chacun, le channel ne doit pas servir à des fins pornographiques ou pédophiles, de diffusion de produits piratés (musique, logiciels, films ou autres...) ou de toute autre raison malsaine ou illégale. <LI TYPE=disc> Le demandeur de robots doit veiller à ce que tous les opérateurs du channel aient lu le présent règlement. <LI TYPE=disc> En cas de litige, l'owner sera responsable. <LI TYPE=disc> <B>Ne jamais donner son mot de passe ou le statut d'opérateur à une personne se faisant passer pour un administrateur du projet Loufiz.</B> Nous n'en avons et n'en aurons PAS BESOIN.<BR> <LI TYPE=disc> Si votre channel est enregistré sur <a href='http://cservice.undernet.org' target='_new' class='lien'>Cservice</a>, vous devez créer <B>un accès 100 AUTOMODE OP pour chacun des 3 robots prêtés.</B> Si votre channel n'est pas enregistré sur <a href='http://cservice.undernet.org' target='_new' class='lien'>Cservice</a>, ces accès devront être créés le jour où vous déciderez d'enregistrer le channel. <LI TYPE=disc> Le channel ne doit pas utiliser régulièrement un de ces modes : +i +k, ou +l empêchant nos eggdrops de joindre. <LI TYPE=disc> Le channel doit avoir au <U>minimum</U> 10 (dix) utilisateurs; hors clones ou robots. </UL> <U>NOTE</U>: Nous ne prêtons pas de robots aux channels destinés à l'aide sur IRC. Ces channels d'aide devraient être capable de s'aider eux-mêmes avant de pouvoir aider les autres.<br> <BR> <br> <a name='regles2'>IV - Rappels</a><br> <br> Sur <a href='http://www.undernet.org' target='_new' class='lien'>Undernet</a>, <UL> <LI TYPE=disc> Toute publicité est INTERDITE. <LI TYPE=disc> Pour une meilleure lisibilité et une meilleure convivialité, merci d'éviter l'usage de scripts avec des messages d'away sur-colorés, se mettant en activité de façon répétée. </UL> Conditions de service d'<a href='http://www.undernet.org' target='_new' class='lien'>Undernet</a> : <A HREF='http://www.user-com.undernet.org/documents/' target ='_new' class='lien'>http://www.usercom.undernet.org/documents/</A>. <BR><BR> <br> <a name='nonrespect'>V - Non respect des règlements</a><br> <br> L'administration peut selon la gravité des fautes, prononcer les sanctions suivantes : <UL> <LI TYPE=disc> Avertissement. <LI TYPE=disc> Exclusion temporaire des robots. <LI TYPE=disc> Exclusion définitive des robots. </UL> <br> <a name='notions'>VI - Notions importantes</a><br> <br><UL> <LI TYPE=disc> Nous considérons que les opérateurs de channel ont tous lu et accepté le présent règlement. <LI TYPE=disc> Les membres du projet Loufiz vous rendent service mais ne sont pas à votre service. <LI TYPE=disc> Le projet Loufiz n'est nullement responsable de ce qui se passe à l'interrieur des channels qu'il protège. </UL> <br> <a name='suppl'>VII - Supplémentaire</a><br> <br> <UL> <LI TYPE=circle> <U>Channel</U>: salon de discussion sur <a href='http://www.undernet.org' target='_new' class='lien'>Undernet</A>.<BR> <BR> <LI TYPE=circle> <U>L'owner</U>: le demandeur d'eggdrops, et le propriétaire du channel. <BR>-Administration web - a le pouvoir de donner l'accès opérateur de channel à ses usagers. <BR>-Opérateur de Channel.<BR> <BR> <LI TYPE=circle> <U>Chanop</U>: accès donné à un utilisateur par l'owner du channel. <BR>Opérateur de Channel.<BR> </UL> Guillaume Tournand <guillaume@tournand.com> September 2003 426/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project <BR><BR> </TD></TR>"; // validation $reglement_1="<TR><TD ALIGN='CENTER'> <FORM METHOD='POST' ACTION='index.php'> <INPUT TYPE='submit' VALUE='Je refuse'></FORM> </TD><TD ALIGN='CENTER'> <FORM METHOD='POST' ACTION='identifiant.php'> <INPUT TYPE='submit' VALUE=\"J'accepte => création d'un identifiant\"></FORM> </TD><TD ALIGN='CENTER'> <FORM METHOD='POST' ACTION='channel.php'> <INPUT TYPE='submit' VALUE=\"J'accepte => demande d'eggdrops\"></FORM> </TD></TR>"; //demande d'eggdrops $conditions="<BR> <U>Conditions à remplir pour obtenir le prêt d'eggdrops :</U><BR> <BR> <LI>avoir lu et accepté le <A HREF='reglement.php' class='lien' target='fenetreimage' onclick='ouvrirfenetre()'>règlement</a> du projet loufiz; la validation du formulaire entrainant l'acceptation de ce dernier. <LI>posséder un channel <U>sur undernet</U> avec <U>au moins</U> 10 (dix) utilisateurs, bots exclus. <LI>avoir un identifiant de la forme LZ-X - un identifiant est un chiffre unique qui permet au site web de vous identifier - (<A HREF='identifiant.php' target='home' class='lien'>création d'un identifiant</A>) <LI>remplir correctement cette demande de support de channel <BR><BR>"; $formulaire_demande="<FORM METHOD='POST' ACTION='channel_confirm.php'> <TABLE WIDTH='100%' HEIGHT='50%' BORDER='0'> <TR ALIGN='LEFT' VALIGN='MIDDLE'><TD ALIGN='RIGHT'> Channel :</TD><TD ALIGN='LEFT' COLSPAN='2'> #<INPUT TYPE='text' NAME='nom_chan' SIZE=20 MAXLENGTH=120> </TR></TD><TR ALIGN='LEFT' VALIGN='MIDDLE'><TD ALIGN='RIGHT'> Identifiant :</TD> <TD ALIGN='LEFT'> LZ-<INPUT TYPE='text' NAME='id_user' SIZE=4 MAXLENGTH=4></TD><TD ALIGN='LEFT'><A HREF='faq.php#8' target='home' class='lien'>Qu'est ce qu'un identifiant ?</A> - <A HREF='identifiant.php' target='home' class='lien'>Création d'un identifiant</A></TD></TR> <TR ALIGN='LEFT' VALIGN='MIDDLE'><TD ALIGN='RIGHT'> Mot de passe de l'identifiant :</TD><TD ALIGN='LEFT'> <INPUT TYPE='password' NAME='pass' SIZE=10 MAXLENGTH=10></TD><TD ALIGN='LEFT'> <A HREF='admin/pass_perdu/' class='lien' target='home'><B>Identifiant ou mot de passe oublié ?</B></A></TD> </TR><TR><TD ALIGN='RIGHT'> Commentaire :<BR>(Optionnel)</TD><TD ALIGN='LEFT' COLSPAN='2'> <TEXTAREA NAME='commentaire' ROWS='5' COLS='55'></TEXTAREA> </TD></TR> </TABLE> <BR><DIV ALIGN='RIGHT'> <INPUT TYPE='submit' VALUE='Valider'> <INPUT TYPE='reset' VALUE='Annuler'> </DIV> </FORM>"; //demande eggdrops confirmation $demande_err_1="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Veillez à remplir tous les champs demandés</H3></U></B><BR><BR><BR> Votre requête ne peut continuer plus loin, il vous faut revenir en arrière et prendre le temps de remplir <U>tous</U> les petits rectangles blancs.<BR><BR></CENTER> <FORM METHOD='POST' ACTION='channel.php'>"; $demande_err_2="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Le channel #$nom_chan n'est pas un nom de channel valide.</H3></U></B><BR><BR><BR> Le nom de channel ne peut être constitué que des caractères : a-z, 0-9, -, ., _, &<BR> <BR>Votre requête ne peut continuer plus loin, il vous faut revenir en arrière et le corriger.<BR><BR></CENTER> Guillaume Tournand <guillaume@tournand.com> September 2003 427/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project <FORM METHOD='POST' ACTION='channel.php'>"; $demande_err_3="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Une demande d'eggdrops pour le channel #$nom_chan a déjà été faite.</H3></U></B><BR><BR><BR> Votre requête ne peut continuer plus loin, il vous faut revenir en arrière et choisir un autre channel.<BR><BR></CENTER> <FORM METHOD='POST' ACTION='channel.php'>"; $demande_err_4="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Erreur d'authentification.</H3></U></B><BR><BR><BR> Assurez vous que Ver. Maj. n'est pas activé par erreur, le mot de passe ne correspond pas au login.<BR><BR></CENTER> <FORM METHOD='POST' ACTION='channel.php'>"; $demande_err_5="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Le channel #$nom_chan a été blacklisté, et ne peut donc pas faire l'objet de demande d'eggdrops du projet Loufiz.</H3></U></B><BR><BR><BR> Votre requête ne peut continuer plus loin, il vous faut revenir en arrière et choisir un autre channel.<BR><BR></CENTER> <FORM METHOD='POST' ACTION='channel.php'>"; $demande_err_5_1="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Une application pour le channel #$nom_chan a déjà été postée et refusée durant ces 24 dernieres heures. Vous devez attendre 24 heures avant de refaire une demande.</H3></U></B><BR><BR><BR> Votre requête ne peut continuer plus loin.<BR><BR></CENTER> <FORM METHOD='POST' ACTION='channel.php'>"; $demande_err_6="<BR><BR><CENTER><FONT COLOR=RED SIZE=+1>Le <B>nombre de channels maximum</B> que le projet loufiz pouvait protéger <B>est atteint</B>.<BR><U>Les nouvelles demandes d'eggdrops ne pourront donc pas être acceptées.</U></FONT></CENTER><FORM METHOD='POST' ACTION='channel.php'>"; $demande_err_6_1="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Compte demo !</H3></U></B><BR><BR><BR> Vous ne pouvez pas demander d'eggdrops avec le compte de demo.<BR><BR></CENTER> <FORM METHOD='POST' ACTION='channel.php'>"; $demande_ok="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Votre demande a bien été prise en compte.</H3></U></B><BR><BR><BR> Vous pouvez suivre l'évolution de votre demande avec la rubrique <A HREF='admin/suivi_demandes.php' CLASS='lien' TARGET='home'>Administrer / suivi des demandes</A><BR><BR><BR>"; $demande_valid="<CENTER><BR><BR><INPUT TYPE='submit' VALUE='Valider'></CENTER>"; // liste des commandes des eggdrops $commandes_header="<CENTER><U><H3>Liste des commandes pour les eggdrops du projet Loufiz.</H3></U></CENTER>"; $commandes_desc="Pour les exemples, nous supposerons que le nom de votre channel est #chan, que votre mot de passe est gloubilga, et que l'eggdrop Lespaul se trouve sur votre channel."; $commandes_head1="Commande"; $commandes_head2="Syntaxe"; $commandes_head3="Exemple"; $commandes_head4="Description"; //creation d'identifiant $identifiant_1_1="<CENTER><H3><U>Création d'un identifiant</U></H3> Ces données sont confidentielles et ne seront utilisées qu'à votre demande.</CENTER>"; $identifiant_1_2_1="Nom :"; $identifiant_1_2_2="Prénom :"; $identifiant_1_2_3="Date de naissance :"; $identifiant_4_1="Nickname :"; $identifiant_4_1_1="Ville :"; $identifiant_4_2="Pays :"; $identifiant_4_3="e-mail :"; $identifiant_4_4="Si vous ignorez votre ident@host, tapez <B>.ident@host</B> sur #loufiz."; $identifiant_5="ident@host"; $identifiant_5_1="Tapez .ident@host sur #Loufiz pour trouver votre ident@host."; $identifiant_5_2="Mot de passe"; $identifiant_5_3="Confirmation"; Guillaume Tournand <guillaume@tournand.com> September 2003 428/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $identifiant_6="Je certifie sur l'honneur, que les réponses ci-dessus sont vraies; j'ai lu et approuvé l'ensemble des"; $identifiant_6_1="règlementations et status"; $identifiant_6_2="du projet Loufiz, et m'engage à les respecter."; $identifiant_7="<DIV ALIGN='RIGHT'> <INPUT TYPE='submit' VALUE=\"J'accepte\"> <INPUT TYPE='reset' VALUE=\"Je refuse\"> </DIV> </FORM>"; //creation identifiant confirm $identifiant_err_1="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Veillez à remplir tous les champs demandés</H3></U></B><BR><BR><BR> Votre requête ne peut continuer plus loin, il vous faut revenir en arrière et prendre le temps de remplir <U>tous</U> les petits rectangles blancs.<BR><BR></CENTER> <FORM METHOD='POST' ACTION='identifiant.php'>"; $identifiant_err_2="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Erreur de ident</H3></U></B><BR><BR><BR> Le ident <I>$username</I> est incorrect, il ne peut etre constitué que des caractères : a-z, 0-9, -, _, .<BR> <BR>Votre requête ne peut continuer plus loin, il vous faut revenir en arrière et corriger votre ident.<BR><BR></CENTER> <FORM METHOD='POST' ACTION='identifiant.php'>"; $identifiant_err_3="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Erreur de host</H3></U></B><BR><BR><BR> Le host <I>$host1</I> est incorrect, il ne peut etre constitué que des caractères : a-z, 0-9, -, .<BR> <BR>Votre requête ne peut continuer plus loin, il vous faut revenir en arrière et corriger votre host.<BR><BR></CENTER> <FORM METHOD='POST' ACTION='identifiant.php'>"; $identifiant_err_4="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Erreur de mot de passe</H3></U></B><BR> <BR><BR>La taille de votre <I>mot de passe</I> est incorrecte.<P><B>Le mot de passe doit contenir 6 (six) caractères minimum</B><BR><BR></CENTER> <FORM METHOD='POST' ACTION='identifiant.php'>"; $identifiant_err_5="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Erreur de mot de passe</H3></U></B><BR><BR><BR> Votre confirmation de votre <I>mot de passe</I> est incorrecte.<P>Il est nécessaire de retaper le même <I>mot de passe</I> dans le champ <I>Confirmation</I>. <BR><BR></CENTER> <FORM METHOD='POST' ACTION='identifiant.php'>"; $identifiant_err_6="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Un utilisateur avec <I>$username</I> comme <I>ident</I> existe déjà.</H3></U></B><BR><BR><BR> Votre requête ne peut continuer plus loin, il vous faut revenir en arrière et choisir un autre <I>ident</I>.<BR><BR></CENTER> <FORM METHOD='POST' ACTION='identifiant.php'>"; $identifiant_err_7="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Votre mot de passe contient le caractère *espace*.</H3></U></B><BR><BR><BR> Votre requête ne peut continuer plus loin, il vous faut revenir en arrière et choisir un autre <I>mot de passe</I>.<BR><BR></CENTER> <FORM METHOD='POST' ACTION='identifiant.php'>"; $identifiant_ok_1_1="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Votre demande d'identifiant a bien été prise en compte.</H3></U></B><BR><BR><BR><BR><BR><BR>"; $identifiant_ok_1_2="$nom $prenom, $ville ($pays), $amail, votre numero d'identifiant est: <BR><B>LZ-"; $identifiant_ok_2="<BR><u>Notez bien cet identifiant</u>, il vous sera demandé pour administrer vos eggdrops</B><BR><BR> Vous pouvez administrer vos données et vos channels avec la rubrique <A HREF='admin/index.php' CLASS='lien' TARGET='home'>Administrer</A>.<BR><BR>Cliquez sur 'Valider' pour demander des eggdrops pour un channel. <FORM METHOD='POST' ACTION='channel.php'></CENTER>"; $identifiant_valid="<CENTER><BR><BR><INPUT TYPE='submit' VALUE='Valider'></CENTER>"; //liens Guillaume Tournand <guillaume@tournand.com> September 2003 429/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $liens_1="<CENTER><U><H3>Channels et sites web d'associations proposant des prêts d'eggdrops.</H3></U></CENTER><BR> <TABLE ALIGN='CENTER' WIDTH='800' BORDER='0'><TR ALIGN='CENTER'><TH>Channel<BR><BR></TH><TH>Adresse web<BR><BR></TH></TR>"; $liens_2="<BR><BR><CENTER><U><H3>Partenaires du projet Loufiz.</H3></U></CENTER>"; $liens_3="<BR><BR><DIV ALIGN='RIGHT'>Ces liens pointent vers des sites dont le projet Loufiz ne peut être tenu responsable.</DIV>"; $lien_loufiz="<BR><BR><BR><CENTER><U><H3>Mettre un lien vers le site du projet Loufiz.</H3></U></CENTER> <BR><U>Bannière 88x31 du projet Loufiz</U> : <A HREF='http://www.loufiz.com/' TARGET='new' CLASS='lien'><IMG SRC='https://www.loufiz.com/images/loufiz_banner_88_31.gif' BORDER='0' ALT='Le projet Loufiz'></A><BR><BR> Copiez ces lignes dans le code HTML de la page web dans laquelle vous voulez mettre un lien vers le site du projet Loufiz :<BR> <pre> &lt;!-- www.loufiz.com --&gt; &lt;A HREF='http://www.loufiz.com/' TARGET='new'&gt; &lt;IMG SRC='http://www.loufiz.com/images/loufiz_banner_88_31.gif' BORDER='0' ALT='Le projet Loufiz'&gt; &lt;/A&gt; &lt;!-- www.loufiz.com --&gt; </pre>"; // frame demande eggdrops/creation identifiant $frame_1="Création d'un identifiant"; $frame_2="Demande d'eggdrops"; // index administrer $body_administrer_1="<TABLE ALIGN='CENTER' WIDTH='100%' HEIGHT='575'><TR><TD COLSPAN=2 ALIGN='CENTER'> Le <a href='suivi_demandes.php' target='home' class='lien'>suivi de vos demandes</a> vous permet de suivre l'évolution de vos demandes d'eggdrops.<BR><BR> Pour retirer les eggdrops, <U>ou</U> pour donner le channel à un autre utilisateur : <A HREF='../retrait/index.php' target='home' class='lien'>Retrait d'eggdrops</A><HR> </TD></TR> <TR><TD COLSPAN='2'><BR></TD></TR> <TR VALIGN='TOP'><TD ALIGN='CENTER' COLSPAN='2'> <H3><B><U>Votre profil utilisateur et channel(s)</U></B></H3> <BR>En vous authentifiant ici vous pourrez modifier vos hosts, nick, adresse e-mail, définir un nouveau mot de passe, ainsi que voir de quel(s) channel(s) vous êtes opérateurs.<BR> De plus, si vous êtes owner, ou admin d'un channel, vous pouvez administrer votre channel ici, et voir en détail les paramètres des eggdrops prêtés. <BR><BR><BR> <FORM METHOD='POST' ACTION='users.php'> <BLOCKQUOTE> <TABLE BORDER='0'> <TR><TD ALIGN='RIGHT'>Identifiant : </TD> <TD ALIGN='left'> LZ-<INPUT TYPE='text' NAME='id_user' SIZE=5 MAXLENGTH=5> </TD></TR> <TD ALIGN='RIGHT'>Mot de passe : </TD> <TD ALIGN='LEFT'> <INPUT TYPE='password' NAME='user_pass' SIZE=20 MAXLENGTH=20> </TD></TR> </TABLE> </BLOCKQUOTE><CENTER><BR> <INPUT TYPE='submit' VALUE='Valider'> <INPUT TYPE='reset' VALUE='Annuler'> </CENTER></FORM> </TD></TR> <TR><TD></TD><TD ALIGN='RIGHT'><A HREF='pass_perdu/' class='lien' target='home'><B>Identifiant ou mot de passe oublié ?</B></A><BR><BR> </TD></TR> Guillaume Tournand <guillaume@tournand.com> September 2003 430/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project <TR><TD COLSPAN='2' VALIGN='CENTER' ALIGN='CENTER'> <HR><H3><A HREF='../commandes.php' class='lien' target='home'>Liste des commandes</A> pour les eggdrops du projet Loufiz.</H3>"; $body_administrer_2="</TR></TD> </TABLE>"; // variables globales $boutton_valider_annuler="<BR><DIV ALIGN='RIGHT'><INPUT TYPE='submit' VALUE='Valider'> <INPUT TYPE='reset' VALUE='Annuler'></DIV></FORM>"; $boutton_logout="<DIV ALIGN='RIGHT'><FORM METHOD='POST' ACTION='logout.php'><INPUT TYPE='submit' VALUE='Logout'></FORM></DIV>"; //page logout $logout_body="<BR><BR><BR><BR><HR><BR><BR><BR><H3><CENTER>L'opération de dé-authentification s'est correctement déroulée, vous allez être redirigé sur la page d'accueil dans 3 secondes.</CENTER></H3>"; // Suivi demandes login $suivi_login_body="<BR><BR><BR><HR><BR><BR> <CENTER><H3><B><U>Suivi de vos demandes</U></B></H3></CENTER> <BR><BR> Cette section vous permet de suivre l'avancement de vos demandes d'eggdrops. <BR><BR><BR> <BR> <FORM METHOD='POST' ACTION='suivi_bot.php'> <CENTER> <B>Nom du channel</B> : #<INPUT TYPE='text' NAME='nom_chan' SIZE=20 MAXLENGTH=120><BR> <BR> <INPUT TYPE='submit' VALUE='Valider'> <INPUT TYPE='reset' VALUE='Annuler'> </CENTER> </FORM> <BR><BR><BR><HR>"; // page de suivi des demandes $suivi_demandes_1="<CENTER><H3><B><U>Le channel #$nom_chan n'a pas été trouvé dans la base de donnée</U></B></H3></CENTER>"; $suivi_demandes_2_1="Suivi de la demande d'eggdrops pour #$nom_chan"; $suivi_demandes_3="validée"; $suivi_demandes_4="Votre demande n'a pas encore été traitée par un administrateur"; $suivi_demandes_5="refusée"; $suivi_demandes_5_1="channel purgé"; $suivi_demandes_6="Demande d'eggdrops"; $suivi_demandes_7="Le"; $suivi_demandes_8="par"; $suivi_demandes_9="<U>Status</U>:"; $suivi_demandes_10="Raison"; $suivi_demandes_11="<B><U>Attention</U></B> : Le ident@host du demandeur d'eggdrops est probablement incorrect !<BR>Il doit aller dans la section <A HREF='index.php' target='home' class='lien'>Administrer</A> pour le corriger."; $suivi_demandes_12="<FONT COLOR=red><B><U>Attention</U></B> : Le channel #$nom_chan a été blacklisté, et ne pourra pas être un channel demandeur d'eggdrops du projet Loufiz.</FONT>"; $suivi_demandes_13="<DIV ALIGN='RIGHT'><FORM METHOD=POST ACTION='index.php'><INPUT TYPE='submit' VALUE='Retour'></FORM></DIV>"; $suivi_demandes_14="Les eggdrops ont été retirés, conformément à la demande du propriétaire du channel"; // index retrait cessation $index_retrait_body_1="Retirer les eggdrops du projet Loufiz, ou donner le channel à un utilisateur."; Guillaume Tournand <guillaume@tournand.com> September 2003 431/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $index_retrait_body_3="Identifiant"; $index_retrait_body_4="Mot de passe"; $index_retrait_body_5="Channel"; $index_retrait_body_6="Si vous désirez donner ce channel à un autre utilisateur, écrire son identifiant ici.<BR>Sinon laisser ces champs vides."; $index_retrait_body_7="Nouvel owner"; $index_retrait_body_8="Confirmation"; $index_retrait_body_9="Valider"; $index_retrait_body_10="Annuler"; // Page de retrait cessation // se trouve dans le fichier .hteggadmin.php // Index pass perdu $index_pass_perdu="<BR><BR><BR><HR><BR> <CENTER><H3><B>Mot de passe oublié</B></H3></CENTER><BR><BR> Votre mot de passe peut vous être envoyé par mail. Pour cela, veuillez entrer :<BR> <LI>votre ident <B>ou</B> votre identifiant. <LI>l'adresse e-mail que vous avez enregistrée dans le projet Loufiz. <BR><BR> Vous ne pourrez demander un tel rappel qu'une fois par jour.<BR> <BR><BR> <FORM METHOD='POST' ACTION='pass_perdu.php'> <BLOCKQUOTE> <TABLE BORDER='0' WIDTH='60%' ALIGN='CENTER'> <TR> <TD ALIGN='right'>ident :</TD> <TD ALIGN='left'> <INPUT TYPE='text' NAME='username' SIZE='10' MAXLENGTH='10'> </TD> <TD ALIGN='right'><B>ou</B> identifiant :</TD> <TD ALIGN='left'> LZ-<INPUT TYPE='text' NAME='id_user' SIZE='5' MAXLENGTH='5'> </TD></TR> <TD ALIGN='right' colspan='2'>adresse e-mail : </TD> <TD ALIGN='LEFT' colspan='2'> <INPUT TYPE='text' NAME='amail' SIZE='35' MAXLENGTH='35'> </TD></TR> </TABLE> </BLOCKQUOTE> <BR><BR> <DIV ALIGN='RIGHT'> <INPUT TYPE='submit' VALUE='Valider'> <INPUT TYPE='reset' VALUE='Annuler'> </DIV> </FORM> <DIV ALIGN='RIGHT'><FORM METHOD='POST' ACTION='../index.php'> <INPUT TYPE='submit' VALUE='Retour'></DIV> <BR><BR><HR>"; // Pass perdu $pass_perdu_1="<BR><BR><B><U><CENTER><H3>Veillez à remplir tous les champs demandés</H3></U></B><BR><BR><BR>Votre requête ne peut continuer plus loin, il vous faut revenir en arrière et prendre le temps de remplir <U>tous</U> les petits rectangles blancs.<BR><BR></CENTER>"; $pass_perdu_2="<BR><BR><B><U><CENTER><H3>Aucun identifiant/ident ne correspond avec l'adresse email spécifiée</H3></U></B><BR><BR><BR>Votre requête ne peut continuer plus loin.<BR><BR></CENTER>"; $pass_perdu_3="<BR><BR><B><U><CENTER><H3>Votre mot de passe vous a déjà été envoyé par mail aujourd'hui.</H3></U></B><BR><BR><BR>Votre requête ne peut continuer plus loin.<BR><BR></CENTER>"; $pass_perdu_4_1="<BR><BR><B><U><CENTER><H3>Le mot de passe de l'identifiant"; $pass_perdu_4_2="est envoyé à l'adresse e-mail"; $pass_perdu_5="[www.loufiz.com] identifiant et mot de passe"; Guillaume Tournand <guillaume@tournand.com> September 2003 432/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $pass_perdu_6="Le"; $pass_perdu_7="l'identifiant"; $pass_perdu_8="a demandé à ce que son mot de passe lui soit envoyé par mail. Son mot de passe est"; $pass_perdu_9="<DIV ALIGN='RIGHT'><FORM METHOD='POST' ACTION='index.php'><INPUT TYPE='submit' VALUE='Retour'></DIV>"; // FAQ $faq_head="Liste des questions fréquemment posées."; $faq_sect1="L'interface web"; $faq_sect2="Les conditions de service"; $faq_sect3="X / Cservice"; $faq_sect4="Utilisation des eggdrops"; $faq_sommaire="Sommaire"; ?> Guillaume Tournand <guillaume@tournand.com> September 2003 433/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project include/fr/.htteam.php <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ?> <?PHP // variables globales $boutton_retour="<DIV ALIGN='RIGHT'><INPUT TYPE='submit' VALUE='Retour'></DIV>"; $boutton_valider_annuler="<DIV ALIGN='RIGHT'><INPUT TYPE='submit' VALUE='Valider'> <INPUT TYPE='reset' VALUE='Annuler'></DIV>"; // page d'index d'administration $administration_index_1="Administration de la base de données :"; $administration_index_2="Recherche dans la base de données."; $administration_index_3_1="Il y a"; $administration_index_3_2="utilisateurs enregistrés."; $administration_index_4_1="Loufiz couvre"; $administration_index_4_2="channel(s)."; $administration_index_5_1="Il y a"; $administration_index_5_2="channel(s) blacklisté(s)."; $administration_index_5_3="Il n'y a pas de channel blacklistés."; $administration_index_7="Aucune nouvelle demande d'eggdrops."; $administration_index_8_1="Il y a"; $administration_index_8_2="nouvelle(s) demande(s) d'eggdrops."; $administration_index_9_2="instructions pour le botnet en attente."; $administration_index_9_3="Aucune instruction pour le botnet en attente."; $administration_index_10="Management du projet"; $administration_index_11="Ajout/suppression d'administrateurs."; $administration_index_12="Loufiz stats"; $administration_index_13="Le projet Loufiz tourne à"; $administration_index_14_1="Il y a"; $administration_index_14_2="commentaire(s)."; $administration_index_15_1="dispo:"; $administration_index_15_2="chan(s)"; $administration_index_16="Salle de contrôle des channels"; $administration_index_17="Monitoring des channels"; $administration_index_18="Doc. sur le monitoring des channels"; $administration_index_19="Liste des raisons des refus de prêt d'eggdrops"; $administration_index_21="Liste des administrateurs"; $administration_index_22="Statistiques du serveur web http://www.loufiz.com (anglais)"; Guillaume Tournand <guillaume@tournand.com> September 2003 434/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $administration_index_23="<INPUT TYPE='submit' VALUE='Rafraîchir'>"; $administration_index_24="Mise a jour de la page liens."; $administration_index_25="Synchro base de donnée => eggdrops"; // update link page $update_link_1="Channels et sites web d'associations proposant des prêts d'eggdrops."; $update_link_2="Ajout d'un lien"; $update_link_3="Channel"; $update_link_4="Site web"; $update_link_5="Ordre"; $update_link_6="Retrait d'un lien"; $update_link_7="id_lien"; $update_link_8="Channel"; $update_link_9="Adresse web"; $update_link_10="Ordre"; $update_link_11="Lien ajouté"; $update_link_12="Lien déjà présent"; $update_link_13="Lien supprimé"; $update_link_14="Lien inexistant"; $update_link_15="Partenaires du projet Loufiz."; $update_link_16="Ajout d'une bannière"; $update_link_17="Supression d'une bannière"; $update_link_18="Adresse web"; $update_link_19="Source de l'image"; $update_link_20="Description (optionnel)"; $update_link_21="id"; $update_link_22="Bannière"; $update_link_submit="<INPUT TYPE='submit' VALUE='Valider'>"; // All chans $all_chans_1="Liste des channels supportés"; $all_chans_2="nom"; $all_chans_3="Identifiant owner"; $all_chans_4="nb op"; $all_chans_5="nb admin"; $all_chans_6="nb s. admin"; $all_chans_7="date support"; // all users $all_users_1="Liste des utilisateurs enregistrés"; $all_users_1_1="Identifiant"; $all_users_2="nom"; $all_users_3="prénom"; $all_users_4="pays"; $all_users_5="date naiss."; $all_users_6="ident"; $all_users_7="date création"; $all_users_8="Précédent"; $all_users_9="Suivant"; //Monitoring des channels $chan_monitoring_1="Monitoring des channels"; $chan_monitoring_2="Channel"; $chan_monitoring_2_1="Lang"; $chan_monitoring_3="Nb rapport"; $chan_monitoring_4="Nb egg op"; $chan_monitoring_5="deop depuis"; $chan_monitoring_6="User 1"; $chan_monitoring_7="User1 depuis"; $chan_monitoring_8="User 2"; $chan_monitoring_9="User2 depuis"; Guillaume Tournand <guillaume@tournand.com> September 2003 435/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $chan_monitoring_10="User 3"; $chan_monitoring_11="User3 depuis"; $chan_monitoring_12="X"; $chan_monitoring_13="X depuis"; $chan_monitoring_14="Axs X"; $chan_monitoring_15="Axs depuis"; $chan_monitoring_16="Nb mode OP"; $chan_monitoring_17="Date MAJ"; $chan_monitoring_18="Purger"; $chan_monitoring_19="j."; $chan_monitoring_19_1="H."; $chan_monitoring_20="Présent"; $chan_monitoring_21="Absent"; $chan_monitoring_22="nombre minimal d'utilisateurs demandé"; $chan_monitoring_23_1="temps maximal pour un nombre insuffisant d'utilisateurs"; $chan_monitoring_23_2="jours"; $chan_monitoring_23_3="heures"; $chan_monitoring_24="temps maximal pour les eggdrops déoppés"; $chan_monitoring_25="temps maximal pour un channel sans un accès 100 par eggdrop"; $chan_monitoring_26="<INPUT TYPE='submit' VALUE='Purger'>"; // Chan monitoring doc // Automode OP = <LI>parmis ces accès <font color='#333399'><B>Nb mode op</B></font> sont en AUTOMODE OP<BR> $chan_monitoring_doc="<BR><BR><HR><BR> <CENTER><H3><B>Documentation du tableau : Monitoring des channels</B></H3></CENTER> <BR> Le tableau de monitoring des channels permet aux administrateurs du projet de voir sur un même tableau si les channels protégés sont conformes au règlement.<BR> Ce tableau se lit de gauche à droite, et chaque colonne 'depuis' se réfère à la colonne qui se trouve à sa gauche.<BR> <BR><BR> Ainsi : le channel <font color='#333399'><B>Channel</B></font>, dont le propriétaire a choisi comme langue <font color='#333399'><B>Lang</B></font>, pour lequel <font color='#333399'><B>Nb rapport</B></font> eggdrops sont venus au rapport, a :<BR><BR> <LI><font color='#333399'><B>Nb egg op</B></font> eggdrops du projet Loufiz opérateurs sur le channel<BR> <LI>deop depuis : <font color='#333399'><B>deop depuis</B></font><BR> <LI>l'eggdrop N°1 annonce qu'il y a <font color='#333399'><B>User 1</B></font> utilisateurs présents sur le channel <LI>ce nombre d'utilisateur est inférieur au nombre minimal d'utilisateurs que le règlement du projet Loufiz demande depuis : <font color='#333399'><B>User1 depuis</B></font> jours<BR> <LI>l'eggdrop N°2 annonce qu'il y a <font color='#333399'><B>User 2</B></font> utilisateurs présents sur le channel <LI>ce nombre d'utilisateur est inférieur au nombre minimal d'utilisateurs que le règlement du projet Loufiz demande depuis : <font color='#333399'><B>User2 depuis</B></font> jours<BR> <LI>l'eggdrop N°3 annonce qu'il y a <font color='#333399'><B>User 3</B></font> utilisateurs présents sur le channel <LI>ce nombre d'utilisateur est inférieur au nombre minimal d'utilisateurs que le règlement du projet Loufiz demande depuis : <font color='#333399'><B>User3 depuis</B></font> jours<BR> <LI>sur ce channel, X est <font color='#333399'><B>X</B></font><BR> <LI>l'état sur la présence de X est identique depuis : <font color='#333399'><B>X depuis</B></font> jours <LI>il y a <font color='#333399'><B>Axs X</B></font> accès sur X (au moins 100) pour les eggdrops<BR> <LI>ce nombre d'accès est resté identique depuis <font color='#333399'><B>Axs depuis</B></font> jours<BR> <LI>les informations pour ce channel ont été mises a jour le : <font color='#333399'><B>date MAJ</B></font><BR> <BR><BR> Lorsqu'une valeur (nombre d'eggdrops ops, nombre d'utilisateurs, accès ou automode sur X) est <B>audessous</B> de ce qui est demandé par le règlement, cette valeur apparait en <font color='red'>rouge</font>. Le channel devient <I>purgeable</I> lorsque cette valeur est restée <B>sous</B> le seuil pendant trop longtemps. A ce moment, un bouton apparait dans la colonne <font color='#333399'><B>Purger</B></font>. Poussez sur ce bouton et le channel sera purgé.<BR> <BR> Les valeurs sont remises à jour toutes les 2 heures. Ces valeurs peuvent être perturbées par des facteurs indépendants de notre volonté : par exemple un lag.<BR> <BR> <B>Note :</B> avant de purger un channel parce que tous les accès n'ont pas été créés sur X, veuillez contacter le propriétaire du channel en premier lieu, avant même que le bouton <B>Purger</B> n'apparaisse."; Guillaume Tournand <guillaume@tournand.com> September 2003 436/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project // Commentaires $commentaires_1="Liste des commentaires"; $commentaires_2="Identifiant"; $commentaires_3="Channel"; $commentaires_4="date"; $commentaires_5="commentaire"; $commentaires_6="Précédent"; $commentaires_7="Suivant"; // demandes channels $demandes_channels_1="Le "; $demandes_channels_2="Channel"; $demandes_channels_3="Commentaire"; $demandes_channels_4_1="REFUS"; $demandes_channels_4_2="VALIDATION"; $demandes_channels_5="blacklist channel"; $demandes_channels_6="dispo"; $demandes_channels_7="ident@host warning"; $demandes_channels_8="Rapport"; $demandes_channels_9="ignorer pour 24H"; $demandes_channels_10="Langue"; // demandes channel confirm $demande_channel_confirm_0="Refusé"; $demande_channel_confirm_1="Raison"; $demande_channel_confirm_2="Warning"; $demande_channel_confirm_3="Le channel a été blacklisté."; $demande_channel_confirm_4="Valide"; $demande_channel_confirm_5="Votre ident@host est probablement incorrect !<BR>Pour le corriger, allez dans la section 'Administrer'."; $demande_channel_confirm_6="Sélectionner au moins une demande"; // Liste des helpers et des admins $liste_helpers_1="Liste des Helpers et Administrateurs"; $liste_helpers_2="Utilisateur"; $liste_helpers_3="Nickname"; $liste_helpers_4="Date entrée"; $liste_helpers_5="Tâche"; // Liste des refus $liste_refus="Tableau de correspondance des refus"; // Index management $index_management_1="<TABLE BORDER='0' ALIGN='CENTER' WIDTH='100%'><TR><TD ALIGN='CENTER' VALIGN='TOP' WIDTH='49%'> <BR><H3><B><U>Administration des utilisateurs</U></B></H3><BR> <FORM METHOD='POST' ACTION='users.php'> <BLOCKQUOTE> <TABLE BORDER='0' WIDTH='70%'> <TR><TD>Identifiant :</TD> <TD ALIGN='left'> LZ-<INPUT TYPE='text' NAME='id_user' SIZE=5 MAXLENGTH=5> </TD></TR> <TR><TD><B>Ou</B> ident:</TD> <TD ALIGN='left'> <INPUT TYPE='text' NAME='username' SIZE=10 MAXLENGTH=10> </TD></TR> </TABLE> Guillaume Tournand <guillaume@tournand.com> September 2003 437/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project </BLOCKQUOTE> <INPUT TYPE='submit' VALUE='Valider'> <INPUT TYPE='reset' VALUE='Annuler'> </FORM> </TD><TD ALIGN='CENTER' VALIGN='TOP'> <BR><H3><B><U>Administration des channels</U></B></H3> <BR> <FORM METHOD='POST' ACTION='channels.php'> <BLOCKQUOTE> <TABLE BORDER='0' WIDTH='85%'> <TR><TD>Nom de channel :</TD> <TD ALIGN='right'> #<INPUT TYPE='text' NAME='nom_chan' SIZE=25 MAXLENGTH=120> </TD></TR> </TABLE> </BLOCKQUOTE> <INPUT TYPE='submit' VALUE='Valider'> <INPUT TYPE='reset' VALUE='Annuler'> </FORM> </TD></TR><TR><TD COLSPAN=2 ALIGN='CENTER' VALIGN='CENTER'> <H3><B><U>Consultation des fiches eggdrops</U></B></H3><BR> <FORM METHOD='POST' ACTION='eggdrops.php'> <BLOCKQUOTE> <TABLE BORDER='0' WIDTH='40%'> <TR><TD>Nom de l'eggdrop :</TD> <TD ALIGN='right'> <INPUT TYPE='text' NAME='nom' SIZE=20 MAXLENGTH=20> </TD></TR> </TABLE> </BLOCKQUOTE> <INPUT TYPE='submit' VALUE='Valider'> <INPUT TYPE='reset' VALUE='Annuler'> </FORM> </TD></TR><TR><TD COLSPAN=2><HR></TD></TR><TR><TD ALIGN='CENTER' VALIGN='TOP'> <FONT COLOR=RED size='+1'><B><U>Purger un channel :</U></B></FONT><BR><BR> <DIV ALIGN='LEFT'>Si vous désirez <U>donner</U> ce channel à un autre utilisateur, veuillez écrire <U>son</U> numéro d'identifiant ici, sinon, veuillez laisser ce champ vide.</DIV></TD> <TD ALIGN='CENTER' VALIGN='CENTER'><BR> <FORM METHOD='POST' ACTION='retrait_cessation.php'> <TABLE BORDER='0' WIDTH='95%> <TR ALIGN='right'><TD><FONT COLOR=RED>Nom de channel :</FONT></TD> <TD ALIGN='right'> <FONT COLOR=RED>#</FONT><INPUT TYPE='text' NAME='nom_chan' SIZE=25 MAXLENGTH=120> </TD></TR> <TR><TD>Raison de la purge :</TD> <TD ALIGN='right'>"; $index_management_2="</TD></TR> <TD><B>ou </B>nouvel owner :</TD><TD ALIGN='right'>LZ-<INPUT TYPE='text' NAME='nouvel_owner' SIZE=5 MAXLENGTH=5></TD></TR></TABLE> <BR><INPUT TYPE='submit' VALUE='Valider'> <INPUT TYPE='reset' VALUE='Annuler'> </FORM> </TD></TR> </TABLE>"; $index_management_3="Raison de purge"; // index admin management $admin_mgmt_index_1="<B>Ajouter/modifier</B> un membre"; $admin_mgmt_index_2="<B>Retirer</B> un membre"; $admin_mgmt_index_3="<BR><BR><CENTER>Les accès sur les <B>bots</B> suivants <U>devront être créés également</U> :</CENTER> <UL> <LI> <B>X</B> /msg x adduser #loufiz &#60;username&#62; 200 <LI> <B>FrosT</B> FrosT add &#60;nick&#62; 200 <BR><BR> Pour modifier un ident@host d'un utilisateur dans FrosT, utiliser la commande <I>FrosT add</I>.<BR> Tapper <I>FrosT help add</I> pour plus de renseignements. Guillaume Tournand <guillaume@tournand.com> September 2003 438/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project </UL>"; $admin_mgmt_index_4="Vous n'avez pas la permission d'entrer ici."; $admin_mgmt_index_5="Aucun numéro d'administration n'a été trouvé pour vous."; $admin_mgmt_index_6="Choisir une tâche"; // admin management retrait $admin_mgmt_retrait_1="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Veuillez saisir une valeur dans le champ de l'identifiant.</H3></U></B><BR><BR><BR>Votre requête ne peut continuer plus loin, il vous faut revenir en arrière et remplir le petit rectangle blanc.<BR><BR></CENTER>"; $admin_mgmt_retrait_2="<BR><BR><BR><BR><BR><B><U><CENTER><H3>L'utilisateur LZ-$id_user n'est pas un administrateur.</H3></U></B><BR><BR><BR>Votre requête ne peut continuer plus loin, il vous faut revenir en arrière et choisir un autre utilisateur qui fait partie de la liste des administrateurs.<BR><BR></CENTER>"; $admin_mgmt_retrait_3="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Vous n'avez pas les privilèges pour modifier/supprimer L'utilisateur LZ-$id_user de la liste des administrateurs.</H3></U></B><BR><BR><BR>Votre requête ne peut continuer plus loin.<BR><BR></CENTER>"; $admin_mgmt_retrait_4="<BR><BR><BR><BR><BR><B><U><CENTER><H3>L'utilisateur LZ-$id_user a bien été retiré de la liste des administrateurs.</H3></U></B><BR><BR><BR>"; // admin management ajout $admin_mgmt_ajout_1="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Veuillez saisir une valeur dans le champ de l'identifiant.</H3></U></B><BR><BR><BR>Votre requête ne peut continuer plus loin, il vous faut revenir en arrière et remplir le petit rectangle blanc.<BR><BR></CENTER>"; $admin_mgmt_ajout_2="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Utilisateur non valide.</H3></U></B><BR><BR><BR>Votre requête ne peut continuer plus loin, il vous faut revenir en arrière et choisir l'identifiant d'un utilisateur valide.<BR><BR></CENTER>"; $admin_mgmt_ajout_3="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Vous n'avez pas définit de tâche pour l'utilisateur LZ-$id_user.</H3></U></B><BR><BR><BR>Votre requête ne peut continuer plus loin, il vous faut revenir en arrière et attribuer une tache à cet utilisateur.<BR><BR></CENTER>"; $admin_mgmt_ajout_4="<BR><BR><BR><BR><BR><B><U><CENTER><H3>L'utilisateur LZ-$id_user a bien été rajouté à la liste des administrateurs.</H3></U></B><BR><BR><BR>"; $admin_mgmt_ajout_5="L'utilisateur LZ-$id_user a maintenant :<BR><BR><LI>l'accès global op sur les eggdrops<LI>accès à la section administrer (son login est son nick)<LI>une adresse mail @loufiz.com<LI>été ajouté dans la mailing-list eggdrops@loufiz.com<LI>été ajouté dans la section contact"; $admin_mgmt_ajout_6="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Les changements sur LZ$id_user ont été effectués.</H3></U></B><BR><BR><BR"; $admin_mgmt_ajout_7="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Le nick de LZ-$id_user doit être changé pour l'ajout de cet administrateur.</H3></U></B><BR><BR><BR>Votre requête ne peut continuer plus loin, il vous faut revenir en arrière et changer son nick afin qu'il ne contienne que des caractères alphanumériques.<BR><BR></CENTER>"; // index blacklist $blacklist_index_1="<B>Ajouter</B> un channel à la blacklist"; $blacklist_index_2="<B>Retirer</B> un channel de la blacklist"; $blacklist_index_3="Liste des channels blacklistés"; $blacklist_index_3_1="Channel"; $blacklist_index_3_2="Admin"; $blacklist_index_4="Date"; $blacklist_index_5="Channel"; $blacklist_index_6="Admin"; $blacklist_index_7="Raison"; $blacklist_index_8="<INPUT TYPE='submit' VALUE='Ajouter'>"; $blacklist_index_9="<INPUT TYPE='reset' VALUE='Annuler'>"; $blacklist_index_10="<INPUT TYPE='submit' VALUE='Retirer'>"; $blacklist_index_11="<INPUT TYPE='submit' VALUE='Trier'>"; // ajout blacklist $blacklist_ajout_1="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Veuillez saisir un nom de channel et une raison.</H3></U></B><BR><BR><BR>Votre requête ne peut continuer plus loin, il vous faut revenir en arrière et remplir tous les champs demandés.<BR><BR></CENTER>"; Guillaume Tournand <guillaume@tournand.com> September 2003 439/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $blacklist_ajout_2="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Le channel #$nom_chan n'est pas un nom de channel valide.</H3></U></B><BR><BR><BR>Votre requête ne peut continuer plus loin, il vous faut revenir en arrière et choisir un autre nom de channel.<BR><BR></CENTER>"; $blacklist_ajout_3="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Le channel #$nom_chan est déjà blacklisté.</H3></U></B><BR><BR><BR>Votre requête ne peut continuer plus loin, il vous faut revenir en arrière et choisir un channel qui n'est pas déjà dans la liste.<BR><BR></CENTER>"; $blacklist_ajout_4="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Le channel #$nom_chan a bien été blacklisté.</H3></U></B><BR><BR><BR>"; // retrait blacklist $blacklist_retrait_1="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Veuillez saisir un nom de channel.</H3></U></B><BR><BR><BR>Votre requête ne peut continuer plus loin, il vous faut revenir en arrière et remplir les champs demandés.<BR><BR></CENTER>"; $blacklist_retrait_2="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Le channel #$nom_chan n'est pas un nom de channel valide.</H3></U></B><BR><BR><BR>Votre requête ne peut continuer plus loin, il vous faut revenir en arrière et choisir un autre channel.<BR><BR></CENTER>"; $blacklist_retrait_3="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Le channel #$nom_chan n'est pas blacklisté.</H3></U></B><BR><BR><BR>Votre requête ne peut continuer plus loin, il vous faut revenir en arrière et choisir un channel présent dans la liste.<BR><BR></CENTER>"; $blacklist_retrait_4="<BR><BR><BR><BR><BR><B><U><CENTER><H3>Le channel #$nom_chan a bien été retiré de la blackliste.</H3></U></B><BR><BR><BR>"; ?> Guillaume Tournand <guillaume@tournand.com> September 2003 440/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project include/style/chan_monitoring.css /* Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the Loufiz project nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ BODY, TD { color : BLACK; font-family : Tahoma ; font-size : 12; } TABLE { border : thin solid #3C486A; font-family : Tahoma ; font-size : 10; } A{ text-decoration: none; color: #0039A2; width: 100%; font-weight : bold; } A:Hover { text-decoration: none; color: black; width : 100%; text-decoration : underline; } A.section { font-size : smaller; background-color : transparent; width: auto; } A.section:hover { text-decoration: none; background-color: Gray; width : 100%; } Guillaume Tournand <guillaume@tournand.com> September 2003 441/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project A.menu { text-decoration : underline; color : Black; background-color : transparent; width: auto; font-weight : normal; } A.menu:hover { text-decoration : underline; width: auto; background-color: transparent; } A.lien { background-color : transparent; font-style : italic; font-weight : normal; color : #6464E3; width : auto; } A.lien:hover { color : BLACK; background-color : transparent; width : auto; text-decoration : underline; } A.img, A.img:hover { text-decoration : none; background-color: transparent; color: Black; font-weight : normal; width: auto; } Guillaume Tournand <guillaume@tournand.com> September 2003 442/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project include/style/loufiz.css /* Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the Loufiz project nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ BODY, TD { color : BLACK; font-family : Verdana, Tahoma ; background-color : #FDFDFF; } A{ text-decoration: none; color: #0039A2; width: 100%; font-weight : bold; } A:Hover { text-decoration: none; color: black; width : 100%; text-decoration : underline; } A.section { font-size : smaller; background-color : transparent; width: auto; } A.section:hover { text-decoration: none; background-color: Gray; width : 100%; } A.menu { text-decoration : underline; color : Black; background-color : transparent; width: auto; font-weight : normal; Guillaume Tournand <guillaume@tournand.com> September 2003 443/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project } A.menu:hover { text-decoration : underline; width: auto; background-color: transparent; } TABLE { border : thin solid #3C486A; } A.lien { background-color : transparent; font-style : italic; font-weight : normal; color : #6464E3; width : auto; } A.lien:hover { color : BLACK; background-color : transparent; width : auto; text-decoration : underline; } A.img, A.img:hover { text-decoration : none; background-color: transparent; color: Black; font-weight : normal; width: auto; } Guillaume Tournand <guillaume@tournand.com> September 2003 444/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project include/style/reglement.css /* Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the Loufiz project nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ BODY, TD { color : BLACK; font-family : Verdana, Tahoma ; background-color : #FDFDFF; } A{ text-decoration: none; color: #0039A2; width: 100%; font-weight : bold; } A:Hover { text-decoration: none; color: black; width : 100%; text-decoration : underline; } A.section { font-size : smaller; background-color : transparent; width: auto; } A.section:hover { text-decoration: none; background-color: Gray; width : 100%; } A.menu { text-decoration : underline; color : Black; background-color : transparent; width: auto; font-weight : normal; Guillaume Tournand <guillaume@tournand.com> September 2003 445/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project } A.menu:hover { text-decoration : underline; width: auto; background-color: transparent; } A.lien { background-color : transparent; font-style : italic; font-weight : normal; color : #6464E3; width : auto; } A.lien:hover { color : BLACK; background-color : transparent; width : auto; text-decoration : underline; } A.img, A.img:hover { text-decoration : none; background-color: transparent; color: Black; font-weight : normal; width: auto; } Guillaume Tournand <guillaume@tournand.com> September 2003 446/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project include/style/table_no_bgcolor.css /* Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the Loufiz project nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ BODY, TD { color : BLACK; font-family : Verdana, Tahoma ; } TABLE { border : thin solid #3C486A; } A{ text-decoration: none; color: #0039A2; width: 100%; font-weight : bold; } A:Hover { text-decoration: none; color: black; width : 100%; text-decoration : underline; } A.section { font-size : smaller; background-color : transparent; width: auto; } A.section:hover { text-decoration: none; background-color: Gray; width : 100%; } A.menu { text-decoration : underline; color : Black; Guillaume Tournand <guillaume@tournand.com> September 2003 447/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project background-color : transparent; width: auto; font-weight : normal; } A.menu:hover { text-decoration : underline; width: auto; background-color: transparent; } A.lien { background-color : transparent; font-style : italic; font-weight : normal; color : #6464E3; width : auto; } A.lien:hover { color : BLACK; background-color : transparent; width : auto; text-decoration : underline; } A.img, A.img:hover { text-decoration : none; background-color: transparent; color: Black; font-weight : normal; width: auto; } Guillaume Tournand <guillaume@tournand.com> September 2003 448/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Appendix D The scheduled programs Guillaume Tournand <guillaume@tournand.com> September 2003 449/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Database to botnet updates. #!/usr/bin/perl -w # Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights # reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # - Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # - Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # - Neither the name of the Loufiz project nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. use strict; use DBI; use Net::Telnet; # Declaration des variables pour mysql my $host = "localhost"; my $user = "root"; my $password = "DBAPasswd42"; my $database = "loufiz"; # declaration de variables pour telnet sur ADAM my $hostname="localhost"; my $port="42000"; my $egg_nickname="LZ-SYS"; my $egg_password="YUbdgTR421"; my $timeout=25; my $sleep_time=1; # nombre minimal d'utilisateur pour un channel demandeur my $min_users=10; # pid file my $pid_file="/tmp/www-egg.pid"; # se lance seulement si le fichier n'existe pas if ( !(-e $pid_file) ) { # on crée le fichier system ("echo $$ > $pid_file"); # Connexion a la base de donnee my $dbh = DBI->connect("DBI:mysql:database=$database;host=$host", $user, $password, {'RaiseError' => 1}); Guillaume Tournand <guillaume@tournand.com> September 2003 450/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # On recupere les données de la table instructions. my $sth = $dbh->prepare("SELECT * FROM instructions ORDER BY id_instr ASC"); $sth->execute(); my $num_rows = $sth->rows(); # Si la table contient des données, on continue l'execution du programme. if ($num_rows){ my ($telnet, $commande, $nom_egg, $nom_chan, $id_instr, $job_done, @output, $cpt, $db_delete, $db_update); # Connexion telnet $telnet = new Net::Telnet ( Timeout=>$timeout, Errmode=>'return'); $telnet->open(Host => $hostname, Port => $port); # Authentification @output = $telnet->waitfor(String => 'Nickname.'); # on envoie le login si ok if (grep /Nickname./, @output) { undef (@output); $telnet->print($egg_nickname); @output = $telnet->waitfor(String => 'Enter your password.'); # on envoit le pass si OK if (grep /Enter your password./, @output) { undef (@output); $telnet->print($egg_password); $telnet->waitfor(String => "*** $egg_nickname joined the party line."); # Traitement du select while (my $ref = $sth->fetchrow_hashref()) { $id_instr=$ref->{'id_instr'}; # En fonction du champ 'ack' on attend ou pas une reponse. undef ($nom_egg); undef ($nom_chan); # Pas de ack, commande en local pour adam if (!$ref->{'ack'}) { #On n'attend pas de reponse, et on balance comme un bourrin $telnet->print("$ref->{'commande'}\n"); $db_delete = $dbh->prepare("DELETE FROM instructions WHERE id_instr='$id_instr'"); $db_delete->execute(); } # Ack = 1 Join de channel elsif ($ref->{'ack'} == '1') { $commande=$ref->{'commande'}; # On attend une reponse de la forme OK chan joint, ou OK deja sur chan if ($commande =~ /^[^ ]+ ([^ ]+) ([^ ]+)/) { $nom_egg = substr ($1, length($1)-3, 3); $nom_chan = $2; } $telnet->print("$ref->{'commande'}\n"); # Si le ack est OK on peut supprimer l'instruction if ($telnet->waitfor(String => "$nom_egg: Joined channel $nom_chan", String => "$nom_egg: I'm on $nom_chan already!")) { Guillaume Tournand <guillaume@tournand.com> September 2003 451/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $db_delete = $dbh->prepare("DELETE FROM instructions WHERE id_instr='$id_instr'"); $db_delete->execute(); } } # Ack = 2 quitte un channel elsif ($ref->{'ack'} == '2') { $commande=$ref->{'commande'}; #On attend une reponse de la forme OK chan quitté, ou OK pas sur chan if ($commande =~ /^[^ ]+ ([^ ]+) ([^ ]+)/) { $nom_egg = substr ($1, length($1)-3, 3); $nom_chan = $2; } $telnet->print("$ref->{'commande'}\n"); # Si le ack est OK on peut supprimer l'instruction if ($telnet->waitfor(String => "$nom_egg: Left channel $nom_chan", String => "$nom_egg: I'm not on channel $nom_chan")) { $db_delete = $dbh->prepare("DELETE FROM instructions WHERE id_instr='$id_instr'"); $db_delete->execute(); } } # Ack = 3 status d'une application elsif ($ref->{'ack'} == '3') { $job_done=0; $commande=$ref->{'commande'}; # On regarde pour quel channel est cette instruction if ($commande =~ /.newapp ([^ ]+)/) { $nom_chan = $1; } # On lance l'instruction $telnet->print("$ref->{'commande'}\n"); sleep 7; undef (@output); @output=$telnet->waitfor(String => ' Scan complete.'); # On supprime l'instruction $db_delete = $dbh->prepare("DELETE FROM instructions WHERE id_instr='$id_instr'"); $db_delete->execute(); for ($cpt=0; $output[$cpt] && !$job_done; $cpt++) { chomp ($output[$cpt]); if ($output[$cpt] =~ /.*Eggdrops request for [#]$nom_chan[:] (.*)/) { $db_update = $dbh->prepare("UPDATE askin_chan SET rapport='$1' WHERE nom_chan='$nom_chan'"); $db_update->execute(); $job_done=1; } } undef (@output); } # Ack = 4 description du channel sur X elsif ($ref->{'ack'} == '4') { Guillaume Tournand <guillaume@tournand.com> September 2003 452/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $commande=$ref->{'commande'}; $telnet->print("$ref->{'commande'}\n"); # Si le ack est OK on peut supprimer l'instruction if ($telnet->waitfor(String => "-X (cservice\@undernet.org)- DESCRIPTION for #loufiz is:")) { $db_delete = $dbh->prepare("DELETE FROM instructions WHERE id_instr='$id_instr'"); $db_delete->execute(); } } # on fait une petite pause entre 2 instructions sleep $sleep_time; } # On backup les donnees $telnet->print(".save"); $telnet->print(".backup"); $telnet->waitfor(String => 'Backing up the channel & user files...'); # On quitte le telnet $telnet->print(".quit"); } } # Deconnexion telnet $telnet->close(); } # Deconnexion Mysql $sth->finish(); $dbh->disconnect(); # suppression du fichier pid system ("rm -f $pid_file"); } Guillaume Tournand <guillaume@tournand.com> September 2003 453/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Botnet monitoring #!/usr/bin/perl -w # Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights # reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # - Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # - Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # - Neither the name of the Loufiz project nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ###################################################################### ###################################################################### ### ### Include des modules necessaires ### ###################################################################### ###################################################################### use strict; use DBI; use Net::Telnet; use SOAP::Lite; ###################################################################### ###################################################################### ### ### Declaration des variables necessaires ### ###################################################################### ###################################################################### # Declaration des variables pour mysql my $host = "localhost"; my $user = "root"; my $password = "DBAPasswd42"; my $database = "loufiz"; # declaration de variables pour telnet sur ADAM my ($hostname, $port, $egg_nickname, $egg_password); $hostname="localhost"; $port="42000"; $egg_nickname="LZ-SYS"; $egg_password="YUbdgTR421"; # declaration des variables pour le programme Guillaume Tournand <guillaume@tournand.com> September 2003 454/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project my ($telnet, @output, @status_output, @bots, @path, $cpt, $serveur_cpt, $serveur_bot, @bots_repondu, $bot_deconnecte, @bots_temp, @channels, $channels_cpt, $max_chans, $channel_exist, $nb_cases, @liste_chans, $liste_chans_cpt, $nom_chan, $is_op, @bot_chans, $chan_cpt, @parse_users, $parse_cpt, $nb_users, $nb_users_done, $egg_username, @cservice_result); my $cservice_bot="X"; my $cservice_uhost="cservice\@undernet.org"; my $sleep_time_x=15; my $sleep_time_soap=1; my $sleep_time_egg=10; my $timeout_time=20; # declaration des variables pour la base de donnée my ($sth, $num_rows, $ref, $update); my (@chan_monitoring); @chan_monitoring = qw(nom_chan nb_egg_report nb_egg_op nb_user_1 nb_user_2 nb_user_3 x_present axs_x x_automode); my $unixtime_now=time(); my $min_users=10; @path='/usr/home/eggdrops/adam/tmp'; $nb_cases=9; # declaration des variables pour soap my $cservice_soap_serveur = "http://cservice.undernet.org/live/_s04p_/index.php"; my $cservice_soap_name = "$cservice_soap_serveur"; # un gadjet dont l'utilité m'échappe # Structure du tableau channels : nom_chan, nb_egg_au_rapport, nb_eggs_op, nb_users_rapporte_egg_1, nb_users_rapporte_egg_2, nb_users_rapporte_egg_3, x_present, nb_access_a_x # pid file my $pid_file="/tmp/egg-monitoring.pid"; my $extra_bot="frost"; ###################################################################### ###################################################################### ### ### Declaration des fonctions necessaires ### ###################################################################### ###################################################################### sub cservice_x_checkapplication { # nom du channel en parametre my $cservice_channel=$_[0]; # valeurs de retour my @cservice_result; $cservice_result[0]=-1; # params locaux my $cpt; my $job_done; #On questionne X pour savoir s'il est present sur ce channel $telnet->print(".msg $cservice_bot info $cservice_channel\n"); @output = $telnet->waitfor(String => "$cservice_channel doesn't appear to be registered", String => "$cservice_channel is registered", Timeout => $timeout_time); # s'il y a une réponse, on la traite Guillaume Tournand <guillaume@tournand.com> September 2003 455/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project if (@output) { for ($cpt=0, $job_done=0; $output[$cpt] && !$job_done; $cpt++) { $_=lc ($output[$cpt]); # channel enregistré, code 1 if (m/$cservice_channel is registered/) { $cservice_result[0]=1; $job_done=1; } # Le channel n'est pas enregistré, code 0 if (m/$cservice_channel doesn't appear to be registered/) { $cservice_result[0]=0; $job_done=1; } } } # On undef pour etre sur de ne pas faire d'erreur undef (@output); sleep $sleep_time_x; # retour return @cservice_result; } sub cservice_soap_checkapplication { # nom du channel en parametre my $soap_channel=$_[0]; # variables de traitement my $soap_query_status; my $soap_app_status; # variable de retour my @soap_result; $soap_result[0]=-1; my $soap = SOAP::Lite ->on_fault (sub {}) ->uri($cservice_soap_name) ->proxy($cservice_soap_serveur); my $reponse = $soap -> checkApplication ( "$soap_channel" ); # s'il y a une réponse, on la traite if ($reponse) { my @result=$reponse->result(); $soap_query_status=@result->[0]{'query_status'}; $soap_app_status=@result->[0]{'app_status'}; # si l'application est trouvée et le channel est enregistré if ( ($soap_query_status==1) && ($soap_app_status==3) ) { $soap_result[0]=1; } else { $soap_result[0]=0; } } sleep $sleep_time_soap; return @soap_result; } Guillaume Tournand <guillaume@tournand.com> September 2003 456/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project sub cservice_x_channelaccesslist { # les parametres my $cservice_channel=$_[0]; my $cservice_username=$_[1]; # valeurs de retour my @cservice_result; $cservice_result[0]=-1; $cservice_result[1]=0; $telnet->print(".msg $cservice_bot access $cservice_channel $cservice_username\n"); @output = $telnet->waitfor(String => "No Match!", String => "End of access list", Timeout => $timeout_time); # on traite la réponse si présente if (@output) { open (F, ">@path/eggdrop_reponse_x.adam") || die "Impossible d'ouvrir le fichier : $!\n"; print F @output; close (F); system("cd @path; grep $cservice_uhost eggdrop_reponse_x.adam > eggdrop_reponse_x_new.adam"); open (F, "<@path/eggdrop_reponse_x_new.adam") || die "Impossible d'ouvrir le fichier : $!\n"; @output=<F>; close (F); # On supprime les fichiers temporaires générés system ("cd @path; rm eggdrop_reponse_x*.adam"); # on parse le résultat for ($cpt=0; $output[$cpt]; $cpt++) { $output[$cpt]=lc($output[$cpt]); if ($output[$cpt] =~ /.*\w+: $cservice_username \w+: (\d+).*/) { $cservice_result[0]=$1; # Calcul du nombre d'automode $output[$cpt+1]=lc($output[$cpt+1]); if ($output[$cpt+1] =~ /.* automode: (\w+)/) { if ($1 eq "op") { $cservice_result[1]=2; } if ($1 eq "voice") { $cservice_result[1]=1; } } } if ($output[$cpt] =~ /.*[(]$cservice_uhost[)]- no match!.*/) { $cservice_result[0]=0; } } # On undef pour etre sur de ne pas faire d'erreur undef (@output); } sleep $sleep_time_x; return @cservice_result; } sub cservice_soap_channelaccesslist { # faute de soap Guillaume Tournand <guillaume@tournand.com> September 2003 457/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project my $soap_fault=0; # les parametres my $soap_channel=$_[0]; my $soap_username=$_[1]; # variables de traitement my $soap_query_status; my $soap_app_nb_match; # variable de retour my @soap_result; $soap_result[0]=-1; my $soap = SOAP::Lite ->on_fault (sub { # zone de récupération des erreurs my $faulty_answer = lc ($_[1]); $soap_fault=1; # on va parser la réponse, et essayer de corriger l'erreur if ($faulty_answer =~ /.*<query_status xsi:type="xsd:int">(\d+)<[\/]query_status>.*<nb_match xsi:type="xsd:int">(\d+)<[\/]nb_match>.*/) { $soap_query_status=$1; $soap_app_nb_match=$2; # il y a eu une réponse, on intialise les valeurs de retour $soap_result[0]=0; $soap_result[1]=0; # s'il y a un match if ( ($soap_query_status==1) && ($soap_app_nb_match==1) ) { # on choppe l'access et l'automode if ($faulty_answer =~ /.*<username xsi:type="xsd:string">$soap_username<[\/]username><level xsi:type="xsd:string">(\d+)<[\/]level><automode xsi:type="xsd:int">(\d+)<[\/]automode>.*/) { # on stoque le résultat $soap_result[0]=$1; $soap_result[1]=$2; } } } }) ->uri($cservice_soap_name) ->proxy($cservice_soap_serveur); my $reponse = $soap -> channelAccessList("$soap_channel", "$soap_username"); # s'il y a une réponse, on la traite if (!$soap_fault) { my @result=$reponse->result(); $soap_query_status=@result->[0]{'query_status'}; $soap_app_nb_match=@result->[0]{'nb_match'}; # il y a eu une réponse, on intialise les valeurs de retour $soap_result[0]=0; $soap_result[1]=0; # si l'application est trouvée et le channel est enregistré if ( ($soap_query_status==1) && ($soap_app_nb_match==1) ){ $soap_result[0]=@result->[0]{'level'}; $soap_result[1]=@result->[0]{'automode'}; Guillaume Tournand <guillaume@tournand.com> September 2003 458/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project } else { $soap_result[0]=0; } } sleep $sleep_time_soap; return @soap_result; } ###################################################################### ###################################################################### ### ### Le programme ### ###################################################################### ###################################################################### # se lance seulement si le fichier n'existe pas if ( !(-e $pid_file) ) { # on créer le fichier system ("echo $$ > $pid_file"); # Connexion telnet $telnet = new Net::Telnet ( Timeout=>$timeout_time, Errmode=>'return'); $telnet->open(Host => $hostname, Port => $port); # Authentification @output = $telnet->waitfor(String => 'Nickname.'); # on envoie le login si ok if (grep /Nickname./, @output) { undef (@output); $telnet->print($egg_nickname); @output = $telnet->waitfor(String => 'Enter your password.'); # on envoit le pass si OK if (grep /Enter your password./, @output) { undef (@output); $telnet->print($egg_password); $telnet->waitfor(String => "*** $egg_nickname joined the party line."); $telnet->print('.bots'); @output = $telnet->waitfor(String => '(total: '); if (@output) { # On trie le resultat pour obtenir le nom des eggdrops connectés chomp @output; @output=split(/, /, "@output"); # on supprime la merde apres le nom du dernier eggdrop for ($cpt=1; $output[$cpt]; $cpt++){ if ($output[$cpt] =~ /^([^ ]*).*/) { push @bots, $1; } } # On ajoute le bot supplementaire push @bots, $extra_bot; # On undef pour etre sur de ne pas faire d'erreur undef (@output); Guillaume Tournand <guillaume@tournand.com> September 2003 459/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # connexion a la base de donnée my $dbh = DBI->connect("DBI:mysql:database=$database;host=$host", $user, $password, {'RaiseError' => 1}); # Mise a jour de l'etat de connexion d'adam $telnet->print('.status'); $telnet->print('.info'); @output = $telnet->waitfor(String => 'No info has been set for you.'); # split de output en lignes @status_output=split(/\n\s+/, "@output"); # analyse du résultat for ($serveur_cpt=0, $serveur_bot=0; $status_output[$serveur_cpt] && (!$serveur_bot); $serveur_cpt++) { $status_output[$serveur_cpt]=lc($status_output[$serveur_cpt]); if ($status_output[$serveur_cpt] =~ /.*server (.*[.]undernet[.]org:\d+)\s*[(]connected.*/) { $serveur_bot="$1"; $sth = $dbh->prepare("UPDATE m_server='$serveur_bot', m_unixtime='$unixtime_now' WHERE nom='ad4m'"); $sth->execute(); $sth->finish(); } } eggdrops SET # On undef pour etre sur de ne pas faire d'erreur undef (@output); undef (@status_output); # On commence la moulinette de connexion aux eggdrops (sauf sur adam) for ($cpt=0; $bots[$cpt]; $cpt++){ # On passe tout en minuscule $bots[$cpt]=lc($bots[$cpt]); # Connexion aux eggdrops $telnet->print(".relay $bots[$cpt]"); # Authentification @output = $telnet->waitfor(String => 'Nickname.', Timeout => $timeout_time ); # on envoit le login si OK if (grep /Nickname./, @output) { undef (@output); $telnet->print($egg_nickname); @output = $telnet->waitfor(String => 'Enter your password.'); # on envoit le pass si OK if (grep /Enter your password./, @output) { undef (@output); $telnet->print($egg_password); $telnet->waitfor(String => "*** $egg_nickname joined the party line."); $telnet->print('.status'); $telnet->print('.info'); @output = $telnet->waitfor(String => 'No info has been set for you.'); # On quitte le .relay $telnet->print('.quit'); Guillaume Tournand <guillaume@tournand.com> September 2003 460/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # Si le bot a repondu, on stoque le resultat dans un fichier if (@output) { open ">@path/chan_$bots[$cpt].adam") || die "Impossible d'ouvrir le fichier : $!\n"; print F @output; close (F); (F, # On stoque dans un tableau la liste des eggdrops qui ont répondu, si le bot est connecté a un serveur $bot_deconnecte=grep /No server currently./, @output; if (!$bot_deconnecte) { # split de output en lignes @status_output=split(/\n\s+/, "@output"); # On met a jour ses informations de connexion dans la table. for $serveur_bot=0; $status_output[$serveur_cpt] && (!$serveur_bot); $serveur_cpt++) { ($serveur_cpt=0, $status_output[$serveur_cpt]=lc($status_output[$serveur_cpt]); # on verifie que le bot soit reellement connecte a un serveur if ($status_output[$serveur_cpt] =~ /.*server (.*[.]undernet[.]org:\d+)\s*[(]connected.*/) { $serveur_bot="$1"; >prepare("UPDATE nom='$bots[$cpt]'"); eggdrops SET m_server='$serveur_bot', $sth = $dbhm_unixtime='$unixtime_now' WHERE $sth- >execute(); $sth->finish(); # on rajoutte le bot dans le tableau des bots qui ont repondu if ($bots[$cpt] ne $extra_bot) { push @bots_repondu, $bots[$cpt]; } # on separe le resultat du status en chanoplist et chanuserlist system ("cd @path; grep 'enforcing' chan_$bots[$cpt].adam > chan_$bots[$cpt]_users.adam; grep -v 'enforcing' chan_$bots[$cpt].adam > chan_$bots[$cpt]_tmp.adam; grep '#' chan_$bots[$cpt]_tmp.adam > chan_$bots[$cpt]_tmp2.adam; grep -v $egg_nickname chan_$bots[$cpt]_tmp2.adam |grep -v 'channel is set +inactive' > chan_$bots[$cpt]_op.adam; rm chan_$bots[$cpt].adam chan_$bots[$cpt]_tmp*.adam"); } } } } } } sleep $sleep_time_egg; undef $bot_deconnecte; # On undef pour etre sur de ne pas faire d'erreur undef (@output); undef (@status_output); } Guillaume Tournand <guillaume@tournand.com> September 2003 461/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # tous les eggdrops n'ayant pas repondu ou sans serveurs sont marques comme deconnectes $sth = $dbh->prepare("UPDATE m_unixtime='$unixtime_now' WHERE m_unixtime!='$unixtime_now'"); $sth->execute(); $sth->finish(); eggdrops SET m_server='-', # Deconnexion Mysql $dbh->disconnect(); } } } # On classe le tableau @bots_repondu par odre alphabetique foreach (sort {$a cmp $b} @bots_repondu) { push @bots_temp, $_; } undef (@bots_repondu); for ($cpt=0; $bots_temp[$cpt]; $cpt++) { push @bots_repondu, $bots_temp[$cpt]; } # On passe a la moulinette chaque bot qui a repondu pour connaitre la liste des channels de chaque bot, et s'il est op dessus for ($cpt=0, undef (@output); $bots_repondu[$cpt]; $cpt++){ $bots_repondu[$cpt]=lc($bots_repondu[$cpt]); open (F, "<@path/chan_$bots_repondu[$cpt]_op.adam") || die "Impossible d'ouvrir le fichier : $!\n"; @output=<F>; close (F); # On separe le fichier et on le splitte en lignes chomp @output; @liste_chans=split(/, /, "@output"); # On undef pour etre sur de ne pas faire d'erreur undef (@output); # Pour chaque ligne, on analyse son contenu for ($liste_chans_cpt=1; $liste_chans[$liste_chans_cpt]; $liste_chans_cpt++){ # On separe le nom des channels ainsi que leur status (op ou pas) if ($liste_chans[$liste_chans_cpt] =~ /^\s*[#]([^\s]*).*/) { $nom_chan=$1; # On passe le nom du chan en minuscules $nom_chan=lc($nom_chan); # On regarde si le bot est op sur le channel if ($nom_chan =~ /(.*)[(].*/){ $nom_chan=$1; $is_op=0; } else { $is_op=1; } # supression des eventuels espaces avant ou apres le nom du channel for ($_=$nom_chan;s/ //;$nom_chan=$_) {} Guillaume Tournand <guillaume@tournand.com> September 2003 462/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # On rajoutte l'entrée dans le tableau @channels for ($channels_cpt=0, $channel_exist=0; ($channels[$channels_cpt]) && (!$channel_exist); $channels_cpt=$channels_cpt+$nb_cases){ # Si le channel est deja present, on met a jour les infos if ($channels[$channels_cpt] eq $nom_chan) { $channels[$channels_cpt+1]=$channels[$channels_cpt+1]+1; $channels[$channels_cpt+2]=$channels[$channels_cpt+2]+$is_op; $channel_exist=1; } } # Sinon on rajoutte nos infos if (!$channel_exist){ for ($channels_cpt=0, $channel_exist=0; $channels[$channels_cpt]; $channels_cpt=$channels_cpt+$nb_cases){} $channels[$channels_cpt]=$nom_chan; $channels[$channels_cpt+1]=1; $channels[$channels_cpt+2]=$is_op; # On met a 0 les 3 champs du nb d'utilisateurs $channels[$channels_cpt+3]=0; $channels[$channels_cpt+4]=0; $channels[$channels_cpt+5]=0; } } undef ($nom_chan); undef ($is_op); } } # On passe chaque bot a la moulinette pour connaitre le nombre d'utilisateur sur chaque channel for ($cpt=0, undef (@output); $bots_repondu[$cpt]; $cpt++){ open (F, "<@path/chan_$bots_repondu[$cpt]_users.adam") || die "Impossible d'ouvrir le fichier : $!\n"; @output=<F>; close (F); # On separe le fichier en lignes chomp @output; @bot_chans=split(/#/, "@output"); # On undef pour etre sur de ne pas faire d'erreur undef (@output); # Pour chaque ligne, on separe le nom de channel du nombre d'utilisateurs for ($chan_cpt=1; $bot_chans[$chan_cpt]; $chan_cpt++, undef ($nb_users), undef ($nom_chan)){ # On recupere le nom du channel if ($bot_chans[$chan_cpt] =~ /([^\s]*)\s*:\s*\d*.*/) { $nom_chan=$1; } # On recupere le nombre d'utilisateurs s'il est present $nb_users=0; if ($bot_chans[$chan_cpt] =~ /[^\s]*\s*:\s*(\d+).*/) { $nb_users=$1; } if (!$nb_users){ $nb_users=0; } Guillaume Tournand <guillaume@tournand.com> September 2003 463/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $nb_users_done=0; # On supprime ces putains de blancs qui nous ont bien cassé les couilles (les 2) for ($_=$nom_chan; s/ //; $nom_chan=$_) {} # On passe le nom du chan en minuscules $nom_chan=lc($nom_chan); if ( ($nom_chan) && ($nom_chan ne 'loufiz') ) { # On rajoutte l'entrée dans le tableau @channels for ($channels_cpt=0, $channel_exist=0; ($channels[$channels_cpt]) && (!$channel_exist); $channels_cpt=$channels_cpt+$nb_cases){ # On trouve le channel deja present, et on met a jour les infos if ($channels[$channels_cpt] eq $nom_chan) { $channel_exist=1; #On met a jour les champs 3 a 5 qui sont les nb d'utilisateurs releves par les 3 eggs pretés # Nota: on retire le nombre d'eggs au rapport au nombre d'utilisateurs relevé if (!$channels[$channels_cpt+3] && !$nb_users_done){ $channels[$channels_cpt+3]=$nb_users$channels[$channels_cpt+1]; # on limite a 0 if ($channels[$channels_cpt+3] < 0){ $channels[$channels_cpt+3]=0; } $nb_users_done=1; } if (!$channels[$channels_cpt+4] && !$nb_users_done){ $channels[$channels_cpt+4]=$nb_users$channels[$channels_cpt+1]; # on limite a 0 if ($channels[$channels_cpt+4] < 0){ $channels[$channels_cpt+4]=0; } $nb_users_done=1; } if (!$channels[$channels_cpt+5] && !$nb_users_done){ $channels[$channels_cpt+5]=$nb_users$channels[$channels_cpt+1]; # on limite a 0 if ($channels[$channels_cpt+5] < 0){ $channels[$channels_cpt+5]=0; } $nb_users_done=1; } } } } } } # On efface les fichiers temporaires des .status system ("cd @path; rm chan_*.adam"); # On modifie les valeurs des champs concernant le nombre d'utilisateurs pour les bots deconnectés for ($channels_cpt=0; $channels[$channels_cpt]; $channels_cpt=$channels_cpt+$nb_cases) { for ($cpt=3; $cpt > $channels[$channels_cpt+1]; $cpt--) { $channels[$channels_cpt+2+$cpt]='-'; } } Guillaume Tournand <guillaume@tournand.com> September 2003 464/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # On controle les acces sur X (si present) # On se connecte a la base de donnée my $dbh = DBI->connect("DBI:mysql:database=$database;host=$host", $user, $password, {'RaiseError' => 1}); # Pour chaque channel on controle l'access sur X et on update la table for ($channels_cpt=0, undef (@output); $channels_cpt=$channels_cpt+$nb_cases, undef (@output)){ $channels[$channels_cpt]; #On vérifie qu'on a pas deja demandé a X des infos pour ce channel if (!$channels[$channels_cpt+6]) { $nom_chan=$channels[$channels_cpt]; # on demande l'état d'enregistrement du channel a Cservice # premiere voie, soap @cservice_result=cservice_soap_checkapplication ("#$nom_chan"); # si pas de réponse, 2eme voie, le msg if ($cservice_result[0] == -1) { undef (@cservice_result); @cservice_result=cservice_x_checkapplication ("#$nom_chan"); # si malgré tout, on n'a pas de réponse if ($cservice_result[0] == -1 ) { $channels[$channels_cpt+6]='3'; $channels[$channels_cpt+7]='-'; $channels[$channels_cpt+8]='-'; } } # Si le channel n'est pas enregistré if ($cservice_result[0] == 0) { $channels[$channels_cpt+6]='2'; $channels[$channels_cpt+7]='-'; $channels[$channels_cpt+8]='-'; } # Si le channel est enregistré if ($cservice_result[0] == 1) { # fin des tests, on peut undef undef (@cservice_result); $channels[$channels_cpt+6]='1'; $channels[$channels_cpt+7]='0'; $channels[$channels_cpt+8]='0'; # On recupere les usernames des eggdrops presents sur ce channel. $sth = $dbh->prepare("SELECT e.username FROM eggdrops e, channels c WHERE c.nom_chan='$nom_chan' AND c.egg_group=e.egg_bloc"); $sth->execute(); $num_rows = $sth->rows(); # pour chaque username on demade les access while ($ref = $sth->fetchrow_hashref()) { $egg_username=$ref->{'username'}; # d'abord on passe par soap @cservice_result=cservice_soap_channelaccesslist("#$nom_chan", "$egg_username"); Guillaume Tournand <guillaume@tournand.com> September 2003 465/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # si pas de réponse, 2eme voie, le msg if ($cservice_result[0] == -1 ) { undef (@cservice_result); @cservice_result=cservice_x_channelaccesslist ("#$nom_chan", "$egg_username"); # si malgré tout, on n'a pas de réponse if ($cservice_result[0] == -1 ) { $channels[$channels_cpt+7]='-'; $channels[$channels_cpt+8]='-'; } } # si l'access est correctement fait if ($cservice_result[0] >= 100 ) { $channels[$channels_cpt+7]++; } # si l'automode est ok if ($cservice_result[0] == 2) { $channels[$channels_cpt+8]++; } } undef (@cservice_result); # On vérifie la concordance du nombre d'access avec le nb d'automode if ($channels[$channels_cpt+7] eq "-") { $channels[$channels_cpt+8] = "-"; } # fin de la requete $sth->finish(); } } # On met a jour la base de donnée $sth = $dbh->prepare("SELECT * FROM chan_monitoring WHERE nom_chan='$nom_chan'"); $sth->execute(); $num_rows = $sth->rows(); if ($num_rows) { $ref = $sth->fetchrow_hashref(); for ($cpt=1; $cpt<$nb_cases; $cpt++){ # Depuis combien de temps l'egg est il op? if ($cpt==2){ if ( (($channels[$channels_cpt+$cpt] == $channels[$channels_cpt+$cpt-1]) && ($channels[$channels_cpt+$cpt]) ) || ($ref->{'op_depuis'} eq "0") ) { $update = $dbh->prepare("UPDATE chan_monitoring SET op_depuis='$unixtime_now' WHERE nom_chan='$nom_chan'"); $update->execute(); $update->finish(); } } # Le nombre d'users est il le meme ? if ($cpt==3){ if (($channels[$channels_cpt+$cpt] ne "-") && ($ref->{'nb_user_1'} ne "-")) { if ( ($channels[$channels_cpt+$cpt] >= $min_users) || ($ref->{'depuis_user_1'} eq "0") ) { $update = $dbh->prepare("UPDATE chan_monitoring SET depuis_user_1='$unixtime_now' WHERE nom_chan='$nom_chan'"); $update->execute(); Guillaume Tournand <guillaume@tournand.com> September 2003 466/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $update->finish(); } } } # Le nombre d'users est il le meme ? if ($cpt==4){ if (($channels[$channels_cpt+$cpt] ne "-") && ($ref->{'nb_user_2'} ne "-")) { if ( ($channels[$channels_cpt+$cpt] >= $min_users) || ($ref->{'depuis_user_2'} eq "0") ) { $update = $dbh->prepare("UPDATE chan_monitoring SET depuis_user_2='$unixtime_now' WHERE nom_chan='$nom_chan'"); $update->execute(); $update->finish(); } } } # Le nombre d'users est il le meme ? if ($cpt==5){ if (($channels[$channels_cpt+$cpt] ne "-") && ($ref->{'nb_user_3'} ne "-")) { if ( ($channels[$channels_cpt+$cpt] >= $min_users) || ($ref->{'depuis_user_3'} eq "0") ) { $update = $dbh->prepare("UPDATE chan_monitoring SET depuis_user_3='$unixtime_now' WHERE nom_chan='$nom_chan'"); $update->execute(); $update->finish(); } } } # X etait il present avant ? if ($cpt==6) { if ( (($channels[$channels_cpt+$cpt] ne "1") && ($channels[$channels_cpt+$cpt] ne "3")) || ($ref->{'x_depuis'} eq "0") ) { $update = $dbh->prepare("UPDATE chan_monitoring SET x_depuis='$unixtime_now' WHERE nom_chan='$nom_chan'"); $update->execute(); $update->finish(); } } # les access sur X ont ils changés ? if ($cpt==7){ # On met la date a jour si (l'acces sur X a change, ou si la date est vide) et (l'access different de '-') if (($channels[$channels_cpt+$cpt] ne "-") && ($ref->{'axs_x'} ne "")) { if ( ($channels[$channels_cpt+$cpt] == 3) || ($ref- >{'axs_depuis'} eq "0") ) { $update = $dbh->prepare("UPDATE chan_monitoring SET axs_depuis='$unixtime_now' WHERE nom_chan='$nom_chan'"); $update->execute(); $update->finish(); } } } # les automodes sur X ont ils changés ? if ($cpt==8){ if (($channels[$channels_cpt+$cpt] ne "-") && ($ref->{'x_automode'} ne "-")) { if ( ($channels[$channels_cpt+$cpt] < 3) || ($ref- >{'automode_depuis'} eq "0") ) { Guillaume Tournand <guillaume@tournand.com> September 2003 467/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $update = $dbh->prepare("UPDATE chan_monitoring SET automode_depuis='$unixtime_now' WHERE nom_chan='$nom_chan'"); $update->execute(); $update->finish(); } } } $update = $dbh->prepare("UPDATE chan_monitoring $chan_monitoring[$cpt]='$channels[$channels_cpt+$cpt]' WHERE nom_chan='$nom_chan'"); $update->execute(); $update->finish(); } SET $update = $dbh->prepare("UPDATE chan_monitoring SET maj='$unixtime_now' WHERE nom_chan='$nom_chan'"); $update->execute(); $update->finish(); } $sth->finish(); } # Deconnexion Mysql $dbh->disconnect(); # deconnexion de la partyline $telnet->print('.quit'); # Deconnexion telnet $telnet->close(); # suppression du fichier pid system ("rm -f $pid_file"); } Guillaume Tournand <guillaume@tournand.com> September 2003 468/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Botnet’s server lists update Fetch Undernet’s IRC servers list #!/usr/bin/perl -w # Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights # reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # - Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # - Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # - Neither the name of the Loufiz project nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # We refuse the use of non-declared variables use strict; # This module is for the Mysql database connexion use DBI; ###################################################################### ###################################################################### ### ### Configuration ### ###################################################################### ###################################################################### # zone de travail temporaire my $temp_path="/home/eggdrops/adam/tmp/"; # Variables for mysql connexion my $host = "localhost"; my $user = "root"; my $password = "DBAPasswd42"; my $database = "loufiz"; ###################################################################### ###################################################################### ### ### Declaration of the used variables ### ###################################################################### ###################################################################### Guillaume Tournand <guillaume@tournand.com> September 2003 469/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # for the fetch of the undernet servers page my $nom_page="undernet_servers.html"; my $url="http://www.undernet.org/servers.php"; my(@output, @temp_servers, $cpt, $server_cpt); # table of undernet servers from undernet my @undernet_servers; # in this table, we have the fqdn, and the port my $undernet_servers_rows=2; my $servers_found=0; # table of undernet servers from loufiz my @loufiz_servers; my $match; # mail configuration my $mail_address="nolderise\@loufiz.com"; my ($mail_rem, $mail_add); my $path_to_mail="/usr/bin/mail"; my $path_to_temp_mail="${temp_path}temp_mail.txt"; my $mail_subject="[www.loufiz.com] Undernet servers checkup status"; my $mail_body="Results of the check between Loufiz recorded undernet servers, and the current undernet network map :\n\n"; # for the SQL my ($sth_svr, $ref, $nom_serveur, $num_rows); ###################################################################### ###################################################################### ### ### The program ### ###################################################################### ###################################################################### # we fetch the page system ("cd $temp_path; fetch -o $nom_page \"$url\" 2>&1 > /dev/null"); # We store the fetched page on a table : @output open (F, "<$temp_path$nom_page") || die "Impossible d'ouvrir le fichier : $!\n"; @output=<F>; close (F); # For each line, we parse it for ($cpt=0; $output[$cpt]; $cpt++) { # first we set the whole line in lower case to be sure $output[$cpt]=lc($output[$cpt]); undef (@temp_servers); # if the line match an html line, we take it if ($output[$cpt] =~ /(.*<tr>.*)/) { push @temp_servers, $output[$cpt]; for (; (!($output[$cpt] =~ /.*<[\/]tr>.*/) ) && $output[$cpt]; $cpt++) { # we store the whole html table line in the table push @temp_servers, $output[$cpt]; } # then we analyse the temp_server table for ($server_cpt=0; $temp_servers[$server_cpt]; $server_cpt++) { Guillaume Tournand <guillaume@tournand.com> September 2003 470/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # everything has to be lower case $temp_servers[$server_cpt]=lc($temp_servers[$server_cpt]); # now we fetch the server fqdn if ($temp_servers[$server_cpt] =~ /.*<a href=[^ ]+>( .*[.]undernet[.]org)<[\/]a>.*/) { $undernet_servers[$servers_found*$undernet_servers_rows]=$1; $servers_found++; push @undernet_servers, "6667"; # now we'll get the ports for ($server_cpt=0; $temp_servers[$server_cpt]; $server_cpt++) { # # # everything has to be lower case $temp_servers[$server_cpt]=lc($temp_servers[$server_cpt]); # # if ($temp_servers[$server_cpt] =~ /.*<.*>(\d{4}).*<[\/]td>.*/) { push @undernet_servers, $1; # # } } } } } } # connection to the database # Connexion to the database my $dbh = DBI->connect("DBI:mysql:database=$database;host=$host", $user, $password, {'RaiseError' => 1}); # now we fill the table of loufiz servers $sth_svr = $dbh->prepare("SELECT nom FROM serveurs WHERE etat='1'"); $sth_svr->execute(); # pour chaque serveur, on l'ajoutte dans le tableau des serveurs de loufiz while ($ref = $sth_svr->fetchrow_hashref()) { $nom_serveur=$ref->{'nom'}; push @loufiz_servers, $nom_serveur; } # end of this request $sth_svr->finish(); # differences entre les serveurs de loufiz et ceux d'undernet for ($mail_rem=0, $cpt=0; $loufiz_servers[$cpt]; $cpt++) { for ($server_cpt=0, $match=0; $undernet_servers[$server_cpt] $server_cpt=$server_cpt+$undernet_servers_rows) { if ($loufiz_servers[$cpt] eq $undernet_servers[$server_cpt]) { $match=1; } } && !$match; if (!$match) { $mail_body="$mail_body$loufiz_servers[$cpt] should be removed\n"; $mail_rem=1; } } $mail_body="$mail_body\n"; # differences entre les serveurs d'undernet et ceux de loufiz for ($mail_add=0, $cpt=0; $undernet_servers[$cpt]; $cpt=$cpt+$undernet_servers_rows) { Guillaume Tournand <guillaume@tournand.com> September 2003 471/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project for ($server_cpt=0, $match=0; $loufiz_servers[$server_cpt] && !$match; $server_cpt++) { if ($undernet_servers[$cpt] eq $loufiz_servers[$server_cpt]) { $match=1; } } if (! $match) { # we add the servers to the database if not already present $sth_svr = $dbh->prepare("SELECT id_svr FROM serveurs WHERE nom='$undernet_servers[$cpt]'"); $sth_svr->execute(); $num_rows = $sth_svr->rows(); $sth_svr->finish(); if (!$num_rows) { $sth_svr = $dbh->prepare("INSERT INTO serveurs(nom, port, etat) VALUES('$undernet_servers[$cpt]', '$undernet_servers[$cpt+1]', '0')"); $sth_svr->execute(); $sth_svr->finish(); } $mail_body="$mail_body$undernet_servers[$cpt] is missing to loufiz\n"; $mail_add=1; } } # Mysql deconnexion $dbh->disconnect(); # send the mail if something has to be done if ($mail_add || $mail_rem) { system ("echo \"$mail_body\" > $path_to_temp_mail"); system ("$path_to_mail -s \"$mail_subject\" \"$mail_address\" < $path_to_temp_mail"); system ("rm $path_to_temp_mail"); } # we delete the temporary file system ("cd $temp_path; rm $nom_page"); Guillaume Tournand <guillaume@tournand.com> September 2003 472/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Update bots’ server list #!/usr/bin/perl -w # Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights # reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # - Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # - Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # - Neither the name of the Loufiz project nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. use strict; if (!$ARGV[2]) { print "use : update_servers.pl <svr_bloc> </absolute/path/to.conf> </absolute/path/to/pid.egg>\n"; } else { ###################################################################### ###################################################################### ### ### Config ### ###################################################################### ###################################################################### my $svr_bloc=$ARGV[0]; my $path_to_conf=$ARGV[1]; my $path_to_pid=$ARGV[2]; # for the fetch of the undernet servers page my $nom_page="/tmp/$$.txt"; my $url="http://www.loufiz.com/undernet_servers.php?svr_bloc=$svr_bloc"; my(@output, @new_config, @web_page, @loufiz_servers, $end_found, $cpt, $svr_cpt, $egg_pid); ###################################################################### ###################################################################### ### ### The program ### ###################################################################### ###################################################################### # we fetch the page system ("fetch -o $nom_page \"$url\" 2>&1 > /dev/null"); Guillaume Tournand <guillaume@tournand.com> September 2003 473/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # We store the fetched page on a table : @output open (F, "<$nom_page") || die "Can't open file : $!\n"; @output=<F>; close (F); # we parse the fetched page for ($cpt=0; $output[$cpt]; $cpt++) { if ($output[$cpt] =~ /(.*[.]undernet[.]org:\d+)/) { push @loufiz_servers, $1; } } # we remove the file system ("rm $nom_page"); # we open the config file open (F, "<$path_to_conf") || die "Can't open file : $!\n"; @output=<F>; close (F); for ($cpt=0; $output[$cpt]; $cpt++) { # if the line match the start of the servers definition, we start the duty if ($output[$cpt] =~ /set servers [{]/) { push @new_config, $output[$cpt]; # we look for the end of the servers declaration for ($end_found=0; $output[$cpt] && !$end_found; $cpt++) { if ($output[$cpt] =~ /[}]/) { $end_found=1; } } # rebuilt the server list for ($svr_cpt=0; $loufiz_servers[$svr_cpt]; $svr_cpt++) { push @new_config, "$loufiz_servers[$svr_cpt]\n"; } push @new_config, "}\n\n"; } # otherwise we keep on pushing it else { push @new_config, $output[$cpt]; } } # then we save the file open (F, ">$path_to_conf") || die "Can't open file : $!\n"; print F @new_config; close (F); # finnaly we rehash the process open (F, "<$path_to_pid") || die "Can't open file : $!\n"; @output=<F>; close (F); system ("kill -HUP $output[0]"); } Guillaume Tournand <guillaume@tournand.com> September 2003 474/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Web page displaying the database’s IRC servers <HTML> <HEAD> <TITLE>Loufiz : Undernet servers</TITLE> </HEAD> <BODY> <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. for ($cpt=0;$cpt <=3; $cpt++) { echo "<A HREF='?svr_bloc=$cpt'>Block N°$cpt</A> "; } echo "<BR><BR>"; require 'include/.htmysql'; $connexion_chans=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_chans); // fetch des données $query = "SELECT nom, port FROM serveurs WHERE etat='1'"; if ($svr_bloc) { $query = "SELECT nom, port FROM serveurs WHERE etat='1' AND svr_bloc='$svr_bloc'"; } $result=mysql_query("$query") or die ("Requete non valide"); $max_svr=mysql_num_rows($result); if ($max_svr) { echo "set servers {<BR>\n"; for ($i=0; $max_svr > $i; $i++){ $nom=mysql_result($result,$i,"nom"); $port=mysql_result($result,$i,"port"); echo "$nom:$port<BR>\n"; } echo "}<BR>\n"; } mysql_close($connexion_chans); ?> </BODY> Guillaume Tournand <guillaume@tournand.com> September 2003 475/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project </HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 476/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Check bots’ current server #!/usr/bin/perl -w # Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights # reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # - Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # - Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # - Neither the name of the Loufiz project nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # We refuse the use of non-declared variables use strict; # This module is for the Mysql database connexion use DBI; ###################################################################### ###################################################################### ### ### Configuration ### ###################################################################### ###################################################################### # Variables for mysql connexion my $host = "localhost"; my $user = "root"; my $password = "DBAPasswd42"; my $database = "loufiz"; ###################################################################### ###################################################################### ### ### Declaration of the used variables ### ###################################################################### ###################################################################### # mail configuration my $mail_address="nolderise\@loufiz.com"; my $send_mail=0; my $path_to_mail="/usr/bin/mail"; my $path_to_temp_mail="/usr/home/eggdrops/adam/tmp/temp_mail.txt"; my $mail_subject="[www.loufiz.com] Loufiz eggdrops checkup status"; Guillaume Tournand <guillaume@tournand.com> September 2003 477/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project my $mail_body="Results of the check of the servers where eggdrops are connected to :\n\n"; # for the SQL my ($sth, $sth_svr, $ref, $m_server, $server, $cfg_server, $num_rows, $nom_egg, $svr_bloc); ###################################################################### ###################################################################### ### ### The program ### ###################################################################### ###################################################################### # connection to the database my $dbh = DBI->connect("DBI:mysql:database=$database;host=$host", $user, $password, {'RaiseError' => 1}); # we fetch the list of eggdrops and servers they are connected to $sth_svr = $dbh->prepare("SELECT nom, svr_bloc, m_server FROM eggdrops WHERE actif='1' AND svr_bloc!='0' AND m_server!='-'"); $sth_svr->execute(); # for each server, we check that the eggdrop is connected to a server he is supposed to while ($ref = $sth_svr->fetchrow_hashref()) { $nom_egg=$ref->{'nom'}; $m_server=$ref->{'m_server'}; $svr_bloc=$ref->{'svr_bloc'}; # first we separate the server's fqdn to its port if ($m_server =~ /(\w+[.]\w+[.]\w+[.]undernet[.]org):\d{4}/) { $server=$1; $sth = $dbh->prepare("SELECT id_svr FROM serveurs WHERE nom='$server' AND svr_bloc='$svr_bloc' AND etat='1'"); $sth->execute(); $num_rows = $sth->rows(); if (!$num_rows) { $mail_body="${mail_body}$nom_egg is connected to $m_server : but server isn't a member svr_bloc $svr_bloc\n"; $send_mail=1; } # end of this request $sth->finish(); } } # end of this request $sth_svr->finish(); # Mysql deconnexion $dbh->disconnect(); # send the mail if something has to be done if ($send_mail) { system ("echo \"$mail_body\" > $path_to_temp_mail"); system ("$path_to_mail -s \"$mail_subject\" \"$mail_address\" < $path_to_temp_mail"); system ("rm $path_to_temp_mail"); } Guillaume Tournand <guillaume@tournand.com> September 2003 478/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Blacklist synchronization #!/usr/bin/perl -w # Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights # reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # - Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # - Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # - Neither the name of the Loufiz project nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # We refuse the use of non-declared variables use strict; # This module is for the Mysql database connexion use DBI; ###################################################################### ###################################################################### ### ### Configuration ### ###################################################################### ###################################################################### # zone de travail temporaire my $temp_path="/home/eggdrops/adam/tmp/"; # Variables for mysql connexion my $host = "localhost"; my $user = "root"; my $password = "DBAPasswd42"; my $database = "loufiz"; # Declare this variable that is the date of the ban my $date_ban; ###################################################################### ###################################################################### ### ### Declaration of the used variables ### ###################################################################### ###################################################################### # for the fetch -- has to be modified for Acetone Guillaume Tournand <guillaume@tournand.com> September 2003 479/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project my $nom_page="acetone_bl.html"; my $url="http://www.acetone.org/login/banlist.php?password=koih3984y9oihoiqf3m4adsg9yqr42"; my(@output, $cpt); # for the SQL my ($sth_bl, $num_rows_bl, $channel, $raison, $admin_nick, $sth_bl_add, $query, $unixtime_ban); sub remove_single_quotes { my $string=$_[0]; my $tmp_string=""; my $char; my $i; my $longueur; # we parse the string to replace every ' char by \' $longueur=length($string); for ($i=0; $i<$longueur; $i++) { $char=substr($string,$i,1); if ($char eq "'") { $tmp_string="$tmp_string\\$char"; } if ($char ne "'") { $tmp_string="$tmp_string$char"; } } # retour return $tmp_string; } ###################################################################### ###################################################################### ### ### The program ### ###################################################################### ###################################################################### # we fetch the page system ("cd $temp_path; fetch -o $nom_page \"$url\" 2>&1 > /dev/null"); my $fetched_file="$temp_path$nom_page"; if ( -e $fetched_file ) { # We store the fetched page on a table : @output open (F, "<$temp_path$nom_page") || die "Impossible d'ouvrir le fichier : $!\n"; @output=<F>; close (F); } # Connexion to the database my $dbh = DBI->connect("DBI:mysql:database=$database;host=$host", $user, $password, {'RaiseError' => 1}); # For each line, we parse it for ($cpt=1; $output[$cpt]; $cpt++) { # first we set the whole line in lower case to be sure $output[$cpt]=lc($output[$cpt]); Guillaume Tournand <guillaume@tournand.com> September 2003 480/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # if the line match , bingo if ($output[$cpt] =~ /^[#]([^ ]*) ([^ ]*) ([^ ]*) (.*) <br>/) { # Go baby ! # from here on, we have : # $1 = channel name without the # # $2 = nick pf the admin who sets the ban # $3 = time where tha ban has been set # $4 = the reason of the ban, if there is one # first, we check if the channel is already on the blacklist table -- has to be modified for Acetone $channel=remove_single_quotes($1); $sth_bl = $dbh->prepare("SELECT id_black FROM blacklist WHERE nom_chan='$channel'"); $sth_bl->execute(); $num_rows_bl = $sth_bl->rows(); # end of this request $sth_bl->finish(); # since $num_rows_bl holds the number of results, if it's = 0, we can add this line to the table -has to be modified for Acetone if (!$num_rows_bl) { # lets convert the Unixtime into a human-readable date #$date_ban=time2str"%Y-%m-%d",$3; $admin_nick=remove_single_quotes($2); # we now use unixtime everywhere $unixtime_ban=$3; # if there is no reason, the we use the same request without the reason field if (!$4) { $query="INSERT INTO blacklist (nom_chan, unixtime_black, nick_admin, raison, source, active) VALUES ('$channel', '$unixtime_ban', '$admin_nick', 'No reason', '2', '1')"; } # if there is a reason, we add it else { $raison=remove_single_quotes($4); # built the query $query="INSERT INTO blacklist (nom_chan, unixtime_black, nick_admin, raison, source, active) VALUES ('$channel', '$unixtime_ban', '$admin_nick', '$raison', '2', '1')"; } # run the query $sth_bl_add = $dbh->prepare("$query"); $sth_bl_add->execute(); # end of this request $sth_bl_add->finish(); } } } # Mysql deconnexion $dbh->disconnect(); if ( -e $fetched_file) { # we delete the temporary file system ("cd $temp_path; rm $nom_page"); } Guillaume Tournand <guillaume@tournand.com> September 2003 481/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Web page displaying the blacklist <?PHP // Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights // reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // - Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // - Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // - Neither the name of the Loufiz project nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. echo "<HTML><HEAD><TITLE>Loufiz : Blacklist</TITLE></HEAD><BODY>"; $pass="koih3984y9oihoiqf3m4adsg9yqr42"; // check the password if ($password != $pass) { echo "You have not entered the correct keys for this page. Please contact Nold for details."; } else { // connexion to the database require 'include/.htmysql'; $connexion_chans=mysql_connect($server,$login,$password) or die ("Connection impossible"); mysql_select_db(loufiz, $connexion_chans); // select the whole blacklist $result_blacklist = mysql_query("SELECT * from blacklist b, blacklist_sources s WHERE active=1 AND b.source=s.id_source ORDER BY unixtime_black DESC, nom_chan ASC") or die ("Requete non valide"); $max_blacklist=mysql_num_rows($result_blacklist); // for each row for ($cpt=0; $cpt<$max_blacklist; $cpt++) { $nom_chan=mysql_result($result_blacklist,$cpt,'b.nom_chan'); $unixtime_black=mysql_result($result_blacklist,$cpt,'b.unixtime_black'); $date_black=date("Y-m-d", "$unixtime_black"); $nick_admin=mysql_result($result_blacklist,$cpt,'b.nick_admin'); $raison=mysql_result($result_blacklist,$cpt,'b.raison'); $source=mysql_result($result_blacklist,$cpt,'s.nom_projet'); echo "#$nom_chan $nick_admin $date_black <B>$source</B> $raison <br> "; } mysql_close($connexion_chans); } ?> </BODY></HTML> Guillaume Tournand <guillaume@tournand.com> September 2003 482/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Guillaume Tournand <guillaume@tournand.com> September 2003 483/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Daily channel log #!/usr/bin/perl -w # Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights # reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # - Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # - Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # - Neither the name of the Loufiz project nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # includes use strict; use DBI; # Declaration des variables pour mysql my $host = "localhost"; my $user = "root"; my $password = "DBAPasswd42"; my $database = "loufiz"; # Path pour le programme d'envoi de mails my $path_to_mail="/usr/bin/mail"; my $path_to_logs="/home/eggdrops/adam/logs"; my $mail_subject="[www.loufiz.com] #Loufiz log quotidien / daily #Loufiz log"; my $sleep_time=1; # declaration des variables utilisees my ($sth, $num_rows, $ref, $to, $commande, $nick); # On se connecte a la base de donnee my $dbh = DBI->connect("DBI:mysql:database=$database;host=$host", $user, $password, {'RaiseError' => 1}); $sth = $dbh->prepare("SELECT nick from users u, admin a WHERE a.id_user=u.id_user AND a.mail_log='1'"); $sth->execute(); $num_rows = $sth->rows(); if ($num_rows) { while ($ref = $sth->fetchrow_hashref()) { $nick = $ref->{'nick'}; Guillaume Tournand <guillaume@tournand.com> September 2003 484/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project $to = "$nick\@loufiz.com"; $commande ="$path_to_mail $path_to_logs/loufiz.log.yesterday"; -s \"$mail_subject\" \"$to\" < system ("$commande"); sleep $sleep_time; } } # Deconnexion Mysql $dbh->disconnect(); Guillaume Tournand <guillaume@tournand.com> September 2003 485/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Servers backup System backup #!/bin/sh # Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights # reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # - Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # - Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # - Neither the name of the Loufiz project nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. chemin=/usr/backup/ machine=`uname -n` sqldump=sqldump/ wday=`date "+%a"` if ! [ -e $chemin$machine ]; then mkdir -p $chemin$machine chown -R root.wheel $chemin chmod 750 $chemin fi if ! [ -e $chemin$sqldump ]; then mkdir -p $chemin$sqldump fi cd $chemin if [ -e old/ ]; then rm -rf old/ fi mv $machine old mkdir $machine /usr/local/bin/mysqldump -uroot -pDBAPasswd42 -c --add-drop-table loufiz > ${sqldump}loufiz-database-dump$wday.sql cp -R ${sqldump} $machine cd $machine /usr/sbin/pkg_info > packages_installes.txt tar -czf root.tar.gz /root/ tar -czf etc.tar.gz /etc/ tar -czf home.tar.gz /home/ tar -czf usr_local_etc.tar.gz /usr/local/etc/ Guillaume Tournand <guillaume@tournand.com> September 2003 486/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project tar -czf usr_local_www.tar.gz /usr/local/www/ tar -czf usr_qmail.tar.gz /usr/qmail/alias/ /usr/qmail/control/ tar -czf var_db.tar.gz /usr/db/ tar -czf usr_src_sys_i386_conf.tar.gz /usr/src/sys/i386/conf/ tar -czf usr_local_bb.tar.gz /usr/local/bb18b3/ cd .. tar -czf $machine.tar.gz $machine /usr/local/bin/lftp -f /root/bin/lftp-sysbckp.conf lftp configuration file #!/usr/bin/lftp # Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights # reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # - Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # - Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # - Neither the name of the Loufiz project nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # run with : lftp -f /path/to/config.lftp lftp ftp://backup:SysBckp75@ns2.loufiz.com/prod_backup/ put /usr/backup/www.loufiz.com.tar.gz exit Guillaume Tournand <guillaume@tournand.com> September 2003 487/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project Archives backup #!/bin/sh # Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights # reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # - Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # - Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # - Neither the name of the Loufiz project nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. chemin=/usr/backup/ repertoire=prod_backup if ! [ -e $chemin$repertoire ]; then mkdir -p $chemin$repertoire chmod 750 $chemin fi cd $chemin$repertoire # mirror du repertoire de ns2 /usr/local/bin/lftp -f /root/bin/lftp-prod_backup.conf lftp configuration file #!/usr/bin/lftp # Copyright (c) 2003, Guillaume Tournand <guillaume@tournand.com> All rights # reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # - Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # - Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # - Neither the name of the Loufiz project nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES Guillaume Tournand <guillaume@tournand.com> September 2003 488/489 MSc Dissertation IRC distributed bot lending platform: The Loufiz project # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # run with : lftp -f /path/to/config.lftp lftp ftp://backup:SysBckp75@ns2.loufiz.com cd /usr/backup/prod_backup/ lcd /usr/backup/prod_backup/ mirror -ec exit Guillaume Tournand <guillaume@tournand.com> September 2003 489/489