Use the existing tools of the target system to quickly package the target machine data

0x01 Preface

This is how the Dragon Boat Festival passed. Except for food and kidney overdrafts, there was really no other gain. Today, looking at the summary of the same knowledge points of K and C cows, here is an overview. Learning is to constantly clone "Baidu" knowledge to supplement oneself. Learn from the "old knowledge" of the predecessors to continue to fill the not strong enough self.

0x02 Fast packaging method under linux machine

Using tar, it is usually pre-installed by default when deploying the system. There are many other compression tools, but here is the most commonly used as an example, just pack a data, whichever is easy to use, it is not necessary to These issues are too entangled [we are not studying compression algorithms]

--exclude 排除不打包的文件
-c 创建文件
-v 显示打包过程
-f 指定要打包的文件
-z 压缩
-X 把要排除的文件名事先写到文件中然后指定它就可以排除多个了
-C 解压到指定目录中
-p 打包的时候保持原有文件属性

Compress and decompress in gunzip format:

# find / -name '*.php' -type f | wc -l
# tar zcf /tmp/phpfile.tar.gz `find / -name '*.php' -type f` 2> /dev/null && cd /tmp && ls ./phpfile.tar.gz && echo $? && tar tf phpfile.tar.gz  | wc -l  会带上原有的目录结构
# tar xf phpfile.tar.gz -C ./  解压

Compress and decompress in bzip format:

# tar jcf access.tar.bz access*   	bzip格式打包压缩文件
# tar jxf access.tar.bz  		zip解压缩

Sub-volume compression and decompression for large files:

# tar cjf - /usr/local/apache2/htdocs/ | split -b 1m - www.bz2 2>/dev/null  1m大小分割,直接压缩到当前目录下
# cat www.bz2a* | tar xj   分割压缩后的解压方法
# ls -lR usr/

0x03 Some quick packaging methods on win machines [usually used with dir and findstr to package some personal emails, which is better]:

7z [压缩比相对较高的一种压缩格式,win下首推]:	
-r 递归压缩
-o 指定要输出到的目录
-p 指定密码
-v 分卷压缩,给的务必要适量,否则文件会非常多
a 添加压缩文件

Common compression and decompression method:

# 7z.exe -r -padmin a c:\drupal754.7z C:\AppServ\www\drupal-7.54-vuln-sqli-rce\*.*
# 7z.exe x -padmin drupal754.7z -oc:\xl

Sub-volume compression and decompression method:

# 7z.exe -r -v1m -padmin a c:\drupal754.7z C:\AppServ\www\drupal-7.54-vuln-sqli-rce\*.*
# 7z.exe x -padmin drupal754.7z.001 -oc:\xl

rar [Extract rar.exe from the installed winrar installation directory and use it directly, provided that the system where you install winrar corresponds to the target system version, otherwise there may be some problems (I think the library should be compatible)] :

-a  	添加要压缩的文件
-p  	指定压缩密码
-r     递归压缩,默认只压根目录,需要先注册下,把rarreg.key丢到安装winrar目录即可
-x 	 指定要排除的文件,单位 k,m,g
-v 	 分卷打包,后面跟上单位就好了,打包大文件会很有用
-m3,4 	使用较好的压缩方式,速度可能会有些慢

Compress and decompress in rar format:

# Rar.exe a -r -padmin -m3 -x*.txt -ta c:\drupal754.rar C:\AppServ\www\drupal-7.54-vuln-sqli-rce\*.*  	把指定目录下的所有文件[包括所有子目录及子目录中的文件,排除txt文件]带密码压缩,然后把压缩好的文件放到c的根下命名成drupal754.rar
# Rar.exe x -padmin c:\drupal754.rar c:\xl	带密码保留原有目录结构解压

Compress and decompress in zip format [the usage is the same as above]:

# Rar.exe a -r -padmin -m3 -x*.txt -ta c:\drupal754.zip C:\AppServ\www\drupal-7.54-vuln-sqli-rce\*.*
# Rar.exe x -padmin c:\drupal754.zip c:\xl

Sub-volume compression and decompression:

# Rar.exe a -r -v1m -padmin -m3 -x*.txt -ta c:\drupal754.rar C:\AppServ\www\drupal-7.54-vuln-sqli-rce\*.* 压缩
# Rar.exe x -padmin c:\drupal754.part01.rar c:\xl	解压

0x04 summary

Obviously, the full text of the customs clearance has almost nothing to do with technology [just the simple use of a few small tools]. Just leave a memo for friends in need. In addition, be sure to pay attention to the target partition when packaging. The size of the file is not enough, otherwise it is easy to make mistakes. Whether the metadata of the file should be saved together, whether the file being packaged is occupied or not, sometimes there may be minor problems with the packaging. I believe that will not be a problem for you.

In addition, I also laid a foreshadowing here. If you really have energy or have technical skills, you may as well write a graphical GUI or a simpler script file to realize the interactivity of win+linux scripts. Here is a little mention , To be continued...

Please indicate: Adminxe's Blog  »  Use the existing tools of the target system to quickly package the target machine data

 

Guess you like

Origin blog.csdn.net/Adminxe/article/details/106990797