DINGA DINGA
article thumbnail
[LOS] succubus
WEB/LOS 2021. 8. 12. 22:55

id와 pw에 각각 필터링이 걸려 있다. id='\' and pw='or 1=1 #' 처럼 쿼리를 만들면 항상 참인 쿼리가 되므로, id에는 \를, pw에는 or 1=1 #을 넣어주었다. Clear!

article thumbnail
[Natas] Level 24 → Level 25
WEB/Natas 2021. 8. 12. 22:43

http://natas25.natas.labs.overthewire.org/index.php natas25/GHF6X7YwACaYYssHVY05cFq83hRktl4c로 로그인 긴 인용문이 있고, 언어를 선택할 수 있게 되어있다. 소스코드를 살펴보았다. natas25 language View sourcecode setLanguage() 함수로 lang 매개변수를 통해 사용자 입력을 받고 있다. safeinclude() 함수는 filename에서 ../를 제거하며, strstr() 함수를 통해 filename에 natas_webpass가 포함되어 있으면 종료한다. logRequest() 함수를 통해 session_id 로그 파일을 열게 되는데, 이 부분으로 패스워드를 알아낼 수 있다. f12를 눌러 PHPS..

article thumbnail
[HackerRank] Cycle Detection
C & C++/HackerRank 2021. 8. 4. 17:24

https://www.hackerrank.com/challenges/detect-whether-a-linked-list-contains-a-cycle/problem Cycle Detection | HackerRank Given a pointer to the head of a linked list, determine whether the linked list loops back onto itself www.hackerrank.com Data Structures > Linked Lists 연결 리스트의 head가 주어지면 해당 리스트가 순환 되는지 체크한다. 코드 bool has_cycle(SinglyLinkedListNode* head) { SinglyLinkedListNode* first = head, ..

article thumbnail
[HackerRank] Print the Elements of a Linked List
C & C++/HackerRank 2021. 8. 4. 16:25

https://www.hackerrank.com/challenges/print-the-elements-of-a-linked-list/problem Print the Elements of a Linked List | HackerRank Get started with Linked Lists! www.hackerrank.com Data Structures > Linked Lists 연결 리스트가 주어지면 각 데이터를 출력한다. 코드 void printLinkedList(SinglyLinkedListNode* head) { if (!head) return; printf("%d\n", head->data); printLinkedList(head->next); } 설명 재귀를 이용했다. 처음에 head가 NULL인..

728x90