Sigh. Here is the reasoning for me posting a link in lieu of a long answer. Original post wants to inject/disaffect/exploit through the lang variable in cookie:
GET /en-us HTTP/1.1
Cookie: xxx=eng.php/../../../anotherfile
He then states he tried and failed:
ErrorException:
include_once(/export/htdocs/xxxx.com/base/languages/content-eng.php/../../../anotherfile.php): failed to open stream: No such file or directory
"No such file or directory" to me means one of a few things:
1) His directory traversal is off:
/export/htdocs/xxxx.com/base/languages/content-eng.php
/export/htdocs/xxxx.com/base/languages/**option1/option2/option3**/anotherfile.php
If the structure is exactly as above, there is no directory traversal vulnerability period.
2) eng.php is not detailed enough to know what it does. This would have to be the vulnerable weak link on the chain
He is relying on an error, thinking: "Oh well I have an error, I am headed on the right track"
OP: You could fiddle with the directories a bit more. It is telling you "I can't find this file" the issue becomes "what are you finding" if you state you have access to the machine, the solution I would use would be to place tokens in folders to determine where you are landing:
/export/htdocs/xxxx.com/base/languages/**option1**/token1
/export/htdocs/xxxx.com/base/languages/**option1/option2**/token2
/export/htdocs/xxxx.com/base/languages/**option1/option2/option3**/token3
Then try another POST/GET perhaps:
Cookie: xxx=eng.php/token1
Cookie: xxx=eng.php/token2
Cookie: xxx=eng.php/token3
Cookie: xxx=eng.php/../token1
Cookie: xxx=eng.php/../token2
Cookie: xxx=eng.php/../token3
Cookie: xxx=eng.php/../../token1
Cookie: xxx=eng.php/../../token2
Cookie: xxx=eng.php/../../token3
Just because you got an error, does not mean directory traversal is present. For all you know it's is a global error you are getting. The initial link I sent was to guide you on a "known known" (variable you control) lang.
EDITING FOR SPACE CONSTRAINTS:
OP: "The base is /export/htdocs/yyy.com/base/. The anotherfile.php is in /export/htdocs/xxx.com/anotherfile.php"
Unless I am misinterpreting this:
/export/htdocs/yyy.com/base/
/export/htdocs/xxx.com/anotherfile.php
Are these on separate sites? If xxx.com is your own server/test machine, I'm under the impression you're trying an LFI exploit:
you --> modify cookie (hey, take this anotherfile.php from my machine) --> yyy.com
Again, the reasoning for my initially posting a link in lieu of an answer. If you meant the other way around (typo):
/export/htdocs/yyy.com/base/
/export/htdocs/yyy.com/anotherfile.php
Then you need to modify your insertion to ../../anotherfile or move another file into:
/export/htdocs/yyy.com/base/
content-
in thelanguages
directory, there is no way for such traversal to work. In your particular case,content-eng.php/
needs to be a folder, not a file.