• Welcome to Valhalla Legends Archive.
 

Packets

Started by TriCk, November 26, 2003, 05:14 AM

Previous topic - Next topic

TriCk

Is there a faster way of sending a text packet than &HE ? Or is there a way to make it fast enough to ban floods? Right now im testing...

InsertNTString "/ban " & username
SendPacket &HE


Code = vb6

Has anyone created a successful bot to ban the turtle(or better floodbot) EVERY time yet? If so share me your strategy... i.e. how did u send the packet fast enough and recieve it fast enough for the bot to ban it in time?
I'm guessing its my receive speed.

Stealth

- Stealth
Author of StealthBot

TriCk

#2
Yeah i'm aware of those certain aspects.
I got none of those things implimented... all my bot shows is Battle.net Information such as If the User was banned or "That user is not logged on."
Could Select Case's be slowing me down?

This is what i currently have as most floods (Turtle) have 0ms pingtime i figure to not ban all people that come in a pingban applies. But im not sure if this technique is fast enough...
This is in the Winsocks DataArrival it refers to a sub

Select Case packetid
Case &HF
Username = KillNull(Mid$(Data, 29))
Message = KillNull(Mid$(Data, Len(Username) + 30))
Ping = MakeLong(Mid$(Data, 13, 4))
Select Case MakeLong(Mid$(Data, 5, 4))
Case &H2
If Ping = 0 Then
InsertNTString "/ban " & Username: SendPacket2 &HE ': TextAdd "0x02: " & Username
End If
End Select


Note: SendPacket2 was my attempt at sending the packet faster... I tried to use this way... As i thought it might speed it up momentarily


Public Function SendPacket2(PacketID As Byte)
   Dim Result As String * 2
   CopyMemory ByVal Result, Len(Buffer) + 4, 2
   sck1.SendData Chr(&HFF) & Chr(PacketID) & Result & Buffer
   Buffer = ""
End Function

TriCk

#3
True.
How would i write the SendData function though?

I got

Public Declare Function Send Lib "wsock32.dll" Alias "send" (ByVal s As Long, buf As Any, ByVal buflen As Long, ByVal flags As Long) As Long


What would s, buf, buflen, and flags be? how would i use this?
Whats difference between ws2_32.dll and wsock32.dll?
How would i declare ws2_32.dll?

MyndFyre

#4
This is when we suggest that you look at the MSDN documentation.  

This is the MSDN article

According to the docs, we have:

s is a pointer to the Socket - a SOCKET handle.
buf is the pointer to the string (I imagine that this is marshaled automagically)
bufLen is the length of the string in case you couldn't guess.
flags should be a bitwise combination of the following flags included in some .h file somewhere:

MSG_DONTROUTE Specifies that the data should not be subject to routing. A Windows Sockets service provider can choose to ignore this flag.
MSG_OOB Sends OOB data (stream-style socket such as SOCK_STREAM only. Also see DECnet Out-Of-band data for a discussion of this topic).

See the MSDN article I pointed you to for more info.  Note that it took me all of two minutes to open another browser window, type "http://msdn.microsoft.com/library/", and do a search for "send windows sockets" - it was the FIRST item to come up.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

TriCk

#5
im a little confused what s is...

Would i refer that to sck1 on my form1? or... what? Would...

Under the function SendData(socket as string, buff as string) As String
SendData = Send(s, buff, Len(buff), 0)

Would that work? or sumthing like that?

TriCk

SocketHandle would be my connected sock like Form1.sck1 am i right?

TriCk

#7
So i'll have to rewrite my bot using Declares?
If so what declares will i need?

Skywing

Quote from: TriCk on November 26, 2003, 06:14 PM
So i'll have to rewrite my bot using Declares?
It is most likely not worth pursuing this venture as it is possible to construct a floodbot attack that cannot be banned from a remote channel operator simply due to network transit times.  Any speed you would gain from using winsock directly would probably be negligible in this instance.

TriCk

#9
I think ur suggesting, if Battle.net's server is too slow it wont matter how fast my bot is?

Skywing

Quote from: TriCk on November 26, 2003, 06:19 PM
But If i get it on a good connection... I want it to be able to ban floods.

I think ur suggesting, if Battle.net's server is too slow it wont matter how fast my bot is?
Consider if an attacker sent a join and a leave message in the same TCP packet.  No matter how fast your connection to the server is, I find it extremely unlikely that you'll be able to ban such an attack, given that the time between a join and a leave is in this case limited only by the processing speed of the server.

TriCk

#11
Well what if someone sends say 6 rejoins
And i know its bannable because i have seen people ban it. thats what i want to achieve with my bot

Arta

The latency of your connection to Battle.net has a great, great deal more to do with it than the speed of your program. Compared to the time that it takes your '/ban' command to get to Battle.net, the speed of your program is irrelevent. Your best bet is to get your operator bot hosted on the fastest connection you can find, and even that is a long shot. A far, far better approach - the one, incidentally, used by most of vL - is to use clients that can filter the crap that floodbots send, so that you never even see it. The nature of floodbot attacks makes it fairly simple to do this automatically.

TriCk

Well Fr0z3n[xL]@USWest claims he can ban turtles "EZ"
Gangz@USWest i have seen him ban a turtleflood 2 times in 1 flood every time.
And they're connections aren't great...

TriCk

Yeah, i'm guessing ur right, but how can people ban it if this is true?