跳转至

2015

sql注入初步

自已用php+mysql写了一个登录页面。其中包含多个sql注入漏洞,在mysql中创建一个表,其中有username password email一个列,添加三个数据

+-------------+-------------+-----------------+ | username | password | email | +-------------+-------------+-----------------+ | admin | admin | admin@admin.com | | yangyanxing | yangyanxing | yyx@yyx.com | +-------------+-------------+-----------------+

在phpmyadmin中使用一条sql命令

SELECT * FROM admin WHERE 1

where 1 是一个永真,这样它会把admin表中的所有数据返回

写一个testsql.php文件来尝试使用sql注入的方式登录这个系统

Android中的UI线程阻塞

当一个应用程序启动之后,android系统会为这个应用程序创建一个主线程,这个线程非常重要,它负责渲染视图,分发事件到响应监听器并执行,对界面进行轮询的监听,一般叫做“UI主线程”

Android系统不会给应用程序的多个元素组件建立多个线程来执行,一个视图(activity)中的多个view组件运行在同一个UI线程当中,因此,多个view组件的监听器的执行可能会相互影响。

如有以下两个button,其中一个在会在主view中进行移动动画,另外一个button在点击以后将线程sleep 5秒

Android开发初步

绑定单击事件有两种方法,一种是通过绑定android:onClick属性,一种是绑定一个setOnClickListener回调函数

通过绑定onClick属性

在activity_main.xml对应的组件上设置android:onClick="test" 属性,然后再Java文件里定义一个test方法来实现,这个test方法是MainActivity类的一个方法

1
2
3
public void test(View view){
        Toast.makeText(MainActivity.this, "你还真敢点啊!", Toast.LENGTH_LONG).show();
    }

这里的view就是要使用的控件,如果是绑定的是个button,那么view就是这个button

没事别蹭wifi-告诉你公共的wifi有多不安全

经常看到一些朋友每到一个地方就先找wifi,没有密码就直接上了!汗……

今天通过两个小工具来显示一下公共wifi的安全隐患(爱蹭网的代价)

工具:wireshark与cain

下载:wireshark

https://www.wireshark.org/download.html Cain & Abel http://www.oxid.it/cain.html (被墙) 百度网盘链接:http://pan.baidu.com/s/18kshg 密码:9owu

md5:EA2EF30C99ECECB1EDA9AA128631FF31 sha1:82407EAF6437D6956F63E85B28C0EC6CA58D298A

如果没有校验工具,我写了一个python脚本来校验 链接:http://pan.baidu.com/s/1i3j93sp 密码:h6gz

appium简明教程(转)

乙醇的自动化教程写的挺好的,以下是转自他的cnblogs上面的博客

appium简明教程(1)——appium和它的哲学世界

什么是appium?

下面这段介绍来自于appium的官网。

Appium is an open-source tool you can use to automate mobile native, mobile web, and mobile hybrid applications on iOS and Android platforms. “Mobile native apps” are those written using the iOS or Android SDKs. “Mobile web apps” are web apps accessed using a mobile browser (Appium supports Safari on iOS and Chrome on Android). “Mobile hybrid apps” have a native wrapper around a “webview” – a native control that enables interaction with web content. Projects like Phonegap, for example, make it easy to build apps using web technologies that are then bundled into a native wrapper – these are hybrid apps.

Importantly, Appium is “cross-platform”: it allows you to write tests against multiple platforms (iOS, Android), using the same API. This enables a large or total amount of code reuse between iOS and Android testsuites. 我们可以从上面的介绍里获得这样的一些信息:

  • 1,appium是开源的移动端自动化测试框架;
  • 2,appium可以测试原生的、混合的、以及移动端的web项目;
  • 3,appium可以测试ios,android应用(当然了,还有firefox os);
  • 4,appium是跨平台的,可以用在osx,windows以及linux桌面系统上; appium的哲学