brainfuck

HTB-靶机-Brainfuck

大憨熊 提交于 2020-12-23 04:00:29
本篇文章仅用于技术交流学习和研究的目的,严禁使用文章中的技术用于非法目的和破坏,否则造成一切后果与发表本文章的作者无关 靶机是作者购买VIP使用退役靶机操作,显示IP地址为10.10.10.17 nmap -sC -sV -p- -T5 -oN brainfuck.nmap 10.10.10.17 nmap扫描结果 扫描结果有开放邮箱,https,还得知一些证书相关的信息,看到有brainfuck.htb和sup3rs3cr3t.brainfuck.htb 直接绑定hosts搞吧 echo " 10.10.10.17 brainfuck.htb " | sudo tee -a /etc/hosts echo "10.10.10.17 sup3rs3cr3t.brainfuck.htb" | sudo tee -a /etc/hosts 访问得到如上信息,发现了一些跟邮件有关的信息,一个邮箱orestis@brainfuck.htb 确认目标是wordpress程序,使用wpscan扫描一把 wpscan --disable-tls-checks --url https://brainfuck.htb -e ap,t,tt,u --api-token pFokhQNG8ZFEmmntdfHfTYnrYdnvJHKtVtDuHTqTqBc 得到一款插件相关的漏洞信息

简单的PHP 8 / PyPy / Node.js JIT性能对比

核能气质少年 提交于 2020-11-29 15:39:18
写在前面:完整的评估性能必须要靠更全面的benchmark,micro-benchmark只能说明一部分问题,一般只能提供某种场景下提升的情况。真实的提升离不开真实场景下对应用的测试。 在知乎上看到一个很有意思的PHP 8 JIT版本的benchmark https://zhuanlan.zhihu.com/p/314783520 ​ zhuanlan.zhihu.com 这个实验通过一个Brainfuck解释器 + Brainfuck代码来测试性能,比较有趣,因为很少有这么测试的。当然,本质上还是micro-benchmark,而且测试的性能很单一,主要就是:单变量++/--,数组读,数组读写。 不过这个文章当中犯了个错误,就是PHP 8虽然已经release了,但是默认并不开启JIT,而且手册很具有误导性,因为手册当中写opcache.jit默认设置为开启,然而还有个opcache.jit_buffer_size也要设置为非0值才可以,更不要说官方镜像默认没有加载opcache.so(what???)所以正确测试的命令行是: php -dzend_extension=opcache.so -dopcache.enable_cli=1 -dopcache.enable=1 -dopcache.jit_buffer_size=100M run.php

Does some Brainfuck compiler/intepreter provide a mean to access an API?

我是研究僧i 提交于 2020-01-25 10:16:07
问题 Again, I stumbled upon a Brainfuck question, and I wondered, do any of its compilers/interpreters provide a way to access some API (the system one, or individual functions from a dll, and so on)? Note: I already asked about APIs provided directly by the compiler/interpreter in this other question. 回答1: As Thomas Jager pointed out , yes, systemf provides access to Linux syscalls. 来源: https://stackoverflow.com/questions/45740929/does-some-brainfuck-compiler-intepreter-provide-a-mean-to-access

Obfuscated code: last digit

我们两清 提交于 2020-01-07 09:46:23
问题 I have a challenge to write obfuscated code in the brainfuck language to do the following: For a given number n output its last digit. input Input will consist of only one line in which there is only one integer n ( 1 < = n < = 2,000,000,000 ) , followed by a newline ' \ n' (ASCII 10). output On the output, has to find exactly one integer denoting the last digit of n. example I input: 32 output: 2 example II: input: 231231132 output: 2 This is what I tried, but it didn't work: +[>,]<.>+++++++

Is there a Brainfuck API?

二次信任 提交于 2019-12-24 10:21:02
问题 So I stumbled upon a Brainfuck question, and I wondered, do any of its compilers/interpreters provide an API? I'll make a separate question about accessing other APIs. 回答1: In pure Brainfuck, there won't be anything, unless you write your own interpreter that uses specific chunks of memory for this. One project that may interest you is ajyoon/systemf, an interpreter where you can make Linux system calls using a special ninth character. EDIT: I ended up answering the wrong question of the

Creating a Brainfuck parser, whats the best method of parsing loop operators?

好久不见. 提交于 2019-12-10 05:23:40
问题 I'm creating a Brainfuck parser (in a BASIC dialect) ultimately to create an interpreter but i've realise it's not as straight forward as i first thought. My problem is that i need a way to accurately parse the matching loop operators within a Brainfuck program. This is an example program: ,>,>++++++++[<------<------>>-] <<[>[>+>+<<-]>>[<<+>>-]<<<-] >>>++++++[<++++++++>-],<.>. '[' = start of loop ']' = end of loop I need to record the start and end point of each matching loop operator so i

Printing a number in brainfuck?

倾然丶 夕夏残阳落幕 提交于 2019-12-09 08:49:18
问题 I've searched for a while, but i couldn't find anything that could help me. Let's say the first cell(or value, etc.) equals 165. How do i print "165"? My idea was to cut the number into seperate pieces: 1,6 and 5. It would than be no problem to print them. Note: I don't just want to print "165". I want to print the value the first cell has. No matter if it's 165, 255, 0, 1 or anything else. 回答1: use a famous modulo procedure ( http://esolangs.org/wiki/brainfuck_algorithms will help you) >++++

Implementing Brainfuck loops in an interpreter

為{幸葍}努か 提交于 2019-12-05 20:22:42
问题 I want to build a Brainfuck (Damn that name) interpreter in my freshly created programming language to prove it's turing-completeness. Now, everything is clear so far ( <>+-,. ) - except one thing: The loops ( [] ). I assume that you know the (extremely hard) BF syntax from here on: How do I implement the BF loops in my interpreter? How could the pseudocode look like? What should I do when the interpreter reaches a loop beginning ( [ ) or a loop end ( ] )? Checking if the loop should continue