Skip to content

Instantly share code, notes, and snippets.

View TheRealNoob's full-sized avatar

TheRealNoob TheRealNoob

  • 22:19 (UTC -07:00)
View GitHub Profile
def function_x(enemy):
print(enemy)
def function_y:
enemy = "energizer"
function_x(enemy=enemy)
"""
Pokemon effectiveness calculator (from the perspective of the attacker)
An attack move can have only one type (ex: fire, water, ground, etc)
A pokemon itself (the enemy in this case) can have one or two types (ex: fire, fire & flying, grass & bug)
"""
normal = {"Normal": 1, "Fighting": 2, "Flying": 1, "Poison": 1, "Ground": 1, "Rock": 1, "Bug": 1, "Ghost": 0, "Steel": 1, "Fire": 1, "Water": 1, "Grass": 1, "Electric": 1, "Psychic": 1, "Ice": 1, "Dragon": 1, "Dark": 1, "Fairy": 1}
fighting = {"Normal": 1, "Fighting": 1, "Flying": 2, "Poison": 1, "Ground": 1, "Rock": 0.5, "Bug": 0.5, "Ghost": 1, "Steel": 1, "Fire": 1, "Water": 1, "Grass": 1, "Electric": 1, "Psychic": 2, "Ice": 1, "Dragon": 1, "Dark": 0.5, "Fairy": 2}
flying = {"Normal": 1, "Fighting": 0.5, "Flying": 1, "Poison": 1, "Ground": 0, "Rock": 2, "Bug": 0.5, "Ghost": 1, "Steel": 1, "Fire": 1, "Water": 1, "Grass": 0.5, "Electric": 2, "Psychic": 1, "Ice": 2, "Dragon": 1, "Dark": 1, "Fairy": 1}
2018-09-21 22:58:11,101:DEBUG:Using selector: SelectSelector
2018-09-21 22:58:11,105:INFO:Connecting to 149.154.175.50:443...
2018-09-21 22:58:11,105:DEBUG:Connection attempt 1...
2018-09-21 22:58:11,162:DEBUG:Connection success!
2018-09-21 22:58:11,162:DEBUG:Starting send loop
2018-09-21 22:58:11,162:DEBUG:Starting receive loop
2018-09-21 22:58:11,162:INFO:Connection to 149.154.175.50 complete!
2018-09-21 22:58:11,163:DEBUG:Packing 1 outgoing message(s) InvokeWithLayerRequest...
2018-09-21 22:58:11,164:DEBUG:Sending 120 bytes...
2018-09-21 22:58:11,165:DEBUG:Receiving items from the network...
2018-09-21 22:58:11,101:DEBUG:Using selector: SelectSelector
2018-09-21 22:58:11,105:INFO:Connecting to 149.154.175.50:443...
2018-09-21 22:58:11,105:DEBUG:Connection attempt 1...
2018-09-21 22:58:11,162:DEBUG:Connection success!
2018-09-21 22:58:11,162:DEBUG:Starting send loop
2018-09-21 22:58:11,162:DEBUG:Starting receive loop
2018-09-21 22:58:11,162:INFO:Connection to 149.154.175.50 complete!
2018-09-21 22:58:11,163:DEBUG:Packing 1 outgoing message(s) InvokeWithLayerRequest...
....
async def hunt_check(sleep_timer):
global last_message
while True:
if last_message == (await one_client.get_messages(BattlingGroup))[0]:
print("Stuck at {}".format(datetime.now()))
one_client.send_message(BattlingGroup, "Battle Request")
last_message = (await one_client.get_messages(BattlingGroup))[0]
print("set new last_message")
Task exception was never retrieved
future: <Task finished coro=<MTProtoSender._reconnect() done, defined at C:\Users\Mike\PycharmProjects\HexaBot2\venv\lib\site-packages\telethon\network\mtprotosender.py:286> exception=AttributeError("'NoneType' object has no attribute 'key'",)>
Traceback (most recent call last):
File "C:\Users\Mike\PycharmProjects\HexaBot2\venv\lib\site-packages\telethon\network\mtprotosender.py", line 294, in _reconnect
await self._send_loop_handle
File "C:\Users\Mike\PycharmProjects\HexaBot2\venv\lib\site-packages\telethon\network\mtprotosender.py", line 379, in _send_loop
body = self.state.pack_message(message)
File "C:\Users\Mike\PycharmProjects\HexaBot2\venv\lib\site-packages\telethon\network\mtprotostate.py", line 89, in pack_message
self.auth_key.key[88:88 + 32] + data + padding).digest()
AttributeError: 'NoneType' object has no attribute 'key'
from telethon import TelegramClient, events, sync
class CreateClient(TelegramClient):
async def __call__(self, request, **kw):
# print(request)
if 'Capture me' in request.stringify():
global last_request
last_request = request
return await super().__call__(request, **kw)
class CreateClient(TelegramClient):
async def __call__(self, request, **kw):
global last_request
last_request = request
return await super().__call__(request, **kw)
one_client = CreateClient(one_display_name, one_api_id, one_api_hash).start()
one_client.send_message(chat_id, "test")
one_client(last_request)
import datetime, time, random
dictionary = dict.fromkeys((range(20)))
minute = datetime.timedelta(seconds=60)
for x in dictionary.keys():
time.sleep(random.randrange(0, 1)) # some variance in timestamps
dictionary[x] = datetime.datetime.now()
print("dict built")
Initial reconnaissance of the MegaCorp One network resulted in the discovery of a misconfigured DNS
server that allowed a DNS zone transfer. The results provided us with a listing of specific hosts to target
for this assessment. An examination of these hosts revealed a password-protected administrative
webserver interface. After creating a custom wordlist using terms identified on the MegaCorp One’s
website we were able to gain access to this interface by uncovering the password via brute-force.
An examination of the administrative interface revealed that it was vulnerable to a remote code
injection vulnerability, which was used to obtain interactive access to the underlying operating system.
This initial compromise was escalated to administrative access due to a lack of appropriate system
updates on the webserver. After a closer examination, we discovered that the compromised webserver