This file contains hidden or 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
| [sshd] | |
| enabled = true | |
| port = 31337 | |
| filter = sshd | |
| logpath = /var/log/auth.log | |
| maxretry = 3 | |
| findtime = 60 | |
| bantime = 1800 |
This file contains hidden or 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
| Host jump | |
| HostName jumphost | |
| User lowpriv | |
| Port 31337 | |
| IdentityFile ~/.ssh/id_ed25519 | |
| Host secret | |
| HostName secretserver | |
| User root | |
| IdentityFile ~/.ssh/id_ed25519 |
This file contains hidden or 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
| Host jump | |
| HostName jumphost | |
| User lowpriv | |
| Port 31337 | |
| IdentityFile ~/.ssh/id_ed25519 | |
| LocalForward 127.0.0.1:8080 myhost.com:80 |
This file contains hidden or 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
| server { | |
| listen 127.0.0.1:8080; | |
| # Update this for your actual webroot | |
| root /var/www/html; | |
| index index.html | |
| server_name _; |
This file contains hidden or 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
| from Crypto.Cipher import ARC4 | |
| import sys | |
| # read in malware | |
| with open(sys.argv[1], "rb") as f: | |
| data = f.read() | |
| # get data | |
| config_block = data[0x51a0:0x5394] | |
| key_len = 32 |
This file contains hidden or 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 python | |
| import sys | |
| def main(argv): | |
| if len(argv) == 1: | |
| print(f"usage: {argv[0]} [path to bin file]") | |
| return 1 | |
| with open(argv[1], "rb") as f: |
This file contains hidden or 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
| let EventData = Event | |
| | where Source == "Microsoft-Windows-PowerShell" | |
| | extend RenderedDescription = tostring(split(RenderedDescription, ":")[0]) | |
| | project TimeGenerated, | |
| Source, | |
| EventID, | |
| Computer, | |
| UserName, | |
| EventData, | |
| RenderedDescription |
This file contains hidden or 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 | |
| import requests | |
| import sys | |
| # use an account with bit 1<<2 set (put 7 for ultimate laziness) | |
| BASE_URL = "https://damctf.xyz" | |
| TEAM_TOKEN = "redacted" # the thing from the url on the team profile page |
This file contains hidden or 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
| # https://github.com/miekg/dns/blob/master/types.go#L27 | |
| with open("in", "r") as f: | |
| lines = [x.strip() for x in f.readlines()] | |
| for l in lines: | |
| parts = l.split("uint16 = ") | |
| type = parts[0].strip()[4:] | |
| val = parts[1] |
This file contains hidden or 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
| rule Methodology_ScriptObf_ReplaceEmpty { | |
| meta: | |
| author = "Zander Work (@captainGeech42)" | |
| descr = "Detects the use of string.Replace() or similar, where the replacement string is an empty string. This is a common technique for basic script obfuscation." | |
| strings: | |
| // doesn't hit on the search string being passed in as a variable FYSA | |
| $re1 = /replace\(["'].*["'], ["']["']\)/ nocase // catches basic usage in at least python and powershell | |
| $re2 = /replace\(["'].*["'], ["']["'], \d+\)/ // python str.replace has an optional third argument, a number. this only catches a decimal number fysa | |
| $re3 = /replace\(\/.*\/\w*, ["']["']\)/ // javascript String.prototype.replace can take a regex pattern for the first argument | |
| $re4 = /replace\(\w+, ["'].*["'], ["']["']/ nocase // vbscript replace takes at least 3 arguments: var to replace in, search string, replacement string. there are three more optional args |