I am developing protocol fuzzing software in C/C++. I need a way to monitor the status of the fuzzing target (like ports, services). Is Nmap a good choice? If yes, then how to invoke Nmap in C/C++, is there an API? Thx.
I don't know what you really need, you did not provide any additional information in your question. In my opinion you can follow two different ways:
use nmap outside your program, as an external tool
use libpcap inside your software to analyze network traffic and obtain the information you need
Related
I want to create a small web server in c++ with http-parser from here nodejs/http-parser, I downloaded and I compiled what should I do next?
First of all, you need a way to communicate using TCP/IP in order to implement the HTTP server; depending on your case, you may also need to use other protocols, like UDP (for instance, if you need to resolve a domain name, you will typically use DNS) or ICMP.
If your application is running by an Operating System, take a look at its documentation about the networking facilities it can provide you. For instance, many operating systems provides a POSIX sockets API that will help you dealing with network devices and protocols.
If you prefer, you can use one of the networking libraries already written, provided they support your environment. They can help you with a useful abstraction of the network, so you can concentrate better on your application.
On the other hand, if your application will not be running by an Operating System, the first thing to do is to find some internet protocol suite that you will be able to use in your particular environment.
If you don't find one, you obviously need to implement everything by yourself.
I have an application that needs to do peer to peer connections on random ports, so I figure I need UPnP so that I can automatically have these ports forwarded and opened so that they can connect to their peers. I have yet to find a good example or tutorial on how to do UPnP and a lot of the docs for things like libupnp are not extremely helpful. So if you have any place where I can learn to program an application that can use UPnP please let me know.
If you only need to open ports on a Nat router I suggest you find a library that does it for you: there's probably no need to learn upnp yourself. If you're on Linux, take a look at GUPnP-IGD: https://developer.gnome.org/gupnp-igd/unstable/GUPnPSimpleIgd.html, it's a really simple way to open ports.
I am trying to create an application that can run as a service and another program to communicate with it (client)
i can find plenty of sample code about services but nothing about programs that interact with services
can someone please link some examples?
Sounds like you could and maybe should use TCP sockets. Or at least that would be the easiest and most straight forward.
Alternatively since it sounds like both client and service are on the same computer you could use some form of IPC (interprocess communication). So depending on your OS you may decide to use IPC instead.
I am developing 2 Windows services, one of them will send pictures and word files to other and other service will give a string answer. That services are in same computer.
I will develop same program's Linux version also.
Which way is the best for communication between services in Linux and Windows.
By the way I am developing that services with C++.
There're different options for your task:
Network. Establish TCP connection between your services, with service that asks as a client and service that answers as a server. It's possible to implement cross-platform solution using Boost.Asio or any other portable network library.
Shared memory. You can implement inter-process communication using shared memory. Cross-platform library: Boost.Interprocess.
Pipes. I don't know cross-platform library for this.
I would recommend to use TCP communication as more flexible solution.
I would suggest reading up on C++ sockets. You're probably going to want to use TCP sockets, since you want to ensure that the data being transferred does so correctly.
Try checking these links out:
Linux Sockets
Windows Sockets
You should search for IPC.
There are a lot of possibilities for inter process communication. Because you are not very specific about your problem and your requirements but I would suggest to take a look at boost::interprocess.
As long as you are sure that both services run on the same machine this will do it.
If you want to switch to a distributed approach you need something different.
Like XML-RPC, thrift or corba. Just to mention some possibilities.
We are building an internal application which will do the following:
Run as a Windows Service
Scan various server/platform types to confirm they are up and running
Call the HeartBeat() method on all of our WCF services
What we want to do is then (for each server) send a notification broadcast so that a listener can pick up the data and display the realtime results in a dashboard environment.
In addition, the data will be collected by the listener for drilldown or reporting purposes.
I'm having a hard time determining what is the proper approach for broadcasting results. SNMP seems like a good fit but I'm not sure how easy it would be to implement in C#. I've looked at WMI and SNMP at the moment.
I'm looking for input on alternatives to either SNMP or WMI for the broadcast approach.
If you're programming exclusively in C#, then your best bet is to find some C# SNMP library that you will probably have to purchase.
If you're wanting to go with portability and standards, then go with SNMP.
If you're always going to be using Win32 C# then go with a WMI solution.
If you don't mind coding outside of C# and instead C or C++ and want to make things compatible with other systems, then I would highly recommend working with Net-SNMP and building an SNMP agent from that.