思路

IPC$横向渗透的方法,也是病毒常用的扩散方法。

1、建立连接

2、复制文件到共享中C$D$E$F$

3、获取服务器的时间

3、设定计划任务按时间执行

用到的Windows API

建立网络驱动器 WNetAddConnection2()


WNetAddConnection2W(
_In_ LPNETRESOURCEW lpNetResource, // 资源信息
_In_opt_ LPCWSTR lpPassword, // 密码
_In_opt_ LPCWSTR lpUserName, // 用户名
_In_ DWORD dwFlags // 标志位
); # 使用 WNetAddConnection2(&netResource, pass, user, CONNECT_UPDATE_PROFILE))

断开网络驱动器 WNetCancelConnection2()

# 使用
WNetCancelConnection2(netResource.lpLocalName, CONNECT_UPDATE_PROFILE, true);

获取局域网内windows server 2003服务器上的时间 NetRemoteTOD()

增加计划任务 NetScheduleJobAdd()

代码实现示例


int ConnectWNet(LPWSTR user, LPWSTR pass, LPWSTR host)
{
std::wstring string;
if (host[0] != L'\\' && host[1] != L'\\')
{
string.append(L"\\\\");
}
string.append(host);
NETRESOURCE netResource;
netResource.lpLocalName = NULL;
netResource.lpRemoteName = (LPWSTR)string.c_str();
netResource.dwType = RESOURCETYPE_ANY;
netResource.lpProvider = NULL; DWORD ret;
char okip[260];
//创建IPC连接
if ((ret = WNetAddConnection2(&netResource, pass, user, CONNECT_UPDATE_PROFILE)) == ERROR_SUCCESS)
{
sprintf(okip, "%s %s %s\n", host, user, pass);
// 断开IPC连接
DWORD dwConFlig = WNetCancelConnection2(netResource.lpLocalName, CONNECT_UPDATE_PROFILE, true);
return 1;
} return 0;
}

参考

远程IPC种植木马

https://blog.csdn.net/weixin_34408624/article/details/86248485

WnetAddConnection2

https://blog.csdn.net/VonSdite/article/details/81230306

渗透之——内网IPC$入侵

https://blog.csdn.net/l1028386804/article/details/85995503

最新文章

  1. jQuery.validator 详解二
  2. 【bzoj2435】[NOI2011]道路修建
  3. Python好用的网站收集
  4. ClassLoader类加载机制
  5. 《zw版·Halcon-delphi系列原创教程》航母舰载机·视觉定位标志的识别代码
  6. Mvc4_@RenderBody()和@RenderSection()
  7. BZOJ1727 [Usaco2006 Open]The Milk Queue 挤奶队列
  8. 一条结合where、group、orderby的linq语法
  9. 以莫泰的形式进行页面转换(传值用block)
  10. 利用redis分布式锁的功能来实现定时器的分布式
  11. Tomcat 部署Undeployment Failure
  12. Retrofit 2.0 throwing @Field parameters can only be used with form encoding
  13. [ES6] 20. Polyfills
  14. How to get multi-touch working(Linux and Andriod)
  15. input事件以及中文输入法的处理
  16. System.getProperty("catalina.home")
  17. [CEOI2008]order
  18. 修改hosts不必重启 立刻生效
  19. zookeeper核心-zab协议-《每日五分钟搞定大数据》
  20. HBase详细概述

热门文章

  1. org.hibernate.MappingException: class com.itheima.domain.Customer.java not found while looking for property: cust_id at org.hibernate.internal.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.
  2. kernel(二)源码浅析
  3. Thymeleaf中的&&解析问题
  4. 运维监控-使用Zabbix Server 创建 Actions
  5. MySQL8常见客户端和启动相关参数
  6. hadoop 2.5 安装部署
  7. SNMP支持IPv6
  8. Dubbo服务端结合maven打jar包
  9. WebRequest/HttpWebRequest/HttpRequest/WebClient/HttpClient的区别
  10. Linux学习笔记:【002】ARM指令流水线