Questions tagged [unix]

Unix is a family of multiuser, multitasking operating system that is widely used in workstations, servers and embedded devices. The best-known Unix variant is Linux.

Filter by
Sorted by
Tagged with
192 votes
7 answers
16k views

How can I protect myself from this kind of clipboard abuse?

Clipboard abuse from websites Many websites use JavaScript or CSS to stealthily insert or replace text in the user's clipboard whenever they copy information from the page. As far as I know this is ...
user avatar
  • 1,859
97 votes
7 answers
39k views

How does hacking work?

I am specifically talking about web servers, running Unix. I have always been curious of how hackers get the entry point. I mean I don't see how a hacker can hack into the webpage when the only entry ...
user avatar
62 votes
6 answers
30k views

Unix execute permission can be easily bypassed. Is it superfluous, or what's the intention behind it?

The unix read permission is actually the same as the execute permission, so if e.g. one process has write access it's also able to execute the same file. This can be done pretty easily:First this ...
user avatar
52 votes
6 answers
11k views

Why does one need a strong password on Unix?

SSH Server: I only allow public-key authentication. Malicious Software: If it's running as my user it has access to my data and an internet connection, it's bad enough already. Yes, su access would ...
user avatar
  • 819
46 votes
2 answers
12k views

Is mosh now recommended by the security experts? (2014)

Mosh has been around for a while now. Although it's claimed to be "a replacement for SSH" by its authors, mosh does actually depend on ssh to do the initial authentication, after which an instance of ...
user avatar
  • 1,874
43 votes
4 answers
5k views

Is passing sensitive data through the process environment secure?

Recently, I have been looking for the possibility to pass sensitive information from one process to another (at process startup time) without passing it through the command line or without using a ...
user avatar
29 votes
5 answers
10k views

Why should one use sudo? [duplicate]

Most modern Linux articles advice using sudo rather than logging into root. This advice is so ingrained, some distros don't automatically allow root login. Indeed they come pre-configured with sudo ...
user avatar
23 votes
3 answers
64k views

How to view all SSH authorized_keys for a unix server

How would I view all the authorised SSH clients from a unix server? I know that cat ~/.ssh/authorized_keys shows authorised keys if logged in from root. Can other users set their own authorised keys ...
user avatar
21 votes
5 answers
5k views

Is it possible for a file that is non-executable and read-only to run malicious code?

On a POSIX system, is there a possibility for a file which is non-executable and read-only (aka with a mode 444) to run malicious code on a machine? If so, can you explain how it would do so?
user avatar
  • 321
18 votes
3 answers
33k views

How do I ensure data encryption on Samba transmission on *NIX systems?

I have a heterogeneous system (both MS and *nix) that communicates with CIFS/SMB. How can I ensure proper data encryption at the application layer?
user avatar
  • 1,066
17 votes
2 answers
126k views

Where is my password stored on Linux? [duplicate]

Is there a specific location where the passwords are stored ? Is it depending on which version is used ? Are they salted ?
user avatar
15 votes
7 answers
821 views

UNIX Servers: Possible intrusions or attacks that do not use any of the open listen sockets

