I am using the Asterisk PBX to relay sip requests and responses to and from devices. I would like to know if there is a way to add custom headers to my sip responses, similar to adding custom header fields through the use of SipAddHeader(). Or, if not, is there any way I can just reconfigure Asterisk to send the custom requests and responses I send to it straight to the target device, without asterisk duplicating some fields and recreating a new request or response. Thank you and have a great one.
No, there is no way do that in CHAN_SIP without chan_sip.c rewrite(major rewrite, not much tracking here).
You can use kamailio or opensips as proxy and change any headers or packets using it.
Related
FiddlerCore seems to have a ton of functionality around managing http requests including parsing headers, parsing and decoding body content, searching for content within a request, etc. Additionally there's the functionality to replay captured requests.
I'd like to use these features on requests that my web application receives directly, for example via an ASP.NET MVC or Web API controller.
In this scenario, I am am natively capturing the request, so I don't need or want FiddlerCore's proxy functionality. I just want to use the bits of FiddlerCore that manage and manipulate requests.
Can I use the above functionality of FiddlerCore and not enable a proxy?
It sounds like you're asking "How do I run FiddlerCore as a reverse proxy?"
Move the target service to a different port (e.g. 81 instead of 80)
Call FiddlerApplication.Startup with the original service port (e.g. 80)
In your FiddlerCore application's BeforeRequest handler, rewrite the port of inbound requests to point to the target port (e.g. 81).
I'm able to make HTTP requests on my local host using client certificates.
I have some logic in my code that can make two requests use the same certificate for their requests, or not, depending on certain conditions.
My localhost is currently pointing to the default 'Welcome to IIS' page.
Is there any way to use Wireshark to detect if the client certificates that are being sent from my machine in separate requests are the same or not?
PS: If someone can suggest a better way of achieving what I'm trying to do here, that'd work as well. I don't necessarily need to use Wireshark. My main objective is to figure if two different requests are sending the same cert or not, as I've mentioned here:
How do I monitor client certs that are being sent via the requests?
Thanks!
I found a way to do this. This guide helped, in summary, yes, you can use Wireshark to examine what client certificates are being sent from the client (or received on the server).
You need to start capturing traffic on Wireshark, only for the period of time when the request(s) is made and processed, and then add the appropriate filters to filter based on the protocol. In my case, I filtered it based on the IP address of the sender and receiver because I knew both.
You'll need the server's certificate to decrypt the messages because they'll be transmitted in encrypted format. You can easily do that by going to Edit -> Preferences. Select Protocols from the menu on the left -> SSL -> Click edit. Add the server's cert and IP, and save the settings.
When I use display filter for HTTP it shows only HTTP packets when HTTP message is on standard port i.e. on port 80. But, when message is not using standard port, then display filter not works for HTTP and I need to filter for TCP and then need to find out HTTP packets manually.
I want to know why this happen? Is it standard behavior or I am doing (or expecting) it wrongly.
Thanks.
I had to enable the HTTP protocol by doing the following:
"Analyze -> Enabled Protocols"
This solution was for version 1.12.2 (and disabled by default in
version 2.0.2) but should work for any variant of version 1 and 2.
If you have HTTP not on its usual port, you can use the "Analyze -> Decode As" tool in Wireshark to tell it to treat all traffic on this port as a certain protocol.
The well-known port for HTTP is port 80. If you're looking at traffic on a different port Wireshark would normally expect traffic to be in the form for whatever service normally uses that port (if any). It has no way to know that traffic on, say, port 1080 is actually HTTP. This is not a bug, but a limitation of the way you are trying to use TCP
I am using version 1.10.2 and it will classify any port as HTTP as long as it sees HTTP data in it.
I have web application that runs on Tomcat (and gets HTTP requests) and some other backend standalone application that gets only TCP. For some reasons, I can use outside only port 8080. So, I need to get all TCP requests (from outside) to port 8080 and forward HTTP ones to web application on Tomcat and all TCP pure requests (that are not HTTP) - to standalone application. Internal forwarding could be done to any port, e.g. 8181 on Tomcat and 8282 on standalone application. Is it possible to setup such configuration? How it could be done?
Thanks in advance.
TCP and HTTP are protocols in different networking stack layer. If you want to use some application to filter HTTP requests, your application should deal with Application-Layer information, not Network-Layer(like TCP/UDP).
I don't see how this can be possible generally. You could look packet-by-packet, but the middle of an http body can be arbitary so you can't just look at the data of each packet
If any particular client will send you either http or general TCP but not both, can you do this by source-IP address? Do you know the addresses of either the servers that will send you http requests or the ones that will send you TCP requests?
If you don't know the source IPs, you could heuristically look at the first packet from some previously unknown IP and see if it looks like http, then tag that address as containing http traffic.
What is the content/format ot the TCP communication? Is there any pattern you can detect in that?
Y
Perhaps you could do something like this using iptables + L7 filter. Of course this will only work if you run Linux on your box. Also I don't know how recently l7 filter project has been updated.
Java servlet technology is not limited to Http. The servlet interface lets you read in the incoming input stream via ServletRequest.getInputStream(). So you can create an implementation of Servlet interface and map it in web.xml and you are all set to receive any TCP traffic.
Once you have the read the input stream to sniff the content you will want to forward HTTP requests to an HttpServlet. To do this you will need to make sure that the input stream you pass on is positioned at the very beginning of the input.
EDIT: On reading your question once again, I noticed that you don't plan to expose the Tomcat directly on external port as I originally thought. If you are willing to make the tomcat listen on the external port, you can try the approach described above
i've read on argosoft.com that it would be possible sending email using the http protocol - where can i find info about it?
i'm looking for a way to send a personalized newsletter off my server withouth putting heavy traffic on my webserver. would this be possible?
thx
You can build such System. Run a Server side Script in PHP/perl/.net or anything that takes inputs like from, to, subject, body from GET/POST arguments and send the mail. and them use curl or do something similer to convey the information to that page and that page will eventually send the mails for You.
However If The SMTP server have an Web Interface then that one can also be used Similar way.
You cant. smtp or imap. At best you can have an http server which accepts mail and then talks smtp/imap with some mail server. Why do you think http would be less overhead?
In fact you don't have to increase the load on your webserver to send mail from your webserver domain. If the newsletter isn't too frequent you could simply have someone send it from any mail client.
If you want to automate. There's a php function too.http://php.net/manual/en/function.mail.php
(also for java and perl)