Searching the file system


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Searching the file system
# 1  
Old 05-31-2007
Searching the file system

Guys,

We have taken a copy of our live filesystem to use for testing, but they want to be sure that no contact can be made to any of the live servers etc, I told them the best way would be to have this handled at the firewall level etc, but it seems that not possible, so.... would it be possible/feasible to search the whole file system for certain strings, for example ftp, I know the following command:

Code:
find . -exec grep "searchTxt" '{}' \; -print

Could be used, but the issue is more that it brings back every occurence of the string, as you would expect, but say I search for ftp, it will bring back xxxxxftp, is there another way of checking for stuff like this, or checking the permissions on files, or taking some other approach to doing this?

Thanks
# 2  
Old 05-31-2007
the best way IMO is to test your system in an isolated lan.
# 3  
Old 05-31-2007
This is what i mentioned above Ghost, but thats not possible i'm afraid Smilie
# 4  
Old 05-31-2007
Quote:
Originally Posted by LiquidChild
This is what i mentioned above Ghost, but thats not possible i'm afraid Smilie
no, i did not see you mention it. What i meant is, an isolated LAN, not connected by your firewall, that you can do testing in. However since you don't have it, then you could try the find command you have posted. pls make clear, what do you mean by "it will bring back xxxxftp" ?? do you mean you only want to search for "ftp" and not things like xxxxftp, ftpyyyyyy, or zzzftpxxx ?
# 5  
Old 06-01-2007
Quote:
Originally Posted by ghostdog74
no, i did not see you mention it. What i meant is, an isolated LAN, not connected by your firewall, that you can do testing in. However since you don't have it, then you could try the find command you have posted. pls make clear, what do you mean by "it will bring back xxxxftp" ?? do you mean you only want to search for "ftp" and not things like xxxxftp, ftpyyyyyy, or zzzftpxxx ?
Kind of, yes i know that you could add the -w option for the full word, but that mite not bring back some results we want to.

Would it be possible to use the hosts file to reroute certain ip address back on themselves or something like that?
# 6  
Old 06-01-2007
then a different approach can be made. how about turning on any software firewalls, like iptables/ipchains or something? you can set it to block connections out from your server.
# 7  
Old 06-01-2007
Are these installed on the actually servers themselves?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

UNIX file system to Linux file system migration

We would be migrating UNIX file system to Linux file system. We do have many directory and sub directories with files. after migrating unix to linux file system , i want to make sure all the files has been copied ? What would be the best approach to validate directory ,sub-directory and file... (1 Reply)
Discussion started by: balajikalai
1 Replies

2. Shell Programming and Scripting

Searching file for pattern, output to file (BASH)

Hello, I'm trying to write a script in Bash to assist in pentesting. Essentially I'm looking to use a script to search for some terms in a log file and then send that key information into another file. The log files consist of HTTP and SSL information that someone creates while browsing and... (2 Replies)
Discussion started by: Sagesparten007
2 Replies

3. Shell Programming and Scripting

searching a file with a specified text without using conventional file searching commands

without using conventional file searching commands like find etc, is it possible to locate a file if i just know that the file that i'm searching for contains a particular text like "Hello world" or something? (5 Replies)
Discussion started by: arindamlive
5 Replies

4. UNIX for Dummies Questions & Answers

Help with searching for a file in a directory and copying the contents of that file in a new file

Hi guys, I am a newbie here :wall: I need a script that can search for a file in a directory and copy the contents of that file in a new file. Please help me. :confused: Thanks in advance~ (6 Replies)
Discussion started by: zel2zel
6 Replies

5. Shell Programming and Scripting

Searching for Log / Bad file and Reading and writing to a flat file

Need to develop a unix shell script for the below requirement and I need your assistance: 1) search for file.log and file.bad file in a directory and read them 2) pull out "Load_Start_Time", "Data_File_Name", "Error_Type" from log file 4) concatinate each row from bad file as... (3 Replies)
Discussion started by: mlpathir
3 Replies

6. Programming

[PHP] asking how to make plain text database searching system

hi, i want to ask, how to make a plain text database (u need to call and search all the data manually) in PHP. i am going to apply it in UNIX os. anyone have any idea how to do it? most of the data only using mysql while i am forbid to do so. (2 Replies)
Discussion started by: grandios
2 Replies

7. Shell Programming and Scripting

searching a log file and appending to a .txt file

I'm new to shell scripting and am writing a script to help me log the free memory and hd space on a server. As of now, the script just runs 'df -h' and appends the output to a file and then runs 'top' and appends the output to a log file. What I want to do, is have the script also search the... (3 Replies)
Discussion started by: enator45
3 Replies

8. UNIX for Dummies Questions & Answers

how to mount a file system of a remote machine to local file system

Hi friends, In my case, there are serveral PCs running Linux in a LAN. I would like to to mount the directory /A_river of machine-A to the file system of another machine machine-B so that I can access files in that directory. I do not know how to do this. The situation is complicated by... (2 Replies)
Discussion started by: cy163
2 Replies

9. Shell Programming and Scripting

Append a field to the end of each line of a file based on searching another file.

Hi All, I have two comma separated value(CSV) files, say FileA and FileB. The contents looks like that shown below. FileA EmpNo,Name,Age,Sex, 1000,ABC,23,M, 1001,DES,24,F, ... (2 Replies)
Discussion started by: ultimate
2 Replies

10. UNIX for Dummies Questions & Answers

searching for a string though file system

Is there a way to search an entire file system for the occurance of a string..... other than grep. I have a large directory structure and I'm not certain that grep <string> */*/*/*... is all that effective - especially as I can't be sure of the number of levels to go down without heaps of... (3 Replies)
Discussion started by: peter.herlihy
3 Replies
Login or Register to Ask a Question