pass

西普 部分WEB Writeup

你。 提交于 2019-12-04 15:56:15
WEB 拐弯抹角 打开一堆代码和注释 ` <?php // code by SEC@USTC echo '<html><head><meta http-equiv="charset" content="gbk"></head><body>' ; $URL = $_SERVER [ 'REQUEST_URI' ]; //echo 'URL: '.$URL.'<br/>'; $flag = "CTF{???}" ; $code = str_replace( $flag , 'CTF{???}' , file_get_contents( './index.php' )); $stop = 0 ; //这道题目本身也有教学的目的 //第一,我们可以构造 /indirection/a/../ /indirection/./ 等等这一类的 //所以,第一个要求就是不得出现 ./ if ( $flag && strpos( $URL , './' ) !== FALSE ){ $flag = "" ; $stop = 1 ; //Pass } //第二,我们可以构造 \ 来代替被过滤的 / //所以,第二个要求就是不得出现 ../ if ( $flag && strpos( $URL , '\\' ) !== FALSE ){ $flag = "" ; $stop = 2 ; //Pass }

浪尽此生 提交于 2019-12-04 15:37:50
包 一、什么是包? 包是模块的一种形式,包的本质就是一个含有 .py 的文件的文件夹。 二、为什么要有包? 模块的第一个版本只有10个功能,但是未来在扩展版本的时候,模块名和用法应该最好不要去修改,但是这只是对使用者友好,而由于版本扩展,文件越来越大,模块设计者对模块的管理、维护会越来越复杂,因此我们可以使用包来扩展模块的功能。 三、如何用包? 3.1 模块和包 导入模块发生的三件事: 创建一个包的名称空间 执行py文件,将执行过程中产生的名字存放于名称空间中。 在当前执行文件中拿到一个名字aaa,aaa是指向包的名称空间的 导入包发生的三件事: 创建一个包的名称空间 由于包是一个文件夹,无法执行包,因此执行包下的.py文件,将执行过程中产生的名字存放于包名称空间中(即包名称空间中存放的名字都是来自于.py) 在当前执行文件中拿到一个名字aaa,aaa是指向包的名称空间的 导入包就是在导入包下的.py,并且可以使用以下两种方式导入: import ... from ... import... 3.2 扩展模块功能 如下我们如果需要扩展aaa.py模块,需要建立一个aaa的目录文件,并且删除aaa.py文件,将aaa.py修改成m1.py和m2.py两个文件,让模块的功能使用方法不改变。 # aaa.py def func1(): pass def func2(): pass def

isinstance和issubclass

大城市里の小女人 提交于 2019-12-04 08:49:05
isinstance和issubclass 一、isinstance与type 在游戏项目中,我们会在每个接口验证客户端传过来的参数类型,如果验证不通过,返回给客户端“参数错误”错误码。 这样做不但便于调试,而且增加健壮性。因为客户端是可以作弊的,不要轻易相信客户端传过来的参数。验证类型用type函数,非常好用,比如 print(type('foo') == str) True print(type(2.3) in (int, float)) True 既然有了type()来判断类型,为什么还有isinstance()呢?一个明显的区别是在判断子类。type()不会认为子类是一种父类类型;isinstance()会认为子类是一种父类类型。千言不如一码。 class Foo(object): pass class Bar(Foo): pass print(type(Foo()) == Foo) True print(type(Bar()) == Foo) False # isinstance参数为对象和类 print(isinstance(Bar(),Foo)) True 需要注意的是,旧式类跟新式类的type()结果是不一样的。旧式类都是<type 'instance'>。 # python2.+ class A: pass class B: pass class C(object

策略模式概述

前提是你 提交于 2019-12-04 04:54:35
策略模式 优点以及定义 策略模式是一种从算法的角度上考虑问题的方式,所有需要算法解决的问题,都可以采用策略模式的角度,降低算法与算法之间的偶尔度 偶尔度说白了就是一个方法对于一个方法的依赖性,就是删除一个方法尽可能少的影响其他的方法 使用 其实我们在开发的过程中,都使用过策略模式,只是我们本身没有去注意摆了 举例说明使用 现在我们要做一个表单验证 正常新情况下 $('#btn_send').click(function(){ var username=$('#username').val(); var qq=$('#qq').val(); var pass=$('#new_password').val(); var newpass=$('#password').val(); var emil=$('#emil').val(); var tel=$('#tel').val(); if(username<4){ layer.msg('用户名不正确',{time:1500}); return false; } if(newpass<4){ layer.msg('密码格式不正确',{time:1500}); return false; } if(newpass!=pass){ layer.msg('两次密码不一致',{time:1500}); return false; } if(qq<6

Hydra暴力破解工具

跟風遠走 提交于 2019-12-03 15:15:35
hydra [[[-l LOGIN|-L FILE] [-p PASS|-P FILE]] | [-C FILE]] [-e nsr] [-o FILE] [-t TASKS] [-M FILE [-T TASKS]] [-w TIME] [-W TIME] [-f] [-s PORT] [-x MIN:MAX:CHARSET] [-SuvV46] [service://server[:PORT][/OPT]]   参数解释如下。 -R 继续从上一次进度接着破解 -S 采用SSL连接 -s <port> 可通过这个参数指定非默认端口 -l <LOGIN> 指定特定的用户名进行爆破 -L <FILE> 指定用户名字典 -p <PASS> 指定特定的密码进行爆破 -P <FILE> 指定密码字典 -e <ns> n:空密码试探;s:使用指定的用户名和密码试探 -C <FILE> 使用冒号分割格式,如"admin:123456"来代替-L/-P -M <FILE> 指定目标列表一行一条 -o <FILE> 指定结果输出文件 -f 在使用-M参数以后,找到第一对登录名或者密码的时候中止破解。 -t <TASKS> 设置线程数,默认是16个线程。 -w <TIMME> 设置最大超时时间,单位为秒,默认是30s。 -v/-V 显示详细过程 Server 目标IP Servicee 指定服务名

How to pass a parameter through another bean&#039;s object inside a method called from &lt;f:event listener=“…”&gt;

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How to pass a parameter through another bean's object inside a method called from <f:event listener="..."> ? I am trying to pass a parameter generated by another bean inside a showData() method that is to be called on using <f:event listener="#{myTransformerBeans.showData}"> The parameter would be #{myDataBean.myId} . 回答1: you could also try <f:event listener="#{myTransformerBeans.showData(myDataBean.myId)}"> 文章来源: How to pass a parameter through another bean's object inside a method called from

How to pass parameter to f:ajax in h:inputText? f:param does not work

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need to pass a parameter to the server in my ajax request. Please see the code below. Scope: View Scope Without f:param Managed Bean public final void onCostoBrutoChange(final AjaxBehaviorEvent event) { createCostoBrutoOptions(promoArticlesList); } In this case, the method onCostoBrutoChange() does gets invoked. But, it does not get invoked when I include f:param. Please see the code below. With f:param Managed Bean public final void onCostoBrutoChange(final AjaxBehaviorEvent event) { createCostoBrutoOptions(promoArticlesList); String id =

How to pass a Custom data object within a intent

匿名 (未验证) 提交于 2019-12-03 10:10:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need to pass my data object within the intent so that called activity can use that. But finding no method to add those to the intent. Can any one please put light in this Thanks 回答1: You will need to make your data object parcelable and send it within the intent. Check the link below. Hope it will help you :) http://prasanta-paul.blogspot.com/2010/06/android-parcelable-example.html 回答2: You can attach data to an intent using putExtras String dataToPass = "The next activity needs this sentence."; ... Intent intent = new Intent(this,

基本指令

不羁的心 提交于 2019-12-03 10:01:57
class int(object): """ int(x=0) -> int or long int(x, base=10) -> int or long Convert a number or string to an integer, or return 0 if no arguments are given. If x is floating point, the conversion truncates towards zero. If x is outside the integer range, the function returns a long instead. If x is not a number or if base is given, then x must be a string or Unicode object representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the

Pass a .js file to mongo db.eval()

匿名 (未验证) 提交于 2019-12-03 09:21:58
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am trying to get variety working with db.eval() instead of commandline --eval . This is because I get some problems with authentication. The normal use is from the commandline: $ mongo test -- eval "var collection = 'users', maxDepth = 3" / path / to / variety . js What I am trying to do is this: $ mongo >> use admin >> db . auth ( "foo" , "bar" ) >> use anotherColl >> db . eval ( "/path/to/variety.js" , "var collection = 'users', maxDepth = 3" ) >> Thu Mar 7 13 : 19 : 10 uncaught exception : { "errmsg" : "compile failed: JS