hack
"keyboard injection" under Linux
What to do if you want to pass some data into STDIN of some process,
and it doesn't accepts it?! One of the most (un)famous example is ssh;
who never tried to do a "echo password | ssh host"?!
So, you just want to inject characters as there were someone
typing them. Remember: TIOCSTI ioctl() call is your
friend 
Just google it to see what
it does. And now, some actually working code:
#!/usr/bin/perl -w
use strict;
use Fcntl;
use constant TIOCSTI => 0x5412;
unless (@ARGV >= 1) {
print "usage: $0 [vt] <input>\n";
exit;
}
my $vt = shift @ARGV;
my $buf = join '', <>;
&writevt ($vt, $buf) || die "can't write to $vt: $!\n";
exit;
sub writevt {
my ($vt, $buf) = @_;
sysopen (VT, $vt, O_RDONLY) || return 0;
for (my $i = 0; $i < length $buf; $i++) {
ioctl (VT, TIOCSTI, substr ($buf, $i, 1)) || return 0;
}
close (VT) || return 0;
return 1;
}
And this is how it works (Linux-specific!!!):
[stas@home stas]$ echo id | ./catvt.pl /dev/pts/0
id
[stas@home stas]$ id
uid=?????(stas) gid=?????(stas) groups=?????(stas)
Kinda awesome
tiny HTTP proxy

This is a tiny and highly experimental HTTP/1.0 proxy software that I have written to debug HTTP protocol & it's clients. It is very small and simple, yet useful to reverse-engineering purposes. It's interface is quite obvious. The Server frame controls the IP, port and connection limit of the proxy server. It also shows how many connections are active at moment. The Data Traffic frame shows in/out packets & bytes. Service frame allows you to stop, start and quit the proxy. These are the very minimalist controls for the very minimalist proxy server.
The interesting stuff begins at the Plugin frame. All the packet
passed through this proxy server are forwarded to the selectable plugin
module. By default, it is logger.dll. It simply saves every
single packet into separate file, which uses the following name scheme:
from_IP.from_port-to_IP.to_port.log (for example,
127.0.0.1.4322-127.0.0.1.21.log). The files can be ordered by
their modification date in your file explorer, so you can track the entire
session:

The logger.dll can be set up to include a sequence counter at
the beginning of each packet and to output saved packets into some specific
directory:

Plugin module is also capable of injecting packets. Load the
replicator.dll file and check the setup screen:

When you click the Capture button and then make some action in
your proxied web client, the replicator plugin will prompt you if it got a
corresponding packet. This packet may be resent automatically, at the period
specified in the Period box. You can capture & replicate several
packets, and manipulate their resend period. A very interesting application
of the replicator plugin is to flood web chats and to spin
up web counters. Of course, the right way is to use
logger.dll and to make a clone that imitates the "real" web
client.
The final note: this is, and always will be, an alpha-state code. I do not develop this proxy application anymore. It is useful to me the way it is. But you can grab the source and make a whatever plugin you like, or even rewrite the code entirely. I don't care. Just give me the proper credits!
inPEct .EXE binder

