0

In my /var/www/html many files with strange chars appeared suddenly.

Below is a sample. Any idea why they appeared (attack ?, app dump ? file system error ?) and how to remove them (there are other files and content I need to preserve).

All files are owned by apache. Web server is running pimcore.

I tried with rm 'file' rm "file" but no success.

# rm "M?."

rm: cannot remove âM?.â: No such file or directory

Any help greatly appreciated.

./??5??????g??RÌ??=w?Õ¸?R?????Å°Y???0????Æe??JV~?=??????#??[??ؼ.a??ŲrÍ??K?f?Q-ÖQ-
./]??????
./?z??2?º¦
./4?j?D???{???W????~uM???????b????zE??jD?c?????????]???d?g?????i????Q??7?}O[????????#v??L?ų??5??uG??k˪?}??i???KF?^3?=?4_?x}?W?V?????X?y?Ug[??Hc????k??"T???g;?uZUgFÙ·9æ¬h?a?u4?z?+?tt
./???2d??&o??Ro?w??1?vP8\??ik?+?kW?z????Z{E????0(ov???s[ms???k|~uË­???7?????jA?6??r:o?Ö±??~???[?????????\ݱڥ??=?-???k??á?y??VÓ¢???5n?2?ÚÏ??
./????n
./?]k?????@??}
./?}??????Æ7?z?????O??czxLL9??m?Õ¥?????Z_?O???P???
./A??V???^ϯ?u?j?ydk??U????v??Y94E????{?ó
./?1Ö??F????߶
HBruijn
  • 72,524
  • 21
  • 127
  • 192
  • Filenames in an incompatible character set might be the cause that file-names don't get displayed correctly, but typically unexpected files owned by your web server in a directory that is writeable to apache/httpd are the result of an (upload) script that fails. Check you logs if you can determine which script. -|- TAB completion might provide you with right escapes to be able to delete them `rm -i ./\?` – HBruijn May 29 '17 at 12:07
  • Have you run `fsck` recently? – chicks May 30 '17 at 20:02
  • Use mc text mode file manager from apt-get install mc (in debian, maybe yum install mc), and you will be able to delete it... not a solution, but it works. – Luciano Andress Martini Dec 05 '17 at 11:05

2 Answers2

0

Do you use sftp ? Maybe you tried to import some files from a windows client into the server and it didn't liked the chars..

In anyway, I would connect via SFTP with FileZilla client for example, go in this folder and delete those files

Vince_Nt
  • 3
  • 2
0

You could try with patterns that don't match the files you want to keep instead. For example, if in addition to the files listed above, you had the following files you wanted to keep:

ATestFile
fileA
someScript.sh

you could try try rm [!Afs]*; rm A[!T]*, which would delete all files that didn't start with the letters "A", "f" or "s", and then files starting with "A" that didn't have a second letter "T". You will need to adjust the patterns for your files, and you might want to try a non-destructive command first, to ensure that your patterns didn't select any files you wanted to keep; e.g. ls [!Afs]*; ls A[!T]*

Pak
  • 901
  • 5
  • 10