Fixed broken identd link and possible fix for issue reported by chrono

This commit is contained in:
Dionysus 2023-09-16 12:31:10 -04:00
parent e8a7c90788
commit d011286fa1
Signed by: acidvegas
GPG Key ID: EF4B922DB85DC9DE
2 changed files with 29 additions and 26 deletions

View File

@ -14,7 +14,7 @@ Any server with SSL/TLS ports opened, will be connected using SSL/TLS. If using
The bot is designed to be very minimal, secure, & trustless by nature. This means anyone can run a copy of your script on their server to help build your botnet. The bot is designed to be very minimal, secure, & trustless by nature. This means anyone can run a copy of your script on their server to help build your botnet.
It is highly recommended that you use a [random spoofing ident protocol daemon](https://github.com/acidvegas/random/blob/master/irc/identd.py) It is highly recommended that you use a [random spoofing ident protocol daemon](https://github.com/internet-relay-chat/archive/blob/master/identd.py)
## Commands ## Commands
| Command | Description | | Command | Description |

View File

@ -140,32 +140,32 @@ class clone():
self.writer = None self.writer = None
async def connect(self): async def connect(self):
if connect_delay:
await asyncio.sleep(random.randint(300,900))
while True: while True:
if self.proxy:
options = {
'proxy' : aiosocks.Socks5Addr(self.proxy.split(':')[0], int(self.proxy.split(':')[1])),
'proxy_auth' : None,
'dst' : (self.server['server'], self.server['ssl'] if self.server['ssl'] and self.ssl_status else 6667),
'limit' : 1024,
'ssl' : ssl_ctx() if self.server['ssl'] and self.ssl_status else None,
'family' : 2
}
self.reader, self.writer = await asyncio.wait_for(aiosocks.open_connection(**options), 15)
else:
options = {
'host' : self.server['server'],
'port' : self.server['ssl'] if self.server['ssl'] and self.ssl_status else 6667,
'limit' : 1024,
'ssl' : ssl_ctx() if self.server['ssl'] and self.ssl_status else None,
'family' : socket.AF_INET6 if self.use_ipv6 else socket.AF_INET,
'local_addr' : (self.vhost, random.randint(5000,60000)) if self.vhost else None
}
try: try:
self.reader, self.writer = await asyncio.wait_for(asyncio.open_connection(**options), 15) if connect_delay:
await self.raw(f'USER {rndnick()} 0 * :{rndnick()}') await asyncio.sleep(random.randint(300,900))
await self.raw('NICK ' + self.nickname) if self.proxy:
options = {
'proxy' : aiosocks.Socks5Addr(self.proxy.split(':')[0], int(self.proxy.split(':')[1])),
'proxy_auth' : None,
'dst' : (self.server['server'], self.server['ssl'] if self.server['ssl'] and self.ssl_status else 6667),
'limit' : 1024,
'ssl' : ssl_ctx() if self.server['ssl'] and self.ssl_status else None,
'family' : 2
}
self.reader, self.writer = await asyncio.wait_for(aiosocks.open_connection(**options), 15)
else:
options = {
'host' : self.server['server'],
'port' : self.server['ssl'] if self.server['ssl'] and self.ssl_status else 6667,
'limit' : 1024,
'ssl' : ssl_ctx() if self.server['ssl'] and self.ssl_status else None,
'family' : socket.AF_INET6 if self.use_ipv6 else socket.AF_INET,
'local_addr' : (self.vhost, random.randint(5000,60000)) if self.vhost else None
}
self.reader, self.writer = await asyncio.wait_for(asyncio.open_connection(**options), 15)
await self.raw(f'USER {rndnick()} 0 * :{rndnick()}')
await self.raw('NICK ' + self.nickname)
except Exception as ex: except Exception as ex:
v6 = 'using IPv6 ' if self.use_ipv6 else '' v6 = 'using IPv6 ' if self.use_ipv6 else ''
if self.ssl_status and self.server['ssl']: if self.ssl_status and self.server['ssl']:
@ -177,7 +177,6 @@ class clone():
error('Failed to connect to \'{0}\' IRC server {1}'.format(self.server['server'], v6), ex) error('Failed to connect to \'{0}\' IRC server {1}'.format(self.server['server'], v6), ex)
else: else:
await self.listen() await self.listen()
self.loop.cancel()
finally: finally:
await asyncio.sleep(86400+random.randint(1800,3600)) await asyncio.sleep(86400+random.randint(1800,3600))
@ -396,6 +395,10 @@ class clone():
pass pass
except Exception as ex: except Exception as ex:
error('Unexpected error occured on \'{0}\' server.'.format(self.server['server']), ex) error('Unexpected error occured on \'{0}\' server.'.format(self.server['server']), ex)
try:
self.loop.cancel()
except:
pass
break break
async def mode(self, target, mode): async def mode(self, target, mode):