Skip to content

Instantly share code, notes, and snippets.

View ilyaluk's full-sized avatar

Ilya Lukyanov ilyaluk

View GitHub Profile
@ilyaluk
ilyaluk / _zn2017_task7.md
Last active November 2, 2017 22:46
ZeroNights 2017 task 7 writeup
  • Есть ссылка на сайт malware.zn.school-ctf.org. Видим там модуль чата, XSS в тексте сообщения.

  • В админке есть несколько чатов, первый из которых датирован сильно раньше начала таски.

  • В этом чате есть ссылка на архив и хост:
diff --git a/sway/ipc-server.c b/sway/ipc-server.c
index dca881f..7db57ad 100644
--- a/sway/ipc-server.c
+++ b/sway/ipc-server.c
@@ -168,6 +168,12 @@ int ipc_handle_connection(int fd, uint32_t mask, void *data) {
close(client_fd);
return 0;
}
+ if ((flags = fcntl(client_fd, F_GETFL)) == -1
+ || fcntl(client_fd, F_SETFL, flags|O_NONBLOCK) == -1) {
#!/usr/bin/python
import socket
import os
i3ipc_magic = b'i3-ipc'
def send_packet(client, type, msg):
pac = i3ipc_magic + len(msg).to_bytes(4, 'little')
pac += type.to_bytes(4, 'little') + msg
client.send(pac)

Keybase proof

I hereby claim:

  • I am ilyaluk on github.
  • I am ilyaluk (https://keybase.io/ilyaluk) on keybase.
  • I have a public key ASBlzTlbbGMN0qysuKZRhVVDyUdIRBUhODfXU5GtmLYsRwo

To claim this, I am signing this object: