謎's キッチン

謎のひとりごと。Amazon欲しい物リストはこちら: https://www.amazon.co.jp/hz/wishlist/ls/CCPOV7C6JTD2

JS/Linuxすげぇ

特に用途思いつかないけどすげぇ
Web上で意味のある起動画面というのが新鮮 (Fakeなら昔からいくつもあったけども)
tccコンパイル

~ # tcc hello.c                                                                
~ # ./a.out                                                                     
Hello World

ping127.0.0.1に打つ

~ # ping 127.0.0.1                                                              
PING 127.0.0.1 (127.0.0.1): 56 data bytes                                       
64 bytes from 127.0.0.1: seq=0 ttl=64 time=0.000 ms                             
64 bytes from 127.0.0.1: seq=1 ttl=64 time=0.000 ms                             
64 bytes from 127.0.0.1: seq=2 ttl=64 time=0.000 ms                             
64 bytes from 127.0.0.1: seq=3 ttl=64 time=0.000 ms                             
                                                                                
--- 127.0.0.1 ping statistics ---                                               
4 packets transmitted, 4 packets received, 0% packet loss                       
round-trip min/avg/max = 0.000/0.000/0.000 ms

httpサーバーを立ち上げて、wgetで取得

~ # httpd -d .
.~ # wget -O- http://127.0.0.1/hello.c                                           
Connecting to 127.0.0.1 (127.0.0.1:80)                                          
/* This C source can be compiled with:                                          
   tcc -o hello hello.c                                                         
*/                                                                              
#include <tcclib.h>                                                             
                                                                                
int main(int argc, char **argv)                                                 
{                                                                               
    printf("Hello World\n");                                                    
    return 0;                                                                   
}                                                                               
-                    100% |*******************************|   166  00:00:00 ETA

top

Mem: 3996K used, 26452K free, 0K shrd, 2048K buff, 868K cached
CPU:  2.1% usr  1.4% sys  0.0% nic 43.1% idle  0.0% io 28.7% irq 24.4% sirq
Load average: 0.28 0.41 0.20 1/13 124
  PID  PPID USER     STAT   VSZ %MEM CPU %CPU COMMAND
  124    76 root     R     1140  3.7   0 56.0 top
   76     1 root     S     1152  3.7   0  0.0 sh
    1     0 root     S     1132  3.7   0  0.0 /bin/sh /sbin/init
   81     1 root     S     1128  3.7   0  0.0 httpd
    3     1 root     SW<      0  0.0   0  0.0 [events/0]
    4     1 root     SW<      0  0.0   0  0.0 [khelper]
   33     5 root     SW       0  0.0   0  0.0 [pdflush]
    2     1 root     SWN      0  0.0   0  0.0 [ksoftirqd/0]
   16     5 root     SW<      0  0.0   0  0.0 [kblockd/0]
    5     1 root     SW<      0  0.0   0  0.0 [kthread]
   35     5 root     SW<      0  0.0   0  0.0 [aio/0]
   32     5 root     SW       0  0.0   0  0.0 [pdflush]
   34     5 root     SW<      0  0.0   0  0.0 [kswapd0]

一般ユーザーに

~ # chmod o+r /dev/clipboard
~ # mkdir -p /home/nazo
~ # adduser nazo
Changing password for nazo
New password:
Retype password:
Password for nazo changed by root
~ # su nazo

権限昇格exploitを試そうと思ったけども、ゲストじゃうまくコンパイルが通らんなぁ。
ホストで-static -m32でコンパイルしてuuencodeしてクリップボード経由で送り込めば、どれかはいけるかなと思ったけど、都合の良いものは見つからんかった。
全削除

~ # umount /proc
~ # rm -rf /
rm: can't remove '/dev/pts': Device or resource busy
rm: can't remove '/dev': Directory not empty
rm: can't remove '/tmp': Device or resource busy
rm: can't remove '/': Device or resource busy
sh: getcwd: No such file or directory
(unknown) # cd /
/ # exit
/sbin/init: line 21: /bin/true: not found
Kernel panic - not syncing: Attempted to kill init!

うーん、外部に繋げないから面白み半減かな、それとやっぱりフレームバッファは欲しいかも