Search code examples
regexburp

Grep Extract - Extract text value from image source


I am trying to pull a value from my HTML Source code and use it as a Grep Extract.

Using Burp Suite's 'Grep - Extract', how do I extract the following text value (in this case the text is hello, but it changes every time and I want to be able to extract the value of text=)?

<div id="CaptchaImage">
     <img src="Captcha.ashx?text=hello">
</div> 

Define at start and end? Or Extract from regex group?

I can't seem to get this to work.


Solution

  • Define at start and end, start after expression src="Captcha.ashx?text=, end at delimiter ".

    Alternatively, define from regex group src="Captcha.ashx\?text=([^"]+)". And here's hoping I didn't forget any backslashes in there.