inPEct means "infect", applicable to PE ("Portable Executable") format. It is an executable binder, thus, it's able to join two .exe files in one. Now, why should anyone want to do that, is a question apart (screenshot is self-explanatory 
At the time I've wrote inPEct, most executable binders were similar to
SFX ("Self-Extract") stubs: they simply extracted their content to
somewhere (commonly %TEMP% directory). inPEct is a bit
different, as it expands the host executable and encrypts & inserts
the hosted executable inside it. When someone executes the bound
application, the host executable runs normally, and the hosted
executable is extracted and then executed. inPEct also has a feature to
execute the hosted executable only once ('smart feature'):
if the bound program is executed by user again, hosted file won't be
extracted anymore. And inPEct is very fast and small, as it's
written entirely in pure assembler (in fact, inPEct's loader has only
800 bytes!). It's encryption algorithm is very cheap, but still uses a
random seed. Thus, I expect that inPEct is more stealthy than similar
binders.
Please note that almost every AntiVirus program detects and
quarantines inPEct (and files produced by it)! This shows it's popularity in the past, I guess 
But today it's useful mostly as a pure assembler programming example... And for AntiVirus research, as this paper actually shows.
ACFTools (for X-Plane)
The Plane-Maker from X-Plane v7.x is fun and easy to use... Although I found it a bit limited to edit my planes' fuselage. 20 cross-sections aren't enough, sometimes. It would be nice to export the fuselage shape into any 3D-editor and fine-tune it there... This is exactly what my ACFTools are supposed to do. Please note that X-Plane v8.x is unsupported, unless you create & edit a v7 model and then import it to Plane-Maker v8. But I believe this isn't a problem: X-Plane v8 is able to use OBJ format files (which can be imported/exported by AC3D and Blender plugins) as parts of an aircraft, thus, extremely weird shapes are perfectly possible without even touching the ACF file.
Now, what exactly ACFTools does? It is able to process the file that stores all the aircraft data (except the textures), in the binary ACF format, and dump all the data in the human-readable TXT format. It is the same format as for Tony Gondola's ACF2Text utility, which inspirited my ACFTools. Then, ACFTools can extract the 3D model of the aircraft from this data, and export it in the AC3D format. After that you can edit the aircraft's shape as you want using AC3D and make the inverse process: from
.ac to .txt, and then from .txt to .acf. Here comes the brief set of ACFTools features:- Convert from ACF (aircraft) & WPN (weapon) formats to TXT format and vice-versa.
- Extract AC3D model from TXT file, along with wings and propellers (using the real airfoils!).
- Import AC3D model into TXT file (fuselage, nacelles, wheel fairings & external fuel tanks only)
ACFTools was written in Perl, thus it is able to work under Linux, MacOS & Windows. And it is Open-Source & highly modular, so you can modify it as you want, or use my functions for your own needs. When you start ACFTools, this is what you get at your console:
##############################################################################
[ACFTools v0.62a] Set of tools to play with ACF files outside of Plane-Maker
Perl script and modules coded by Stanislaw Pusep
Site of this and another X-Plane projects of mine: http://xplane.sysd.org/
Allows you to:
* export X-Plane (www.x-plane.com) aircraft data files to human-editable
plaintext format and 3D mesh editable in AC3D modeler (www.ac3d.org).
* import plaintext/3D mesh back to ACF file.
##############################################################################
Usage: acftools.exe[parameters]
o Commands:
-extract [DEF] : extract TXT from ACF (opt: using DEF definition)
-generate : generate ACF from TXT
-merge : merge body from AC3D file to TXT
o Parameters:
-acffile FILE : name of ACF file to process
-txtfile FILE : name of TXT file to process
-ac3dfile FILE : name of AC3D file to process
-noorder : DO NOT sort vertices while merging bodies
-noac3d : DO NOT generate AC3D
-(min|max)body N: write all bodies in specified range to AC3D
-force LIST : force extraction of bodies LIST (comma-separated N)
-normalize N : normalize wings to N vert/surface (N>=2 or no wings!)
o Notes:
* You can use abbreviations of commands/parameters (-gen or even -g
instead of -generate).
* The only required parameter for "extract" command is -acffile.
Both -txtfile and -ac3dfile are derivated from it.
* "generate" command and -txtfile has the same relation.
* By default "extract" uses the latest DEF file.
* "generate" doesn't need DEF at all (it is implicit in TXT)
* If file to be created already exists backup is made automatically.
o Examples:
acftools.exe --extract=ACF700 --acffile="F-22 Raptor.acf"
(extract 'F-22 Raptor.txt' from 'F-22 Raptor.acf')
acftools.exe -e -acf "F-22 Raptor.acf"
(same as above)
acftools.exe -me -ac3d ladar.ac -txt "F-22 Raptor.txt"
(merge *single* 3D body from 'ladar.ac' to 'F-22 Raptor.txt')
acftools.exe -g -txt "F-22 Raptor.txt"
(reverse operation; generate 'F-22 Raptor.acf' from 'F-22 Raptor.txt')
defs directory. By default, it is a ACF740.def,
which works for X-Plane v7.40 and later. You can specify any definition
file you want, as shown on the screen above. You can also write your
own definition files, if you have the structure specification. Note
that to convert TXT back to ACF, no definition is necessary, as the TXT
format itself holds all the data necessary to build the binary file.
The second thing is to specify the file that ACFTools should convert.
The name of the converted file and every of the intermediary files will
be generated from this name. When converting from ACF to AC3D formats,
TXT file is generated automatically. Please note that when you want to
put the edited aircraft part back into the .acf file, you must save this part as a .ac
separate file, then merge it into the TXT file, and after that convert
it into ACF! Yes, it would be nice to have a GUI to automate the entire
process, but I'm too lazy to do that! Anyway, may the source be with you

