Finding Files in Linux

Hi Guys,

 

I saw an interesting beginners video on Hak5 about locating files within linux. This made me think about some of the commands that I used to locate certain thing such as files used in apache compromises or files tha developers may have put on a server and forgot where. There are many ways to find what you are looking for but we need to start at the beginning. The following are from a video that Shannon Morse did on finding files.

 

I know the following seem to be the easiest and basic but we have to start somewhere in order to find what we are looking for. Thanks Shannon Morse for the following.

 

—===—===—===—

Locate 3 non case sensative words named test

locate -i -n 3 test

—===—===—===—

Locate case sensative words

locate test
locate Test

—===—===—===—
Search a file called Test for keywords such as word

grep word Test

—===—===—===—
Search for the keyword word in all files using *

grep word *

—===—===—===—
Locate a file that is case sensative and name specific in the current folder. If the files test or Test do not exist, nothing will be shown.

find -name test
find -name Test

—===—===—===—
Locate any file with the name test within it in the current folder.

find -name “*test*”

—===—===—===—
Locate files owned by a user (kf4bzt) in the current folder.

find -user kf4bzt

—===—===—===—
Locate files not owned by a particular user in the current folder.

find ! -user kf4bzt

—===—===—===—
Locate files with a specific group in the current folder.

find -group apache

—===—===—===—
Locate files not with a specific group in the current folder

find ! -group apache

 

—===—===—===—

—===—===—===—

Not that we have some basics behind us, we need to expand on them and do some other searching. 🙂

 

In order to find specific folders by name and place the results into a file:

find . -type d -name ‘uploads’ > uploads

 

—===—===—===—

 

Read the same file above as a reference for another find to locate php extensions within the folders found. 

for i in `cat uploads`; do find $i -type f -name ‘*.php’; done 

 

—===—===—===—

Let’s say that you want to locate files name page68.php and add the results to a file called comp. Below shows how to do this.

find . -type f -name ‘*’ -exec grep –i page68.php {} > comp \; 

 

 

Bootable USB Drive and Linux Distro Issues

Hey All,

 

I wanted to throw this out there as this has become an issue with some Linux Operating Systems and there is a possible fix now that I ran across. Let me give you an example of what has taken place lately. There are some Ubuntu or Mint based distros which have a hard time booting from USB thumb drives. I noticed it in Ultimate Edition (Ubuntu), Parrot OS (Debian) and a few others. I used to never have issues with booting into live media or installing operating systems until UEFI was introduced on hardware. This became a royal pain in the rear end to manage. Laptop manufacturers have been locking down the bios so that consumers could not make changes to their own hardware such as disabling UEFI. When Windows 8.1 and 10 came around, a lot of hardware manufactures went with the UEFI way of doing things because Microsoft does not want anyone installing what they want on their own hardware. There is always a way to fix a problem but it does take some research.

Once you have gained access to your bios and disabled UEFI support, now you can install what ever you want with little or no issues. Now back to the distro boot and install issues. I found that if you have isohybrid installed on your machine then you can fix a boot issue that keep occurring. Essentially, there is some post processing that in not occurring while creating the first iso burn. People seem to think that this needs to be fixed on the developers side.

 

http://www.syslinux.org/wiki/index.php?title=Isohybrid

https://help.ubuntu.com/community/mkusb/isohybrid

 

—===—===—===—

 

From the link above, here are the instruction needed to make this work. I have been successful in burning and running live media but still may have issues with installed distros though.

I have verified that isohybrid is installed with arch distros such as Manjaro and MateRevenge but may need to be install in Ubuntu based distros from the following instructions.

 

Installing isohybrid

If the program isohybrid is not found, you can install it with the following program packages

  • in 14.04 ‘Trusty’ the package containing isohybrid is syslinux

  • in 15.04 ‘Vivid’ and newer versions, isohybrid is in the package syslinux-utils

sudo apt-get install syslinux
# or
sudo apt-get install syslinux-utils

Using isohybrid

Example:

# run this command only to keep original iso file
cp -p filename.iso filename-hybrid.iso

# the actual command
isohybrid filename-hybrid.iso

See the manual file for more details,

man isohybrid

 

—===—===—===—

 

So this may not be the perfect solution but I have found that it works with distros that you burn to a USB thumb drive and just wont run or install. I am still seeing an issue with the latest Ultimate Edition though which it sounds like they are aware of something happening. I was able to use the instructions above and burn the media and run the distro in live mode but after install, it looks like it freezes or something before completing the boot process.

 

—===—===—===—

 

Update on this process

 

While trying this process out, I found that it does indeed allow for booting into a distro via a USB thumb drive. It still does not fix the issue of doing an OS install to a physical hard drive. I have tried Ultimate Edition where the install looked like it went through but upon reboot would not do anything. I tried Parrot OS and the install fails while writing to the disk. There are some distros that I can install such as arch releases and SharkLinux. I am sure that most Ubuntu distros should install without issue.