Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > General Coding
You last visited: Today at 04:42

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Packet sending

Discussion on Packet sending within the General Coding forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Nov 2007
Posts: 80
Received Thanks: 65
Packet sending

Hey,

I have manged to hook, wsasend()/wsarecv()... But why is the sent data different to the data I logg with a packeteditor?

How I mange it to send a packet?

--------------

Ich habe es geschafft die wsasend()/wsarecv Funktionen zu hooken. Aber warum sind die Daten die ich dort abfange anders, als die die ich mit wpe pro sniffe?

Und wie bekomme ich es hin nun Packete zu senden?

greets
D4rk_Sasuke
D4rk_Sasuke is offline  
Old 01/24/2012, 22:47   #2
 
elite*gold: 42
Join Date: Jun 2008
Posts: 5,426
Received Thanks: 1,888
wpe hookt auch nur send/recv bzw wsasend/wsarecv. Wenn du da etwas anderes raus hast, musst du was falsch gemacht haben
Kann natürlich auch dadran liegen, dass die Verschlüsselung, falls vorhanden, dynamisch ist
MoepMeep is offline  
Old 01/24/2012, 23:06   #3
 
elite*gold: 0
Join Date: Nov 2007
Posts: 80
Received Thanks: 65
Also die Daten die ich gesnifft habe sind unverschlüsselt und statisch... Habe nun den lpBuffer in lpBuffer->buf und lpBuffer->len aufgeteilt nun habe ich auchd ie richtigen Daten, nur das hängt bei buf noch mehr hinten drann?? Also über die length von der angegebenen lpBuffer->len hinweg?
D4rk_Sasuke is offline  
Old 01/24/2012, 23:10   #4
 
elite*gold: 42
Join Date: Jun 2008
Posts: 5,426
Received Thanks: 1,888
Poste einfach mal deinen Code, dann kann dir eher geholfen werden.
MoepMeep is offline  
Old 01/25/2012, 06:43   #5
 
elite*gold: 0
Join Date: Nov 2007
Posts: 80
Received Thanks: 65
PHP Code:
// dllmain.cpp : Definiert den Einstiegspunkt für die DLL-Anwendung.
#include "stdafx.h"
#include <Windows.h>
#include <cstring>
#include "detours.h"
#include <winsock2.h>
#include <fstream>

using namespace std;

#pragma comment(lib,"detours.lib") 
typedef int (WINAPI *SendFunc)(SOCKET, const char*, intint);
typedef int (WINAPIt_WSASend)(SOCKET,LPWSABUF,DWORD,LPDWORD,DWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE );

int count 0;
int count1 0;
t_WSASend o_WSASend NULL;
SendFunc o_Send NULL;

int WINAPI hook_WSASend(SOCKET s,LPWSABUF lpBuffers,DWORD dwBufferCount,LPDWORD lpNumberOfBytesSent,DWORD dwFlags,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
{
    
        
fstream datei;
        
datei.open("WSASend.txt"ios::out ios::ate ios::app);
        
count++;


        
datei << count << ". " << << " " << lpBuffers << " " << lpBuffers->buf << " " <<  lpBuffers->len << " " << dwBufferCount << " " << lpNumberOfBytesSent << " " << dwFlags << " " << lpOverlapped <<  " " << lpCompletionRoutine << "\n" << endl;
        
datei.close();
    
    return 
o_WSASend(s,lpBuffers,dwBufferCount,lpNumberOfBytesSent,dwFlags,lpOverlapped,lpCompletionRoutine);
}

int WINAPI hook_Send(SOCKET s, const charbufint lenint flags)
{
            
fstream datei;
        
        
datei.open("SendPackets.txt"ios::out ios::ate ios::app);
        
count1++;
        
datei << count1 << ". " << << " " <<  buf << " " << len << " " << flags << "\n" << endl;
        
datei.close();

    return 
o_Send(sbuflenflags);
}


BOOL APIENTRY DllMainHMODULE hModule,
                       
DWORD  ul_reason_for_call,
                       
LPVOID lpReserved
                     
)
{
    switch (
ul_reason_for_call)
    {
    case 
DLL_PROCESS_ATTACH:
        
o_WSASend = (t_WSASend)DetourFunction((PBYTE)&WSASend,(PBYTE)&hook_WSASend);
        
o_Send = (SendFunc)DetourFunction((PBYTE)send,(PBYTE)hook_Send);
        break;
    case 
DLL_THREAD_ATTACH:
    case 
DLL_THREAD_DETACH:
    case 
DLL_PROCESS_DETACH:
        break;
    }
    return 
TRUE;

D4rk_Sasuke is offline  
Old 01/25/2012, 11:22   #6
 
elite*gold: 42
Join Date: Jun 2008
Posts: 5,426
Received Thanks: 1,888
Dazu dann bitte noch deinen output und den output von WPE.
MoepMeep is offline  
Old 01/25/2012, 11:50   #7
 
xNopex's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 827
Received Thanks: 471
Code:
fstream datei;
        datei.open("WSASend.txt", ios::out | ios::ate | ios::app);
        count++;


        datei << count << ". " << s << " " << lpBuffers << " " << lpBuffers->buf << " " <<  lpBuffers->len << " " << dwBufferCount << " " << lpNumberOfBytesSent << " " << dwFlags << " " << lpOverlapped <<  " " << lpCompletionRoutine << "\n" << endl;
        datei.close();
Datei mit std::ios::binary öffnen und mit .write() reinschreiben.
xNopex is offline  
Thanks
1 User
Old 01/25/2012, 15:29   #8
 
elite*gold: 0
Join Date: Nov 2007
Posts: 80
Received Thanks: 65
So nun habe ich die richtigen Daten.

Wie sende ich denn aber nun ein Packet? Also von einem anderen Programm aus?
D4rk_Sasuke is offline  
Old 01/26/2012, 19:37   #9
 
xNopex's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 827
Received Thanks: 471
Quote:
Wie sende ich denn aber nun ein Packet? Also von einem anderen Programm aus?
Nja im externen Programm einfach mit dem Server verbinden und dann senden?
xNopex is offline  
Old 01/26/2012, 20:29   #10
 
elite*gold: 0
Join Date: Nov 2007
Posts: 80
Received Thanks: 65
Also so connecten... Wobei sock der geloggte socket ist.

PHP Code:
   addr.sin_family=AF_INET;

   
addr.sin_port=htons(12345); // server port

  
addr.sin_addr.s_addr=inet_addr("127.0.0.1"); //server ip



  
rc=connect(sock ,(SOCKADDR*)&addr,sizeof(SOCKADDR)); 
ICh bekomme Fehler code 10038

Quote:
WSAENOTSOCK
10038
Socket operation on nonsocket.
An operation was attempted on something that is not a socket. Either the socket handle parameter did not reference a valid socket, or for select, a member of an fd_set was not valid.
Oder sollte ich den Game connect sicherheitshalber auch hooken?
D4rk_Sasuke is offline  
Reply


Similar Threads Similar Threads
c# sending packet
11/22/2011 - .NET Languages - 0 Replies
i enter an online flash game from my app webbrowser tho i cant find out how to send packets trougth it :S. i managed to send packets trought WPE PRO tho i want to code it into my proggy. i dont think i need to hook my own app am i?
Need help sending a packet !
02/28/2010 - Kal Online - 1 Replies
i've got a Question and i hope some1 can help me there is an item at a NPC that u can buy 1 only each time .. and i need to buy 1000000 of it so i need to send the packet to buy this item 1000000 times when i try to sniff the packet to buy this item i got : Packet type : 0x18 format : m arguments : (unknown character) so ... how can i send that (unknown character) as an argument ?? in the code that (unknown character) is displayed from "(DWORD)va_arg(args,DWORD)" when i tried to save...
sending packet at WPe
07/18/2008 - Dekaron - 10 Replies
after sending some packet at WPE my connection to 2moons always got disconnect the moment I send the packet can someone help me regargding this
packet sending
03/31/2008 - RF Online - 4 Replies
now i know how to bypass rf online and now i can run WPE PRO w/o getting detected by fireguard.any1 can help me w/ this packet sniffing?coz i get confused on what packet to capture and send to the server.thanks
sending a packet
11/26/2007 - Conquer Online 2 - 3 Replies
I've captured a packet that I'd like to re-send to do a specific function, but I don't know how to do that. I know it involves 4 encryption keys and a packet id number. My best guess is to send the packet to a proxy that hopefully will forward it to the server properly. Anyone want to offer some tips on what to use?



All times are GMT +2. The time now is 04:42.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.