I strongly recommend you to read the
docs\README.txt file contained in the ACFTools package before you start using it!Duke3D D.M. cheater

E1L2 near the dark room elevator: enhanced brightness
Do you consider yourself a good Duke3D deathmatch player?! Neither I do

For our luck, 3D Realms released Duke3D source code under GPL license at April 1st, 2003. No, I'm not fooling you! Since then, several people are enhancing this classic game, extending it's portability and adding some cool features to it. There are ports like icculus Duke3D port and JonoF's Duke Nukem 3D Port. So, with the source in my hands, I decided to make my own version. I called it Duke Nukem 3D v1.666. It is 100% compatible with the original MS-DOS Duke3D v1.5, and adds some cheats into deathmatch games:
- Omniscience. You can peek at your opponents screen (using
"Coop View", which now works even in the deathmatch mode!), and hear the
sounds they make (you may hear them scream when hit at the long distances).
You are able to see in darkness all the time, without using the
night vision goggles, and without that ugly green screen tinting. You'll know
when your opponent drops a holoduke, so you won't waste your ammo with
it. And finally, you won't see that confusing steroids trail anymore!
- Aim bot features. Aim bot (which can be turned off!) will track the closest visible opponent automatically. If you're close enough to your opponent, aim bot will also try to kick him while shooting. And it will auto-activate med kit when you get shot! Another cool feature associated to the aim bot is the auto-jetpack. Jump from a high place, and jetpack will be activated automatically when you're close to the ground.
- Practical enhancements. When you find a new weapon, game won't switch to it automatically. You will always see which weapon your opponent is using, without activating the "Weapon Mode". Demo viewer doesn't switches camera automatically anymore. And game doesn't prompts you with credit screens/animations when started or finished.
DNCROZduring multiplayer?! Even this is possible in the cheater! The only problem is: both players should type it when the game is paused, or the "Out Of Sync" condition occurs. Other cheats that work in the multiplayer game are:DNSCOTTY###; DNCOORDS, DNVIEW; DNRATE; DNBETA; DNTODD; DNSHOWMAP; DNALLEN; DNDEBUG.- ".ANM viewer". Just type
DNENDINGwhile playing, and the game skips right to the episode ending video
"duke3d.exe /q2 /a"
command). It may work in the acceptable way on crossover 100 Mbps LAN
connection (peer-to-peer), although... And the worst thing ever: Duke3D
v1.666 will only work on real DOS mode, so forget it if you only have
Windows NT/2k/XP (anyway, those who play Duke3D over network frequently
do have Windows 9x installed for this specific purpose
)Still interested?! It's a bit difficult to install, though... First, you need to have the original Duke Nukem 3D v1.5 installed. Second, backup it!!! After that:
- Unpack the
DN3D1666.ZIPinto your Duke3D installation directory, overwriting files. - Configure Duke3D. Run
SETUP.EXE, and go to "Controller Setup", then "Choose Controller Type", and then select "Keyboard and External". After this, select "Setup External", "Change External Program Name", and type"DUKE3D.EXE"there. Now you can save config, but DON'T LAUNCH A GAME YET!!!
(NOTE: it would be great if you disabled Turn_Left and Turn_Right keyboard bindings, although, if you don't plan to use "AutoAimSelfCalibrate" setting inDUKE3D.666file or won't use Auto-Aim feature at all, you don't need to do this). - Now, edit the file
DUKE3D.666. Open it in your favorite editor (EDIT.COM
), and you'll see that it's almost self-explanatory. Note that
your mouse is now configured by this file, any SETUPsettings will be ignored! Also note that default mouse settings for v1.666 imitates the default settings for the original Duke3D v1.5.
"DN3D1666.ME!" file, supplied in the download package.Relative project: GRP packer plugin for the Total Commander.
Sorry, no source code is available for direct download. However, if you're interested in it, contact me and I'll provide it to you! Thus, GPL license of the original Duke3D source wouldn't be harmed, I beleive...
MD5/SHA1 checksum
Basically, the file checksum plugin integrates the functionality of GNU utilities
md5sum and sha1sum
into the Total Commander GUI. This is done through the packer extension
API: you simply select files/directories you want to checksum, and
"Pack" (Alt+F5) them into a .md5 or .sha "archive". It will be a plain text file which looks like this (just the same format as that of above GNU utilities):3fb2924c8fb8098dbc8260f69824e9c437d28c68 FC4-i386-disc1.iso
31fdc2d7a1f1709aa02c9ea5854015645bd69504 FC4-i386-disc2.iso
032455cdf457179916be3a739ca16add75b768b7 FC4-i386-disc3.iso
f560f26a32820143e8286afb188f7c36d905a735 FC4-i386-disc4.iso
736e1555e88740d6131c5c84fbe69ed1073ba82d FC4-i386-rescuecd.iso

Then, to verify files consistence from TC, select
.md5 or .sha
file and "Test archive" (Shift+Alt+F9). Files generated by *BSD md5 utility are also supported. You can also browse checksum
files as they were directories; this is specially useful to locate
and check for consistence a single file from the huge directory tree.
To do that, just "View" (F3) a file, and TC Lister will pop you a
window with content like this:D:\_INSTALL_\stentz-binary-i386\FC4-i386-rescuecd.iso
expected: 736e1555e88740d6131c5c84fbe69ed1073ba82d
computed: 736e1555e88740d6131c5c84fbe69ed1073ba82d
SHA1 checksum OK!
Installation:
- Unzip the
"checksum.wcx"to the Total Commander or Windows Commander plugins directory - In Windows Commander 4.0 (or newer) or Total Commander, choose 'Configuration => Options'
- Open the 'Packer' page
- Click 'Configure packer extension WCXs'
- Type
md5as the extension - Click 'New type', and select the
"checksum.wcx"file - Click OK and then 'Configure packer extension WCXs'
- Now type
shaas the extension - Click 'New type', and select the
"checksum.wcx"file again - Click OK
Usage:
(This section uses MD5 checksums as example; for SHA1 the procedure is thesame, just replace every "md5" you see by "sha"
)- Generate MD5 checksum:
- Select files you wish to compute checksum.
- Then go to "Files => Pack".
- Select "md5" as packer.
- PLEASE NOTE THAT ARCHIVE PATH WILL BE IGNORED!!! ".md5" 'archive' is ALWAYS generated in current directory (where checked files are), and NOT in the opposite panel! The only exception is creating checksum of the files stored on CD-ROM media as there's no way to create files there.
- Press OK and check CURRENT directory for ".md5" list generated.
- Verify MD5 checksum:
- Certify that ".md5" list is in it's right place (filenames listed in it should be relative to the current directory).
- Select it and do "Files => Test Archive(s)".
- If any file doesn't matches stored MD5 checksum then "CRC error" message box appears.
- If everything is clear Total Commander remains quiet.
- Browse MD5 checksum list:
- Certify that ".md5" list is in it's right place (filenames listed in it should be relative to the current directory).
- Select it and enter it as it were a normal archive.
- If any file is present in the ".md5" list but wasn't found in the current directory then "?" is displayed instead of file date/time and size.
- PLEASE NOTE THAT FILES CAN NOT BE EXTRACTED TO YOUR DISK! ".md5" isn't an archive, it stores only the hash of the file.
- Select file you wish to check and press F3 (call Lister).
- Lister will show complete file name, expected checksum and generated checksum. If both checksum matches then the last line is "MD5 checksum OK!".
Diamond Rio PMP300 FS-plugin

Diamond Rio PMP300, with only 32 MB of flash memory, was the second portable MP3 player ever released, in 1998. Unfortunately, such a revolutionary piece of hardware is very painful to interface with: as it is connected through parallel port, highest transfer rates achieved were around 80 KB/s. And the software bundled with it was too primitive. To the luck of thousands of (un)happy Rio owners, The Snowblind Alliance released their Open-Source RIO utility, which became a starting point of several alternative Rio manager interfaces. Mine is just one of them

First of all, there's absolutely no need to write the entire file manager. Total Commander (TC for short) is one of the most feature-rich file managers ever made, and it supports a very extensible plugin API. As a result, one could use TC to manage files directly on the flash memory of his/her Rio! Actually, my plugin supports listing, uploading, downloading & deleting files from Diamond Rio PMP300 internal memory. It also displays the transfer speed and the total/remaining space. Take a look at this screenshot to see it in action. Behind the GUI, my plugin uses the source of the "RIO utility v1.07" by The Snowblind Alliance.
Installation:
Just the same as for many other FS-plugins:- Unzip
rio.wfx&rio.cfgfiles to Total Commander directory - Choose "Configuration => Options => Operation => FS-Plugins"
- Choose
rio.wfx - Click OK.
- You can now access the plugin in the "Network Neighborhood"
- Open
rio.cfgfile and set the correct LPT port address (see below for more details)
Configuration:
In the majority of cases, the plugin may work fine "out-of-the-box". If it doesn't work at all, probably you'll need to discover and specify your PC's parallel port hardware address. Open your system's "Device Manager" (on Windows XP, open the context menu for "My Computer", click "Properties", go to the "Hardware" tab, and click the "Device Manager"). Go straight to "Ports (COM & LPT)". Now locate the port that your Rio device is attached. On my case, it's LPT1. Double-click "Printer port (LPT1)", and go to the "Resources" tab. You need the first one of "I/O Range" numbers:
378 is what you need. Note that this number is in a hexadecimal format. Thus, many programs (like my plugin) may accept it as 0x378. Now, open the
rio.cfg file. It looks like this, by default:# Assume that Rio is connected to LPT1
IOPort 0x378
# default
IODelayInit 20000
IODelayTx 100
IODelayRx 2
# "turbo" mode (UNSAFE!!!)
#IODelayInit 5000
#IODelayTx 1
#IODelayRx 1
IOPort parameter to the value you discovered.Note all that
IODelay* parameters. For the safety reasons,
the delays are high by default, and, consequently, the file transfer is
slow. If you comment out the default values and uncomment the turbo
mode ones, you'll get a great increase in performance! But remember to
only use it when your Rio battery is 100% charged, and when your Rio is
turned on. It may corrupt some bits, through.I.E. 'hidden image' maker

, just select the above image (or go to "Edit =>
Select All", or press Ctrl-A). You
may see a watermark with white letters forming a word "TEST". This only
happens in IE, due to the specific way it masks the selected images to
show their selected state. Firefox,
for example, simply tints the image with bluish color. There are lots
of jokes one can make using this simple principle. For example, all
images on your homepage may have some "subliminal" messages. Adobe
PhotoShop is perfectly suitable to make such 'Hidden Images' by hand;
in fact, my inspiration was a tutorial made by Matt Kment to do this.
But if you
are too lazy and/or do not have PhotoShop installed (UN*X users, for
example), you can use this small program I wrote in Perl to automate
the
"steganographic" process. I wrote it using ImageMagickTM
library (so it's required to successfully run the program). It is a
command line program, but it is simple enough to use,
and it has an advantage to be integrable into your own scripts/programs
(you can even setup your server to embed your company logo into all
graphics of your site, but this will overload the server's CPU and RAM
too quickly). I called my program "Internet Explorer Mask'O'Matic".
Take a look at it's startup screen:Internet Explorer Mask'O'Matic v1.0 by Stas
Grab yours at http://sysdlabs.hypermart.net/
Inspirated by some mad stuff by Lem0nHead
Based on Photoshop 'Hidden Image' Guide (http://www.atomicwienerdog.com/ot/)
made by Matt Kment & suggested to me by xfalmp
ERROR: please give us --visible
* Usage: MaskOMatic.pl
* Options (note that you can use syntaxes like --vis= --hid -out -p):
--visible filename of image normally seen (required)
--hidden filename of image seen when selected in IE (required)
--output filename to write out, format is selected automatically
using suffix provided (required)
--percentage float value between 0 & 100; how much of hidden appears
(optional, defaults to 50%)
--quality JPEG/MIFF/PNG compression level (optional, DON'T USE!)
--contrast flag, internal contrast reduction (optional)
--test filename to dump preview of selected image (optional)
* Notes:
# Visible & hidden images doesn't need to have same size, when size
doesn't matches then hidden image is rescaled using Lanczos filter
# A huge set of image formats is supported (JPG, GIF, PNG for example)
but I strongly advice you to write output in loseless format *only*
(BMP, PNG, TGA) and *then* fine-tune contrast/brightness & save
compressed in your favourite image editor (like GIMP)
* Example:
MaskOMatic.pl --vis bush.jpg --hid death.jpg --out sublim.bmp
--visible, --hidden
& --output. You can abbreviate them
as -v, -h &
-o,
respectively. "Visible" is an image that user sees by default.
"Hidden" is what user sees when he/she selects the image. And "output"
is the resulting image you can embed into your pages. It is also
possible to use the "--test"
option to preview the selected state of the output image without
starting Internet Explorer. If it looks bad, you may play around with "--percentage"
option, which specifies the 'weight' of the hidden image. The higher
is this value, the greater is the hidden image visibility. If that's
not
enough to hide your image well (some things are pretty difficult to
hide!), you can try to tune the output image with "--contrast"
option, but I suggest you to use some GUI program to do that as you get
the visual feedback instantly. I also suggest you to always save your
output in the non-compressed lossless format (like BMP, TGA, TIFF), and
then
fine-tune the compression in some program specialized in it (GIMP has a nice
compressor with visual feedback).
Alternatives:
- Hidden Image Photoshop tutorial
- Magic Image Generator C#/VS.NET2003 program (with source)
"ps auwx" faker
"Process Stack Faker" (psf for short) is able to hide the real executable name and it's parameters from the output of "ps auwx", "ps -ef" & "top"
(on UN*X machines), without any superuser privileges. Why should one
wish to hide the stuff he/she executes is a complete different topic 
Let's take a look at the options that psf itself accepts:
$ ./psf
Process Stack Faker (a.k.a. Fucker) v0.03
Coded by Stas; (C)opyLeft by SysD Destructive Labs, 1997-2003
Usage: psf [options] command arg1 arg2 ...
Where options can be:
-s string fake process name
-p filename file to write PID of spawned process - optional
-d try to start as daemon (in background, no tty) - optional
-l DO NOT exec through link (detectable by 'top'!!!) - optional
-u uid[:gid] (format just like in chown(1)) reset UID/GID - optional
-n priority renice process - optional
Example: psf -s "pine -i" -d -n 19 ./john -session:websrv
$
psf will execute "command arg1 arg2", and it will appear to "ps" & "top" utilities as "string". All other options are... Uhm, optional! They are only useful to detach processes not designed to run as daemons. "-l"
is a 'compatibility' switch that disables the weird trick used to
override the detection of the real filename by some process listers
(notably "top"). The default option may work unexpectingly on some systems (by the way, psf works fine on FreeBSD 4.3, Linux 2.4, NetBSD 1.5 & Solaris 2.7). To test psf, try this:$ psf -s "pine -i" sleep 30 &
[1] 440
$ ps auwx
...
stas 84 0.0 0.6 2012 1232 pts/0 S 19:12 0:00 bash -rcfile .bashrc
stas 440 0.0 0.1 1204 376 tty2 S 20:09 0:00 pine -i
stas 450 0.0 0.4 2544 816 tty2 R 20:12 0:00 ps auwx
...
"sleep 30" process was spoofed as "pine -i". Please note the white line between PIDs 440 and 450. This occurs because psf uses whitespace (0x20) characters to shift the original process arguments away from the visible area 
To understand how does
psf works and learn how to compile it, just read the comments inside the source. Micro$oft Messenger Hack

"Micro$oft Messenger Hack" (MSMH for short
is a GUI alternative to the command line "net send",
with some nice additional features. Please remember that "Messenger"
referred here is a Windows NT/2k/XP system service, that "Transmits net send and
Alerter service messages between clients and servers. This service is
not related to Windows Messenger.". Messages transferred using this service looks
just like this one:
MSMH is able to send the same message as above example. It lists machines on the local network, so you won't mistype host names anymore. It can send messages multiple times, also (just imagine yourself flooding
"*"
. And, using "WinPopup" method, both "From" and "To" fields can be spoofed. By the other side, "net send" method can send messages beyond your LAN, given the IP address of the remote host.MSMH executable is very small, as I programmed it in assembler language. But beware: Service Packs make the Messenger service disabled by default, and firewalls won't allow remote host to receive your messages. Well, MSMH was much funnier when I wrote it a long time ago



