Author Topic: Rewrite + relative url inside a hidden input value  (Read 548 times)

Offline connetport

  • Contributor
  • *
  • Posts: 2
  • Karma: 0
    • Connetport
Rewrite + relative url inside a hidden input value
« on: October 24, 2011, 04:54:07 AM »
Hi,

I have an internal website that I can't modify and need to publish it as bookmark on the csg clientless webpage.

Netscaler is taking charge of mostly everything but this kind of path is not encoded :

<input type="hidden" value="/RelativeToken/Path/To/A/File.extension">

From what I see it uses a weird javascript that load files thru hidden values inside the html body

So when the browser tries : https://netscaler/RelativeToken/Path/To/A/File.extension it fails obviously because the url has not been encoded and it's not hosted on the netscaler.

I'm quite new to netscaler but, from what I understand, I have several options :
1- Change the default policy to take charge of this
2- Use the rewrite module in order to encode the url
3 - Use the Url transformation so that https://netscaler/RelativeToken/Path/To/A/File.ext will work

I think that the most safe and clean is to use the rewrite module.

However how shall I do to make netscaler encode the url inside the value of an input element inside the body of the webpage ?

I've tried to :
- add an action of type clientless_vpn_encode_all with a http response body caseless regex like this : re~/relativetoken/.*\.[a-z]{3}~
- add a policy always true
- Bind them

But it seem that netscaler reject the binding due to the clientless_vpn_encode_all or clientless_vpn_encode method ...

Someone can help me ?

Best regards.


For the note :
- I use netscaler 9.2
- The local webserver is in Domino 8.0 witch I can't touch


Offline mkalle

  • VIP Member
  • ***
  • Posts: 25
  • Karma: 1
Re: Rewrite + relative url inside a hidden input value
« Reply #1 on: October 26, 2011, 05:12:48 AM »
I think you are making it more complicated then it really is.

The netscaler is able to rewrite anything, so just match the string, and make the rule with the "REPLACE" option, and you are good to go.


Offline connetport

  • Contributor
  • *
  • Posts: 2
  • Karma: 0
    • Connetport
Re: Rewrite + relative url inside a hidden input value
« Reply #2 on: October 26, 2011, 06:14:36 AM »
but how to replace an url like this :

/RelativeToken/Path/To/A/File.extension

to this :

/cvpn/hash/RelativeToken/Path/To/A/File.extension

?

By the way, what kind of hash or encoding netscaler is using ?