1
mirror of git://git.acid.vegas/IRCP.git synced 2024-11-23 00:16:41 +00:00

CTCP replies

This commit is contained in:
Dionysus 2023-05-25 21:22:42 -04:00
parent d904c9ab97
commit 44686cdd5f
Signed by: acidvegas
GPG Key ID: EF4B922DB85DC9DE
2 changed files with 11 additions and 3 deletions

View File

@ -88,7 +88,7 @@ All of the raw data from a server is logged & stored. The categories below are s
## Todo ## Todo
* Capture `IRCOPS` & `STATS p` command outputs * Capture `IRCOPS` & `STATS p` command outputs
* Built in identd & CTCP replies * Built in identd
* Checking for IPv6 availability *(Need to find the server DNS, link names are not required to have DNS entries)* * Checking for IPv6 availability *(Need to find the server DNS, link names are not required to have DNS entries)*
* Random nick changes for stealth on larger networks * Random nick changes for stealth on larger networks
* Create a helper script for parsing logs & generating statistics on data * Create a helper script for parsing logs & generating statistics on data

12
ircp.py
View File

@ -215,6 +215,7 @@ class probe:
if self.nicks['check']: if self.nicks['check']:
nick = random.choice(self.nicks['check']) nick = random.choice(self.nicks['check'])
self.nicks['check'].remove(nick) self.nicks['check'].remove(nick)
debug(self.server + 'WHOIS ' + nick)
try: try:
await self.raw('WHOIS ' + nick) await self.raw('WHOIS ' + nick)
except: except:
@ -290,9 +291,12 @@ class probe:
await self.raw('NICK ' + rndnick()) await self.raw('NICK ' + rndnick())
else: else:
await self.raw('NICK ' + settings.nickname + str(random.randint(1000,9999))) await self.raw('NICK ' + settings.nickname + str(random.randint(1000,9999)))
elif numeric == '465': # ERR_YOUREBANNEDCREEP
if 'dronebl' in line:
error(self.server + 'dronebl detected')
elif numeric == '464': # ERR_PASSWDMISMATCH elif numeric == '464': # ERR_PASSWDMISMATCH
error(self.server + 'network has a password') error(self.server + 'network has a password')
elif numeric == 'NOTICE': elif numeric == 'NOTICE' and len(args) >= 4:
nick = args[0].split('!')[1:] nick = args[0].split('!')[1:]
msg = ' '.join(args[3:])[1:] msg = ' '.join(args[3:])[1:]
if nick == 'NickServ': if nick == 'NickServ':
@ -300,10 +304,14 @@ class probe:
for i in ('You must have been using this nick for','You must be connected for','not connected long enough','Please wait', 'You cannot list within the first'): for i in ('You must have been using this nick for','You must be connected for','not connected long enough','Please wait', 'You cannot list within the first'):
if i in msg: if i in msg:
error(self.server + 'delay found', msg) error(self.server + 'delay found', msg)
elif numeric == 'PRIVMSG': elif numeric == 'PRIVMSG' and len(args) >= 4:
nick = args[0].split('!')[0][1:] nick = args[0].split('!')[0][1:]
msg = ' '.join(args[3:])[1:]
if nick == 'NickServ': if nick == 'NickServ':
self.snapshot['services'] = True self.snapshot['services'] = True
if msg[:8] == '\001VERSION':
version = random.choice('http://www.mibbit.com ajax IRC Client','mIRC v6.35 Khaled Mardam-Bey','xchat 0.24.1 Linux 2.6.27-8-eeepc i686','rZNC Version 1.0 [02/01/11] - Built from ZNC','thelounge v3.0.0 -- https://thelounge.chat/')
await self.raw(f'NOTICE {nick} \001VERSION {version}\001')
if numeric in self.snapshot: if numeric in self.snapshot:
if not self.snapshot[numeric]: if not self.snapshot[numeric]:
self.snapshot[numeric] = line self.snapshot[numeric] = line