Fixed it bcz of https://tryhackme.com/room/easyctf :) enjoy
수정되었습니다. https://tryhackme.com/room/easyctf 덕분입니다 :) 즐기세요.
Critical Issues Fixed
주요 수정 사항
- Python 2 to Python 3 Compatibility
- Python 2에서 Python 3 호환성
- Old: print "string"
- New: print("string")
- Changed all print statements to print() functions
- Updated string formatting to use f-strings
- 기존: print "string"
- 변경: print("string")
- 모든 print 문을 print() 함수로 변경
- 문자열 포맷팅을 f-strings로 업데이트
- Deprecated optparse Library
- Deprecated된 optparse 라이브러리
- Old: import optparse
- New: import argparse
- Replaced entire option parsing system with modern argparse
- Added proper help text and default values
- 기존: import optparse
- 변경: import argparse
- 전체 옵션 파싱 시스템을 최신 argparse로 대체
- 적절한 도움말 텍스트와 기본값 추가
- String Formatting Issues
- 문자열 포맷팅 문제
- Old: String concatenation and old % formatting
- New: f-strings throughout (f"string {variable}")
- More readable and efficient
- 기존: 문자열 연결 및 기존 % 포맷팅
- 변경: 전체적으로 f-strings 사용 (f"string {variable}")
- 더 읽기 쉽고 효율적
- Infinite Loop Risk
- 무한 루프 위험
- Old: Global flag variable could cause infinite loops
- New: Loop breaks when no character match found
- Better control flow logic
- 기존: 전역 플래그 변수로 인해 무한 루프 발생 가능
- 변경: 문자 일치가 없으면 루프 중단
- 향상된 제어 흐름 로직
- Error Handling
- 오류 처리
-
Old: No error handling for network requests or file operations
-
New: Added try-except blocks for:
requests.exceptions.RequestException
FileNotFoundError
KeyboardInterrupt
General exceptions
-
기존: 네트워크 요청 또는 파일 작업에 대한 오류 처리 없음
-
변경: try-except 블록 추가:
requests.exceptions.RequestException
FileNotFoundError
KeyboardInterrupt
일반 예외
- Code Organization
- 코드 구성
-
Old: Procedural script with global variables
-
New: Object-oriented approach with CMSMSExploit class
Better encapsulation
Easier to maintain and debug
Reusable components
-
기존: 전역 변수를 사용한 절차적 스크립트
-
변경: CMSMSExploit 클래스를 사용한 객체 지향 접근 방식
더 나은 캡슐화
유지보수 및 디버깅 용이
재사용 가능한 구성 요소
- Hex Conversion
- 16진수 변환
- Old: hex(ord(char))[2:] - prone to encoding issues
- New: format(ord(char), 'x') - cleaner and more reliable
- 기존: hex(ord(char))[2:] - 인코딩 문제 발생 가능
- 변경: format(ord(char), 'x') - 더 깔끔하고 신뢰성 높음
- Additional Improvements
- 추가 개선 사항
- Added --time parameter for configurable delays (default: 1 second)
- Better terminal output with clear screen function
- Progress feedback every 100 words during cracking
- Proper timeout for HTTP requests (10 seconds)
- UTF-8 encoding support for wordlist reading
- Better help/usage information
- 구성 가능한 지연 시간을 위한 --time 매개변수 추가 (기본값: 1초)
- 화면 지우기 함수로 향상된 터미널 출력
- 크래킹 중 100단어마다 진행 피드백
- HTTP 요청에 적절한 타임아웃 (10초)
- 단어 목록 읽기를 위한 UTF-8 인코딩 지원
- 향상된 도움말/사용법 정보