add files

This commit is contained in:
Cyberes 2023-03-31 22:46:54 -06:00
parent f0edcac9b0
commit 28bc84d859
16 changed files with 551 additions and 2 deletions

128
README.md
View File

@ -1,3 +1,127 @@
# RT-IPC_camera # RT-IPC_IP_Camera
Files from an IP camera using Hisilicon Ipcam.
## RTSP Streams
1280x720: `rtsp://xxx.xxx.xxx.xxx:554/11`
There is also a 1080p stream that I didn't bother searching for.
Also see: https://www.ispyconnect.com/camera/hisilicon
## Telnet Login
Telnet port is `8357`
Username: `root`
Password: `runtop10`
## Port Scan
```
PORT STATE SERVICE
554/tcp open rtsp
8357/tcp open unknown
8840/tcp open unknown
```
RTSP on `554` and `8840`.
Telnet on `8357`.
## Process List
```
PID USER VSZ STAT COMMAND
1 root 1448 S {linuxrc} init
2 root 0 SW [kthreadd]
3 root 0 SW [ksoftirqd/0]
5 root 0 SW< [kworker/0:0H]
7 root 0 SW< [lru-add-drain]
8 root 0 SW [kdevtmpfs]
9 root 0 SW< [netns]
154 root 0 SW [oom_reaper]
155 root 0 SW< [writeback]
157 root 0 SW [kcompactd0]
158 root 0 SW< [crypto]
159 root 0 SW< [bioset]
161 root 0 SW< [kblockd]
164 root 0 SW [spi0]
167 root 0 SW [spi1]
187 root 0 SW< [cfg80211]
274 root 0 SW [kswapd0]
380 root 0 SW< [bioset]
381 root 0 SW< [bioset]
382 root 0 SW< [bioset]
383 root 0 SW< [bioset]
384 root 0 SW< [bioset]
385 root 0 SW< [bioset]
386 root 0 SW< [bioset]
387 root 0 SW< [bioset]
388 root 0 SW< [bioset]
389 root 0 SW< [bioset]
390 root 0 SW< [bioset]
391 root 0 SW< [bioset]
392 root 0 SW< [bioset]
393 root 0 SW< [bioset]
394 root 0 SW< [bioset]
395 root 0 SW< [bioset]
435 root 0 SW< [bioset]
440 root 0 SW< [bioset]
445 root 0 SW< [bioset]
450 root 0 SW< [bioset]
455 root 0 SW< [bioset]
460 root 0 SW< [bioset]
490 root 0 SW [irq/24-mmc0]
492 root 0 SW [irq/25-mmc1]
493 root 0 SW [kworker/0:2]
499 root 0 SW [kworker/0:3]
502 root 0 SW< [kworker/0:1H]
504 root 0 SW< [bioset]
505 root 0 SW [mmcqd/0]
528 root 0 SWN [jffs2_gcd_mtd3]
551 root 1456 S telnetd -p 8357
552 root 1452 S {boottab} /bin/sh /etc/boottab
590 root 0 SW [irq/39-VI_CAP0]
669 root 0 SW [dog]
692 root 1448 S {start_cgiServer} /bin/sh /bin/vs/autostartup/before/back/start_cgiServer.sh
696 root 1444 S syslogd -m 0 -O /tmpfs/syslog.txt -S -s 100 -b 0
699 root 1480 S {exe} ash /bin/vs/sysmon.sh
700 root 1636 S {net_serv.sh} /bin/sh /bin/vs/cgi-bin/net_serv.sh
704 root 25548 S ./ipcam -sensortype soih62 -boardtype 723000 -restartcnt 0
707 root 1256 S /bin/vs/cgiServer
822 root 0 SW [RtmpTimerTask]
823 root 0 SW [RtmpMlmeTask]
824 root 0 SW [RtmpCmdQTask]
825 root 0 SW [RtmpWscTask]
832 root 1864 S wpa_supplicant -B -d -Dnl80211 -i ra0 -c /etc/network/wpa_supp.conf
860 root 0 SW [kworker/u2:2]
940 root 1460 S /sbin/udhcpc -i ra0 -b -A 3
3641 root 0 SW [kworker/u2:1]
13587 root 1452 S /bin/login -- root
13738 root 1440 S sleep 15
13758 root 1460 S -sh
13805 root 1440 S sleep 2
13806 root 1440 S sleep 2
13807 root 1448 R ps
```
## Directory Structure
See `tree.txt`
## Other Stuff
`rec.log` is from `/bin/vslocal/sd/record/20230323/18/rec.log`

View File

