mirror of
https://github.com/autistic-symposium/sec-pentesting-toolkit.git
synced 2025-05-19 15:10:24 -04:00
some small fixes
This commit is contained in:
parent
a50737bc6b
commit
52067188ed
11 changed files with 65 additions and 0 deletions
14
Useful_Scripts/bits_to_char.py
Normal file
14
Useful_Scripts/bits_to_char.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
# read data
|
||||
data = []
|
||||
with open('hidden-message.pcap', 'rb') as f:
|
||||
data = f.read()
|
||||
|
||||
# get bits
|
||||
bits = ''
|
||||
for i in xrange(75, len(data), 81):
|
||||
bits += '0' if data[i:i+1]=='I' else '1'
|
||||
# convert to chars
|
||||
flag = ''
|
||||
for i in xrange(0, len(bits), 8):
|
||||
flag += chr(int(bits[i:i+8], 2))
|
||||
print flag
|
2
Useful_Scripts/bytes_to_char.py
Normal file
2
Useful_Scripts/bytes_to_char.py
Normal file
|
@ -0,0 +1,2 @@
|
|||
print ''.join(map(chr, [0x20, 0x64, 0x65, 0x36, 0x38, 0x33, 0x38, 0x32, 0x35, 0x32, 0x66, 0x39, 0x35, 0x64, 0x33, 0x62, 0x39, 0x65, 0x38, 0x30, 0x33, 0x62, 0x32, 0x38, 0x64, 0x66, 0x33, 0x33, 0x62, 0x34, 0x62, 0x61, 0x61, 0x00]))
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
|
||||
__author__ = "bt3gl"
|
||||
|
||||
|
||||
def xor_str(str1, str2):
|
||||
flag = ""
|
||||
for i in range(len(str1)):
|
||||
flag += (chr(int(str1[i], 16) ^ int(str2[i], 16)))
|
||||
print flag
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
kTXt = ''.join('28 36 38 2C 10 03 04 14 0A 15 08 14 02 07 08 18 0D 00 61 04 16 11 0B 12 00 07 61 03 0C 73 02 1F 02 1D 06 12 63 04 08 03 0B 1C 14 03 63 1D 0E 03 0A 10 04 2A 61 8F AC C1 00 00 00 00').split()
|
||||
xORk = ''.join('43 53 41 57 43 53 41 57 43 53 41 57 43 53 41 57 43 53 41 57 43 53 41 57 43 53 41 57 43 53 41 57 43 53 41 57 43 53 41 57 43 53 41 57 43 53 41 57 43 53 41 57 43 53 41 57 43 53 41 57').split()
|
||||
|
||||
xor_str(kTXt, xORk)
|
|
@ -1,25 +0,0 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
file, err := os.Open("ataylor.png")
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
info, _ := os.Stat("ataylor.png")
|
||||
input := make([]byte, info.Size())
|
||||
out := make([]byte, len(input))
|
||||
file.Read(input)
|
||||
|
||||
key := [...]byte{0x43, 0x53, 0x41, 0x57} // CSAW
|
||||
for i := 0; i < len(input); i++ {
|
||||
out[i] = input[i] ^ key[i%len(key)]
|
||||
}
|
||||
|
||||
fmt.Println(string(out))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue