[SOLUCIONADO] Modificar /proc/cpuinfo

Iniciado por elpollino, Octubre 27, 2017, 02:27:52 PM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Octubre 27, 2017, 02:27:52 PM Ultima modificación: Noviembre 01, 2017, 12:56:04 AM por Gabriela
hola chicos , como puedo modificar este archivo  /proc/cpuinfo  , 
es para un proyecto de seguridad muchas gracias por su ayuda
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

cpuinfo, es un file conocido como "virtual", simplemente refleja lo que tu Hardware "es/tiene". Generalmente la info de los procesadores, tiempos etc.

No se que tan util seria editarlo, imagino que estaras programando algo que verifique si usa 'x' o 'y' procesador.. o cosas asi porque sino no tengo idea..
Pero de todos modos podrias probar con root. Es el unico que podria editar ese archivo.. usa root y nano para editarlo y deberia funcionar. Pero al reiniciar ese archivo estoy seguro que se regenera.

Saludos.
Security Researcher
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

hola muchas gracias por responder ,  ya pude modificarlo y encontrar una solucion !

mountkernfs.sh
Código: bash

#! /bin/sh
### BEGIN INIT INFO
# Provides:          mountkernfs
# Required-Start:
# Required-Stop:
# Should-Start:      glibc
# Default-Start:     S
# Default-Stop:
# Short-Description: Mount kernel virtual file systems.
# Description:       Mount initial set of virtual filesystems the kernel
#                    provides and that are required by everything.
### END INIT INFO

PATH=/sbin:/bin
. /lib/init/vars.sh
. /lib/init/tmpfs.sh

. /lib/lsb/init-functions
. /lib/init/mount-functions.sh

# May be run several times, so must be idempotent.
# $1: Mount mode, to allow for remounting
mount_filesystems () {
MNTMODE="$1"

#
# Mount tmpfs on /run and/or /run/lock
#
mount_run "$MNTMODE"
mount_lock "$MNTMODE"

#
# Mount proc filesystem on /proc
#
domount "$MNTMODE" proc "" /proc proc "-onodev,noexec,nosuid"

        #
        # Override /proc/cpuinfo with falsified information, if required
        #
        if [ -e /etc/cpuinfo] ; then
          mount -o bind /etc/cpuinfo /proc/cpuinfo
        fi

#
# Mount sysfs on /sys
#
# Only mount sysfs if it is supported (kernel >= 2.6)
if grep -E -qs "sysfs\$" /proc/filesystems
then
domount "$MNTMODE" sysfs "" /sys sysfs "-onodev,noexec,nosuid"
fi

if [ -d /sys/fs/pstore ]
then
domount "$MNTMODE" pstore "" /sys/fs/pstore pstore ""
fi

if [ -d /sys/kernel/config ]
then
domount "$MNTMODE" configfs "" /sys/kernel/config configfs ""
fi
}

case "$1" in
  "")
echo "Warning: mountkernfs should be called with the 'start' argument." >&2
mount_filesystems mount_noupdate
;;
  start)
mount_filesystems mount_noupdate
;;
  restart|reload|force-reload)
mount_filesystems remount
;;
  stop|status)
# No-op
;;
  *)
echo "Usage: mountkernfs [start|stop]" >&2
exit 3
;;
esac


cpuinfos
Código: dos

#!/bin/bash

### BEGIN INIT INFO
# Provides: cpuinfos
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO

mount -o bind /etc/cpuinfo /proc/cpuinfo


cpuinfo
Código: dos

processor : 0
vendor_id : 0
cpu family : 0
model : 6
model name : 0
stepping : 3
microcode : 0
cpu MHz : 0
cache size : 0 KB
physical id : 0
siblings : 1
core id : 0
cpu cores : 1
apicid : 0
initial apicid : 0
fpu : 0
fpu_exception : 0
cpuid level : 0
wp : 0
flags : 0
bugs : 0
bogomips : 0
TLB size : 0K pages
clflush size : 0
cache_alignment : 0
address sizes : 0 bits physical, 0 bits virtual
power management: 0



script instalacion
Código: bash

#!/bin/bash

mv cpuinfo /etc/
mv mountkernfs.sh /etc/init.d/
mv cpuinfos /etc/init.d/

chmod +x /etc/init.d/cpuinfos

/etc/init.d/cpuinfos start

update-rc.d cpuinfos defaults 10
update-rc.d cpuinfos defaults 10
update-rc.d cpuinfos defaults 10
update-rc.d cpuinfos defaults 10


Con esta forma cargara desde el boot , ya cuando inicie el sistema ya esta modificado el cpuinfo
es que se necesitan buscar nuevas formas para prevenir el SSE2 Test de Tor
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login