Hacking the DC++ client to record search results from users
So I am not the first one to do this. I am writing this with reference to an article by Himanshu Mishra that I read recently. Link here.
He basically gives you an idea of how to perform the hack. Well, it doesn’t tell you exactly the commands that you need. Although it’s really easy to do some Google search and get to the hack but if you are facing issues with setting up the ncdc++ client. This one’s for you.
How are we going to do this hack?
DC++ is a peer-to-peer file sharing client that lets individual nodes host their servers (hubs) that users join to share files in a decentralized manner. When a user searches in their dc++ client, the client sends this request to the hub to which rest of the nodes are connected. The hub then forwards the request to *everyone* who is connected to it and returns the indexes to user to download.
The hack is about monitoring the log of your dc client to get what other user search. We are going to use a commandline client for DC++ which has support for Linux only. A workaround to use it on Windows is by Cygwin or Windows Subsytem for Linux(WSL).
Here’s the hack:
- Download the tar ball from here & extract it.
$ tar -zxvf file_name.tar.gz- Need to install the dependencies. It requires ncurses, bzip2, zlib, sqlite3, glib2 , gnutls and bla bla bla.
$ sudo apt-get install libncurses5-dev libncursesw5-dev $ sudo apt-get install bzip2$ sudo apt-get install zlib1g-dev$ sudo apt-get install sqlite3 libsqlite3-dev$ sudo apt-get install libglib2.0-dev$ sudo apt-get install libbz2-1.0 libbz2-dev$ sudo apt-get install gnutls-bin libgnutls28-dev
3. Build the package from the source code:
$ ./configure$ make$ sudo make install
4. Start the client:
$ ncdc5. Gives you a prompt:
main>6. See the manual to learn the commands to configure your client. Link here.
Get Parichay Barpanda’s stories in your inbox
Join Medium for free to get updates from this writer.
7. You need to set some rules for the client (depends on the rules set by hub you are connecting to). I will tell you about the ones I used based on the rules of my hub:
main> /set nick MyNick
main> /set description ncdc is awesome!
main> /set connection 10
main> /share "My Awesome Files" /path/to/files8. I hope the commands are intuitive enough, else refer to manual on pt. 6!
If you need to set a particular parameter then:
main> /setto see all the parameters with their key and value pair. Use page up or page down to scroll up/down the list.
9. I had to modify my slot count for my hub(as it was limited to 6), so to do that:
main> /set slots 610. Set the log_debug to true, so that you can log all the queries that are made to you (via the hub):
main> /set log_debug true11. Need to change your connection from passive to active:
main> /set active true12. Connect to the hub by typing:
main> /open ncdc <ip_address>Voila! You are connected.
13. Ncdc by default will create a folder .ncdc (hidden) on your home directory. You will find the logs there. All the search queries are logged in a file called stderr.log. To read the contents of the log file:
$ tail -f ~/.ncdc/stderr.log14. Use another client instance or another pc to connect to the hub. Now make search. You will find your log updated when you search from another client. Logs may have lots of meta data that you might not be interested in, so you’ll need to parse the data.
Leave some claps if this helps.
Auf Wiedersehen.






