• Welcome to Valhalla Legends Archive.
 

I want to learn how to add proxy support

Started by ChR0NiC, November 17, 2003, 01:56 AM

Previous topic - Next topic

ChR0NiC

If anyone can recommend any public sources I could look through or teach me how, please by all means.

Gangz

What kind of connection are you using? BNLS Hash or CSB?

Grok

Quote from: ChR0NiC on November 17, 2003, 01:56 AM
If anyone can recommend any public sources I could look through or teach me how, please by all means.

Winsock Programmer's FAQ
http://tangentsoft.net/wskfaq/articles/firewalls.html

See the section on SOCKS.

Stealth

Quote from: Gangz on November 17, 2003, 09:45 AM
What kind of connection are you using? BNLS Hash or CSB?

Any type can be routed through a proxy.
- Stealth
Author of StealthBot


Kp

Quote from: ChR0NiC on November 17, 2003, 07:49 PM
BNLS Hash
Which is it?  Most clients which use BNLS do so to avoid needing to perform local hashing.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

ChR0NiC

My bot uses BNLS but not CSB. It uses BNLS packets

Dyndrilliac

Quote from: Kp on November 19, 2003, 04:08 PM
Quote from: ChR0NiC on November 17, 2003, 07:49 PM
BNLS Hash
Which is it?  Most clients which use BNLS do so to avoid needing to perform local hashing.

I always add hashing incase the BNLS server is down for whatever reason - So mine has both. He probably did the same.
Quote from: Edsger W. DijkstraIt is practically impossible to teach good programming to students that have had a prior exposure to BASIC; as potential programmers they are mentally mutilated beyond hope of regeneration.

Maddox

#8
This could have been easily answered by googling "socks protocol." Also, what does this have to do with bot development?
asdf.

Maddox

Quote from: warz on November 21, 2003, 05:59 PM
What doesn't it have to do with bot development? He stated he uses BNLS, so it's obviously for a bot.

That is like saying I use buttons on my bot, so if I have a question about buttons then I should ask on the bot development forum. A better question to ask yourself before posting a question is: if I ask this question on a non-bot related forum, can I get a good answer?
asdf.

Banana fanna fo fanna

Thus...

Talking to Battle.net isn't bot related, it's networking-related
User databases aren't bot related, they're algorithmns/datastructures
UI for a bot isn't bot related, it's GUI related

etc etc

TriCk

#11
ChR0NiC ... Sup brO...  :P

I have ur solution right here...
For BNLS-Type logon...
Okay on ur Winsock that connects to BNET(not BNLS) under the
Winsock_Connect Sub do this...

If Form2.Proxy.Value = 0 Then
   Send Your Logon Stuff Here (Header, 0x1E/0x50)
ElseIf Form2.Proxy.Value = 1 Then
   Dim splt() As String, str As String, i As Integer
   varServer = LCase(varServer)
   splt = Split(varServer, ".")
       For i = 0 To UBound(splt)
           str = str & Chr(CStr(splt(i)))
       Next i
   sck2.SendData Chr(&H4) & Chr(&H1) & Chr(&H17) & Chr(&HE0) & str & "anonymous" & Chr(&H0)
   TextAdd "SOCK: Connected!"
End If

Then on the Winsock's(BNET), DataArrival Sub

Do...


