Category Archives: Just For Fun

Home »  Just For Fun

admin
Comments Off on A little ssh honeypot fun

I say honeypot but really it isn’t a honeypot… but it is something I am using to log/capture data from malicious individuals….so thus the reason I say honeypot. I want to edit sshd to log all user/password attempts. Cent7 yum install git make zlib-devel openssl-devel openssh-devel pam-devel screen autoconf gcc vim-enhanced lsof git clone https://github.com/openssh/openssh-portable.git cd openssh-portable/ autoreconf ./configure vim auth-passwd.c (add in my little log code in the auth_password function) //for Lanix logit(“sshd credentials:%s:%s”,authctxt->user,password); make we are going to use the built-in sshd_config and the current ssh_host_keys to prevent anyone remote being able to easily identify the trap. cp /etc/ssh/sshd_config /root/  (modify this as there are multiple parts we didn’t complile into our ssh and errors will be thrown, also to test I run it first on a different port) cp /etc/ssh/ssh_host_* /root/ chmod 0600 /root/ssh_host_* /root/openssh-portable/sshd -f sshd_config -D (I test with the -D so that I can easily […]

admin
Comments Off on SSH proxy through my VM cloud server (using firejail and chrome)

Oh.. you have country blocking turned on at the firewall… or some other web filter or firewall that is preventing you from viewing a website. Keep in mind you do need a server you have access to via ssh… I like cloud servers, they tend to not have web filters..lol First we need to setup the ssh socks5 proxy, we will ssh into our VM (virtual machine server) and proxy through there on local port 8080: ssh -D 8080 myuser@myserver.mydomain Now, keep in mind I am using Kali 2017.1 for this next part but you can use other distros and even configure other browsers to connecto to your localhost:8080 proxy, I am using firejail and google-chrome. Firejail allows me to have an independant isolated browser running so I can still have my regular browser up and running as needed. This is how we connect: firejail –private google-chrome –proxy-server=”socks5://localhost:8080″ Boom, good […]

admin
Comments Off on So you play with wordpress and you want to see it but you want others to see an underconstruction page?

Here is a fun little modification you can make to the wordpress index.php so that only you can see the wordpress instance and everyone else will see an underconstruction image.  Keep in mind, this requires you to be connecting to your website from a static IP, or just update the file every time your IP changes….that works too. <?php /** * Front to the WordPress application. This file doesn’t do anything, but loads * wp-blog-header.php which does and tells WordPress to load the theme. * * @package WordPress */ /** * Tells WordPress to load the WordPress theme and output it. * * @var bool */ $ip=$_SERVER[‘REMOTE_ADDR’]; if ($ip == ‘222.222.222.222’ || $ip == ‘111.111.111.111) { /* Just replace 222.222.222.222 and 111.111.111.111 with your own ip addresses and anyone connecting to your wordpress instance from those IP addresses would see the wordpress site, everyone else would see a basic html […]

admin
Comments Off on Adding a new server to a Mongo replica set

Ok, so you have a new mongo server setup and you want to add it to an existing replica set.  Lets just make this easy, we will talk authentication another time.  Assume this time you have your mongo server installed, you have the firewall setup to allow remote connections. edit the mongod.conf file – usually in /etc/mongod.conf make sure it is configured to listen on all interfaces, or the one you want… Make sure you add the same replica set name so that it can join the group. Login to your current primary mongo server execute this command to add it rs.add({“_id” : 3, “host” : “servername:27017”, “tags” : {“dc”: “dcname”}}) you can also add priority and such, but just keeping things simple here. Now the new server will sync the data and then it will be ready to go!

admin
Comments Off on O Coraid, Coraid, wherefor art thou Coraid?

Well, it is sad that coraid has gone… Sadder still that their support is gone. I was working on a coraid for a friend and they had two disks fail at the same time, good old raid 5 doesn’t like that too much.  The new one’s are raid 6, but how to recover data off these raid5 ones?  Old notes to the rescue! First your remove the lun: remove 1 Now you need to recreate the raid but make sure to keep one drive as missing so that it will not initialize the whole array.  (in this case we are leaving dirve 6 as missing and drive 0 as an optional spare – if we want to risk an attempt at a rebuild) make -r 1 raid5 2.1-5 missing 2.7-15 Now you need to online the lun in order to see it on the servers online 1 Now you can […]

admin
Comments Off on Installing Fusion-io/Sandisk ioDrive2 drivers on CentOS7 with LUKS encryption

I was working on a Mongo database server that was going to be running a Fusion-io/Sandisk ioDrive2 card for wicked speed, and also needed to do on disk encryption…fun task.  I am using CentOS7 and ioDrive2 drivers version 3.2.10.  I wanted auto mounting of the space, so I can have the services start on reboot (after putting in the LUKS password). 1. download drivers from https://link.sandisk.com/Home/SoftwareDownload (may need to make account first) (in this case v 3.2.10) 2. # tar xvf fusionio-files-*.tar 3. # uname -r (now check the binary available does it match your kernel? – mine did not) 4. # cd fusionio-files-*/ioDrive2/Linux_centos-7/3.2.10/Software\ Source 5. # rpmbuild –rebuild iomemory-vsl-3.2.10.1509-1.0.el7.centos.src.rpm 6. # cd ~/rpmbuild/RPMS/x86_64/ 7. # yum install iomemory-vsl-3.10.0*.rpm iomemory-vsl-config-3.10.0-*.rpm iomemory-vsl-source-3.2.10*.rpm 8. # cd ~/fusionio-files-*/ioDrive2/Linux_centos-7/3.2.10/Utilities/ 9. # yum install fio*.rpm 10. # yum install lib*.rpm 11. # mkdir /var/lib/mongo 12. # modprobe iomemory-vsl 13. # dmesg (to vierify that the […]