高难度的网络问题

一方晴空 2009-03-06 10:33:50
1.给你提供正确的密码和用户名,使用C#语言模拟浏览器进行自动登录。(或直接获得用户提交的数据包,分析数据进行自动登录)
2.进入登录的系统,然后浏览器向用户返回数据包,用C#技术获得此用户的数据包。
3.对获取的数据进行分析处理,把数据在显示自己的页面上。

这完全是一个模仿浏览器的实现一个网络抓包的功能,各位有什么好的建议吗?
...全文
149 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
guohouchang 2009-08-10
  • 打赏
  • 举报
回复
上次做过一个局域网 登录 进攻参考
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace MessageTransfer
{
/// <summary>
/// 共享连接类
/// </summary>
public class ConnShareRes
{
private readonly static Encrypt dncrypt = new Encrypt();
private readonly static string userName = dncrypt.DecryptString("nuHRWBOdemdSagmhp59pUw==");
private readonly static string userPwd = dncrypt.DecryptString("QLsFwBVPFoM11MhrTr3kaA==");
/// <summary>
/// 服务器URL
/// </summary>
public readonly static string shareResDictionary = dncrypt.DecryptString("E1ETohnoMgtZwSkf7+/INwC/0cb7addJpEWhSxGhJZzWkg+rkadr5sWcZAIHzLV2");
//构造函数
public ConnShareRes()
{
}
[StructLayout(LayoutKind.Sequential)]
public struct NETRESOURCEA
{
public int dwScope;
public int dwType;
public int dwDisplayType;
public int dwUsage;
[MarshalAs(UnmanagedType.LPStr)]
public string lpLocalName;
[MarshalAs(UnmanagedType.LPStr)]
public string lpRemoteName;
[MarshalAs(UnmanagedType.LPStr)]
public string lpComment;
[MarshalAs(UnmanagedType.LPStr)]
public string lpProvider;
public override String ToString()
{
String str = "LocalName: " + lpLocalName + " RemoteName: " + lpRemoteName + " Comment: " + lpComment + " lpProvider: " + lpProvider;
return (str);
}
}
[DllImport("mpr.dll")]
public static extern int WNetAddConnection2([MarshalAs(UnmanagedType.LPArray)] NETRESOURCEA[] lpNetResource, [MarshalAs(UnmanagedType.LPStr)] string lpPassword, [MarshalAs(UnmanagedType.LPStr)] string UserName, int dwFlags);
[DllImport("mpr.dll")]
public static extern int WNetCancelConnection2(string lpName, int dwFlags, bool fForce);
//开始远程连接
public bool RemoteConnect(bool bConnected)
{
int res;
NETRESOURCEA[] n = new NETRESOURCEA[1];
n[0] = new NETRESOURCEA();
n[0].dwType = 1;
int dwFlags = 1; // CONNECT_INTERACTIVE;
//n[0].lpLocalName = @"X:";
n[0].lpLocalName = @"";

n[0].lpRemoteName = shareResDictionary;
//n[0].lpRemoteName = @"\\wanglh\manageshare";
n[0].lpProvider = null;
//Console.WriteLine(n[0]);
if (bConnected)
{
res = WNetAddConnection2(n, userPwd, userName, dwFlags);
}
else
{
res = WNetCancelConnection2(shareResDictionary, 1, true);
}
return (res == 0) ? true : false;
}
}
}


hecong875 2009-03-06
  • 打赏
  • 举报
回复
帮顶了!没做过.
一方晴空 2009-03-06
  • 打赏
  • 举报
回复
很多的网站上是用框架做的,路径很难找到,如果你能提供找到路径的方法也可以的;还有很多的网站是用JS写的,没有HTML的代码,所以如果可以是能嵌入其中一些代码,获得页面,或者自动运行取得数据也可以的,但是很难啊。

111,126

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