r/PHPhelp • • Nov 25 '24

Looking for iOS apps to help learn php frameworks.

0 Upvotes

Feel free to tell me to remove this but I’m looking for an iOS app to help me learn different php frameworks. Stuff I can look at when I’m not at work or home.

Wouldn’t have to be anything too in depth. Just something to rather teach the basics or help keep me updated. I can do the majority of the learning from home/work by reading the docs for whatever framework.

Anyway, I appreciate any ideas you have.


r/PHPhelp • • Nov 25 '24

Help Needed: Website Under Attack - PHP File Upload Exploit

4 Upvotes

Hey Redditors,

I’m dealing with a serious issue on my website, and I’m hoping someone here can provide some guidance.

About a month ago, we discovered that our website was under attack. The attacker managed to upload a PHP file into the images folder, which is used for storing user profile pictures. Unfortunately, our code was missing proper file validation at the time, which allowed them to exploit this vulnerability.

Even though we’ve since added file validation to prevent further exploits, the attacker seems to have retained some level of access. They are still able to upload PHP files into directories, which makes me suspect there’s an additional backdoor or vulnerability I’ve missed.

I’d appreciate any advice on:

  1. Steps to identify and remove any backdoors or malicious scripts.
  2. Best practices to secure the site and prevent further breaches.
  3. Tools or resources to help analyze and clean the server.

Thanks in advance for your help!


r/PHPhelp • • Jun 17 '24

curl request is throwing 403 in PHP CURL

2 Upvotes

CURL request in php is throwing 403. This is working fine with ping command, Command line CURL request, working in browser and postman. I tried to pull same container locally it works there but it doesn't work in AWS ECS task. Inside AWS ECS task when I tried to run same URL with CLI CURL its work.

What will be problem ? if it was network issue then it should not have work from CLI CURL. Only happening with PHP CURL code.

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://gissvr.leepa.org/gissvr/rest/services/ParcelsWFS/MapServer',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET'));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

I tried hitting URL In browser and then copy as CURL from network tab. Then imported to Postman then converted to PHP CURL in postman. Used same code. Same PHP code is working locally in same docker image container but not working in ECS task container using same Docker image.

Now one more thing I got to know from official website of leepa.org who provide this URL. is

Working : https://gissvr4.leepa.org/gissvr/rest/services/ParcelsWFS/MapServer

Not working : https://gissvr.leepa.org/gissvr/rest/services/ParcelsWFS/MapServer

ping gissvr.leepa.org

PING e242177.dscb.akamaiedge.net (23.213.203.8) 56(84) bytes of data.

64 bytes from a23-213-203-8.deploy.static.akamaitechnologies.com (23.213.203.8): icmp_seq=1 ttl=41 time=10.4 ms

64 bytes from a23-213-203-8.deploy.static.akamaitechnologies.com (23.213.203.8): icmp_seq=2 ttl=41 time=10.4 ms


r/PHPhelp • • Aug 07 '22

Best PHP library options for scraping sites with JavaScript - Symfony Panther, Chrome-PHP, Mink, etc.?

3 Upvotes

I am looking for a PHP browser tool that I can use to scrape websites that require execution of JavaScript, and can click JavaScript links. I'm not entirely sure what the terminology is, I think it's browser emulators or browser controllers.

I've found these:

https://github.com/symfony/panther

https://github.com/chrome-php/chrome

https://github.com/minkphp/Mink

I've seen some articles on scraping that mention Symfony Panther, but haven't seen the others mentioned anywhere.

Symfony Panther - 2.6K stars, 57 watching, 206 forks, used by 9.8K, 85 contributors, last updated August 2

Chrome-PHP - 1.5K stars, 43 watching, 201 forks, used by 139, 38 contributors, last updated July 8

Mink - 1.5K stars, 38 watching, 267 forks, used by 25.8K, 85 contributors, last updated March 28

They seem to have fairly similar stats except for users, where Mink has 25.8K while Panther has 9.8K and Chrome-PHP only 139.

I don't know exactly how to choose between these, and if there's any other options in PHP (I know there's other options in Python and Node.JS, but I'm looking for one in PHP). I don't know if some are easier to use, or faster, etc.

I also found this Mink-Panther driver, I'm a newbie so I'm not sure what Mink even is exactly, or what this is quite supposed to do.

https://github.com/robertfausk/mink-panther-driver

Sorry for being vague, but I'm afraid I don't have enough knowledge on this subject to even know which questions to ask.

Are there any other PHP libraries that can be used to scrape JavaScript websites and click JavaScript links? And how should I choose between them? Is there some that are considered better than others, or do they all do roughly the same thing?