il manuale l'ho letto, e ho trovato anche la spiegazione che dici tu, ne ho trovata una anche in inglese che mi dice:
pratricamente mi viene detto che posso usare la variabile [che è un url, o comunque un file] nella pagina successiva come argomento di un include, ma non mi sembra quella gran cosa, cioè, lo posso fare anche con la costante a Off...o no? non si tratta di un semplice passaggio di dati tramite querystring?Another PHP option, allow_url_fopen, allows programmers to treat URLs as files. (This option is still on by default.) People often use data from a request to determine the name of a file to read, as in the following example of an application that expects a parameter to specify the name of the file to execute:
The application then uses the value of the parameter what directly in a call to the include() language construct:codice:http://www.example.com/view.php?what=index.php
As a result, an attacker can, by sending a path to any file on the system as parameter (for example /etc/passwd), read any file on the server. The include( ) puts the contents of the file into the resulting web page. So, what does this have to do with allow_url_fopen? Well, if this option is enabled and you supply a URL in the what parameter, PHP will read and execute arbitrary code from wherever on the Internet you tell it to!codice:<? include($what) ?>
se io ho http://www.example.com/view.php?what=index.php e in view.php faccio:
e ho la costante a Off non funziona? se potessi provare non chiederei qui, ma non ho permessi di amministratore sulla macchina e non posso cambiare la costante [che al momento è a On].codice:$pagina = $_GET['what']; include($pagina);
poi stando all'ultima parte in grassetto, della spiegazione in inglese, sembrerebbe che se fosse settata a On si andrebbe incontro a non pochi attacchi da parte di simpaticoni, ma anche qui, se si fa un minimo controllo sui dati ricevuti via GET [così come si dovrebbe fare per quelli via POST] non penso si vada incontro a grandi problemi.
aspetto ancora delucidazioni, perché sinceramente non capisco il significato della costante, cioè, il significato l'ho capito, quello che non capisco è cosa cambia se questa è settata a On piuttosto che a Off.
ringrazio per le risposte ottenute finora, e spero di poter ottenere altre spiegazioni.
![]()