분류 전체보기
-
Webhacking.kr / old-21Web/webhacking.kr 2024. 8. 30. 10:59
문제Blind SQL Injection 문제이다풀이흔히 문제에서 많이 사용하는 guest / guest를 입력해보자login success 하지만 우리는 admin의 계정을 탈취하는 것을 목적으로 수행한다 결과값이 다른 것을 확인할 수 있다 즉 admin / 'or =1=1#을 넣었을 경우 DB에서 결과값을 돌려주지만 php 코드에서 결과값을 한번 더 확인 한 뒤 사용자에게 보여주는 것 같다wrong password = DB내 존재login fail = DB 내 존재 X 이를 이용하여 Blind SQL Injection 수행 BLIND SQLI1. admin password 길이 확인2. bit masking or lpad & bin & ord 를 활용해서 비밀번호 확인3. 입력 더보기?id=admin&..
-
Webhacking.kr / old-10Web/webhacking.kr 2024. 8. 30. 09:23
문제 설명소스코드를 확인해 보자O||||Goal 태그에 onclick 이벤트가 있고 if 문으로 리다이렉션 시키는 것을 확인할 수 있다. 즉 id=hackme a태그를 이용하여 O 문구를 1600px로 이동시키면 성공 정답더보기1. 개발자도구 -> style에 left를 1599로 변경 후 클릭2. onclick에 this.style.left=parseInt(this.style.left,10) => this.style.left=parseInt(this.style.left,1600) 수정 후 클릭
-
Webhacking.kr / old-26Web/webhacking.kr 2024. 8. 23. 11:20
문제확인 사항1. preg_match로 admin을 필터링2. urldecode 수행 후 비교 진행 사항입력 값 -> url 인코딩 -> url 디코딩 -> server $_GET['id'] -> preg_match 비교 -> url decode -> 비교 따라서 2번의 url 인코딩이 필요하다 기본적으로 'admin'을 아스키코드로 인코딩을 하면 %61%64%6D%69%6E => admin 으로 server에 전송$_GET['id']를 통해 1차 디코딩 => admin으로 들어감 => preg match에 걸림 => 실패 %2561%2564%256D%2569%256E => 1차 decode => %61%64%6D%69%6E => preg match 걸리지 않음=> 2차 decode => admin ..
-
Webhacking.kr / old-27Web/webhacking.kr 2024. 8. 22. 12:38
문제간단한 sql injection 문제이다 소스코드를 확인해보자 해당 부분에 중요한 부분은 다음과 같다 if(preg_match("/#|select|\(| |limit|=|0x/i",$_GET['no'])) exit("no hack"); $r=mysqli_fetch_array(mysqli_query($db,"select id from chall27 where id='guest' and no=({$_GET['no']})")) or die("query error"); 필터링을 우회하여 id=admin의 결과를 불러오면 된다. 힌트더보기공백 우회: %09 / %0a / %0b / %0c ...주석 처리 : # / -- / ;%00 / 정답더보기0)%09or%09id%09like%09%27admin..
-
PAM (Pluggable Authentication Modules)System 2024. 8. 19. 15:08
리눅스 시스템에서 사용하는 ‘인증 모듈(Pluggable Authentication Modules)’로써 응용 프로그램(서비스)에 대한 사용자의 사용 권한을 제어하는 모듈이다.응용프로그램 자체적으로 사용자 인증하는 과정User → su root → su 명령어 파일su 명령어 파일 → root 정보 확인 → passwd 파일passwd파일 → 정보 확인 결과 반환 → su 명령어 파일su 명령어 파일 → su 명령어 결과 반환 → UserPAM 모듈을 통한 사용자 인증 과정User → su root → su 명령어 파일su 명령어 파일 → root 정보 확인 → PAM 모듈PAM 모듈 → 정보 확인 결과 반환 → su 명령어 파일su 명령어 파일 → su 명령어 결과 반환 → User응용프로그램이 자체적..
-
/etc/passwd & /etc/shadowSystem 2024. 8. 19. 14:19
/etc/passwd사용자 계정 정보를 관리하는 파일UNIX / LINUX 사용자 관리시스템을 이용하는 사용자 계정과 인증을 관리passwd 파일에 사용자 계정 비밀번호를 저장shadow 패스워드 정책shadow 파일에 암호화 하여 비밀번호를 저장 후 root 계정만 접근 가능일반 패스워드 정책passwd 파일 구조[user_account] : [user_password] : [user_ID] : [group_ID] : [comment] : [home_directory] : [login_shell]user_account사용자 계정명, root 계정은 시스템에 대한 총괄 권한을 가지고 있는 계정으로 공격자의 목표가 될 수 있으므로 원격 접속을 금지하는 것이 보안상 안전하다.일반적으로 root 계정으로 su..