escapingbug / ancypwn Goto Github PK
View Code? Open in Web Editor NEWScript to setup pwn environment for CTF with Docker
License: MIT License
Script to setup pwn environment for CTF with Docker
License: MIT License
测了下wsl2 backend。。。
文件夹共享那里感觉有点迷。。默认配置的"/mnt/c/"被格式化之后路径显然是"/mnt//c/........"多了个杠2333
把杠去掉后,路径不报错但是好像并不能共享。。。
试了下转换成类似于"c:/a/b/c"这样就可以共享了,所以这么改了下:
def _win_dir_to_wsl(directory, config):
directory = os.path.realpath(os.path.expanduser(directory))
directory = directory.replace(":\\", ':/')
directory = directory.replace('\\', '/')
return directory
还有就是弹alacritty的时候,实际执行的命令类似于:
C:\Users\lomet> alacritty -e powershell -NoExit -Command "ancypwn attach -c "/usr/
bin/gdb -q "./books" 69 -x "/tmp/pwnaODROv.gdb"""
就是说command莫名其妙截断了。。弹出来的窗口
Usage: ancypwn attach [OPTIONS]
Try 'ancypwn attach --help' for help.
Error: no such option: -q
然后我这样改了下就可以了。。
command = 'ancypwn attach -c \'{}\''.format(content['exec']) # 把双引号改成单引号了
或者是alacritty那个脚本要改下
context.terminal = ['notiiterm', '-t', 'iterm', '-p', '50806', '-e'] # use 50806 port as an example
Current implementation of the server will be shutdown when terminal is closed.
A better solution to solve x11 display problem on *nix system. We can just use terminal outside of docker, then get into docker and attach to started process. All we need is information about such a process outside of docker. This can be done by port mapping with a server/client model to pass message.
With this, all display problem will be solved. But this can only be used for pwntools' gdb.attach
like function, all others are not considered.
$ sudo ancypwn run .
sh: xhost: command not found
This maybe caused by not completely installed ancypwn.
Have you read https://github.com/Escapingbug/ancypwn?
Traceback (most recent call last):
File "/usr/local/bin/ancypwn", line 11, in <module>
load_entry_point('ancypwn==0.2.5', 'console_scripts', 'ancypwn')()
File "/Users/danielsmith/Library/Python/2.7/lib/python/site-packages/ancypwn.py", line 272, in main
parse_args()
File "/Users/danielsmith/Library/Python/2.7/lib/python/site-packages/ancypwn.py", line 110, in parse_args
args.func(args)
File "/Users/danielsmith/Library/Python/2.7/lib/python/site-packages/ancypwn.py", line 234, in run_pwn
raise e
KeyError: 'DISPLAY'
$ export DISPLAY=0
$ sudo ancypwn run .
sh: xhost: command not found
Warning: Unable to get terminal size, you need to specify terminal size manually or your command line may behave strangely
________ ________ ________ ___ ___ ________ ___ __ ________
|\ __ \ |\ ___ \ |\ ____\ |\ \ / /||\ __ \ |\ \ |\ \ |\ ___ \
\ \ \|\ \ \ \ \\ \ \ \ \ \___| \ \ \/ / /\ \ \|\ \ \ \ \ \ \ \ \ \ \\ \ \
\ \ __ \ \ \ \\ \ \ \ \ \ \ \ / / \ \ ____\ \ \ \ __\ \ \ \ \ \\ \ \
\ \ \ \ \ \ \ \\ \ \ \ \ \____ \/ / / \ \ \___| \ \ \|\__\_\ \ \ \ \\ \ \
\ \__\ \__\ \ \__\\ \__\ \ \_______\ __/ / / \ \__\ \ \____________\ \ \__\\ \__\
\|__|\|__| \|__| \|__| \|_______||\___/ / \|__| \|____________| \|__| \|__|
\|___|/
root@linuxkit-025000000001:/pwn#
the master branch is always faild to build directly in aliyun but outside term branch can. I'm confused about this, why?
end
ancypwn
running with full terminal supportxhost +
currently allows any clients to connect)我遇到了新的问题,也是无法弹出新的Term。
新的终端窗口未弹出。
顺便一提,在安装ancypwn-terminal-iterm2之后,其依赖包osascript不会被安装,需要手动安装才可以顺利运行test_run()函数并弹出新的终端窗口。
我无法确定本地的守护进程是否已被启动,在docker容器测试使用socket链接是可以成功发送数据的。
Originally posted by @hebtuerror404 in #9 (comment)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.