Jump to content
UBot Underground

Recommended Posts

Hey Guys

I have been playing with this for hours, can someone please help

I'm using $replace regular expression to replace the word proxy.php

The problem I have is the below regex matches both occurrences

and I only want to replace the first occurrence

 

?<=file_get_contents..)(.*?(?="))

 

echo (file_get_contents("proxy.php"));
echo (file_get_contents("proxy.php"));

echo (file_get_contents("proxy.php"));

 

cheers

 

 

 

Link to post
Share on other sites

This code will extract only the LAST occurence:

(?<=.*").*\..*(?=".*$)

...otherwise, just like UBotDev.com said above, add everything to a list (so that you eliminate dupes that way and then loop through it and eliminate anything else that doesn't suit your needs.

Link to post
Share on other sites

One way to get the first item is
 

set(#proxy_php, "echo (file_get_contents(\"proxy1.php\"));
echo (file_get_contents(\"proxy2.php\"));
echo (file_get_contents(\"proxy3.php\"));", "Global")
set(#proxy_php, $list item($find regular expression(#proxy_php, "(?<=contents\\(\\\").*?(?=\\\"\\)\\))"), 0), "Global")


I've given them numbers just to show it grabs the correct item


 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...