mounting bitlocker encrypted drive in kali linux using dislocker

apt-get install libfuse-dev libpolarssl-dev
wget http://www.hsc.fr/ressources/outils/dislocker/download/dislocker.tar.bz2
tar xvf dislocker.tar.bz2
cd dislocker/src/
make
make install

if you get this error running /usr/bin/dislocker :
/usr/bin/dislocker: error while loading shared libraries: libdislocker.so.0: cannot open shared object file: No such file or directory
run this to fix it:

install -pm755 libdislocker.so.0.4.1 /usr/lib
install -pm755 libdislocker.so.0 /usr/lib

installation is done.

dislocker by Romain Coltel, v0.4.1 (compiled for Linux/x86_64)

Usage: dislocker [-hqrsv] [-l LOG_FILE] [-o OFFSET] [-V VOLUME DECRYPTMETHOD -F[N]] [— ARGS…]
with DECRYPTMETHOD = -p[RECOVERY_PASSWORD]|-f BEK_FILE|-u[USER_PASSWORD]|-k FVEK_FILE|-c

Options:
-c, —clearkey decrypt volume using a clear key (default)
-f, —bekfile BEKFILE
decrypt volume using the bek file (on USB key)
-F, —force-block N force use of metadata block number N (1, 2 or 3)
-h, —help print this help and exit
-k, —fvek FVEK_FILE decrypt volume using the FVEK directly
-l, —logfile LOG_FILE
put messages into this file (stdout by default)
-o, —offset OFFSET BitLocker partition offset (default is 0)
-p, —recovery-password[RECOVERY_PASSWORD]
decrypt volume using the recovery password method
-q, —quiet do NOT display anything
-r, —readonly do not allow to write on the BitLocker volume
-s, —stateok do not check the volume’s state, assume it’s ok to mount it
-u, —user-password decrypt volume using the user password method
-v, —verbosity increase verbosity (CRITICAL errors are displayed by default)
-V, —volume VOLUME volume to get metadata and keys from

— end of program options, beginning of FUSE’s ones

ARGS are any arguments you want to pass to FUSE. You need to pass at least
the mount-point.
——
Here is how to use it:
after getting list of drives available and choosing proper one using fdisk -l
we mount it in following directories.

mkdir /mnt/tmp
mkdir /mnt/bitlocker
dislocker -v -V /dev/sdb3 -u  -- /mnt/tmp/
mount -o loop,ro /mnt/tmp/dislocker-file /mnt/bitlocker/

setup anyconnect compatible ocserv VPN server on centos 6.0

Setting up ocserv is pretty easy on centos 6.0

yum install autoconf automake gcc libtasn1-devel zlib zlib-devel trousers trousers-devel gmp-devel gmp xz texinfo libnl-devel libnl tcp_wrappers-libs tcp_wrappers-devel tcp_wrappers dbus dbus-devel ncurses-devel pam-devel readline-devel bison bison-devel flex gcc automake autoconf wget

 

wget http://www.lysator.liu.se/~nisse/archive/nettle-2.7.tar.gz
tar xvf nettle-2.7.tar.gz
cd nettle-2.7
./configure --prefix=/opt/
make && make install
cd..

 

wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.2/gnutls-3.2.12.tar.xz
tar xvf gnutls-3.2.12.tar.xz
cd gnutls-3.2.12
export LD_LIBRARY_PATH=/opt/lib/:/opt/lib64/
NETTLE_CFLAGS="-I/opt/include/" NETTLE_LIBS="-L/opt/lib64/ -lnettle" HOGWEED_CFLAGS="-I/opt/include" HOGWEED_LIBS="-L/opt/lib64/ -lhogweed" ./configure --prefix=/opt/
make && make install
cd..

 

wget http://www.carisma.slowglass.com/~tgr/libnl/files/libnl-3.2.24.tar.gz
tar xvf libnl-3.2.24.tar.gz
cd libnl-3.2.24
./configure --prefix=/opt/
make && make install
cd..

 

wget ftp://ftp.infradead.org/pub/ocserv/ocserv-0.10.10.tar.xz
tar xvf ocserv-0.10.10.tar.xz
cd ocserv-0.10.10
LIBGNUTLS_CFLAGS="-I/opt/include/" LIBGNUTLS_LIBS="-L/opt/lib/ -lgnutls" LIBNL3_CFLAGS="-I/opt/include" LIBNL3_LIBS="-L/opt/lib/ -lnl-3 -lnl-route-3" ./configure --prefix=/opt/
make && make install

 

mkdir /etc/ocserv
cd /etc/ocserv

put the following in /etc/ocserv/config:

auth = "plain[/etc/ocserv/ocpasswd]"
max-clients = 1024
max-same-clients = 2
tcp-port = 443
udp-port = 443
keepalive = 32400
dpd = 90
try-mtu-discovery = false
server-key = /etc/ocserv/key.pem
server-cert = /etc/ocserv/cert.pem
tls-priorities = "NORMAL:%SERVER_PRECEDENCE:%COMPAT"
auth-timeout = 20
cookie-timeout = 86400000
rekey-time = 86400000
use-utmp = true
use-dbus = false
pid-file = /var/run/ocserv.pid
socket-file = /var/run/ocserv-socket
run-as-user = nobody
run-as-group = daemon
device = vpns
ipv4-network = 10.18.240.0
ipv4-netmask = 255.255.255.0
dns = 199.85.126.20
dns = 199.85.127.20
ping-leases = false
output-buffer = 10
user-profile =/etc/ocserv/profile.xml
cisco-client-compat = true

and the following in /etc/ocserv/profile.xml:
replace [SERVER_IP_OR_URL] and [CONNECTION_NAME] with appropriate values

<?xml version="1.0" encoding="UTF-8"?>
<AnyConnectProfile xmlns="http://schemas.xmlsoap.org/encoding/"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:schemaLocation="http://schemas.xmlsoap.org/encoding/  AnyConnectProfile.xsd">

<ClientInitialization>
<AutoUpdate>true</AutoUpdate>
<BypassDownloader>true</BypassDownloader>
<UseStartBeforeLogon>false</UseStartBeforeLogon>
<StrictCertificateTrust>false</StrictCertificateTrust>
<RestrictPreferenceCaching>false</RestrictPreferenceCaching>
<RestrictTunnelProtocols>IPSec</RestrictTunnelProtocols>
<CertEnrollmentPin>pinAllowed</CertEnrollmentPin>
<CertificateMatch>
<KeyUsage>
<MatchKey>Digital_Signature</MatchKey>
</KeyUsage>
<ExtendedKeyUsage>
<ExtendedMatchKey>ClientAuth</ExtendedMatchKey>
</ExtendedKeyUsage>
</CertificateMatch>
</ClientInitialization>

<ServerList>
<HostEntry>
<HostName>CA</HostName>
<HostAddress>ca.opis.ir</HostAddress>
</HostEntry>
</ServerList>

</AnyConnectProfile>

now we will create certificates

cd /etc/ocserv
/opt/bin/certtool --generate-privkey --outfile key.pem
/opt/bin/certtool --generate-self-signed --load-privkey key.pem --outfile cert.pem

then we can add user or change user password like this:
replace <username> with appropriate value

LD_LIBRARY_PATH=/opt/lib/:/opt/lib64/ /opt/bin/ocpasswd -c /etc/ocserv/ocpasswd &lt;username&gt;

if you want the client to be connected to internet do not forget to setup MASQUERADE with following:

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

also set net.ipv4.ip_forward = 1 in /etc/sysctl.conf
open corresponding ports in iptables.

iptables -I INPUT -p tcp -m tcp --dport 443 -j ACCEPT
iptables -I INPUT -p udp -m udp --dport 443 -j ACCEPT

we’re all set. start the server with this:

LD_LIBRARY_PATH=/opt/lib/:/opt/lib64/ /opt/sbin/ocserv -c /etc/ocserv/config