If Form2.Proxy.Value = 1 Then
       sckBNET.GetData strTemp, vbString
           Select Case Mid(strTemp, 1, 2)
           Case Chr(&H0) & Chr(&H5A)
               TextAdd "SOCK: Request Granted"
               SendHeader
               >>Send 0x1E/0x50<<
           Case Chr(&H0) & Chr(&H5B)
               TextAdd "SOCK: Request Rejected Or Failed"
               sckBNET.Close
               Exit Sub
           Case Chr(&H0) & Chr(&H5C)
               TextAdd "SOCK: Request Rejected Because SOCKS server cannot IDENT on the client"
               sckBNET.Close
               Exit Sub
           Case Chr(&H0) & Chr(&H5D)
               TextAdd "SOCK: Request Rejected Because the Client Program and the ID Report Different User-IDs"
               sckBNET.Close
               Exit Sub
           End Select
   strbuffer = strbuffer & strTemp
   While Len(strbuffer) > 4
       lnglen = Val("&H" & StrToHex(StrReverse(Mid$(strbuffer, 3, 2))))
       If Len(strbuffer) < lnglen Then Exit Sub
       parseBNET (Left$(strbuffer, lnglen))
       strbuffer = Mid$(strbuffer, lnglen + 1)
   Wend
   Else
       sckBNET.GetData strTemp, vbString
       strbuffer = strbuffer & strTemp
       While Len(strbuffer) > 4
         lnglen = Val("&H" & StrToHex(StrReverse(Mid(strbuffer, 3, 2))))
         If Len(strbuffer) < lnglen Then Exit Sub
          parseBNET (Left(strbuffer, lnglen))
         strbuffer = Mid(strbuffer, lnglen + 1)
       Wend
End If


Finally...
On ur parseBNLS Sub(or whatever your's is called)
Under Case &HF for Select Case Asc(Mid$(data, 3, 1))


Case &HF
       If varproduct = "3RAW" Or varproduct = "PX3W" Then
           InsertDWORD &H2
           sendBNLSPacket &HD
       End If
       If Form2.Proxy.Value = 1 Then
       sckBNET.Close
       TextAdd "SOCK: Connecting..."
       sckBNET.Connect varProxy, 1080
       Else
       sckBNET.Close
       sckBNET.Connect varServer, 6112
       End If



**Fixed Spelling ;)

Stealth

-1 for spitting out code.

People who don't know any Visual Basic should not be attempting to make bots in Visual Basic.

Consider your problem: You want to add proxy support to your bot.

Consider the root of your problem: You don't know how to implement the SOCKS protocol.

Consider the best way to solve your problem: A Google search.

Let's say you've done a few Google searches and found some stuff that was relevant to your situation, but you still can't make heads or tails of it. That would be the prime time to come to these forums and ask your question, mentioning of course that you've actually put some research time into it yourself and aren't just saying "write my program for me!".

If you're not willing to actually LEARN the solution to your problem and are just looking to mooch some working code, I think you don't belong on this forum. Eh. </2AM rant>
- Stealth
Author of StealthBot

Lenny

"Topic: I want to learn how to add proxy support" - emphasis on LEARN
The Bovine Revolution
Something unimportant

Live Battle.net:

WARNING: The preceding message may have contained content unsuitable for young children.

Kp

Quote from: TriCk on November 21, 2003, 10:56 PM

Case &HF
       If varproduct = "3RAW" Or varproduct = "PX3W" Then
           InsertDWORD &H2
           sendBNLSPacket &HD
       End If
       If Form2.Proxy.Value = 1 Then
       sckBNET.Close
       TextAdd "SOCK: Connecting..."
       sckBNET.Connect varProxy, 1080
       Else
       sckBNET.Close
       sckBNET.Connect varServer, 6112
       End If
I see a couple of things here that could be improved.  First, there's no need to sckBNET.Close inside both branches of the if.  Move it outside.  Second, you're assuming that the bncs will always and only be on port 6112.  Third, you could simplify the Connect statement by assigning the port to a variable based on whether proxy support is in effect, then connecting based on that.  VB-ish syntax, with some probable errors since I don't actually write VB:


       sckBNET.Close
       X = Form2.BNCSPort.Value ' or just X = 6112 if you want to ewwishly hardcode the port
       Y = varServer
       If Form2.Proxy.Value = 1 Then
       TextAdd "SOCK: Connecting..."
       X = 1080
       Y = varProxy
       End If
       sckBNET.Connect Y, X
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!