[Ilugc] [[Need help]] Few *nix questions

  • From: knura9@xxxxxxxxx (Arun Khan)
  • Date: Mon, 22 Feb 2016 10:41:45 -0700

On Mon, Feb 22, 2016 at 8:25 AM, Shakthi Kannan <shakthimaan at gmail.com> 
wrote:

Hi,

--- On Mon, Feb 22, 2016 at 1:08 PM, sahil ?????
<scorpionking.sahil at gmail.com> wrote:
| * Identify which IP address and port the Apache daemon listens on.
\--

Check its configuration file.


Also, "netstat -nltup"  will list all tcp/udp ports and program name.
You can also do "lsof" and grep for port numbers that will list the
program using the respective port(s).

---
| Is it a valid solution? I think by scanning on port 80 using nmap we can
| find out what ip's apache daemon listens.
\--


Beware of using scanning tools like nmap.  When you use nmap make sure
if you have the permission from the owner of the target IP.   Some
ISPs may not like it even when you have the instance owner's
permission.

How can you tell if it isn't another web server running on port 80?


netstat and lsof are pretty reliable (unless your server has been
hacked and root kitted).

---
| * Find all IP addresses between your server and www.google.com
\--

What do you mean by "between"?


+1  but I guess OP is asking for number of connections between his
server (client) and www.google.com (server).

Again, "netstat" and "lsof" will list the connections.

The rest of them are fundamental stuff i.e. *nix admin 101


---
| * Write a shell script to get the third element delimited by ":"
| ...
| Do not use <awk, sed, cut...>
\--

Why not?

+1

| I hope such questions will help others too.
\--


In what way?  IMO, they should be part of your "snap your fingers" tool kit.

Where did you find such questions?


+1.  To me they appear to be job interview type questions.

-- Arun Khan

Other related posts: