You can not select more than 25 topics 
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long. 
		
		
		
		
		
			
	
	
		
			
	
		
			This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
		 
	
		
		
			
				
				
					
						
						
						
							---
 
						
						
						
							layout: post
 
						
						
						
							title: CTF初体验
 
						
						
						
							tags: [CTF, Python]
 
						
						
						
							---
 
						
						
						
							
 
						
						
						
							  我好菜啊<!--more-->    
 
						
						
						
							   
 
						
						
						
							# 开端
  
						
						
						
							, , , ,  
						
						
						
							  以前我倒是对CTF也有些了解, , , ,  
						
						
						
							  不过我曾经也攻击过一些网站,也算有点经验吧,所以觉得问题应该不大。
 
						
						
						
							
 
						
						
						
							# 答题
  
						
						
						
							, , , ,  
						
						
						
							  等到我想答题的时候题目也基本上全部都出来了,我打开网站一看,题的类型挺多的,有涉及密码学、二进制、文件组成、溢出之类乱七八糟的东西。当然我全都不会 ~~(于是就凉了)~~ 。   
 
						
						
						
							  虽然大多数都不会, ,  
						
						
						
							  首先吸引我的是一个叫做Cookie的题, , , , , , , , , , , , , , , , , , , ~~(太菜了)~~    
 
						
						
						
							  之后我换了一道题, , , :  
						
						
						
							```python
  
						
						
						
							from  flask  import  Flask ,  request ,  escape 
 
						
						
						
							import  os 
 
						
						
						
							
 
						
						
						
							app  =  Flask ( "" ) 
 
						
						
						
							
 
						
						
						
							@app.route ( "/" ) 
 
						
						
						
							def  index (): 
 
						
						
						
							    return  get ( "index.html" ) 
 
						
						
						
							
 
						
						
						
							@app.route ( "/<path:path>" ) 
 
						
						
						
							def  get ( path ): 
 
						
						
						
							    print ( "Getting" ,  path ) 
 
						
						
						
							    if  ".."  in  path : 
 
						
						
						
							        return  "" 
 
						
						
						
							
 
						
						
						
							    if  "logs"  in  path  or  ".gti"  in  path : 
 
						
						
						
							        return  "Please do not access the .git-folder" 
 
						
						
						
							
 
						
						
						
							    if  "index"  in  path : 
 
						
						
						
							        path  =  "index.html" 
 
						
						
						
							
 
						
						
						
							    if  os . path . isfile ( path ): 
 
						
						
						
							        return  open ( path ,  "rb" ) . read () 
 
						
						
						
							
 
						
						
						
							    if  os . path . isdir ( path ): 
 
						
						
						
							        return  get ( "folder.html" ) 
 
						
						
						
							
 
						
						
						
							    return  "404 not found" 
 
						
						
						
							
 
						
						
						
							
 
						
						
						
							if  __name__  ==  "__main__" : 
 
						
						
						
							    app . run ( "0.0.0.0" ,  "8000" ) 
 
						
						
						
							``` 
 
						
						
						
							  虽然我Python学的不多, , , , , , , , , , , ,  
						
						
						
							  其他的题受限于水平原因,  
						
						
						
							  
 
						
						
						
							# 结语
  
						
						
						
							, , , , ,  
						
						
						
							  我想了想, , , , , ,  
						
						
						
							  不过我自己连题都做不出来,还想什么出题😂……还是多研究研究吧。   
 
						
						
						
							  另外如果我以后想去试试挑战CTF的话,