• Stars
    star
    460
  • Rank 93,057 (Top 2 %)
  • Language
    Go
  • License
    BSD 2-Clause "Sim...
  • Created over 9 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Tunnel TCP over a plain HTTP session (warning: mediocre Go code)

Crowbar

When a corkscrew just isn't enough...

Intro

Crowbar overview

Crowbar is an EXPERIMENTAL tool that allows you to establish a secure circuit with your existing encrypting TCP endpoints (an OpenVPN setup, an SSH server for forwarding...) when your network connection is limited by a Web proxy that only allows basic port 80 HTTP connectivity.

Crowbar will tunnel TCP connections over an HTTP session using only GET and POST requests. This is in contrast to most tunneling systems that reuse the CONNECT verb. It also provides basic authentication to make sure nobody who stumbles upon the server steals your proxy to order drugs from Silkroad.

Features

  • Establishes TCP connections via a proxy server using only HTTP GET and POST requests
  • Authenticates users from an authentication file
  • Will probably get you fired if you use this in an office setting

Security & Confidentiality

Crowbar DOES NOT PROVIDE ANY DATA CONFIDENTIALITY. While the user authentication mechanism protects from replay attacks to establish connectivity, it will not prevent someone from MITMing the later connection transfer itself, or from MITMing whole sessions. So, yeah, make sure to use it only tunnel an SSH or OpenVPN server, and firewall off most outgoing connections on your proxy server (ie. only allow access to an already publicly-available SSH server)

The authentication code and crypto have not been reviewed by cryptographers. I am not a cryptographer. You should consider this when deploying Crowbar.

Known bugs

The crypto can be improved vastly to enable server authentication and make MITMing more difficult. It could also use a better authentication setup to allow the server to keep password hashes instead of plaintext.

The server should include some filtering functionality for allowed remote connections.

The server lacks any cleanup functions and rate limiting, so it will leak both descriptors and memory - this should be fixed soon.

Is it any good?

Eh, it works. I'm not an experienced Golang programmer though, so the codebase is probably butt-ugly.

License

BSD 2-clause, 'nuff said.

Usage

Binary releases

Release and snapshot binaries can be downloaded from this project's Github Releases page.

Server setup

This assumes you're using Linux. If not, you're on your own.

Set up an user for the service

useradd -rm crowbar
mkdir /etc/crowbar/
chown crowbar:crowbar /etc/crowbar

Create an authentication file - a new-line delimited file containing username:password pairs.

touch /etc/crowbar/userfile
chown crowbar:crowbar /etc/crowbar/userfile
chmod 600 /etc/crowbar/userfile
echo -ne "q3k:supersecurepassword\n1337h4xx0r:canttouchthis" >> /etc/crowbar/userfile

Set up an iptables rule to forward traffic from the :80 port to :8080, where the server will be running. Replace eth0 with your public network interface.

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to-port 8080

Run the daemon in screen/tmux or write some unit files for your distribution:

crowbard -userfile=/etc/crowbar/userfile

Client setup

This assumes you're running Linux on your personal computer. If not, you're on your own.

Crowbar will honor the de-facto standard HTTP_PROXY env var on Linux:

export HTTP_PROXY=evil.company.proxy.com:80

For netcat-like functionality:

crowbar-forward -local=- -username q3k -password secret -server http://your.proxy.server.com:80 -remote towel.blinkenlights.nl:23

For port-forwarding:

crowbar-forward -local=127.0.0.1:1337 -username q3k -password secret -server http://your.proxy.server.com:80 -remote towel.blinkenlights.nl:23 &
nc 127.0.0.1 1337

For SSH ProxyCommand integration, place this in your .ssh/config, and then SSH into your.ssh.host.com as usual:

Host your.ssh.host.com
    ProxyCommand crowbar-forward -local=- -username q3k -password secret -server http://your.proxy.server.com:80 -remote %h:%p

Building from source

I assume you have a working $GOPATH.

go get github.com/q3k/crowbar/...

crowbar-forward and crowbard will be in $GOPATH/bin.

More Repositories

1

chubby75

Linsn RV901T HUB75 LED "Receiver Card" Reverse Engineering
Python
521
star
2

cve-2019-5736-poc

Unweaponized Proof of Concept for CVE-2019-5736 (Docker escape)
C
208
star
3

zturn-stuff

Various files for the MYiR ZTurn Zynq 7010 board
HTML
81
star
4

m16c-interface

A Serial IO programmer for Renesas M16C, includes security PIN bypass.
Python
80
star
5

TPM2137

Hardware task for WCTF2019
Python
46
star
6

ctf

Stuff from CTF contests
Verilog
41
star
7

httorrent

torrent -> http plumbing
Go
24
star
8

is-even

A microservice to check whether a number is even.
Go
18
star
9

qfc

q3k's hardware monorepo
Bluespec
17
star
10

q3d

a boneless 3d object format for asset exchange
CMake
15
star
11

ulx3s-foss-blinky

A template project for the ULX3S ECP5 FPGA board using only Open Source Software
Verilog
13
star
12

libsteam

A steam-interfacing library written in C. Based off the SteamRE project.
C
13
star
13

qf100

OpenMPW5/Sky130 tapeout of Lanai-based Microcontroller
Verilog
13
star
14

ski

Fork of the ski ia64 emulator
C
12
star
15

Cucumber

A hobby OS (kernel).
C
10
star
16

phook

A toolset for extending closed-source Linux processes
C
9
star
17

vraytekdigor

Experimental custom firmware build infrastructure for Draytek Vigor 167 modem
Go
9
star
18

ledvideo

RGB LED IP Core
Verilog
8
star
19

is-odd

A microservice to return whether a number is odd.
Go
8
star
20

catclock

Plan9 catclock that builds under plan9port
OpenEdge ABL
7
star
21

bugless

A no-nonsense bug tracker.
Go
7
star
22

doodles

Various scripts, bits and bobs.
C++
5
star
23

hacklock

An open source RFID lock for hackerspaces and more!
Lua
4
star
24

qrisc

VLIW RISC CPU demo for ORConf 23 Bluespec Lightning Talk
Bluespec
4
star
25

track

A little toy tracker/DAW/thing.
Rust
4
star
26

HaxxIcons

Icons for hackerspaces.
4
star
27

nixos-onie

Experiments in running NixOS on ONIE-capable switches
Nix
4
star
28

ledblaster

open source hub75e for the masses
Python
3
star
29

q3kled

RGB LED Linux driver
C
3
star
30

pktls

Use Wireguard-style public/private keypairs for secure cross-service TLS communication in Go
Go
3
star
31

internet-of-booze

Hardware task for CONFidence 2015 CTF
C
3
star
32

qubes-gentoo-overlay

A Portage overlay for Gentoo AppVMs in QubesOS
Shell
3
star
33

bigbrain

A terrible handwriting recognition neural network in Rust/WASM.
Rust
2
star
34

coriolis

Mirrot of Coriolis git repo
C++
2
star
35

pythonshark

A not-very-nice Python API for talking to Grooveshark servers
Python
2
star
36

statusz

/statusz-like status pages for Go
Go
2
star
37

gm_datapack

A binary Lua module for Garry's Mod to tell when a datapack is created.
C
2
star
38

backdoorflag

backdoorflag
1
star
39

mun

An IRC Bot (framework) written in Lua
Lua
1
star
40

q3kmips

A toy MIPS pipelined CPU in Verilog.
Verilog
1
star
41

cursedjson

A fork of Go's encoding/json with support for Infinity/-Infinity/NaN.
Go
1
star
42

Rhubarb

A simple 3D engine.
C++
1
star
43

aoc-2022-jsonnet

q3k does advent of code in jsonnet
Jsonnet
1
star
44

scarab

A lean job runner for DevOps/SRE automation.
Go
1
star
45

bekant-trotten-hack

Mounting an IKEA BEKANT tabletop on a TROTTEN sit/stand underframe.
1
star
46

ppsa-jsonapi

A shitty API proxy for a shitty API
Python
1
star
47

xinchejian-at

An at.hackerspace.pl implemention for XinCheJian, but different
Python
1
star
48

screencontroller

FPGA & RGB LED Matrix Stuff
Verilog
1
star
49

kasownik

Warsaw Hackerspace membership & payment management system
Python
1
star
50

roulette

russianroulette.sh
Python
1
star
51

louvre

Distributed backup effort for the Warsaw Hackerspace IRC bot term store
Go
1
star
52

godhcprev

Stateless v6 forward/rev DNS server
Go
1
star
53

abrasion

gamez
Rust
1
star
54

dalek

Software to control the Warsaw Hackerspace teletype 'Dalek'
Python
1
star
55

TabascoBeer-Game0

A game for PyWeek.
Python
1
star
56

speedtest

Self-hosted HTML5 Speedtest. Easy setup, examples, configurable, mobile friendly. Supports PHP, Node, Multiple servers, and more
JavaScript
1
star
57

rsh-unbound

A tool to synchronize "Rejestr Stron Hazardowych" to an Unbound blacklist
Go
1
star