ilk sorun icin, listedeki identleri belirledigin portlarda yasaklamak.
Kod: Kodu kopyalamak için üzerine çift tıklayın!
#include "config.h"
#include "struct.h"
#include "common.h"
#include "sys.h"
#include "numeric.h"
#include "msg.h"
#include "channel.h"
#include <time.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#include <io.h>
#endif
#include <fcntl.h>
#include "h.h"
#include "proto.h"
#ifdef STRIPBADWORDS
#include "badwords.h"
#endif
#ifdef _WIN32
#include "version.h"
#endif
DLLFUNC int m_portidentd(aClient *sptr, aChannel *chptr);
#define channel "#Monitor"
#define monitor "Koruma"
ModuleHeader MOD_HEADER(m_portidentd)
= {
"m_portidentd",
"identd korumasi porta gore EceLMeriC",
"identd korumasi porta gore EceLMeriC",
"3.2-b8-1",
NULL
};
DLLFUNC int MOD_INIT(m_portidentd)(ModuleInfo *modinfo)
{
HookAddEx(modinfo->handle, HOOKTYPE_PRE_LOCAL_CONNECT, m_portidentd);
return MOD_SUCCESS;
}
DLLFUNC int MOD_LOAD(m_portidentd)(int module_load)
{
return MOD_SUCCESS;
}
DLLFUNC int MOD_UNLOAD(m_portidentd)(int module_unload)
{
return MOD_SUCCESS;
}
static char *identdlistesi[] = {
"X",
"XX",
"XXX",
"XXXX",
"XXXXX",
"XXXXXX",
"XXXXXXX",
NULL
};
static int identd_listesi(char *identd)
{
char **ilist;
for (ilist=identdlistesi; *ilist; *ilist++)
{
if (!strcmp(identd, *ilist))
return 1;
}
return 0;
}
DLLFUNC int m_portidentd(aClient *sptr, aChannel *chptr)
{
if (sptr->listener->port != 6673)
if (sptr->listener->port != 6675)
return 0;
if (identd_listesi(sptr->user->username)) {
if ((chptr = find_channel(channel, NullChn)) != NullChn)
sendto_channel_butone(&me, &me, chptr, ":%s PRIVMSG %s :Port identd Korumasi: Nick -> \2%s\2 identd -> \2%s\2 IP -> \2%s\2", monitor, channel, sptr->name, sptr->user->username, sptr->user->realhost);
sendto_one(sptr, ":%s NOTICE %s :*** Kullanmis oldugunuz identd sadece web girislerine mahsustur.", me.name, sptr->name);
return place_host_ban(sptr, BAN_ACT_KILL, "Girisiniz Engellenmistir.", 1800);
}
}
ikinci sorun icin, anladigim kadari ile sunucu girisine sadece listedeki belirledigin identleri yasaklicaksin.
Kod: Kodu kopyalamak için üzerine çift tıklayın!
#include "config.h"
#include "struct.h"
#include "common.h"
#include "sys.h"
#include "numeric.h"
#include "msg.h"
#include "channel.h"
#include <time.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#include <io.h>
#endif
#include <fcntl.h>
#include "h.h"
#include "proto.h"
#ifdef STRIPBADWORDS
#include "badwords.h"
#endif
#ifdef _WIN32
#include "version.h"
#endif
DLLFUNC int m_identd(aClient *sptr, aChannel *chptr);
#define channel "#Monitor"
#define monitor "Koruma"
ModuleHeader MOD_HEADER(m_identd)
= {
"m_identd",
"Sunucu identd korumasi EceLMeriC",
"Sunucu identd korumasi EceLMeriC",
"3.2-b8-1",
NULL
};
DLLFUNC int MOD_INIT(m_identd)(ModuleInfo *modinfo)
{
HookAddEx(modinfo->handle, HOOKTYPE_PRE_LOCAL_CONNECT, m_identd);
return MOD_SUCCESS;
}
DLLFUNC int MOD_LOAD(m_identd)(int module_load)
{
return MOD_SUCCESS;
}
DLLFUNC int MOD_UNLOAD(m_identd)(int module_unload)
{
return MOD_SUCCESS;
}
static char *identdlistesi[] = {
"X",
"XX",
"XXX",
"XXXX",
"XXXXX",
"XXXXXX",
"XXXXXXX",
NULL
};
static int identd_listesi(char *identd)
{
char **ilist;
for (ilist=identdlistesi; *ilist; *ilist++)
{
if (!strcmp(identd, *ilist))
return 1;
}
return 0;
}
DLLFUNC int m_identd(aClient *sptr, aChannel *chptr)
{
if (identd_listesi(sptr->user->username)) {
if ((chptr = find_channel(channel, NullChn)) != NullChn)
sendto_channel_butone(&me, &me, chptr, ":%s PRIVMSG %s :identd Korumasi: Nick -> \2%s\2 identd -> \2%s\2 IP -> \2%s\2", monitor, channel, sptr->name, sptr->user->username, sptr->user->realhost);
sendto_one(sptr, ":%s NOTICE %s :*** Kullanmis oldugunuz identd sadece web girislerine mahsustur.", me.name, sptr->name);
return place_host_ban(sptr, BAN_ACT_KILL, "Girisiniz Engellenmistir.", 1800);
}
}
umarim yanlis anlamamisimdir, iyi forumlar.