-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser-data
163 lines (139 loc) · 3.62 KB
/
user-data
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#cloud-config
hostname: ctf
prefer_fqdn_over_hostname: false
user:
name: alex
ssh_authorized_keys:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH8i1tyqtQX+8Klc18XHUUO+PFVI/FsjbGbfcbQfWOXj alex@bread
lock_passwd: false
groups: docker, wheel
package_update: true
package_upgrade: true
package_reboot_if_required: true
packages:
- adobe-source-code-pro-fonts
- bsdtar
- cargo
- curl
- elfutils
- eza
- file
- gdb
- gdb-gdbserver
- gdm
- git
- gnome-shell
- java-17-openjdk-devel
- jq
- moby-engine
- netcat
- openssh-clients
- openssl-devel
- patchelf
- pkgconf-pkg-config
- podman
- python3-pip
- python3-pwntools
- rubygems
- spice-vdagent
- tmux
- vim
- wget
- xz-devel
write_files:
- path: /etc/pwn.conf
content: |
[update]
interval=never
[context]
terminal = ["tmux", "new-window", "-t", "pwntools"]
- path: /usr/local/bin/term
permissions: '0755'
content: |
#!/bin/sh
exec tmux new -s pwntools
- path: /etc/tmux.conf
content: |
set -g mouse on
- path: /etc/gdbinit
content: |
source /usr/local/lib/gef.py
- path: /usr/local/share/pwninit-template.py
content: |
#!/usr/bin/env python3
from pwn import *
{bindings}
context.binary = {bin_name}
if args.REMOTE:
r = remote("addr", 1337)
else:
r = process({proc_args})
if args.GDB:
gdb.attach(r)
r.interactive()
- path: /etc/profile.d/pwninit-template.sh
content: |
alias pwninit='pwninit --template-path /usr/local/share/pwninit-template.py'
- path: /etc/gdm/custom.conf
content: |
[daemon]
AutomaticLoginEnable=True
AutomaticLogin=alex
[security]
[xdmcp]
[chooser]
[debug]
- path: /home/alex/.vimrc
owner: alex:alex
content: |
call plug#begin()
Plug 'jiangmiao/auto-pairs'
Plug 'tpope/vim-surround'
Plug 'sheerun/vim-polyglot'
call plug#end()
set number
set ignorecase smartcase
set nohlsearch
set linebreak
set splitright splitbelow
set mouse=a
nnoremap Y y$
let g:AutoPairsShortcutToggle = '<C-p>'
let g:AutoPairsShortcutJump = '<C-n>'
let g:AutoPairsShortcutFastWrap = '<C-9>'
let g:AutoPairsShortcutBackInsert = '<C-b>'
defer: true
runcmd:
- passwd -d alex
- |
curl -fLo /usr/share/vim/vimfiles/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
- |
set -e
export CARGO_INSTALL_ROOT='/usr/local'
cargo install pwninit
cargo install xgadget --features cli-bin
- curl -fsSLo /usr/local/lib/gef.py 'https://github.com/hugsy/gef/raw/main/gef.py'
- |
set -e
ghidra_file="$(mktemp)"
readonly ghidra_file
trap 'rm -f -- "${ghidra_file}"' EXIT
ghidra_url="$(
curl -fsSL \
-H 'Accept: application/vnd.github+json' \
-H 'X-GitHub-Api-Version: 2022-11-28' \
'https://api.github.com/repos/NationalSecurityAgency/ghidra/releases/latest' |
jq -r '.assets | .[] | first(select(.name | test("ghidra_\\d+\\.\\d+(\\.\\d+)?_PUBLIC_\\d{8}\\.zip"))).browser_download_url'
)"
readonly ghidra_url
curl -fsSLo "${ghidra_file}" -- "${ghidra_url}"
rm -rf /opt/ghidra
mkdir /opt/ghidra
bsdtar -xf "${ghidra_file}" -C /opt/ghidra --strip-components 1 --preserve-permissions
rm -- "${ghidra_file}"
ln -sf /opt/ghidra/ghidraRun /usr/local/bin/ghidra
- gem install one_gadget
- systemctl set-default graphical.target
power_state:
mode: poweroff