Filter Fiddler traffic - fiddler

Is it possible to instruct Fiddler to only show me traffic directed to a specific host name?
In other words, can Fiddler traffic be filtered for Host?

See this screenshot. Located at the top right part of the screen

Fiddler's Filters tab can do this - set the 'Hosts' dropdown to 'Show only the following hosts' then put the name in the textbox below.

Go to fiddler script tag and paste following into OnBeforeRequest function. (Screenshot below)
if (oSession.url.Contains("ruby:8080") || oSession.url.Contains("localhost:1234"))
{
oSession["ui-hide"] = "yup"; // "The "yup" value is unimportant"
}
This way you can filter by any part of url be it port, hostname or whatever.
It is useful for filtering out localhost trash as filtering by host alone does not do this...
EDIT as per #baburao comment: Apparently fiddler gives access to process info through the x-ProcessInfo flag. So if you wanna hide a process (say for 'chrome'), change the condition to: if (oSession["x-ProcessInfo"].Contains("chrome"))
Hope this saves you some time.

An alternative is to filter and export session.
You can filter by typing in the bottom black box area with prefix # and your hostname. eg, #msn.com
Fiddler documentation has good sample. http://docs.telerik.com/fiddler/knowledgebase/QuickExec

Related

how to extract parameters from Jmeter for web forms using redirection

Hi so my webform navigates from : http://43.252.88.109:4006/BracketICT/?t=aZCcbzidJJKfFgrkk1RYPH0zHTl+MtTuoGeiUw0hEw48nLZUoPrfntO29VV2daEiR3cPbu25/Xf2a3Q1UMZs1tAoUDti4wBVbYQbRHhhBDTt0Z1yTrWlkWKunP18DkVBkRSSVMdiHYyQ=&uniqueID=dGdck61pZFirpz9fA5FQZFhakSeoICZ9&dev=1696661 to
http://43.252.88.109:4006/BracketICT/examstart.aspx
]3
i.e. from the instructions page to exam start page on the click of ![the exam start button. My Jmeter response during recording shows that the link: http://43.252.88.109:4006/BracketICT/examstart.aspx
accepts two parameters i.e. attemptid or recordid. These values are generated on the location parameter of the examstart screen when the user clicks on starts test and lands on exam page. My response for http://43.252.88.109:4006/BracketICT/examstart.aspx does not show the location parameter on JMeter. How do i extract attempt id or recordid dynamically in this case during redirection ?]5
You need to:
Expand the 3rd sample result from the top in the View Results Tree listener
Switch to "Response Headers" tab
there you should be able to see the Location header and you will be able to extract these attemptid and recordid values using Regular Expression Extractor

SOAPUI ReadyAPI resource parameter in URL

Is there a way to have a parameter at the end of the URL for a Rest request?
This is the URL:
http://localhost:8000/my_user/1000
I've tried to use a parameter for the 1000, like so:
http://localhost:8000/my_user/${#Project#id_test}
This doesn't render 1000 at the end.
Is there a way to do this?
There are REST resource parameter types.
In your case, style should be Template. That should resolve the issue.
To give an example:
While adding a new REST Resource from API use below url instead of plain text value.
In the request you would see as below:
Now, in your test cases, you can use the property expression (the one you were using in the question) i.e., ${#Project#id_test} for value field/column as underline in the above image.
You may also go thru documentation if needed.
What you're trying to achieve is possible, though I'm not sure about the value you have supplied.
When you set up a RESTful Test Project is SoapUI, you define the root/base url under test.
When you set up the service call in SoapUI, you define the GET, POST settings. In the same place, you can add parameters. Click on the Request tab and you should see an empty table with headings, Name, Value, Style, Level.
You can add your parameter here.
E.g.
Name | Value | Style | Level
id | Smith | QUERY | RESOURCE
When you run the service call and you not sure your request is correct, click on the Raw tab and that will show what SoapUI is actually sending to your service.

How can I redirect hundreds of hostnames to other hostnames using nginx

I have a system where many (~20k) subdomains use nginx's default_server, which passes the work off to an app.
I also have many (~100) hostnames that need to be redirected to a correct one, that is different for each hostname and that would then redirect to the default_server.
one.example.com -> eleven.example.com
two.example.com -> twelve.domain.com
three.example.com -> wibble.example.com
blah.domain.com -> fifteen.example.com
The redirects are arbitrary, ie there is no pattern to them.
Rather than having to update nginx config to add a new server block whenever a new redirect is needed or updated I'd prefer to use a map file of some sort that nginx can check for redirects.
Sadly having searched about quite a bit I've not found anything like it, all examples I've found use a new server block for each redirecting host or use regexes. I'd prefer to be able to update a map file or database on the fly that nginx can refer to.
My current best option I have is to update the background app to apply the redirects.
I did previously find the map but it wasn't clear that it could be used in this way and none of the examples showed it. Saying that it turned out to be quite easy.
This is what I have that seems to work;
map $host $redirect_host {
hostnames;
one.david.org eleven.david.org;
two.david.org twelve.steve.org;
three.steve.org thirteen.david.org;
four.steve.org fourteen.steve.org;
}
server {
...
if ($redirect_host) {
return 301 $scheme://$redirect_host$request_uri;
}
...
}
It's a shame that this solution requires nginx restart, but it's not a big deal.

Dumping Fiddler sessions automatically

I need to do some data analysis on xml data coming in http responses. Is there a way to set fiddler dump these responses automatically on disk?
(I have filtered the responses, dumping the sessions works too)
In a situation like this one I make a simple edit to the OnBeforeResponse function in the Fiddler rules. Choose Rules | Customize Rules and then add something similar to this::
if (oSession.url.Contains(".xml")) {
var directory: String = "C:\\Temp\\XML";
var path: String = System.IO.Path.Combine(directory, Guid.NewGuid() + ".xml");
oSession.SaveResponseBody(path);
}
The line that I am using to 'filter' the requests may not be appropriate for your situation -- you should attempt to repeat the filter condition that you used in the Fiddler UI.\
Hope that helps.

Fiddler: how to make a subnet-based filter?

I would like Fiddler2's host filter to keep sessions to all hosts on 192.168.2.*
The docs say that e.g. fiddler2.com filter would catch all *.fiddler2.com but I can't figure how to do the same kind of filtering for IP subnets instead of hostnames.
Is there a specific syntax? Should I use a custom rule?
TIA.
You need to write a custom rule. Inside OnBeforeResponse, look at the m_hostIP property on the session and use that to set the UI-HIDE flag if it doesn't match the site you care about.