How to find who created .png file and remove the author on MAC? - security

For security reasons, I want to have .png files without an author in the metadata.
How do I check who is the author of the .png file on Mac?
How do I remove the author on .png file on Mac?
I check for the information on Preview, but it only contains information like camera type, pixels, etc. but not the author.

Using exiftool in terminal, you can see all the metadata by running exiftool on the file (exiftool /path/to/file.png). You can remove the embedded metadata with the command exiftool -all= /path/to/file.png. Take note that some metadata are properties of the file and cannot be removed.

Related

How to block the executable file upload in web server

I am working on a web app project to block all the file executable from file upload.
Example: user can upload, txt, png, image and video files and not any executable scripts like, Perl, Python, exe, PHP, .so, .sh files.
If it is a PHP file, then I strstr for "<?php" tag, If this tag is present, then it is PHP file. How can we find the same for other script/executable files?
Edit: Some time hackers will upload the malicious files using .png or .jpg extn, so what is the pattern to check inside the files?
Rather than making your own checks you make use of an existing library and you block everything that does not register as a desired format.
Most such libraries guess the content type and encoding of a file by looking for certain signatures or magic byte sequences at specific positions within the file.
Other libraries may be more specialised and will for example only identify image or video formats.
https://www.php.net/manual/en/intro.fileinfo.php
https://github.com/ahupp/python-magic
https://docs.python.org/3/library/imghdr.html
The file programme is a command line tool for identification of file types.
After the first pass where you identify and accept only the desired file formats you should then make all files that are not rejected go through an antivirus scanner.
Depending on you use cases you may decide to strip the original file name extension and/or even the complete file name that was provided during the upload and assign the mime-type that was detected rather than rely on user provided properties.

Nodejs: Detect file type without extension

I'm looking to remotely download and detect a file from a website, like this
http://examplewebsite.com/100/download
When viewing in my browser, this automatically downloads as the appropriate file type, 100.pdf, but sometimes it can be a .xls or .doc file. etc.
Looking at libraries available, like file-type, it only works if you already have the extension
Is this possible?
If you have the url, you can split by '.' and select the last element of your list.
The file-type library you linked in your question actually checks the source of the file to guess. It doesn't use the file extension at all.

In Linux system file extensions as capital and small lettters

While using linux system I encounter that that many file extensions are in capital as well as small letters like
myfile.JPG and myfile.jpg
I know Linux file system is case sensitive, but what's the difference in these two files? and why sometimes they get saved saved as capital or sometimes in small.
I have seen the same for other file too like
.ttf vs .TTF
Thanks
There is no difference if you name the file myfile.jpg or myfile.JPG or myfile.jpeg. Linux doesn't care.
The extension might be used by some programs running on linux and by humans to easily identify the filetype but it doen't affects the file in any way. You can even call it myfile.dog or just leave it without extension and would be the same image file and for linux it wouldn't make any difference.
If you have an image file and you want to tell what kind of image file it is you can use the file command or if you have imagemagick installed you can use the identify command.
Try renaming some jpeg file and give it a png extension, the run file image.png, you will see that it still is a jpeg file and that the png extension is there only to confuse you.
You might find this usefull: https://www.quora.com/How-do-Linux-identify-file-types-without-extensions-And-why-cant-Windows-do-so

Embedded file in jpeg

I'm searching an easy way to have a file embedded in a jpeg. I'm not trying to hide anything inside but I want to have a the additional information as jpeg "built-in", so I don't need to encrypt anything. I found the EXIF interface but there isn't a tag "additional file", I can add only some metadata like date and so on.
The easiest way would be to just create an archive (e.g. a 7z file) and append the archive file to the end of the jpeg using copy
copy /b image.jpg + data.7z image_with_data.jpg
Alternatively you could embed the information as IPTC data
See
How to Embed in JPEG
Hide files inside of JPEG images

Why odt file can not be opened by zip but can be opened by open office?

I think odt files are ziped files.
Why odt file can not be opened by zip but can be opened by open office?
And a zip file not complete can also be unziped??
Who is familiar with zip format?
ODT files may or may not be zipped. It could also be a plain basic XML file (see http://en.wikipedia.org/wiki/OpenDocument#Specifications).
Also, there are several versions of the ZIP file format that may or may not inter-operate well, so maybe it's just your ZIP utility not being able to read the particular format your ODT file uses.
Rename the file's extension to zip. In that case, it should open with the zip unarchiver (tested with 7-Zip, PowerArchiver, Total Commander).
The problem seems to lie with the archivers' extension sniffing: PowerArchiver (albeit an old, old version) had problems opening the file when the extension was odt, but worked fine with zip.
Of course, the file extension odt will probably be associated with OpenOffice, so double-clicking the file will start OpenOffice.
You can try with 7zip for .odt, If those are zip files, supposed to able to open.
a zip file not complete, you mean broken zip files?, its depends on how its damage. even you can open it, you will not get desired results.
Finally, i found the file is doc format, but saved as odt.
This file is searched by google.
odt files are open office document text files.

Resources