| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
Tags
- 쿠키변조
- 안드로이드 모의해킹
- 모의해킹
- Bandit
- error-based
- 취약점 진단
- sql injection
- Linux
- pentest
- androGoat
- msfconsole #heartbleed #247ctf #misc #webhacking
- 리눅스
- time-based
- androidhacking
- 밴딧
- bandit #밴딧 #웹해킹 #해킹 #화이트해커 #공부 #스터디 #IT #hacking #linux #openssl #nmap
Archives
- Today
- Total
d0r1
[dreamhack] SingleByteXor 본문

문제 이름이 힌트였다.
54 58 ~~
--> hex 값이므로, 이를 변환
[84, 88, 107, 100, 88, 117, 79, 123, 33, 92, 124, 117, 66, 79, 33, 99, 79, 116, 66, 117, 81, 125, 109]
xor의 경우,
0 ^ 0 = 0
0 ^ 1 = 1
1 ^ 0 = 1
1 ^ 1 = 0
즉, 두 값이 서로 다르면 참이 출력된다
이는 실제로 코드에서 a ^ b 로 표현이 가능하다.
또한, FF 까지 값이 있음을 확인하였으니, 1111 1111 --> 256 까지의 케이스가 있음을 짐작할 수 있다.
즉, 0 ~ 256 까지 직접 다 대입하면서 풀어보면 나온다는 얘기
test = "54586b6458754f7b215c7c75424f21634f744275517d6d"
length = int(len(test)/2)
print(length)
temp = []
for i in range(0, length):
temp.append(int(test[i*2:i*2+2], 16)) # 16진수 문자열을 정수로 변환하여 리스트에 추가
print(temp)
for i in range(0, 257):
print(f"[+] key : {i}")
for j in range(0, len(temp)):
result = i^temp[j] # XOR 연산 수행
print(chr(result), end="")
print("\n")'dreamhack > crypto' 카테고리의 다른 글
| [dreamhack] darimchal_001 (0) | 2023.08.23 |
|---|