@ -0,0 +1,7 @@
#!/bin/sh
######before vs_server
/bin/vslocal/autostartup/before_startup.sh
######after vs_server
/bin/vslocal/autostartup/after_startup.sh &

View File

@ -0,0 +1,34 @@
####检测是否带SD卡,不带SD卡退出
partition=""
checknum=30
while [ $checknum -gt 0 ]
do
##Not support this syntax (( checknum-- ))
checknum=`expr $checknum - 1`
partition=`ls /dev/ | grep mmcblk.p. | head -1`
if [ ${partition}"A" == "A" ];then
partition=`ls /dev/ | grep mmcblk | head -1`
if [ ${partition}"A" == "A" ];then
sleep 10
continue
fi
fi
sleep 30
if [ ! -e /bin/vs/sd/pqtools ];
then
exit
fi
cd /bin/vs/sd/pqtools
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/bin/vs/sd/pqtools
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/bin/vs/sd/pqtools/libs
killall ittb_control
kill -9 `ps | grep control |head -1| awk '{print $1}'`
ulimit -s 1024
./ittb_control &
break
done

View File

@ -0,0 +1,9 @@
#!/bin/sh
#########这个脚本的作用主要作用是删除恢复出厂设置标志
if [ -e /etc/ipcamera/resetdef ]
then
sleep 120
rm /etc/ipcamera/resetdef -rf
fi

View File

@ -0,0 +1,22 @@
#!/bin/sh
while [ 1 ]
do
if [ ! -e /tmpfs/ipcam.pid ]
then
sleep 3
else
sleep 15
break
fi
done
for initscript in /bin/vs/autostartup/after/*
do
if [ -x $initscript ] ;
then
echo "[RCS]: $initscript"
$initscript &
fi
done

View File

@ -0,0 +1,11 @@
#!/bin/sh
cd /bin/vs
while [ 1 ]
do
RES=`pidof cgiServer`
if [ -z "$RES" ]; then
/bin/vs/cgiServer &
fi
sleep 15
done

View File

@ -0,0 +1,120 @@
#!/bin/sh
show_info()
{
echo -e "\033[32m $1 \033[0m" >&2
}
show_info_exit()
{
echo -e "\033[32m $1 \033[0m" >&2
umount -l /bin/vslocal/sd
exit
}
######如果不存在SD卡直接退出
[ -e /dev/mmcblk0p1 ] || exit
######挂载SD卡
mount -t vfat /dev/mmcblk0p1 /bin/vslocal/sd
ret=`mount | grep mmcblk0p1 > /dev/null; echo $?`
######挂载失败退出
[ "${ret}" == "0" ] || show_info_exit "mount sd card error"
get_parts_offect()
{
echo `dmesg | grep ^0x | grep $1 | cut -d: -f1 | cut -d- -f1`
}
get_parts_size()
{
echo 0x`cat /proc/mtd | grep $1 | cut -d' ' -f2`
}
sd_path=/bin/vslocal/sd
upgrade_tools_path=/bin/vslocal/upgrade_tools
sd_upgrade_path=${sd_path}/upgrade_tools
image_path=${sd_path}/runtop_image
image_parts_path=${image_path}/parts
######镜像目录不存在退出
[ -e ${image_path} ] || show_info_exit ""
mkdir ${image_parts_path} -p
#####分区镜像
boot_img_path=${image_parts_path}/u-boot.bin
kernel_img_path=${image_parts_path}/uImage
rootfs_img_path=${image_parts_path}/rootfs_uclibc.img
config_img_path=${image_parts_path}/config.bin
key_img_path=${image_parts_path}/key.img
#####分区路径
boot_mtd=/dev/`cat /proc/mtd | grep "boot"|cut -d: -f1`
kernel_mtd=/dev/`cat /proc/mtd | grep "kernel"|cut -d: -f1`
rootfs_mtd=/dev/`cat /proc/mtd | grep "rootfs"|cut -d: -f1`
config_mtd=/dev/`cat /proc/mtd | grep "config"|cut -d: -f1`
#####分区位置偏移
boot_offect=`get_parts_offect boot`
kernel_offect=`get_parts_offect kernel`
rootfs_offect=`get_parts_offect rootfs`
config_offect=`get_parts_offect config`
#####分区大小
boot_size=`get_parts_size boot`
kernel_size=`get_parts_size kernel`
rootfs_size=`get_parts_size rootfs`
config_size=`get_parts_size config`
[ ! -d ${boot_mtd} ] || show_info_exit "boot partitions do not exist"
[ ! -d ${kernel_mtd} ] || show_info_exit "kernel partitions do not exist"
[ ! -d ${rootfs_mtd} ] || show_info_exit "rootfs partitions do not exist"
[ ! -d ${config_mtd} ] || show_info_exit "config partitions do not exist"
cd ${image_parts_path}
#####导出各个分区镜像
dd if=${boot_mtd} of=${boot_img_path}
dd if=${kernel_mtd} of=${kernel_img_path}
dd if=${rootfs_mtd} of=${rootfs_img_path}
######分区配置文件
echo "boot:${boot_offect}:${boot_size}:3.1.1.1" > ${image_parts_path}/ov.conf
echo "kernel:${kernel_offect}:${kernel_size}:3.1.1.1" >> ${image_parts_path}/ov.conf
echo "rootfs:${rootfs_offect}:${rootfs_size}:3.1.1.1" >> ${image_parts_path}/ov.conf
echo "config:${config_offect}:${config_size}:3.1.1.1" >> ${image_parts_path}/ov.conf
#######制作升级包
show_info "gen upgrade ov!!!"
find ${image_parts_path} -name "*pad*" -exec rm -f {} \;
${upgrade_tools_path}/genrelease ${image_parts_path} ov.conf 0
mv hi351x_upgrade.ov ${image_path}/rt-upgrade-hi3518ev200.ov
#######制作带恢复出厂设置的升级包
show_info "gen upgrade config ov!!!"
dd if=${config_mtd} of=${config_img_path}
find ${image_parts_path} -name "*pad*" -exec rm -f {} \;
${upgrade_tools_path}/genrelease ${image_parts_path} ov.conf 0
mv hi351x_upgrade.ov ${image_path}/rt-upgrade-hi3518ev200-conf.ov
#####制作生产镜像
show_info "gen image !!!"
cp ${upgrade_tools_path}/key.img ${key_img_path}
cat ${boot_img_path} > rt-upgrade-hi3518ev200.bin
cat ${kernel_img_path} >> rt-upgrade-hi3518ev200.bin
cat ${rootfs_img_path} >> rt-upgrade-hi3518ev200.bin
cat ${key_img_path} >> rt-upgrade-hi3518ev200.bin
cat ${config_mtd} >> rt-upgrade-hi3518ev200.bin
mv rt-upgrade-hi3518ev200.bin ${image_path}/
ls ${image_path} -lh
#####清理环境
rm ${image_parts_path} -rf
umount -l /bin/vslocal/sd

View File

@ -0,0 +1,55 @@
#!/bin/sh
export PATH=$PATH:/bin/vs/cgi-bin:/bin/vs:/komod
. /bin/vs/cgi-bin/netenv.conf
. /bin/vs/cgi-bin/net_func.sh
. $wifidev_config
sd_testpath=/bin/vslocal/sd/VAL_TEST/
wifitest=${sd_testpath}/wifi_test.conf
if [ ! -e /dev/mmcblk0 ];then
echo -e "\033[45;37m[VAL_TEST]Exit custom test\033[0m"
exit
fi
#####挂载SD卡,不存在/dev/mmcblk0p1节点时使用/dev/mmcblk0
if [ ! -e /dev/mmcblk0p1 ];then
mount -t vfat /dev/mmcblk0 /bin/vslocal/sd
else
mount -t vfat /dev/mmcblk0p1 /bin/vslocal/sd
fi
#####是否挂载成功
sdInfo=`mount | grep "/bin/vslocal/sd" | awk '{print $1}'`
if [ $sdInfo"A" == "A" ];then
echo -e "\033[45;37m[VAL_TEST]Exit custom test\033[0m"
exit
fi
if [ -d ${sd_testpath} ];then
#######把这个目录拷贝到/tmpfs/
cp ${sd_testpath} /tmpfs/ -raf
if [ -x $wifitest ];then
chmod +x $wifitest
. $wifitest
if [ ! -z $wifissid ];then
if [ ! -z $wifikey ];then
########先保存原来的配置
cp $wifi_config /tmpfs/wifi_conf.bak
wifissid_new=`str2hexstr $wifissid`
wifikey_new=`str2hexstr $wifikey`
/bin/vs/cgi-bin/setwifiattr.cgi "cmd=setwifiattr&-enable=1&-ssid=${wifissid_new}&-wktype=3&-wepid=0&-key=${wifikey_new}"
cp $wifi_config $wifi_config_test
mv /tmpfs/wifi_conf.bak $wifi_config
fi
fi
fi
fi
#######卸载SD卡
umount /bin/vslocal/sd -l

View File

@ -0,0 +1,21 @@
#!/bin/sh
####阻塞执行
for initscript in /bin/vs/autostartup/before/*
do
if [ -x $initscript -a ! -d $initscript ] ;
then
echo "[RCS]: $initscript"
$initscript
fi
done
####非阻塞执行
for initscript in /bin/vs/autostartup/before/back/*
do
if [ -x $initscript ] ;
then
echo "[RCS]: $initscript"
$initscript &
fi
done

View File

@ -0,0 +1,12 @@
#!/bin/sh
get_ap_ssid()
{
####LUOHE-P2P中间的数字
APPrefix="CAMDUCK"
P2P_ID=`paraconf r 1 P2P_ID`
APPostfix=`echo ${P2P_ID} | awk -F'-' '{print $2}'`
echo $APPrefix-$APPostfix
}

View File

@ -0,0 +1,76 @@
#!/bin/sh
. /etc/sysenv.conf
if [ "$REQUEST_METHOD" = "GET" ]
then
CGIPARAM=$QUERY_STRING
elif [ "$REQUEST_METHOD" = "POST" ]
then
read CGIPARAM
else
CGIPARAM=$1
fi
CMD_LINE="`echo $CGIPARAM | sed -n "s/&/\n/gp"`"
get_param()
{
echo "${CMD_LINE}" | grep "${1}=" | sed -n "s/\-${1}=//p"
}
#boardconffile=/etc/board.conf
#sensorconffile=/etc/sensor.conf
arg_action="`get_param "action"`"
show_info()
{
. ${BOARD_CONF}
. ${SENSOR_CONF}
# echo 200 OK HTTP 1.1
# echo -e "\r"
echo -e "Content-Type:text/plain\r"
echo -e "\r"
echo -e "var boardtype = \"$boardtype\" ;\r"
echo -e "var sensortype = \"$sensortype\" ;\r"
echo -e "\r"
}
#echo arg_action $arg_action
if [ $arg_action = "get" ]
then
show_info
exit
fi
if [ $arg_action = "set" ]
then
###arg_board="`get_param "board"`"
arg_sensor="`get_param "sensor"`"
. ${SENSOR_CONF}
###echo "boardtype=$arg_board" > ${BOARD_CONF}
rm -f ${SENSOR_CONF}
echo "sensortype=$arg_sensor" \
$'\n'"sensordetect=$sensordetect" > ${SENSOR_CONF}
sync
/bin/sensorenv.sh
show_info
exit
fi

View File

@ -0,0 +1 @@
wget -O /tmpfs/wifiaudio.log "http://127.0.0.1/web/cgi-bin/hi3510/close_voice_cfg_wifi_mode.cgi?cmd=close_voice_cfg_wifi_mode"

View File

@ -0,0 +1,47 @@
#!/bin/sh
export PATH=$PATH:/bin/vs/cgi-bin:/bin/vs
DDNSCONF=/etc/ipcamera/ddns.conf
DDNSBIN=/bin/vs/ez-ipupdate
. $DDNSCONF
#1.kill
#echo "killall -QUIT ez-ipupdate"
killall -INT ez-ipupdate
if [ $ddnsenable -eq 1 ]
then
#2.judge the valid interface
#echo "judge the valid interface"
#for i in eth0 eth1
#do
# ifconfig $i |grep UP > /dev/null 2>&1
# if [ $? -eq 0 ];then
# interface=$i
# break
# fi
#done
#3.restart ez-ipupdate
#echo "restart ez-ipupdate"
#echo "ez-ipupdate -d -S $servicetype -u $user:$password -h $host -i $interface -P $interval -b $cachefile"
if [ "${ddnsuser}" = "" ]
then
ddnsuser=0
fi
if [ "${ddnspassword}" = "" ]
then
ddnspassword=0
fi
if [ "${ddnshost}" = "" ]
then
ddnshost=0
fi
#$DDNSBIN -a 0.0.0.0 -d -S $servicetype -u $user:$password -h $host -P $interval -b $cachefile --force -i $interface
$DDNSBIN -a 0.0.0.0 -d -S $ddnsservicetype -u $ddnsuser:$ddnspassword -h $ddnshost -P $ddnsinterval --force
fi #if [ $upnpenable -eq 1 ]

View File

@ -0,0 +1,8 @@
#!/bin/sh
echo "devs restart" >> /tmpfs/devs
#killall -10 ipcam
if [ -e /tmpfs/ipcam.pid ]
then
echo "send sigusr1 to vs_server.devs restart"
kill -10 `cat /tmpfs/ipcam.pid`
fi

View File

@ -0,0 +1 @@
#!/bin/sh

View File

@ -0,0 +1 @@
wget -O /tmpfs/wifiaudio.log "http://127.0.0.1/web/cgi-bin/hi3510/enter_voice_cfg_wifi_mode.cgi?cmd=enter_voice_cfg_wifi_mode"