我正在为计算机安全课程做一个调试项目,但发现我试图检查的某些变量的内存地址在运行之间会发生变化。我与讲师进行了交流,他建议在我的课程中禁用 ASLR,以便在分析过程中保持内存地址静态。
我正在运行托管在 Cloud9 中的 Debian 实例。
为了实现这一点,我使用以下命令:
echo 0 | tee /proc/sys/kernel/randomize_va_space
我在 root 下运行此命令。当我执行此操作时,操作系统返回错误:
tee: /proc/sys/kernel/randomize_va_space: Read-only file system
我理解这是完全正常的行为,但对于我想要做的事情来说并不理想。
我该如何禁用系统上的只读标志?我知道这可能会提供一个解决方案,所以下面是我虚拟机上mount
的输出转储。mount
none on / type aufs (rw,relatime,si=18e455316acd065c,dio,dirperm1)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev type tmpfs (rw,nosuid,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666)
sysfs on /sys type sysfs (ro,nosuid,nodev,noexec,relatime)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,relatime,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (ro,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/cpuset type cgroup (ro,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/memory type cgroup (ro,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/blkio type cgroup (ro,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/freezer type cgroup (ro,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (ro,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (ro,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/pids type cgroup (ro,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/perf_event type cgroup (ro,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/devices type cgroup (ro,nosuid,nodev,noexec,relatime,devices)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
/dev/mapper/volg1-lvdata on /mnt type ext4 (ro,relatime,data=ordered)
/dev/mapper/volg1-lvdata on /nix type ext4 (ro,relatime,data=ordered)
/dev/mapper/volg1-lvdata on /mnt/shared type ext4 (ro,relatime,data=ordered)
/dev/mapper/volg1-lvdata on /etc/resolv.conf type ext4 (rw,relatime,data=ordered)
/dev/mapper/volg1-lvdata on /etc/hostname type ext4 (rw,relatime,data=ordered)
/dev/mapper/volg1-lvdata on /etc/hosts type ext4 (rw,relatime,data=ordered)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=65536k)
/dev/mapper/volg1-lvdata on /root/.ssh/authorized_keys type ext4 (ro,relatime,data=ordered)
/dev/mapper/volg1-lvdata on /home/ubuntu/.ssh/authorized_keys type ext4 (ro,relatime,data=ordered)
devpts on /dev/console type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
proc on /proc/asound type proc (ro,nosuid,nodev,noexec,relatime)
proc on /proc/bus type proc (ro,nosuid,nodev,noexec,relatime)
proc on /proc/fs type proc (ro,nosuid,nodev,noexec,relatime)
proc on /proc/irq type proc (ro,nosuid,nodev,noexec,relatime)
proc on /proc/sys type proc (ro,nosuid,nodev,noexec,relatime)
proc on /proc/sysrq-trigger type proc (ro,nosuid,nodev,noexec,relatime)
tmpfs on /proc/kcore type tmpfs (rw,nosuid,mode=755)
tmpfs on /proc/timer_list type tmpfs (rw,nosuid,mode=755)
tmpfs on /proc/timer_stats type tmpfs (rw,nosuid,mode=755)
tmpfs on /proc/sched_debug type tmpfs (rw,nosuid,mode=755)
tmpfs on /sys/firmware type tmpfs (ro,relatime)