JXBrowser, intercepting loading of a script, and change it's contents. - jxbrowser

I know you can add a LoadAdapter, and implement onStartLoadingFrame
but is it possible to modify the response? IE the content sent to the client. I cant seem to see the responseText anywhere yet to modify it.

You can use CustomProtocolHandler to response with custom data.
Please take a loot at the article for details.

Related

Wireshark showing post parameters in diffrent locations in follow TCP stream window

Im running some tests on a app and Ive stumbled upon an odd thing that happends when I sniff the traffic between me and the app server using wireshark:
In a scenario when Im making the post request through the app's html, it looks like that:
But when Im requesting the same thing using the chrome extension "postman", it looks like that:
why are the parameters are now shown at the top of the request? I mean, what changed here?
Im trying to find a clue why is it working in the first option and refuses to work on the second. thats why I need to investigate every little thing..
Edit:
I wrote a short html page to illustrate this and the second option happens here as well:
...
<form action="http://x.x.x.x/page.cgi?id=1726931735&host_name=blah" method="post">
....
postman will send an empty body by default, you need to enable the rows of key-value fields for them to be added to the request. postman does not read the form on the page, its parameters must be inserted into the plugin fields. Otherwise postman will send an empty request just like you see.
You need to enter the fields in the Body tab in postman:
It's very odd. The first one is correct. The second is using get semantics but doing a post with no content. I'd try something else instead of this chrome extension.

Tamper GET request parameter with Tamper Data in Firefox?

I am able to tamper post request parameter with Tamper Data in firefox i.e when i make
post request and i get the popup in firefox to change POST request parameters but in case
of GET request, i get the popup but there is no way to change the request parameter.
So question is Can't we change the request parameter thru Tamper Data/Fiddler?(Yes i agree
we can change it from browser address bar but that will be applicable once first request has been firect but i want to tamper some data in the very first Get Request. So i want to change GET request paramater with Tamer Data/Fiddler.Is it possible?)
You can't do that using Tamper-Data. You could use a more advanced standalone-tool, like Web Scarab which will let you intercept and edit all portions of your web-requests.
Using fiddler, in conjunction with FiddlerScript is also an alternative.
You can easily use Fiddler to tamper with any aspect of a request or response. You can do this using FiddlerScript or manually using breakpoints. To change traffic manually using breakpoints, watch this tutorial video: http://www.youtube.com/watch?v=8bo5kXMAcV0&list=PLvmaC-XMqeBbw72l2G7FG7CntDTErjbHc
You can also use: Live http header addon. Hope it help.

Centralized image server with security and water mark on it

I have a situation where I have to make a centralized image website. I want to secure those images from direct access. I want to send response with a watermark over it depending on request parameter. What is the best approach for it.
So far I have created a content website and directly accessing image.
Should I create handler from response.
But if I use handler will it be slow (response).
Kindly suggest me the best approach.
An image handler is the way to go, you will be able to check the http header referer and only serve image when appropriate.
There is an article on the code project that has all the parts you need:
http://www.codeproject.com/Articles/126421/Image-Handling-In-ASP-NET
You'll have to ignore certain sections and expand on others, but there is basically everything you need in the article.
This might help you: http://www.naveenbhat.in/2012/06/directory-security-on-webservice-with.html
Here, I created the handler for html and pdf types. You can implement the logic in same way for image.

Saving contents of <pre> tag to file on server

I have searched here and googled for this, and I've probably come across an answer, but I guess I don't understand asp.net enough to get it working. As the title says, I'm trying to save the contents of a tag to a file on the server. I'm specifically using asp.net because I'm developing for a website on a WHS box and I'd like to use the already existing FBA.
Using javascript, I can successfully get the contents, but I am unable to work with it from there. From what I've read, it sounds like I need to POST the contents, either a postback or to another page, to save the file. That's what I'm having problems getting working. I can get a StreamWriter created and working, but I am unable to pass what I need to it.
Thanks for any help, and I can post some of the code I have now if needed. JR
You need to use Javascript to send an AJAX request to an ASHX handler with the text as the POST body.
You can then read the POST in the ASHX handler from the Request object and write it to disk.

How to create an HTTP GET request with a form

How do I send an HTTP GET request without a form? This request is performed on a web page.
For more details on what I'm trying to accomplish and why, see my question here: http get/post request and google geolocation api
Any link is a GET request, so, just make a link, add the extra info at the end, done.
http://someurl.net/somelink?value1=avalue&value2=anothervalue
A normal hyperlink does a GET request when the user clicks on it. Loading an image is also a GET request, as are most of the other ways of embedding things in a page. If you're trying to do it via JavaScript, you can use an XMLHttpRequest.
You can use Ajax and jQuery's get method:
$.get("someURL.php?variables=true");
Note, that you will only be able to make requests to the same domain OR the target domain must return JSON formatted results.
In plain HTML you can do that e.g. requesting an image:
<img src="http://example.com/?bla=bla">
< a href="www.google.com">google</a>
I agree with altCognito points out using jquery but I'd rather use
$.get("someurl.php", { variable: value });
I like this way better because it allows me to send objects instead of concatenate strings.
you can see a couple of samples here

Resources