63
votes
Why does one need a strong password on Unix?
You seem to have a pretty clear understanding of the risks. As others have stated it highly encouraged to use a strong password, so if you are running a sensitive service, then by all means, please ...
26
votes
Accepted
Unix command to generate cryptographically secure random string
No, it's not entirely secure. Let's look at each of the commands:
dd if=/dev/urandom bs=256 count=1 2> /dev/null
This will read a single 256 byte block from /dev/urandom, a cryptographically ...
15
votes
How can utilities with setuid set to root be secure if they are debuggable?
Normally, when su runs, it runs setuid (as root). When you start it with gdb, the setuid bit doesn't take effect (because it's being ptraced), so even if you convince it that you entered the right ...
13
votes
Why does one need a strong password on Unix?
You do not need a strong password.
The advise about password, like so many others, is a safe default that we security professionals give because it is usually a good advise, many people (and ...
12
votes
What is the entropy of a password made with pwgen?
An exact answer would require a deeper analyzis of the pwgen source code, or a more exact measurement. But I think we can use a strong compressor to approximate the entropy. The command
pwgen 1048576|...
10
votes
Why is linux filesystem considered DAC and not MAC
I don't think the granularity of permissions that can be achieved is relevant here. It doesn't matter if permission can be assigned to specific users, it matters which users can change permissions. ...
10
votes
Accepted
Why is linux filesystem considered DAC and not MAC
In a discretionary access control system the owner of the source decides who can access data. In a mandatory access control system an admin decides who can access data, which is then typically ...
9
votes
Accepted
Is `arc4random` secure enough?
Both arc4random and /dev/urandom have histories of problems. Some systems have reimplemented arc4random without RC4, but some systems kept RC4. I prefer arc4random over /dev/urandom, but if your ...
9
votes
Accepted
Is it safe to use a unix pipe to redirect sensitive output data as input to another program?
The | is anonymous. The pipe will usually not be accessible to anyone who isn't root or the owner of one of the processes. As soon as you read the standard input and close it, the cat process will ...
7
votes
Why does one need a strong password on Unix?
On the one hand, the fact is that you don't know. A strong password is defense in depth. Say that you (or someone else) installs an additional service that also uses Unix authentication; for example ...
6
votes
Why does one need a strong password on Unix?
I think the question should be "Why NOT use a strong password".
In my opinion, a strong password is the foundation of any secure system. You mentioned some safeguards, but you forgot some other ...
6
votes
Should I compile as root?
There are two different situations:
1. You are going to run the software as root
In this case you should really trust the source code before using it. Either by auditing it, or by trusting the ...
6
votes
Accepted
Way to properly escape user input which gets run by shell_exec() in PHP?
The function escapeshellarg safely quotes a value (including escaping quotes in the name, etc) so that it can be used as an argument in a command string passed to a shell.
$user_input = $_POST['...
5
votes
Unix Privilege Escalation: "sudo must be owned by uid 0 and have the setuid bit set"
what's to stop an attacker from compiling their own custom sudo binary that allows it to execute with any uid?
There's a basic misunderstanding going on here. The program does execute, it just stops ...
4
votes
Is mosh now recommended by the security experts? (2014)
Something to keep in mind while using MOSH... Although most of us use SSH to initiate the connection, MOSH doesn't require that to make it work (SSH only kicks off a new mosh-server on the server side ...
4
votes
`rsync -K`-based exploit
Here's a possible attack. Start with this on sender:
sender:/path/to/sourcedir
└── foo@ -> /etc/
Run the rsync once and get this:
receiver:/path/to/targetdir
└── foo@ -> /etc/
Now change ...
4
votes
`rsync -K`-based exploit
You are correct on the use of the -K option. But the exploit is about having different users performing the link creation and running rsync. Let's first see some rsync -K in action. Make some test ...
4
votes
What is the easiest way to sandbox an application in a *NIX environment?
There is no secure, easy-to-use command line sandbox utility. Popular utilities such as Firejail can often be a cure worse than the disease, and many sandbox bypasses and privilege escalation ...
3
votes
Accepted
Sniff plaintext password written in /tmp directory
A possible attacker can also use the inotify mechanism of the linux kernel to track the filesystem events in the /tmp directory.
If a new file is created, create also a hard link to this file. It ...
3
votes
Best practices for securing a public facing web server?
I would definitely add that SSH should not allow password authentication alone, but public-key (and/or some second token).
I would personally add enabling seLinux (or appArmor) to the list, and ...
3
votes
How can I protect myself from this kind of clipboard abuse?
What I do to protect against this is use bracketed paste mode. Like Stéphane said, zsh and urxvt support it by default. If you limit yourself to only pasting when in a zsh prompt in urxvt, the only ...
3
votes
How can I protect myself from this kind of clipboard abuse?
It goes a lot deeper than embedded line edits where you would at least see what ended up happening; or at least see that something was being hidden. I could post a benign-looking code fragment like ...
3
votes
How to view all SSH authorized_keys for a unix server
IMO it's a good idea to also check the ~/.ssh/authorized_keys2 file.
From https://marc.info/?l=openssh-unix-dev&m=100508718416162&w=2:
For backward compatibility ~/.ssh/authorized_keys2 ...
3
votes
Unix - Is it safe by default to give a new user ssh access and be certain they can not alter the system?
This depends on what the user can do with the SSH access. If he is limited to specific actions like scp/sftp, selected port forwarding or running selected commands the risk might be small. If instead ...
3
votes
Accepted
Security of Linux/Unix user information
1) The file itself is commonly read access to all in one form or another across distros. So I would always assume information in that file is public.
2) The better option is to store data in LDAP etc....
3
votes
In-memory encrypted Linux/unix kernel
Not possible. The host can read everything, no matter what it is.
Encrypted memory means there must be a decryption key, and that key must reside in clear, in the memory. The memory the host has full ...
3
votes
Unix Privilege Escalation: "sudo must be owned by uid 0 and have the setuid bit set"
To be executed as another user, a file needs to have the setuid permission bit set and needs to be owned by that target user (in this case, root).
what's to stop an attacker from compiling their ...
3
votes
Unix Privilege Escalation: "sudo must be owned by uid 0 and have the setuid bit set"
I think the OP misunderstood the intention of this check. It's not meant to protect sudo from being maliciously misused, but rather a simple precondition for it to function: if it is not setuid by ...
3
votes
Accepted
What are the dangers of extending my PATH?
It is obviously dangerous to add a directory to the PATH where other and potential malicious users can write into, where others can modify existing binaries or where you have symlinks pointing to ...
3
votes
Feeding entropy pool with my own data
This looks a lot like a XY problem: you want to solve X problem doing Y, but don't know how to do Y, so you are asking about Y here.
You are trying to use true secure random numbers and don't trust ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
unix × 154linux × 47
permissions × 15
operating-systems × 11
file-system × 11
passwords × 10
exploit × 9
ssh × 9
authentication × 7
php × 7
access-control × 7
cryptography × 6
attacks × 6
macos × 6
c × 6
openbsd × 6
network × 5
malware × 5
windows × 5
encryption × 4
web-application × 4
hash × 4
sudo × 4
penetration-test × 3
password-management × 3