adepierre / sniffcraft Goto Github PK
View Code? Open in Web Editor NEWC++ program to capture and display all traffic between a client and a server in minecraft
License: GNU General Public License v3.0
C++ program to capture and display all traffic between a client and a server in minecraft
License: GNU General Public License v3.0
Hello,
Please tell me why after the player login from version 1.16.5 above, the running sniffcraft is disabling with following error:
[0:0:0:32] [S --> C] Login Compression
[0:0:0:32] [S --> C] Game Profile
Segmentation fault (core dumped)
With respect,
Unhappy hurtlay.
Hi,
Can SniffCraft currently capture and output .PCAP or .PCAPNG files (and decompress packets)?
If not, I was thinking of adding that feature in my fork. It's currently a mess and it would take time for me so I wanted to ask first.
Thank you,
could y'all add support for 1.8.9?
thanks
1.19.2
1.20.1
SniffCraft exits after connectting to the server for no reason
to replicate this connect to 8b8t.me
using the version 1.12.2
...
[0:00:02:882] [S --> C] Set Player Team
[0:00:02:882] [S --> C] Set Player Team
[0:00:02:882] [S --> C] Tab List
Server --> Client: NULL MESSAGE WITH ID: 59
[0:00:02:908] [S --> C] Set Objective
[0:00:02:908] [S --> C] Set Objective
1.19.3
1.19.4
1.12.2
probably just doing something wrong but when i launch it outputs this and then stops
Loading updated conf file
Missing or malformed cached credentials for Mojang account with login <email>, sending credentials to get a new one...
Sending credentials to Mojang authentication server...
Authentication completed!
1.18.2
1.18.2
Have system error of not found zlib1__.dll in executable file
1.19.4
Move from proxying to sniffing is optional here.
When encryption is requested, we may still listen to packet talk,
but not interfere with communication happening after that.
We may breach encryption by making the client share it's shared secret.
I have made a Lua script that logs it to a file for further use.
I have already tested this solution by dumping TCP streams
and decrypting them with said logged key.
I suggested this somewhere else already:
uis246/MCPC_dissect#2
All SniffCraft has to do on encryption request is to start
listening to that file for key and match proxy connection
by identifying local(Client) and remote(Proxy) addresses
and their ports. (Not server's IP+port we proxy to.)
BTW For connecting beside the local machine,
the proxy should always patch Handshake packet to
proper values to not include local IP and port.
BTW2 I might implement that script for other MC versions if needed.
You can contact me on Discord under username MajsterTynek#8884
or find me on AdvancedMacros Discord server.
1.16.3
1.20.1
1.12.2
1.18
I never worked with cmake, Visual Studio or C++. Can someone please help me install the programm? I tried it severel times and after finishing all steps and trying to run the sniffcraft command in cmd, i get the message that the command does not exist.
1.18
1.19.2
I found a bug.
It is during the decryption, in Connection::handle_read.
std::vector<unsigned char>& data = read_buffer;
size_t length = bytes_transferred;
std::vector<unsigned char> processed_data;
if (data_processor != nullptr)
{
processed_data = data_processor->ProcessIncomingData({ data.begin(), data.begin() + length });
data = processed_data;
length = processed_data.size();
}
During my debugging, read_buffer
which is basically being used as an unsigned char
array for a buffer was changing size.
data
is a reference to read_buffer
and when you assign to a reference it overwrites the original and it depends on it being BUFFER_SIZE
. The offending line:
data = processed_data;
The fix I came up with is: 2dc1724
std::vector<unsigned char> processed_data;
if (data_processor != nullptr)
{
processed_data = data_processor->ProcessIncomingData({ read_buffer.begin(), read_buffer.begin() + length });
length = processed_data.size();
}
else
{
processed_data = read_buffer;
}
{
std::lock_guard<std::mutex> received_lock(received_mutex);
ready_received_data.insert(ready_received_data.end(), processed_data.begin(), processed_data.begin() + length);
// We need to protect the callback call in the mutex scope
// otherwise we could have data in the buffer without the
// data length being transmitted correctly
if (data_callback)
{
data_callback(length);
}
}
1.19.2
C:\Windows\System32>"C:\Users\Ethan\Desktop\sniffcraft.exe" 12345 localhost:62709 "C:\Users\Ethan\Desktop\custom.json"
Waiting connection on 127.0.0.1:12345
Loading updated conf file...
Conf file loaded!
Trying to authenticate using Microsoft account
[2023-05-01 07:25:05.524] [INFO] [(21356)] Authentifier.cpp(86): Cached Minecraft token for Microsoft account still valid.
[2023-05-01 07:25:05.525] [INFO] [(21356)] Authentifier.cpp(89): Getting player certificates...
[2023-05-01 07:25:05.528] [INFO] [(21356)] Authentifier.cpp(1159): Cached player certificates still valid!
[2023-05-01 07:25:05.528] [INFO] [(21356)] Authentifier.cpp(96): Player certificates obtained!
Starting new proxy to localhost:62709
Waiting connection on 127.0.0.1:12345
[0:00:00:000] [(SC) --> S] Client Intention
[0:00:00:000] [C --> (SC)] Client Intention
[0:00:00:004] [S --> C] Login Disconnect
{
"reason": {
"raw_text": "{\"text\":\"This server has mods that require Forge to be installed on the client. Contact your server admin for more details.\"}"
}
}
forge needs to be installed in sniffcraft.exe
even though the alt has it
{
"LogToConsole": true,
"LogToReplay": false,
"LogRawBytes": false,
"Online": true,
"MicrosoftAccountCacheKey": "",
"Handshaking": {
"ignored_clientbound" : [
],
"ignored_serverbound" : [
],
"detailed_clientbound": [
],
"detailed_serverbound": [
]
},
"Status": {
"ignored_clientbound" : [
],
"ignored_serverbound" : [
],
"detailed_clientbound": [
],
"detailed_serverbound": [
]
},
"Login": {
"ignored_clientbound" : [
],
"ignored_serverbound" : [
],
"detailed_clientbound": [
"Hello",
"Login Disconnect"
],
"detailed_serverbound": [
"Key"
]
},
"Play": {
"ignored_clientbound" : [
"Move Entity Pos",
"Move Entity PosRot",
"Move Entity Rot",
"Entity Event",
"Player Position",
"Rotate Head",
"Level Chunk",
"Section Blocks Update",
"Light Update",
"Forget Level Chunk",
"Set Entity Data",
"Update Attributes",
"Add Entity",
"Set Entity Motion",
"Teleport Entity",
"Set Equipment",
"Add Mob",
"Remove Entity",
"Block Update",
"Animate",
"Keep Alive",
"Set Time",
"Block Event",
"Sound"
],
"ignored_serverbound" : [
"Move Player Pos",
"Move Player PosRot",
"Move Player Rot",
"Move Player Status Only",
"Keep Alive"
],
"detailed_clientbound": [
"Container Set Content",
"Container Set Slot"
],
"detailed_serverbound": [
"Container Click",
"Container Close"
]
}
}
If need be I can give the modpack zip for my forge modpack for testing if requested in discord
1.19.3
Packets
ServerboundClientIntentionPacket
ClientboundGameProfilePacket
ClientboundLoginCompressionPacket
ClientboundHelloPacket
are not present in ProtocolCraft for version 1.16.5.
On commit b38b519
everything works fine
Hi @adepierre
Could you please support sniffcraft to capture data in old minecraft pe version like 0.13, 0.14 ?
Thank you so much!
Maybe useless for package ispection software, but in some cases it useful. For example if you have bot and want to see actions of other players or something like this.
Implementation example:
https://github.com/uis246/AltCraft-tools/blob/master/TransperentProxy/replaymod.c
(Yep. Another proxy)
It works with crushedpixels' replaymod.
Replay contains only clientbound packets, so no client representation without injection move packets to replay.
1.19.2
Would you mind adding me on discord for some help and to answer a few complicated questions?
1.19.2
1.18.2
1.19.2
1.14.4
1.12.2
Let me explain; BotCraft is capable of joining a server using encryption, and is capable of decrypting all packets as well. What stops us from when the player connects to our proxy server ( in offline mode ), to encrypt and forward all packets to the server we are connecting to. All packets we receive could be decrypted and forwarded to the client.
Pakkit ( https://github.com/Heath123/pakkit ) is a nodejs program that relies on node-minecraft-protocol ( https://github.com/PrismarineJS/node-minecraft-protocol ) and is capable of doing this, and manipulating packets as well.
The same method used by pakkit should be possible using the excellent ProtocolCraft as well.
builds fine but when i try to start it says "The code execution cannot proceed because zlib.dll was not found."
1.16.5
I'm getting this error when SniffCraft is running and I try to connect to localhost
:
Starting new proxy to server-ip:25565
Empty mojang credentials, trying to authenticate using Microsoft account
[2022-08-16 23:31:44.118] [INFO] [(52208)] Authentifier.cpp(144): Cached Minecraft token for Microsoft account still valid.
Client --> Server: PARSING EXCEPTION: Wrong input size in ReadData || Hello
[0:0:0:0] [C --> S] Client Intention
[0:0:0:77] [S --> C] Hello
[0:0:0:269] [(SC) --> S] Key
Session closed
Anything I can do to resolve this?
Thanks
libc++abi: terminating due to uncaught exception of type std::bad_optional_access: bad_optional_access
^^
when i hit connect in the minecraft and it starts to initiate the connection process
1.19
1.18.2
1.17.1
1.19.2
1.20.1
1.19.2
Ever since the update to add the online mode I haven't been able to build the project. I keep getting this error
In file included from /usr/include/c++/11.1.0/memory:76,
from /home/trac/coding/SniffCraft/3rdparty/asio/asio/include/asio/associated_allocator.hpp:19,
from /home/trac/coding/SniffCraft/3rdparty/asio/asio/include/asio.hpp:18,
from /home/trac/coding/SniffCraft/sniffcraft/include/sniffcraft/server.hpp:3,
from /home/trac/coding/SniffCraft/sniffcraft/src/server.cpp:1:
/usr/include/c++/11.1.0/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = Botcraft::Authentifier]’:
/usr/include/c++/11.1.0/bits/unique_ptr.h:361:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = Botcraft::Authentifier; _Dp = std::default_delete<Botcraft::Authentifier>]’
/home/trac/coding/SniffCraft/sniffcraft/include/sniffcraft/MinecraftProxy.hpp:26:7: required from here
/usr/include/c++/11.1.0/bits/unique_ptr.h:83:23: error: invalid application of ‘sizeof’ to incomplete type ‘Botcraft::Authentifier’
83 | static_assert(sizeof(_Tp)>0,
| ^~~~~~~~~~~
/usr/include/c++/11.1.0/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = Botcraft::AESEncrypter]’:
/usr/include/c++/11.1.0/bits/unique_ptr.h:361:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = Botcraft::AESEncrypter; _Dp = std::default_delete<Botcraft::AESEncrypter>]’
/home/trac/coding/SniffCraft/sniffcraft/include/sniffcraft/MinecraftProxy.hpp:26:7: required from here
/usr/include/c++/11.1.0/bits/unique_ptr.h:83:23: error: invalid application of ‘sizeof’ to incomplete type ‘Botcraft::AESEncrypter’
make[2]: *** [sniffcraft/CMakeFiles/sniffcraft.dir/build.make:146: sniffcraft/CMakeFiles/sniffcraft.dir/src/server.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:142: sniffcraft/CMakeFiles/sniffcraft.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
And the build steps in the README don't work because the folder is called SniffCraft not sniffcraft and -DWITH_ENCRYPTION gives you
CMake Error: Parse error in command line argument: WITH_ENCRYPTION
Should be: VAR:type=value
CMake Error: Run 'cmake --help' for all supported options.
1.12.2
1.12.2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.