Atitit. 注册表操作查询 修改 api与工具总结 java c# php js python 病毒木马的原理
Atitit. 注册表操作查询 修改 api与工具总结 java c# php js python 病毒木马的原理
1. reg 工具
这个cli工具接口有,优先使用,jreg的要调用dll了,麻烦的..
2. Jreg 框架
Jreg的要调用dll了,麻烦
作者:: ★(attilax)>>> 绰号:老哇的爪子 ( 全名::Attilax Akbar Al Rapanui 阿提拉克斯 阿克巴 阿尔 拉帕努伊 ) 汉字名:艾龙, EMAIL:1466519819@qq.com
转载请注明来源: http://www.cnblogs.com/attilax/
3. 1,查询所有子项和值 by reg
D:\>reg query hklm\software\TTT
! REG.EXE VERSION 3.0
HKEY_LOCAL_MACHINE\software\TTT
Name REG_SZ TTT BLOG
EMail REG_SZ taoether@gmail.com
URL REG_SZ http://www.taoyoyo.net/ttt/
Type REG_DWORD 0x2
2,查询特定项
D:\>reg query hklm\software\ttt /v url
! REG.EXE VERSION 3.0
HKEY_LOCAL_MACHINE\software\ttt
url REG_SZ http://www.taoyoyo.net/ttt/
这里最难的是如何取得我们想要的字符串呢,困惑了好长时间,终于找到方法了。
原来也没有别的好办法,只能用find,for循环来截取我们需要的内容。(下面的例子如果看不懂,请参考本博客另外的文章:DOS循环-bat/批处理for命令详解之二)
例如我们要得到url的键值: http://www.taoyoyo.net/ttt/,可以用以下脚本:
复制代码 代码如下:
@ECHO OFF
for /f "tokens=1,2,3,4,*" %%i in ('reg query "HKEY_LOCAL_MACHINE\software\ttt" ^| find /i "URL"') do SET "pURL=%%k"
echo TTT BLOG的URL值为:%pURL%
4. Code by jreg
package aaaAddr;
import java.util.List;
import java.util.Map;
import jdk.nashorn.internal.ir.Terminal;
import com.attilax.json.AtiJson;
import com.attilax.lang.YamlAtiX;
import com.attilax.lang.text.strUtil;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.registry.RegistryKey;
import com.registry.RegistryValue;
/** aaaAddr.SysServiceUtil.getList
* @author digdeep@126.com
*/
public class SysServiceUtil {
// "HKEY_LOCAL_MACHINE"
public static final RegistryKey LOCALMACHINE = RegistryKey
.getRootKeyForIndex(RegistryKey.HKEY_LOCAL_MACHINE_INDEX);
// "HKEY_LOCAL_MACHINESystemCurrentControlSetControlTerminal ServerWinStationsRDP-Tcp"
public static final RegistryKey rdpKey = null;
// = new RegistryKey(LOCALMACHINE,
// "\System\CurrentControlSet\Control\Terminal
// Server\WinStations\RDP-Tcp\");
/**
* 获得 windows server 中的 terminal server 的端口 也就是远程桌面服务的端口
*
* @return
*/
public static long getTerminalServerPort() {
long port = -1;
if (rdpKey.hasValues()) {
RegistryValue portNumber = rdpKey.getValue("PortNumber");
System.out.println(portNumber.toString()); // Name: PortNumber Type:
// REG_DWORD Value: 3389
String value = portNumber.toString();
port = Long.valueOf(value.substring(value.lastIndexOf(": ") + 2));
System.out.println("port: " + port);
}
return port;
}
public static void main(String[] args) {
SysServiceUtil sysx = new SysServiceUtil();
List li = sysx.getList();
System.out.println(AtiJson.gson(li));
}
/**
* attilax 2016年4月12日 下午2:35:10
*
* @return
*/
@SuppressWarnings("all")
public List getList() {
// getTerminalServerPort();
String roottype = "1:man,2:auto,3:manType3,4:disable";
Map roottype_m = YamlAtiX.getMap_fromTxt(roottype);
RegistryKey k = new RegistryKey(LOCALMACHINE,
"SYSTEM\\CurrentControlSet\\services");
//todox drektly use fullpath se ,get retu is empty in get subkey..zihao use jeig locamacie var mode..
// System.out.println( AtiJson.toJson(k));
/*
*
* { "hKey": -2147483647, "name": "services", "path":
* "HKEY_CURRENT_USER\\HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet",
* "handles": [], "created": false, "level": 4, "lastError": 0,
* "view64": 256 }
*/
// k.g
List<RegistryKey> li = k.getSubKeys();
// k.getSubKeys(".NETFramework")
// k.getSubKeyNames()
// k.getNumberOfSubKeys()
System.out.println(li.size());
List<Map> li_r = Lists.newLinkedList();
int i = 0;
for (RegistryKey registryKey : li) {
try {
i++;
System.out.println(i);
// System.out.println( AtiJson.toJson(registryKey));
System.out.println(registryKey.getName());
if (registryKey.getName().equals("AcpiPmi"))
System.out.println("dbg");
Map m = Maps.newLinkedHashMap();
if (registryKey.getValue("Description") != null) {
RegistryValue v = registryKey.getValue("Description");
byte[] byteData = v.getByteData();
// Object s = strUtil.from_wz_encode( byteData,"gbk");
Object s = strUtil.from_wz_encode(byteData,
"UnicodeLittleUnmarked");
m.put("Description", s);
}
m.put("name", registryKey.getName());
if (registryKey.getValue("DisplayName") != null) {
RegistryValue v = registryKey.getValue("DisplayName");
// v.getName() ==DisplayName
// v.toString()
byte[] byteData = v.getByteData();
Object s = strUtil.from_wz_encode(byteData,
"UnicodeLittleUnmarked");
m.put("DisplayName", s);
}
if (registryKey.getValue("ImagePath") != null)
m.put("ImagePath", strUtil.from_wz_encode(registryKey
.getValue("ImagePath").getByteData(),
"UnicodeLittleUnmarked"));
m.put("Start", getReg_dword(registryKey.getValue("Start") ));
if(m.get("Start")!=null)
m.put("StartTxt", roottype_m.get(m.get("Start")));
// //if DelayedAutostart=1 and auto ,then auto delaye start
m.put("DelayedAutostart",getReg_dword(registryKey.getValue("DelayedAutostart") ));
li_r.add(m);
} catch (Exception e) {
e.printStackTrace();
}
//
}
System.out.println("--ok");
return li_r;
}
/**
attilax 2016年4月12日 下午4:59:53
* @param string
* @return
*/
private Object getReg_dword(RegistryValue regVal) {
if (regVal != null) {
byte[] a=regVal
.getByteData();
return strUtil.from(a[0]);
}
return regVal;
}
}
5. 参考
批处理操作注册表完全攻略(读取注册表-写入注册表等)_DOS-BAT_脚本之家.htm
Atitit. 注册表操作查询 修改 api与工具总结 java c# php js python 病毒木马的原理的更多相关文章
- delphi 注册表操作(读取、添加、删除、修改)完全手册
DELPHI VS PASCAL(87) 32位Delphi程序中可利用TRegistry对象来存取注册表文件中的信息. 一.创建和释放TRegistry对象 1.创建TRegistry对象.为了操 ...
- Delphi的注册表操作
转帖:Delphi的注册表操作 2009-12-21 11:12:52 分类: Delphi的注册表操作 32位Delphi程序中可利用TRegistry对象来存取注册表文件中的信息. 一.创 ...
- CRegKey 注册表操作
CRegKey 注册表操作 标签: accessnulluserpathbyteie 2011-11-03 13:55 3477人阅读 评论(0) 收藏 举报 分类: win32(7) 1.简介 ...
- C#注册表操作类--完整优化版
using System; using System.Collections.Generic; using System.Text; using Microsoft.Win32; namespace ...
- C#注册表操作类(完整版) 整理完整
/// <summary> /// 注册表基项静态域 /// /// 主要包括: /// 1.Registry.ClassesRoot 对应于HKEY_CLASSES_ROOT主键 /// ...
- QSettings配置读写-win注册表操作-ini文件读写
版权声明:若无来源注明,Techie亮博客文章均为原创. 转载请以链接形式标明本文标题和地址: 本文标题:QSettings配置读写-win注册表操作-ini文件读写 本文地址:http:// ...
- C# 我的注册表操作类
using System; using System.Collections.Generic; using System.Text; using Microsoft.Win32; using Syst ...
- 《天书夜读:从汇编语言到windows内核编程》八 文件操作与注册表操作
1)Windows运用程序的文件与注册表操作进入R0层之后,都有对应的内核函数实现.在windows内核中,无论打开的是文件.注册表或者设备,都需要使用InitializeObjectAttribut ...
- 【读书笔记】C#高级编程 第二十四章 文件和注册表操作
(一)文件和注册表 对于文件系统操作,相关的类几乎都在System.IO名称空间中,而注册表操作由System.Win32名称空间中的类来处理. (二)管理文件系统 System.MarshalByR ...
随机推荐
- easyui combobox可编辑的情况下,只能首字母开始过滤的问题选项
esayui中的combobox下拉列表在可编辑的情况下可以输入内容来过滤下拉框的选项,而1.4.2版本只能在从首字母开始过滤例如其中一个选项是"test", 只能输入" ...
- unity3d由多个部分组成一个角色
摘自http://forum.unity3d.com/threads/16485-quot-stitch-multiple-body-parts-into-one-character-quot So ...
- soap-学习
1. SOAP 是一种简单的基于 XML 的协议,它使应用程序通过 HTTP 来交换信息. 简单的说:SOAP是用于访问网络服务的协议. 2. 什么是SOAP SOAP 指简易对象访问协议 SOAP ...
- fiddler在ios10.3系统抓包https失败原因解决
一直是按照以往的设置抓包,设置代理ip,通过Safari下载安装证书,抓包https怎么显示证书无效呢?难道证书被apple设为黑名单了?google后发现,IOS10.3以后,安装了证书不是默认启用 ...
- libev客户端
#include <ev.h> #include <stdio.h> #include <netinet/in.h> #include <stdlib.h&g ...
- 流畅的python第二十章属性描述符学习记录
描述符是对多个属性运用相同存取逻辑的一种方式.例如,Django ORM 和 SQL Alchemy等 ORM 中的字段类型是描述符,把数据库记录中字段里的数据与 Python 对象的属性对应起来.描 ...
- dbus启动失败:Couldn't connect to system bus: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
在没有开启x窗口的shell下启动dbus相关程序时会如上错误,详细原因如下: This is not considered to be a bug. Auto-launching D-Bus ses ...
- Zend Guard Run-time support missing 问题的解决
Zend Guard是目前市面上最成熟的PHP源码加密产品了. 刚好需要对自己的产品进行加密,折腾了一晚上,终于搞定,将碰到的问题及解决方法记录下来,方便日后需要,也可以帮助其他人. 我使用的是Wam ...
- App服务端架构变迁
随着移动互联网时代的到来,移动技术也随之飞速发展.如今,App已然成为绝大多数互联网企业用来获取用户的核心渠道.以往以PC为主要承载平台的各业务线,源源不断集成加入到移动项目中来,原本以产品为中心快速 ...
- 解复用-mpeg2
http://blog.csdn.net/yipie/article/details/7612226 数字高清晰度电视(High Definition Television)简称HDTV,是继黑白电视 ...