SuSH

大概是以技术文为主的blog

0%

试着给Newifi3 D2编译LEDE固件,图省事在WSL 1的Ubuntu 18.04跑,结果踩了几个坑。

  • make过程中提示sleep: cannot read realtime clock: Invalid argument

    参阅 https://github.com/microsoft/WSL/issues/4898#issuecomment-586512514 ,其中给出的原因是WSL 1的glibc没有为nanosleep 6函数实现CLOCK_REALTIME系统调用:

    An example of the WSL team continuing to service WSL 1 for now is a patch for issue 4989 384. Issue 4989 arises from a patch in glibc 2.31 49 that implements a nanosleep() library call in a more UNIX-like manner 26 based on CLOCK_REALTIME. Emulating UNIX system clocks on an NT kernel is tricky. WSL 1 implemented the most popular clock-based system calls, but not all of them, and did not build CLOCK_REALTIME support into nanosleep 6. But because this is such a fundamental change in glibc the WSL team is very graciously implementing support for CLOCK_REALTIME in nanosleep in WSL 1 and will be backporting it in updates to existing builds. This is a challenging task that will take some time. In contrast, other more obscure system clock calls, like the one raised in issue 4973 106, will likely not see implementation in WSL 1.

    我选择了添加PPA的workaround,添加完之后似乎还不work。

    之后找到了 https://github.com/microsoft/WSL/issues/4898#issuecomment-624450947 ,这位提供了直接下载deb包安装glibc的方式:

    I solved it by downloading and manually installing the patched package:

    https://launchpad.net/~rafaeldtinoco/+archive/ubuntu/lp1871129/+build/19152555/+files/libc6_2.31-0ubuntu8+lp1871129~1_amd64.deb

    Other files from the same repository can be found here: https://launchpad.net/~rafaeldtinoco/+archive/ubuntu/lp1871129/+build/19152555

    It's still [@rafaeldtinoco](https://github.com/rafaeldtinoco) 's PPA after all but saves some mess adding APT repositories or so.

    1
    2
    wget "https://launchpad.net/~rafaeldtinoco/+archive/ubuntu/lp1871129/+build/19152555/+files/libc6_2.31-0ubuntu8+lp1871129~1_amd64.deb"
    sudo dpkg -i libc6_2.31-0ubuntu8+lp1871129~1_amd64.deb

    Thanks Rafael and Christian!

  • make过程中提示find: The relative path 'Files' is included in the PATH environment variable, which is insecure in combination with the -execdir action of find. Please remove that entry from $PATH

    WSL与Windows共享PATH环境变量,make工具在Windows的PATH中寻找不到所需文件所以报错。在WSL中执行source /etc/environment,将WSL的环境变量重置为Ubuntu的默认值即可。

终于给这台Taishan 200装好系统了。这台机子是ARMv8架构,系统映像不多,找到映像,上传到服务器走的是家宽的小水管(控制面板没有从网络直接下载映像的选项),安装过程又在各种意想不到的地方报错,耗尽耐心之后再搁置,于是前前后后居然拖了小半年。

之前装CentOS 7,安装程序启动时卡在"Starting Network manager"(前面这篇文章的截图正好展现了这个画面)。在启动项里把loglevel改成7,输出debug级的日志信息,观察到是卡在"anaconda-pre-log-gen gathering udev info"处。查到的结果似乎要我patch什么东西,一时半会搞不定,遂弃。

后来试着转投Ubuntu 20.04,在进入安装程序前会报若干错误,在分区环节结束后就没法继续下去了。

阅读全文 »

一次改造家庭网络拓扑的经历

背景

宅在乡下,宽带是百兆的,速度尚可,但老旧的网络设备让我每两三分钟就断一次网。我难以忍受,决定对其进行改造。 原来的网络拓扑如下: topo-before

阅读全文 »

Aurora CTF Writeup

Web

PHP is very good

按F12,看到提示:

查看/code

以中间的正则表达式去搜索,找到了这篇文章 。 了解到是需要构造一个无参数的函数链来读取到文件内容。一个可用的payload为if(chdir(next(scandir(pos(localeconv())))))readfile(end(scandir(pos(localeconv()))));

阅读全文 »

Hackergame 2019 Writeup

比赛结束后忙了若干天才有空挤出这篇writeup……

先放一下自己的成绩吧(

签到题

送分题,打开开发者工具,把按钮的disabled属性去掉即可:

输入token后提交即可得到flag:

阅读全文 »