What type of attacks are there that do not use open TCP or open UDP ports? Is it safe to assume that no open ports means no remote access? (Excluding the possibility that there is a badware already ...
user avatar
  • 13.8k
15 votes
4 answers
46k views

Finding environment variables with gdb, to exploit a buffer overflow

I have to exploit a very simple buffer overflow in a vulnerable C++ program for an assignment and I am not being able to find the environment variable SHELL. I have never worked with BoF before, and ...
user avatar
  • 313
15 votes
1 answer
2k views

Linux /etc/shadow password change security

I wonder what happens what happens when I am changing my password on a Linux system. Basically all passwords are stored in a file called /etc/shadow or /etc/master.passwd in BSD-like systems as I do ...
user avatar
14 votes
4 answers
11k views

OpenBSD vs. NetBSD security

If I search for the two words: OpenBSD and NetBSD on http://www.exploit-db.com/ then I get 17 hits regarding security bugs on OpenBSD, and 8 hits regarding security bugs on NetBSD. So what are the ...
user avatar
  • 6,109
12 votes
2 answers
5k views

What are the dangers of storing webserver temp files in the /tmp/ folder?

I have configured my first publicly accessible nginx server. I have configured it to use a /tmp/nginx folder to store temp files. This includes the body of http requests, proxy files etc. The /tmp ...
user avatar
  • 223
12 votes
2 answers
3k views

How is the available entropy in /dev/random calculated (or estimated)?

It seems (to a non-expert) that /dev/random is acclaimed to be useable as a source of pure random data. However, I am curious as to the analysis of the file /dev/random. /dev/random is a collection ...
user avatar
11 votes
3 answers
682 views

Is it insecure to have an SSH server on a workstation?

I know one systems administrator who runs SSH Server on his workstation to push files to it and check things from a phone but I think it is a bad idea for several reasons: An operations workstation ...
user avatar
11 votes
1 answer
3k views

Unix command to generate cryptographically secure random string

Is the following Unix command cryptographically secure to randomly generate 20 characters (a-zA-Z0-9 only)? dd if=/dev/urandom bs=256 count=1 2> /dev/null | LC_ALL=C tr -dc 'A-Za-z0-9' | head -c20 ...
user avatar
  • 1,097
11 votes
3 answers
2k views

What prevents this exploit from working (unix SUID)?

If I have a user on a unix system where Im allowed to create new files, what prevents me from downloading an executable file onto that system which is already SUID'ed to root on a different system? ...
user avatar
  • 16.1k
11 votes
3 answers
7k views

Shellshock Bash bug on mobile systems

Does the bug in Bash affect Android or iOS mobile systems?
user avatar
10 votes
4 answers
2k views

Does UNIX have a dual approval mechanism?

Sudo and logging is used to keep administrators accountable. But is there a command/configuration that lets you enforce a dual approval type control such as the the "Two Person Concept"? (eg. Two ...
user avatar
  • 101
10 votes
1 answer
358 views

What is your default umask set to?

What is your default umask set to? Did you run into any problem setting a stricter default umask?
user avatar
9 votes
7 answers
2k views

Is it wrong to root login with SSH?

I've long been under the impression that with unix, you should never login as root. Now I've started using Virtual Private Servers over at DigitalOcean, and some advice is to use SSH keys to login as ...
user avatar
9 votes
3 answers
26k views

MSFConsole/Kali Linux - gain root access to unix system

I am messing around with Kali Linux, MSFConsole and DVWA (Damn Vulnerable Web Application). I have successfully been able to get into the system (Raspberry Pi) by creating a PHP backdoor and uploaded ...
user avatar
  • 1,177
9 votes
1 answer
3k views

Is symlink race a very common vulnerability in UNIX systems

As far as I know, when I am creating a new file or directory in a directory that can be written by multiple users (and thus an adversary can have made a symlink there), the only way to protect myself ...
user avatar
  • 609
9 votes
1 answer
2k views

How Homebrew may impact your Mac's security [duplicate]

I read (here and here) that Homebrew (the Unix package manager) is a significant Mac security risk. An attack is allowed because Homebrew makes /usr/local/bin writable without root user privilege, ...
user avatar
  • 247
8 votes
1 answer
882 views

How can utilities with setuid set to root be secure if they are debuggable?

Today I heard at Uni something that broke my mental model about separation of users' rights. Namely, I heard that: I can freely debug all programs I have the permission to run, even those that have ...
user avatar
  • 5,587
8 votes
4 answers
10k views

SHA-512 unix passwords. How secure are those hashes, really?

I came across this very alarming sounding thread which indicates a GPU with about half the compute capacity of the GPU currently powering the monitor I type this on is capable of 11.5k c/s. I'm not ...
user avatar
  • 977
7 votes
3 answers
292 views

Is it safe to attach a potentially malicious hard drive to a Solaris machine?

We bring in hard drives from un-trusted sources and would like to ensure that they will not contain any harmful content. What kind of risk is there for Solaris? As in, if Solaris is running, and I ...
user avatar
  • 13.8k
7 votes
2 answers
463 views

Security of o=rwx with classical Unix permissions

Is it in anyway insecure to go o=rw or o=rwx on files and directories confined to directories that are marked o=? In other words, given private (g=,o=) home directory, is it perfectly safe to write ...
user avatar
  • 270
7 votes
2 answers
869 views

Where can I “hide” easter eggs for students learning about Linux security?

I feel like this isn't the best place to ask this (since there's no single right answer), but I can't think of a better place. If you have a better recommendation, could you please recommend it and I ...
user avatar
  • 1,404
7 votes
2 answers
12k views

What is the easiest way to sandbox an application in a *NIX environment?

I have a significant number of untrusted binary applications that need to be executed on a *nix box. I'm hoping that there might be some simple command/script (e.g. sandbox ./app1953) that could ...
user avatar
7 votes
2 answers
361 views

What output can a program, when executed from a command line, output to generate behavior that is a vulnerability on the terminal emulator?

Reading this post, titled "Fixing Unix/Linux/POSIX filenames", I came across a VERY interesting phrase by the author, which says: Oh, and don’t display filenames. Filenames could contain control ...
user avatar
  • 181
6 votes
2 answers
756 views

`rsync -K`-based exploit

In the description of the -K (--keep-dirlinks) flag, the rsync man page gives this warning (my emphasis): One note of caution: if you use --keep-dirlinks, you must trust all the symlinks in the ...
user avatar
  • 1,043
6 votes
2 answers
24k views

what does it mean to be setuid root?

I am reading Tanenbaum's Modern Operating Systems 3e. He says "Suppose that the program being attacked [with malicious code] is SETUID root in UNIX (or has Administrator power in Windows). The [...
user avatar
  • 1,437
6 votes
1 answer
457 views

Why require root to be the first entry in /etc/passwd?

Security policies sometimes demand that root be the first entry in the /etc/passwd file. Is there a valid reason for requiring this, or is it just conventional to do so since the root account is the ...
user avatar
  • 1,415
6 votes
2 answers
902 views

How a malware executes remote payload

Let's assume a malware was installed (on a UNIX-based platform) with some social engineering tricks. The original installed code itself may be benign, but the only malicious activity is that the ...
user avatar
  • 1,281
6 votes
2 answers
479 views

How is the password prompt going to protect me from ruining my computer?

On Unix based systems, I'm often prompted to enter my password before installing or running a program. Why does this protect me? If I'm running a kiosk, I understand that a password might prevent ...
user avatar
  • 1,721
5 votes
2 answers
5k views

Can you describe a real-life scenario of exploiting sticky bits?

Sticky bit are mentioned in every UNIX security book, but I couldn't find anyone that describes the exploitation of Sticky Bit set on a file. Can you?
user avatar
  • 1,066
5 votes
3 answers
346 views

Could browsers improve security of stored passwords by using setuid?

On Unix-esque systems, Mozilla Firefox stores a users' preferences, web history and stored passwords in a set of files that are readible and writeable by that particular user. This makes sense: when ...
user avatar
5 votes
2 answers
1k views

What is the entropy of a password made with pwgen?

pwgen is a unix utility that generates "memorable" passwords randomly. The man page says the entropy is lower than truly random passwords with the same specification. What is the actual entropy of a ...
user avatar
  • 151
5 votes
3 answers
4k views

Making passwd/shadow files more secure

The passwd/shadow files in a unix-like OS contain sensitive info such as a user's password. In addition those files aren't necessarily secured: with a live CD we can access those files on the hard ...
user avatar
  • 457
5 votes
5 answers
371 views

Unix Privilege Escalation: "sudo must be owned by uid 0 and have the setuid bit set"

It seems protections are harcoded into sudo that prevent the binary from executing as a low-privileged user. Running it in Ubuntu as a normal user returns the following error: "sudo must be owned ...
user avatar
5 votes
4 answers
2k views

Should I compile as root?

When I am compiling software for local installation, what factors should I take into consideration when deciding whether to compile as root or to compile under my regular user account? ./configure ...
user avatar
5 votes
1 answer
356 views

Is it safe to use a unix pipe to redirect sensitive output data as input to another program?

I want to make a Node.js development server use HTTPS by giving it access to the contents of a TLS certificate and private key file. On the one hand, I don't like the idea of making the TLS private ...
user avatar
  • 188
5 votes
2 answers
3k views

Can UNIX Domain Sockets be locked by user ID?

If I created a folder /tmp/me with permissions 700, and started a process under me that starts a listen socket under /tmp/me/socket. I currently assume that a connection to that socket originated ...
user avatar
  • 13.8k
5 votes
1 answer
6k views

Why is `cd` restricted in rbash/restricted bash?

The bash manual says: A restricted shell behaves identically to bash with the exception that the following are disallowed or not performed: Changing directories with the cd builtin. Why is ...
user avatar
5 votes
2 answers
5k views

Best practices for securing a public facing web server? [closed]

I'm looking to make a "bare minimum" checklist for securing a public facing Unix web server. Assume it's a LAMP stack (or similar). This list should be what minimums you would implement. Obviously ...
user avatar
  • 153
5 votes
1 answer
1k views

Always setgroups before setuid?

On GNU/Linux systems that are build using RPM packages, the rpmlint utility complains about programs that don't call setgroups before setuid. The idea is that before dropping privileges, a process ...
user avatar
  • 2,283