Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working verify #29

Closed
hahwul opened this issue Apr 20, 2020 · 5 comments
Closed

Not working verify #29

hahwul opened this issue Apr 20, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@hahwul
Copy link
Owner

hahwul commented Apr 20, 2020

No description provided.

@hahwul hahwul added the bug Something isn't working label Apr 20, 2020
@hahwul
Copy link
Owner Author

hahwul commented Apr 20, 2020

[W] Reflected Payload: cat='><iFrAme/src=jaVascRipt:alert(45) id=dalfox></iFramE>
    48 line:  syntax to use near ''><iFrAme/src=jaVascRipt:alert(45) id=dalfox></iFramE>' at l
 -  http://testphp.vulnweb.com/listproducts.php?cat=%27%3E%3CiFrAme%2Fsrc%3DjaVascRipt%3Aalert%2845%29+id%3Ddalfox%3E%3C%2FiFramE%3E

@hahwul
Copy link
Owner Author

hahwul commented Apr 20, 2020

코드에 io reader closer을 바이트로 변환해서 찍어보니..

[*] Start parameter analysis.. 🔍



◑ Waiting routines..

결국 값이 제대로 들어오지 않아 발생한 문제

@hahwul
Copy link
Owner Author

hahwul commented Apr 20, 2020

bytes, _ := ioutil.ReadAll(resp.Body)
str := string(bytes)

vds := VerifyDOM(resp.Body)

느낌적인 느낌이 resp.Body 즉 웹 요청 이후의 ioReader가 강제로 closing되서 데이터가 없는 것 같음.
만들때도 이 문제 인지했었고, 일부러 defer 뺐었는데..

@hahwul
Copy link
Owner Author

hahwul commented Apr 20, 2020

https://golang.org/pkg/strings/#NewReader 참고

	r := ioutil.NopCloser(strings.NewReader("hello world")) // r type is io.ReadCloser
	
	// example to test r
	buf := new(bytes.Buffer)
	buf.ReadFrom(r)
	r.Close()
	s := buf.String()
	fmt.Println(s)

@hahwul
Copy link
Owner Author

hahwul commented Apr 20, 2020

VerifyDOM의 인자를 string으로 바꾸고, 내부에서 ReadCloser로 바꿈.

 21 func VerifyDOM(s string) bool { //(body io.ReadCloser) bool {
 22
 23         body := ioutil.NopCloser(strings.NewReader(s)) // r type is io.ReadCloser
 24         defer body.Close()

잘됨

[W] Reflected Payload: cat='><iFrAme/src=jaVascRipt:alert(45) class=dalfox></iFramE>
    48 line:  syntax to use near ''><iFrAme/src=jaVascRipt:alert(45) class=dalfox></iFramE>' a
[V] Injected Object from Payload: cat='><iFrAme/src=jaVascRipt:alert(45) class=dalfox></iFramE>

@hahwul hahwul closed this as completed in 05a5d88 Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant