|
You last visited: Today at 03:49
Advertisement
Nostale Packet Sniffer
Discussion on Nostale Packet Sniffer within the Nostale forum part of the MMORPGs category.
03/18/2023, 13:09
|
#1
|
elite*gold: 0
Join Date: May 2014
Posts: 14
Received Thanks: 0
|
Nostale Packet Sniffer
Hello  , i'm trying to create a proxy in C that stands between the client and the nostale server and shows me the packets exchanged with the game. I see that every time notale is started on a local port which is dynamic and changes every time the game is opened. Below is my C code used to create the TCP proxy.
Should I need to implement in this code something that allows me to preload the port on the nostal hooks? And if so, can anyone tell me which solutions I could adapt?
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winsock2.h>
#pragma comment(lib, "ws2_32.lib")
#define PORT LOCAL_PORT
int main() {
WSADATA wsa;
SOCKET s, new_socket;
struct sockaddr_in server, client;
int c;
printf("\nInitializing Winsock...");
if (WSAStartup(MAKEWORD(2, 2), &wsa) != 0) {
printf("WSAStartup failed. Error Code : %d", WSAGetLastError());
return 1;
}
if ((s = socket(AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) {
printf("Could not create socket : %d", WSAGetLastError());
}
server.sin_family = AF_INET;
server.sin_addr.s_addr = INADDR_ANY;
server.sin_port = htons(PORT);
if (bind(s, (struct sockaddr*)&server, sizeof(server)) == SOCKET_ERROR) {
printf("Bind failed with error code : %d", WSAGetLastError());
}
listen(s, 3);
puts("Waiting for incoming connections...");
c = sizeof(struct sockaddr_in);
while ((new_socket = accept(s, (struct sockaddr*)&client, &c)) != INVALID_SOCKET) {
puts("Connection accepted");
SOCKET server_socket = socket(AF_INET, SOCK_STREAM, 0);
if (server_socket == INVALID_SOCKET) {
printf("Could not create socket : %d", WSAGetLastError());
return 1;
}
struct sockaddr_in server_address;
server_address.sin_family = AF_INET;
server_address.sin_addr.s_addr = inet_addr("NOSTALE_IP_SERVER");
server_address.sin_port = htons(NOSTALE_PORT);
if (connect(server_socket, (struct sockaddr*)&server_address, sizeof(server_address)) < 0) {
printf("Connection error");
return 1;
}
char buffer[1024];
int bytes_received;
while ((bytes_received = recv(new_socket, buffer, sizeof(buffer), 0)) > 0) {
send(server_socket, buffer, bytes_received, 0);
memset(buffer, 0, sizeof(buffer));
bytes_received = recv(server_socket, buffer, sizeof(buffer), 0);
send(new_socket, buffer, bytes_received, 0);
memset(buffer, 0, sizeof(buffer));
}
closesocket(server_socket);
puts("Remote server connection closed");
closesocket(new_socket);
puts("Client connection closed");
}
WSACleanup();
return 0;
}
Sorry for my english and ty to all
|
|
|
03/18/2023, 15:36
|
#2
|
elite*gold: 0
Join Date: Oct 2018
Posts: 257
Received Thanks: 207
|
Hello,
First of all I want to mention that I never did it, so it is only guesses + information that I found in the previous months/years.
Your "proxy" should be a server to your client and a client to Nostale server, therefore the local port from Nostale client should not really matter, as you are anyway only listening to it.
NostaleClientX.exe (client) <=> (server) Your proxy (client) <=> (server) GF's servers
That also means you will find a way to redirect NostaleClientX.exe's packets to your proxy (there are many ways to do it, just pick the most suitable for you)
TL;DR: You don't need to handle the client local port
|
|
|
03/18/2023, 15:52
|
#3
|
elite*gold: 0
Join Date: May 2014
Posts: 14
Received Thanks: 0
|
Hi  , thank you for the answer,
It should be just like you said, only that by setting any free port, the software stays on "wainting connection", no connection is intercepted. Of course, all this by starting the Tcp proxy first and then the nostal client
|
|
|
03/18/2023, 18:39
|
#4
|
elite*gold: 0
Join Date: Jan 2018
Posts: 44
Received Thanks: 69
|
I've created a Proxy via C# once a few years ago..
|
|
|
03/18/2023, 19:22
|
#5
|
elite*gold: 0
Join Date: May 2014
Posts: 14
Received Thanks: 0
|
Quote:
Originally Posted by AfterLife-
I've created a Proxy via C# once a few years ago..

|
Hi, thanks for the reply. I will to know if it is possible to force nostal traffic on a specific port or if there is a way to understand on which port it will listen on to set it before the proxy
|
|
|
03/19/2023, 20:11
|
#6
|
elite*gold: 0
Join Date: Jan 2018
Posts: 44
Received Thanks: 69
|
The port for the login server is set in the executable file and varies depending on the language of the client.
Here are the corresponding port values for each language:
4000 = EN
4001 = DE
4002 = FR
4003 = IT
4004 = PL
4005 = ES
4006 = CZ
4007 = RU
4008 = TR
Upon logging in, you will be provided with the IP address and port number of the world server that you are attempting to connect to. If nothing has been changed, you may refer to my previous response in the HandlePacket function.
|
|
|
04/12/2023, 05:51
|
#7
|
elite*gold: 0
Join Date: Nov 2021
Posts: 5
Received Thanks: 0
|
It looks like you are trying to create a TCP proxy in C that stands between a client and a Nostale game server. Your code creates a socket and listens on a dynamic local port for incoming connections. When a connection is accepted, your code connects to the Nostale server, reads data from the client, forwards it to the Nostale server, and then reads data from the Nostale server and forwards it to the client.
To answer your question, it is possible to preload the port on the Nostale hooks, but it would require modifying the Nostale game client to use a fixed port instead of a dynamic one. This is not something you can do from the proxy server side.
However, you can modify your proxy server code to detect the local port that the Nostale game client is using and then use that same port to connect to the Nostale server. One way to do this is to use a packet sniffer library like WinPcap or Npcap to capture the packets exchanged between the Nostale game client and the server, and then parse the packets to extract the local port used by the client. You can then modify your code to use this port to connect to the server.
Another way to detect the local port used by the Nostale game client is to use the Windows API function GetExtendedTcpTable, which returns a table of all TCP endpoints on the local machine. You can search this table for an endpoint with a matching remote IP address and port number to the Nostale server, and then use the corresponding local port number to connect to the server.
Keep in mind that intercepting and manipulating network traffic can have legal and ethical implications, so make sure you have permission to do so before proceeding with your project.
|
|
|
04/12/2023, 09:59
|
#8
|
elite*gold: 0
Join Date: Jan 2018
Posts: 44
Received Thanks: 69
|
Quote:
Originally Posted by matuf98
It looks like you are trying to create a TCP proxy in C that stands between a client and a Nostale game server. Your code creates a socket and listens on a dynamic local port for incoming connections. When a connection is accepted, your code connects to the Nostale server, reads data from the client, forwards it to the Nostale server, and then reads data from the Nostale server and forwards it to the client.
To answer your question, it is possible to preload the port on the Nostale hooks, but it would require modifying the Nostale game client to use a fixed port instead of a dynamic one. This is not something you can do from the proxy server side.
However, you can modify your proxy server code to detect the local port that the Nostale game client is using and then use that same port to connect to the Nostale server. One way to do this is to use a packet sniffer library like WinPcap or Npcap to capture the packets exchanged between the Nostale game client and the server, and then parse the packets to extract the local port used by the client. You can then modify your code to use this port to connect to the server.
Another way to detect the local port used by the Nostale game client is to use the Windows API function GetExtendedTcpTable, which returns a table of all TCP endpoints on the local machine. You can search this table for an endpoint with a matching remote IP address and port number to the Nostale server, and then use the corresponding local port number to connect to the server.
Keep in mind that intercepting and manipulating network traffic can have legal and ethical implications, so make sure you have permission to do so before proceeding with your project.
|
ChatGPT Copy & Paste on a few weeks inaktiv Thread.. Noice
|
|
|
05/01/2023, 06:04
|
#9
|
elite*gold: 0
Join Date: Nov 2021
Posts: 5
Received Thanks: 0
|
Quote:
Originally Posted by AfterLife-
ChatGPT Copy & Paste on a few weeks inaktiv Thread.. Noice
|
yeah, just lazy writing tbh
|
|
|
05/01/2023, 11:48
|
#10
|
elite*gold: 110
Join Date: Jun 2016
Posts: 545
Received Thanks: 180
|
Quote:
Originally Posted by matuf98
yeah, just lazy writing tbh
|
Just a lack of knowledge*
|
|
|
 |
Similar Threads
|
Nostale packet sniffer with Python
01/19/2023 - Nostale Hacks, Bots, Cheats & Exploits - 6 Replies
heu guys i wonder if someone have tried to build a packet logger using python, if not have you any idea how to start to build my packet logger nostale? i just want to scrap all the information from the packet (received one) i don't want to inject it in nostale like the others packet sniffer with c++
|
Packet Sniffer from C#
10/01/2011 - CO2 Exploits, Hacks & Tools - 43 Replies
Hi,
I did a google and I found this packet sniffer in C#.
I compiled it and found it not bad.
This is not my work ^^
You may use it to see where is your packet goes to.
This also help you to find out if there is any trojan / backdoor & etc.
|
Conquer Online Packet Sniffer
03/24/2009 - CO2 Exploits, Hacks & Tools - 21 Replies
Well I just put this together in a few hours so its a bit messy atm, but here goes.
The .rar will come with two files: PacketSniffer.exe and config.ini
config.ini
GameServer=
In this part you must put in your GAME SERVER ip.
This is NOT the ip in your server.dat.
You'll need to find this one out on your own until I record all the game server ips.
|
CO packet sniffer
10/18/2007 - CO2 Exploits, Hacks & Tools - 49 Replies
This program allows you to see and easily log decrypted packets sent to and from the CO servers. This program does not attach to conquer or look at the memory conquer resides in. It only looks at packets coming over the network.
Current limitations:
Only one connection: The program can only keep track of one connection. This means that if you attempt to login again, the program will desync. If enough interest is shown in this program, it can be changed to allow multiple clients.
Only...
|
All times are GMT +2. The time now is 03:49.
|
|