Sign in to follow this  
Followers 0
Targus

Valid TCP Packet

1 post in this topic

#1 ·  Posted (edited)

alright im working on a chat bot for our server and well i can read packets edit etc but i have been unable to create a valid on.

ive used the tcpconnect / send it sends from the wrong port so its dropped and im currently using the Winpcap.au3 udf

and i cant get the structure right.

if anyone has an example of one or has a working one and could share on how i would hug u ive been tried for weeks but i cant get it to work D:

Details :

has to come from me to a specific port from a specific port from me ( is randomly renewed every 10 minutes ) is a tcp packet and can be random length.

heres my attempt which fails >.< if u can see why please tell me.

Dim $destmac = "00146ca8f464" ; Chat server mac
    Dim $sourcemac = _GetMac() ;my mac
    Dim $type = "0x0800" : IP / TCP packet
    Dim $version = "4500"
    Dim $totallenght = "100" ; il generate the length when it works
    Dim $fragment = "0100" ; do not fragment
    Dim $ttl = "128" ; time to live
    Dim $protocal = "6" 
    Dim $soruceip = "192168021" ; my lan ip
    Dim $destip = "1743624234" ; server ip
    Dim $sport = "2195" ;port is randomly generated
    Dim $dprot = "10008" ;static port for the chat serer
    Dim $mydata = '<m t="packet test XD" u="127287186_61" />.' ;packet data (<m) = message (t=) = text (u=) user id (/<.) = end
    Dim $mypacket = "0x" & $destmac & $sourcemac & $type & $version & $totallenght & $fragment & $ttl & $protocal & $soruceip & $destip & $sport & $dprot & $mydata ; stick together to a binary string
    If _PcapSendPacket($pcap, $mypacket) <> 1 Then ;use the udf to send with winpcap
        _ConsoleWrite("Failed Packet") ;if it failed say so
    Else
        _ConsoleWrite("Sent Packet with data of : " & $mypacket & " On Pcap : " & $pcap) ;if not say so
    EndIf

Thanks Kris

Edited by Targus

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0