Skip to content

Instantly share code, notes, and snippets.

@droberson
Created August 29, 2020 17:44
Show Gist options
  • Save droberson/d24771263dde4696b752fdc218947396 to your computer and use it in GitHub Desktop.
Save droberson/d24771263dde4696b752fdc218947396 to your computer and use it in GitHub Desktop.
verify maps of libs loaded into a process
#!/bin/bash
PIDS=$(pidof sshd)
PACKAGES=""
for pid in $PIDS;
do
for lib in $(cat /proc/$pid/maps |awk {'print $6'} |grep ^/ |sort |uniq);
do
PACKAGES="$PACKAGES $(rpm -q --whatprovides $lib)"
done
done
for package in $(echo $PACKAGES |tr ' ' '\n' |sort | uniq)
do
rpm -V $package
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment