![]() |
|
[Python] TCP/IP socket client, need some guidance - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Python] TCP/IP socket client, need some guidance (/showthread.php?tid=5027597) |
TCP/IP socket client, need some guidance - ๖ۣۜEмотιν∆тзď . - Oct 19, 2015 Hello 🤝 I wanted to create a bot to send login/join packets to a game server. So it will join then send more packets for it to write something in the chat, but I'm not sure how to do this. If someone could help me, I'd appriciate it so much! :) This is the code I got so far: Code import socketFYI, the game I picked to try on is "Soldat" a old 2d shooting game. Also, someone told me I could use wireshark or some packet sniffer but I have no clue in what form to put it into the code and how to send it. Please help me! 😖 -- EDIT: I installed Wireshark and listened to port 23073 while I connected to the server and gave me this data (UDP protocol): 0e:e9:6e:00:31:2e:36:2e:38:4d:61:6a:6f:72:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:0b:32:31:45:39:33:35:42:41:44:37:30:00 How could I apply that to the code and send that packet to the established connection? * - h0lyl337 - Nov 18, 2015 try socket.send(packet.pcap) * - Pentahedron - Nov 19, 2015 You must look at the handshake that is made to initiate a connection. Usually there is a ~4 message long sequence where the 2 nodes send packets between them to sync (on level 4). For example, in these packets, the username, and a command to login might be sent. To catch the handshake, setup wireshark and filter all packets that aren't from the game server. Post the pcap file somewhere (and provide a link) so we can analyse it. Also, this won't be easy :p. the data is encoded and there are predefined symbols/strings that mean things to the server and client that we don't know (yet). When you captured the data you posted, did your username have "Major" or was there any text with "Major" in it? PM for questions * - Pseudonym - Nov 21, 2015 UDP is stateless protocol, it doesn't have any handshakes, it doesn't establish connection nor it does close it. I would recommend learn something about UDP before trying to use it. * - Feanor - Nov 22, 2015 Have you tried making a udp socket? :) * - Pentahedron - Nov 28, 2015 (Nov 21, 2015 07:01 AM)Pseudonym Wrote: UDP is stateless protocol, it doesn't have any handshakes, it doesn't establish connection nor it does close it. I would recommend learn something about UDP before trying to use it. UDP doesn't have a handshake. Though inside the UDP packet, the application may do a /handshake/ of it's own. After some research I realized the term "/negotiation/" is more accurate. To prove my point lets look at TFTP. It utilizes UDP, though still has some packets transferred before the real packets with the data are sent. These initial packets negotiate parameters (and other things), but the point is, they must be sent to successfully transfer a file through TFTP. In conclusion, just because a protocol uses UDP underneath it, doesn't mean it doesn't have some negotiating/handshake packets sent before the real data (on the application layer). |